Updates from Pootle.
[lxde/lxpanel.git] / src / icon-grid.h
CommitLineData
2918994e 1/**
2 * Copyright (c) 2009 LxDE Developers, see the file AUTHORS for details.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef ICON_GRID_H
20#define ICON_GRID_H
21
22#include <gtk/gtk.h>
23
24#include "panel.h"
25
26struct _icon_grid_element;
27struct _icon_grid;
28
29/* Representative of an icon grid element. This is a widget to be packed into a rectangular grid whose size adapts to conditions. */
30typedef struct _icon_grid_element {
31 struct _icon_grid_element * flink; /* Forward link */
32 struct _icon_grid * ig; /* Back pointer to IconGrid */
33 GtkWidget * widget; /* Customer's widget */
34 gboolean visible; /* True if widget is visible */
35} IconGridElement;
36
37/* Representative of an icon grid. This is a manager that packs widgets into a rectangular grid whose size adapts to conditions. */
38typedef struct _icon_grid {
39 IconGridElement * child_list; /* List of icon grid elements */
40 Panel * panel; /* Back pointer to panel */
41 GtkWidget * container; /* Container widget */
42 GtkOrientation orientation; /* Desired orientation */
43 gint child_width; /* Desired child width */
44 gint child_height; /* Desired child height */
45 gint spacing; /* Desired spacing between grid elements */
46 gint border; /* Desired border around grid elements */
47 gint target_dimension; /* Desired dimension perpendicular to orientation */
48 gboolean actual_dimension; /* True if container has been allocated space */
49 gboolean children_changed; /* True if icon grid element list changed */
50 GtkWidget * widget; /* Layout widget we use for packing */
51 int rows; /* Computed layout rows */
52 int columns; /* Computed layout columns */
53} IconGrid;
54
55extern IconGrid * icon_grid_new(
56 Panel * panel, GtkWidget * container, GtkOrientation orientation,
57 gint child_width, gint child_height, gint spacing, gint border, gint target_dimension);
58 /* Create an icon grid */
59extern void icon_grid_set_orientation(IconGrid * ig, GtkOrientation orientation, gint target_dimension);
60 /* Change the orientation of an icon grid */
61extern void icon_grid_add(IconGrid * ig, GtkWidget * child, gboolean visible);
62 /* Add a child to the icon grid */
63extern void icon_grid_remove(IconGrid * ig, GtkWidget * child);
64 /* Remove a child from the icon grid */
65extern void icon_grid_reorder_child(IconGrid * ig, GtkWidget * child, gint position);
66 /* Reorder the position of a child in the icon grid */
67extern void icon_grid_set_visible(IconGrid * ig, GtkWidget * child, gboolean visible);
68 /* Set the visibility of a child in the icon grid */
69extern void icon_grid_free(IconGrid * ig); /* Free the icon grid */
70
71#endif