Automatic translation update from Pootle
[lxde/lxpanel.git] / src / icon-grid.h
CommitLineData
7d17da4d 1/*
588c8419 2 * Copyright (C) 2014-2016 Andriy Grytsenko <andrej@rep.kiev.ua>
7d17da4d
AG
3 *
4 * This file is a part of LXPanel project.
2918994e 5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
b840f7cc 21#ifndef __ICON_GRID_H__
de7ff173 22#define __ICON_GRID_H__ 1
2918994e 23
24#include <gtk/gtk.h>
25
de7ff173
AG
26G_BEGIN_DECLS
27
9fac586f
AG
28#define PANEL_TYPE_ICON_GRID (panel_icon_grid_get_type())
29#define PANEL_ICON_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
30 PANEL_TYPE_ICON_GRID, PanelIconGrid))
31#define PANEL_ICON_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
32 PANEL_TYPE_ICON_GRID, PanelIconGridClass))
33#define PANEL_IS_ICON_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
34 PANEL_TYPE_ICON_GRID))
35#define PANEL_IS_ICON_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
34ba1c30 36 PANEL_TYPE_ICON_GRID))
9fac586f
AG
37
38extern GType panel_icon_grid_get_type (void) G_GNUC_CONST;
39
40typedef struct _PanelIconGrid PanelIconGrid;
41typedef struct _PanelIconGridClass PanelIconGridClass;
42
43extern GtkWidget * panel_icon_grid_new(
8f9e6256 44 GtkOrientation orientation, gint child_width, gint child_height, gint spacing, gint border, gint target_dimension);
2918994e 45 /* Create an icon grid */
7f824ea3
AG
46
47/**
48 * panel_icon_grid_set_constrain_width
49 * @ig: a widget
50 * @constrain_width: value to set
51 *
52 * Changes #PanelIconGrid::constrain-width property on the @ig. This
53 * property defines whether children of @ig may be constrained in case if
54 * the size allocated to @ig isn't sufficient to give assigned size for
55 * all existing children of @ig. All children will receive the same size
56 * deficit in described case.
57 */
9fac586f 58extern void panel_icon_grid_set_constrain_width(PanelIconGrid * ig, gboolean constrain_width);
7f824ea3 59
04544a53
AG
60/**
61 * panel_icon_grid_set_aspect_width
62 * @ig: a widget
63 * @aspect_width: value to set
64 *
65 * Changes #PanelIconGrid::aspect-width property on the @ig. The property
66 * enables or disables taking icons aspect into consideration for @ig.
67 * If disabled then all icons will have the same size (child_width) as
68 * defined for widget. If enabled then child_width will be ignored but
69 * icons aspect will be taken into consideration when children space is
70 * allocated.
71 * Note that if #PanelIconGrid::constrain-width is set to %TRUE then the
72 * #PanelIconGrid::aspect-width is ignored and behavior of widget is that
7f824ea3 73 * as if #PanelIconGrid::aspect-width is set to %FALSE.
04544a53
AG
74 *
75 * Since: 0.8.0
76 */
9633d713 77extern void panel_icon_grid_set_aspect_width(PanelIconGrid * ig, gboolean aspect_width);
04544a53 78
756c623e
AG
79/* extern void panel_icon_grid_set_fill_width(PanelIconGrid * ig, gboolean fill_width);
80 Set the fill-width property */
9fac586f 81extern void panel_icon_grid_set_geometry(PanelIconGrid * ig,
8f9e6256 82 GtkOrientation orientation, gint child_width, gint child_height, gint spacing, gint border, gint target_dimension);
83 /* Change the geometry of an icon grid */
9fac586f 84extern gint panel_icon_grid_get_child_position(PanelIconGrid * ig, GtkWidget * child);
eb713fbc 85 /* Get the index of an icon grid element. */
9fac586f 86extern void panel_icon_grid_reorder_child(PanelIconGrid * ig, GtkWidget * child, gint position);
2918994e 87 /* Reorder the position of a child in the icon grid */
6473286a
AG
88extern guint panel_icon_grid_get_n_children(PanelIconGrid * ig);
89 /* Count non-internal children */
2918994e 90
230200de 91typedef enum {
a4492fd4
AG
92 PANEL_ICON_GRID_DROP_LEFT_AFTER,
93 PANEL_ICON_GRID_DROP_LEFT_BEFORE,
94 PANEL_ICON_GRID_DROP_RIGHT_AFTER,
95 PANEL_ICON_GRID_DROP_RIGHT_BEFORE,
230200de
AG
96 PANEL_ICON_GRID_DROP_BELOW,
97 PANEL_ICON_GRID_DROP_ABOVE,
98 PANEL_ICON_GRID_DROP_INTO
99} PanelIconGridDropPosition;
100
101/**
102 * panel_icon_grid_get_dest_at_pos
103 * @ig: a widget
104 * @x: coordinate to inspect
105 * @y: coordinate to inspect
106 * @child: (allow-none): (out) (transfer none): pointer to return found child
107 * @pos: (allow-none): (out): pointer to return drop position
108 *
109 * Inspects coordinates @x and @y within @ig to contain some child widget.
110 * Returns nearest child widget and position against it.
111 *
112 * Returns: %FALSE if position is not drawable.
113 *
114 * Since: 0.9.0
115 */
6473286a
AG
116extern gboolean panel_icon_grid_get_dest_at_pos(PanelIconGrid * ig, gint x, gint y,
117 GtkWidget ** child, PanelIconGridDropPosition * pos);
230200de
AG
118
119/**
120 * panel_icon_grid_set_drag_dest
121 * @ig: a widget
122 * @child: (allow-none): pointer to a child
123 * @pos: drop position to draw
124 *
125 * Queues drawing of focus for given @child and @pos. If @child is %NULL
126 * then nothing will be drawn. In any case previous focus will be wiped.
127 *
128 * Since: 0.9.0
129 */
6473286a
AG
130extern void panel_icon_grid_set_drag_dest(PanelIconGrid * ig, GtkWidget * child,
131 PanelIconGridDropPosition pos);
230200de 132
a4492fd4
AG
133/**
134 * panel_icon_grid_get_drag_dest
135 * @ig: a widget
136 * @child: (allow-none): pointer to pointer to a child
137 *
138 * Retrieves data last set with panel_icon_grid_set_drag_dest()
139 *
140 * Returns: position to drop.
141 *
142 * Since: 0.9.0
143 */
6473286a 144extern PanelIconGridDropPosition panel_icon_grid_get_drag_dest(PanelIconGrid * ig, GtkWidget ** child);
a4492fd4 145
de7ff173
AG
146G_END_DECLS
147
2918994e 148#endif