Mercurial > pidgin
annotate finch/libgnt/gntwidget.h @ 24182:a29ae9a5c311
Use PURPLE_DEVEL_WEBSITE instead of hardcoding it.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 09 Oct 2008 11:57:28 +0000 |
parents | ae330012956f |
children | 5876584828e8 |
rev | line source |
---|---|
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
1 /** |
18303
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17928
diff
changeset
|
2 * @file gntwidget.h Widget API |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17928
diff
changeset
|
3 * @ingroup gnt |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17928
diff
changeset
|
4 */ |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17928
diff
changeset
|
5 /* |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
6 * GNT - The GLib Ncurses Toolkit |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
7 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
8 * GNT is the legal property of its developers, whose names are too numerous |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
10 * source distribution. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
11 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
12 * This library is free software; you can redistribute it and/or modify |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
15 * (at your option) any later version. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
16 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
20 * GNU General Public License for more details. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
21 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18566
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
25 */ |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
26 |
15817 | 27 #ifndef GNT_WIDGET_H |
28 #define GNT_WIDGET_H | |
29 | |
30 #include <stdio.h> | |
31 #include <glib.h> | |
32 #include <ncurses.h> | |
33 | |
34 #include "gntbindable.h" | |
35 | |
36 #define GNT_TYPE_WIDGET (gnt_widget_get_gtype()) | |
37 #define GNT_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget)) | |
38 #define GNT_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WIDGET, GntWidgetClass)) | |
39 #define GNT_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WIDGET)) | |
40 #define GNT_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WIDGET)) | |
41 #define GNT_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WIDGET, GntWidgetClass)) | |
42 | |
43 #define GNT_WIDGET_FLAGS(obj) (GNT_WIDGET(obj)->priv.flags) | |
44 #define GNT_WIDGET_SET_FLAGS(obj, flags) (GNT_WIDGET_FLAGS(obj) |= flags) | |
45 #define GNT_WIDGET_UNSET_FLAGS(obj, flags) (GNT_WIDGET_FLAGS(obj) &= ~(flags)) | |
46 #define GNT_WIDGET_IS_FLAG_SET(obj, flags) (GNT_WIDGET_FLAGS(obj) & (flags)) | |
47 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
48 typedef struct _GntWidget GntWidget; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
49 typedef struct _GntWidgetPriv GntWidgetPriv; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
50 typedef struct _GntWidgetClass GntWidgetClass; |
15817 | 51 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
52 typedef enum _GntWidgetFlags |
15817 | 53 { |
54 GNT_WIDGET_DESTROYING = 1 << 0, | |
55 GNT_WIDGET_CAN_TAKE_FOCUS = 1 << 1, | |
56 GNT_WIDGET_MAPPED = 1 << 2, | |
57 /* XXX: Need to set the following two as properties, and setup a callback whenever these | |
58 * get chnaged. */ | |
59 GNT_WIDGET_NO_BORDER = 1 << 3, | |
60 GNT_WIDGET_NO_SHADOW = 1 << 4, | |
61 GNT_WIDGET_HAS_FOCUS = 1 << 5, | |
62 GNT_WIDGET_DRAWING = 1 << 6, | |
63 GNT_WIDGET_URGENT = 1 << 7, | |
64 GNT_WIDGET_GROW_X = 1 << 8, | |
65 GNT_WIDGET_GROW_Y = 1 << 9, | |
66 GNT_WIDGET_INVISIBLE = 1 << 10, | |
67 GNT_WIDGET_TRANSIENT = 1 << 11, | |
18566
3c634117a7ef
Allow disabling the widget actions on specific widgets. This allows, for
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18303
diff
changeset
|
68 GNT_WIDGET_DISABLE_ACTIONS = 1 << 12, |
15817 | 69 } GntWidgetFlags; |
70 | |
71 /* XXX: This will probably move elsewhere */ | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
72 typedef enum _GntMouseEvent |
15817 | 73 { |
74 GNT_LEFT_MOUSE_DOWN = 1, | |
75 GNT_RIGHT_MOUSE_DOWN, | |
76 GNT_MIDDLE_MOUSE_DOWN, | |
77 GNT_MOUSE_UP, | |
78 GNT_MOUSE_SCROLL_UP, | |
79 GNT_MOUSE_SCROLL_DOWN | |
80 } GntMouseEvent; | |
81 | |
82 /* XXX: I'll have to ask grim what he's using this for in guifications. */ | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
83 typedef enum _GntParamFlags |
15817 | 84 { |
85 GNT_PARAM_SERIALIZABLE = 1 << G_PARAM_USER_SHIFT | |
86 } GntParamFlags; | |
87 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
88 struct _GntWidgetPriv |
15817 | 89 { |
90 int x, y; | |
91 int width, height; | |
92 GntWidgetFlags flags; | |
93 char *name; | |
94 | |
95 int minw, minh; /* Minimum size for the widget */ | |
96 }; | |
97 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
98 struct _GntWidget |
15817 | 99 { |
100 GntBindable inherit; | |
101 | |
102 GntWidget *parent; | |
103 | |
104 GntWidgetPriv priv; | |
105 WINDOW *window; | |
106 | |
107 void (*gnt_reserved1)(void); | |
108 void (*gnt_reserved2)(void); | |
109 void (*gnt_reserved3)(void); | |
110 void (*gnt_reserved4)(void); | |
111 }; | |
112 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
113 struct _GntWidgetClass |
15817 | 114 { |
115 GntBindableClass parent; | |
116 | |
117 void (*map)(GntWidget *obj); | |
118 void (*show)(GntWidget *obj); /* This will call draw() and take focus (if it can take focus) */ | |
119 void (*destroy)(GntWidget *obj); | |
120 void (*draw)(GntWidget *obj); /* This will draw the widget */ | |
121 void (*hide)(GntWidget *obj); | |
122 void (*expose)(GntWidget *widget, int x, int y, int width, int height); | |
123 void (*gained_focus)(GntWidget *widget); | |
124 void (*lost_focus)(GntWidget *widget); | |
125 | |
126 void (*size_request)(GntWidget *widget); | |
127 gboolean (*confirm_size)(GntWidget *widget, int x, int y); | |
128 void (*size_changed)(GntWidget *widget, int w, int h); | |
129 void (*set_position)(GntWidget *widget, int x, int y); | |
130 gboolean (*key_pressed)(GntWidget *widget, const char *key); | |
131 void (*activate)(GntWidget *widget); | |
132 gboolean (*clicked)(GntWidget *widget, GntMouseEvent event, int x, int y); | |
133 | |
134 void (*gnt_reserved1)(void); | |
135 void (*gnt_reserved2)(void); | |
136 void (*gnt_reserved3)(void); | |
137 void (*gnt_reserved4)(void); | |
138 }; | |
139 | |
140 G_BEGIN_DECLS | |
141 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
142 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
143 * @return GType for GntWidget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
144 */ |
15817 | 145 GType gnt_widget_get_gtype(void); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
146 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
147 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
148 * Destroy a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
149 * @param widget The widget to destroy. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
150 */ |
15817 | 151 void gnt_widget_destroy(GntWidget *widget); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
152 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
153 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
154 * Show a widget. This should only be used for toplevel widgets. For the rest |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
155 * of the widgets, use #gnt_widget_draw instead. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
156 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
157 * @param widget The widget to show. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
158 */ |
15817 | 159 void gnt_widget_show(GntWidget *widget); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
160 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
161 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
162 * Draw a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
163 * @param widget The widget to draw. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
164 */ |
15817 | 165 void gnt_widget_draw(GntWidget *widget); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
166 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
167 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
168 * @internal |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
169 * Expose part of a widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
170 */ |
15817 | 171 void gnt_widget_expose(GntWidget *widget, int x, int y, int width, int height); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
172 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
173 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
174 * Hide a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
175 * @param widget The widget to hide. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
176 */ |
15817 | 177 void gnt_widget_hide(GntWidget *widget); |
178 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
179 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
180 * Get the position of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
181 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
182 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
183 * @param x Location to store the x-coordinate of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
184 * @param y Location to store the y-coordinate of the widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
185 */ |
15817 | 186 void gnt_widget_get_position(GntWidget *widget, int *x, int *y); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
187 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
188 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
189 * Set the position of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
190 * @param widget The widget to reposition. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
191 * @param x The x-coordinate of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
192 * @param y The x-coordinate of the widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
193 */ |
15817 | 194 void gnt_widget_set_position(GntWidget *widget, int x, int y); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
195 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
196 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
197 * Request a widget to calculate its desired size. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
198 * @param widget The widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
199 */ |
15817 | 200 void gnt_widget_size_request(GntWidget *widget); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
201 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
202 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
203 * Get the size of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
204 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
205 * @param width Location to store the width of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
206 * @param height Location to store the height of the widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
207 */ |
15817 | 208 void gnt_widget_get_size(GntWidget *widget, int *width, int *height); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
209 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
210 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
211 * Set the size of a widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
212 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
213 * @param widget The widget to resize. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
214 * @param width The width of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
215 * @param height The height of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
216 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
217 * @return If the widget was resized to the new size. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
218 */ |
15817 | 219 gboolean gnt_widget_set_size(GntWidget *widget, int width, int height); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
220 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
221 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
222 * Confirm a requested a size for a widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
223 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
224 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
225 * @param width The requested width. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
226 * @param height The requested height. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
227 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
228 * @return @c TRUE if the new size was confirmed, @c FALSE otherwise. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
229 */ |
15817 | 230 gboolean gnt_widget_confirm_size(GntWidget *widget, int width, int height); |
231 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
232 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
233 * Trigger the key-press callbacks for a widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
234 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
235 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
236 * @param keys The keypress on the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
237 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
238 * @return @c TRUE if the key-press was handled, @c FALSE otherwise. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
239 */ |
15817 | 240 gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys); |
241 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
242 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
243 * Trigger the 'click' callback of a widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
244 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
245 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
246 * @param event The mouseevent. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
247 * @param x The x-coordinate of the mouse. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
248 * @param y The y-coordinate of the mouse. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
249 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
250 * @return @c TRUE if the event was handled, @c FALSE otherwise. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
251 */ |
15817 | 252 gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y); |
253 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
254 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
255 * Give or remove focus to a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
256 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
257 * @param set @c TRUE of focus should be given to the widget, @c FALSE if |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
258 * focus should be removed. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
259 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
260 * @return @c TRUE if the focus has been changed, @c FALSE otherwise. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
261 */ |
15817 | 262 gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set); |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
263 |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
264 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
265 * Activate a widget. This only applies to widgets that can be activated (eg. GntButton) |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
266 * @param widget The widget to activate. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
267 */ |
15817 | 268 void gnt_widget_activate(GntWidget *widget); |
269 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
270 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
271 * Set the name of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
272 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
273 * @param name A new name for the widget. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
274 */ |
15817 | 275 void gnt_widget_set_name(GntWidget *widget, const char *name); |
276 | |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
277 /** |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
278 * Get the name of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
279 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
280 * @return The name of the widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
281 */ |
15817 | 282 const char *gnt_widget_get_name(GntWidget *widget); |
283 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
284 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
285 * @internal |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
286 * Use #gnt_widget_draw instead. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
287 */ |
15817 | 288 void gnt_widget_queue_update(GntWidget *widget); |
289 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
290 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
291 * Set whether a widget can take focus or not. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
292 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
293 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
294 * @param set @c TRUE if the widget can take focus. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
295 */ |
15817 | 296 void gnt_widget_set_take_focus(GntWidget *widget, gboolean set); |
297 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
298 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
299 * Set the visibility of a widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
300 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
301 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
302 * @param set Whether the widget is visible or not. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
303 */ |
15817 | 304 void gnt_widget_set_visible(GntWidget *widget, gboolean set); |
305 | |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
306 /** |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
307 * Check whether the widget has shadows. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
308 * |
21253
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
309 * @param widget The widget. |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
310 * |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
311 * @return @c TRUE if the widget has shadows. This checks both the user-setting |
ae330012956f
Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
312 * and whether the widget can have shadows at all. |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
313 */ |
15817 | 314 gboolean gnt_widget_has_shadow(GntWidget *widget); |
315 | |
316 G_END_DECLS | |
317 | |
318 #endif /* GNT_WIDGET_H */ |