| 138 }; |
138 }; |
| 139 |
139 |
| 140 G_BEGIN_DECLS |
140 G_BEGIN_DECLS |
| 141 |
141 |
| 142 /** |
142 /** |
| |
143 * gnt_widget_get_gtype: |
| |
144 * |
| 143 * Returns: GType for GntWidget. |
145 * Returns: GType for GntWidget. |
| 144 */ |
146 */ |
| 145 GType gnt_widget_get_gtype(void); |
147 GType gnt_widget_get_gtype(void); |
| 146 |
148 |
| 147 /** |
149 /** |
| |
150 * gnt_widget_destroy: |
| |
151 * @widget: The widget to destroy. |
| |
152 * |
| 148 * Destroy a widget. |
153 * Destroy a widget. |
| 149 * @widget: The widget to destroy. |
|
| 150 */ |
154 */ |
| 151 void gnt_widget_destroy(GntWidget *widget); |
155 void gnt_widget_destroy(GntWidget *widget); |
| 152 |
156 |
| 153 /** |
157 /** |
| |
158 * gnt_widget_show: |
| |
159 * @widget: The widget to show. |
| |
160 * |
| 154 * Show a widget. This should only be used for toplevel widgets. For the rest |
161 * Show a widget. This should only be used for toplevel widgets. For the rest |
| 155 * of the widgets, use #gnt_widget_draw instead. |
162 * of the widgets, use #gnt_widget_draw instead. |
| 156 * |
|
| 157 * @widget: The widget to show. |
|
| 158 */ |
163 */ |
| 159 void gnt_widget_show(GntWidget *widget); |
164 void gnt_widget_show(GntWidget *widget); |
| 160 |
165 |
| 161 /** |
166 /** |
| |
167 * gnt_widget_draw: |
| |
168 * @widget: The widget to draw. |
| |
169 * |
| 162 * Draw a widget. |
170 * Draw a widget. |
| 163 * @widget: The widget to draw. |
|
| 164 */ |
171 */ |
| 165 void gnt_widget_draw(GntWidget *widget); |
172 void gnt_widget_draw(GntWidget *widget); |
| 166 |
173 |
| 167 /** |
174 /** |
| |
175 * gnt_widget_expose: |
| |
176 * |
| 168 * @internal |
177 * @internal |
| 169 * Expose part of a widget. |
178 * Expose part of a widget. |
| 170 */ |
179 */ |
| 171 void gnt_widget_expose(GntWidget *widget, int x, int y, int width, int height); |
180 void gnt_widget_expose(GntWidget *widget, int x, int y, int width, int height); |
| 172 |
181 |
| 173 /** |
182 /** |
| |
183 * gnt_widget_hide: |
| |
184 * @widget: The widget to hide. |
| |
185 * |
| 174 * Hide a widget. |
186 * Hide a widget. |
| 175 * @widget: The widget to hide. |
|
| 176 */ |
187 */ |
| 177 void gnt_widget_hide(GntWidget *widget); |
188 void gnt_widget_hide(GntWidget *widget); |
| 178 |
189 |
| 179 /** |
190 /** |
| 180 * Get the position of a widget. |
191 * gnt_widget_get_position: |
| 181 * |
|
| 182 * @widget: The widget. |
192 * @widget: The widget. |
| 183 * @x: Location to store the x-coordinate of the widget. |
193 * @x: Location to store the x-coordinate of the widget. |
| 184 * @y: Location to store the y-coordinate of the widget. |
194 * @y: Location to store the y-coordinate of the widget. |
| |
195 * |
| |
196 * Get the position of a widget. |
| 185 */ |
197 */ |
| 186 void gnt_widget_get_position(GntWidget *widget, int *x, int *y); |
198 void gnt_widget_get_position(GntWidget *widget, int *x, int *y); |
| 187 |
199 |
| 188 /** |
200 /** |
| 189 * Set the position of a widget. |
201 * gnt_widget_set_position: |
| 190 * @widget: The widget to reposition. |
202 * @widget: The widget to reposition. |
| 191 * @x: The x-coordinate of the widget. |
203 * @x: The x-coordinate of the widget. |
| 192 * @y: The x-coordinate of the widget. |
204 * @y: The x-coordinate of the widget. |
| |
205 * |
| |
206 * Set the position of a widget. |
| 193 */ |
207 */ |
| 194 void gnt_widget_set_position(GntWidget *widget, int x, int y); |
208 void gnt_widget_set_position(GntWidget *widget, int x, int y); |
| 195 |
209 |
| 196 /** |
210 /** |
| |
211 * gnt_widget_size_request: |
| |
212 * @widget: The widget. |
| |
213 * |
| 197 * Request a widget to calculate its desired size. |
214 * Request a widget to calculate its desired size. |
| 198 * @widget: The widget. |
|
| 199 */ |
215 */ |
| 200 void gnt_widget_size_request(GntWidget *widget); |
216 void gnt_widget_size_request(GntWidget *widget); |
| 201 |
217 |
| 202 /** |
218 /** |
| 203 * Get the size of a widget. |
219 * gnt_widget_get_size: |
| 204 * @widget: The widget. |
220 * @widget: The widget. |
| 205 * @width: Location to store the width of the widget. |
221 * @width: Location to store the width of the widget. |
| 206 * @height: Location to store the height of the widget. |
222 * @height: Location to store the height of the widget. |
| |
223 * |
| |
224 * Get the size of a widget. |
| 207 */ |
225 */ |
| 208 void gnt_widget_get_size(GntWidget *widget, int *width, int *height); |
226 void gnt_widget_get_size(GntWidget *widget, int *width, int *height); |
| 209 |
227 |
| 210 /** |
228 /** |
| 211 * Set the size of a widget. |
229 * gnt_widget_set_size: |
| 212 * |
|
| 213 * @widget: The widget to resize. |
230 * @widget: The widget to resize. |
| 214 * @width: The width of the widget. |
231 * @width: The width of the widget. |
| 215 * @height: The height of the widget. |
232 * @height: The height of the widget. |
| 216 * |
233 * |
| |
234 * Set the size of a widget. |
| |
235 * |
| 217 * Returns: If the widget was resized to the new size. |
236 * Returns: If the widget was resized to the new size. |
| 218 */ |
237 */ |
| 219 gboolean gnt_widget_set_size(GntWidget *widget, int width, int height); |
238 gboolean gnt_widget_set_size(GntWidget *widget, int width, int height); |
| 220 |
239 |
| 221 /** |
240 /** |
| 222 * Confirm a requested a size for a widget. |
241 * gnt_widget_confirm_size: |
| 223 * |
|
| 224 * @widget: The widget. |
242 * @widget: The widget. |
| 225 * @width: The requested width. |
243 * @width: The requested width. |
| 226 * @height: The requested height. |
244 * @height: The requested height. |
| 227 * |
245 * |
| |
246 * Confirm a requested a size for a widget. |
| |
247 * |
| 228 * Returns: %TRUE if the new size was confirmed, %FALSE otherwise. |
248 * Returns: %TRUE if the new size was confirmed, %FALSE otherwise. |
| 229 */ |
249 */ |
| 230 gboolean gnt_widget_confirm_size(GntWidget *widget, int width, int height); |
250 gboolean gnt_widget_confirm_size(GntWidget *widget, int width, int height); |
| 231 |
251 |
| 232 /** |
252 /** |
| |
253 * gnt_widget_key_pressed: |
| |
254 * @widget: The widget. |
| |
255 * @keys: The keypress on the widget. |
| |
256 * |
| 233 * Trigger the key-press callbacks for a widget. |
257 * Trigger the key-press callbacks for a widget. |
| 234 * |
258 * |
| 235 * @widget: The widget. |
|
| 236 * @keys: The keypress on the widget. |
|
| 237 * |
|
| 238 * Returns: %TRUE if the key-press was handled, %FALSE otherwise. |
259 * Returns: %TRUE if the key-press was handled, %FALSE otherwise. |
| 239 */ |
260 */ |
| 240 gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys); |
261 gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys); |
| 241 |
262 |
| 242 /** |
263 /** |
| 243 * Trigger the 'click' callback of a widget. |
264 * gnt_widget_clicked: |
| 244 * |
|
| 245 * @widget: The widget. |
265 * @widget: The widget. |
| 246 * @event: The mouseevent. |
266 * @event: The mouseevent. |
| 247 * @x: The x-coordinate of the mouse. |
267 * @x: The x-coordinate of the mouse. |
| 248 * @y: The y-coordinate of the mouse. |
268 * @y: The y-coordinate of the mouse. |
| 249 * |
269 * |
| |
270 * Trigger the 'click' callback of a widget. |
| |
271 * |
| 250 * Returns: %TRUE if the event was handled, %FALSE otherwise. |
272 * Returns: %TRUE if the event was handled, %FALSE otherwise. |
| 251 */ |
273 */ |
| 252 gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y); |
274 gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y); |
| 253 |
275 |
| 254 /** |
276 /** |
| 255 * Give or remove focus to a widget. |
277 * gnt_widget_set_focus: |
| 256 * @widget: The widget. |
278 * @widget: The widget. |
| 257 * @set: %TRUE of focus should be given to the widget, %FALSE if |
279 * @set: %TRUE of focus should be given to the widget, %FALSE if |
| 258 * focus should be removed. |
280 * focus should be removed. |
| 259 * |
281 * |
| |
282 * Give or remove focus to a widget. |
| |
283 * |
| 260 * Returns: %TRUE if the focus has been changed, %FALSE otherwise. |
284 * Returns: %TRUE if the focus has been changed, %FALSE otherwise. |
| 261 */ |
285 */ |
| 262 gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set); |
286 gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set); |
| 263 |
287 |
| 264 /** |
288 /** |
| |
289 * gnt_widget_activate: |
| |
290 * @widget: The widget to activate. |
| |
291 * |
| 265 * Activate a widget. This only applies to widgets that can be activated (eg. GntButton) |
292 * Activate a widget. This only applies to widgets that can be activated (eg. GntButton) |
| 266 * @widget: The widget to activate. |
|
| 267 */ |
293 */ |
| 268 void gnt_widget_activate(GntWidget *widget); |
294 void gnt_widget_activate(GntWidget *widget); |
| 269 |
295 |
| 270 /** |
296 /** |
| |
297 * gnt_widget_set_name: |
| |
298 * @widget: The widget. |
| |
299 * @name: A new name for the widget. |
| |
300 * |
| 271 * Set the name of a widget. |
301 * Set the name of a widget. |
| 272 * @widget: The widget. |
|
| 273 * @name: A new name for the widget. |
|
| 274 */ |
302 */ |
| 275 void gnt_widget_set_name(GntWidget *widget, const char *name); |
303 void gnt_widget_set_name(GntWidget *widget, const char *name); |
| 276 |
304 |
| 277 /** |
305 /** |
| |
306 * gnt_widget_get_name: |
| |
307 * @widget: The widget. |
| |
308 * |
| 278 * Get the name of a widget. |
309 * Get the name of a widget. |
| 279 * @widget: The widget. |
310 * |
| 280 * Returns: The name of the widget. |
311 * Returns: The name of the widget. |
| 281 */ |
312 */ |
| 282 const char *gnt_widget_get_name(GntWidget *widget); |
313 const char *gnt_widget_get_name(GntWidget *widget); |
| 283 |
314 |
| 284 /** |
315 /** |
| |
316 * gnt_widget_queue_update: |
| |
317 * |
| 285 * @internal |
318 * @internal |
| 286 * Use #gnt_widget_draw instead. |
319 * Use #gnt_widget_draw instead. |
| 287 */ |
320 */ |
| 288 void gnt_widget_queue_update(GntWidget *widget); |
321 void gnt_widget_queue_update(GntWidget *widget); |
| 289 |
322 |
| 290 /** |
323 /** |
| |
324 * gnt_widget_set_take_focus: |
| |
325 * @widget: The widget. |
| |
326 * @set: %TRUE if the widget can take focus. |
| |
327 * |
| 291 * Set whether a widget can take focus or not. |
328 * Set whether a widget can take focus or not. |
| 292 * |
|
| 293 * @widget: The widget. |
|
| 294 * @set: %TRUE if the widget can take focus. |
|
| 295 */ |
329 */ |
| 296 void gnt_widget_set_take_focus(GntWidget *widget, gboolean set); |
330 void gnt_widget_set_take_focus(GntWidget *widget, gboolean set); |
| 297 |
331 |
| 298 /** |
332 /** |
| |
333 * gnt_widget_set_visible: |
| |
334 * @widget: The widget. |
| |
335 * @set: Whether the widget is visible or not. |
| |
336 * |
| 299 * Set the visibility of a widget. |
337 * Set the visibility of a widget. |
| 300 * |
|
| 301 * @widget: The widget. |
|
| 302 * @set: Whether the widget is visible or not. |
|
| 303 */ |
338 */ |
| 304 void gnt_widget_set_visible(GntWidget *widget, gboolean set); |
339 void gnt_widget_set_visible(GntWidget *widget, gboolean set); |
| 305 |
340 |
| 306 /** |
341 /** |
| |
342 * gnt_widget_has_shadow: |
| |
343 * @widget: The widget. |
| |
344 * |
| 307 * Check whether the widget has shadows. |
345 * Check whether the widget has shadows. |
| 308 * |
|
| 309 * @widget: The widget. |
|
| 310 * |
346 * |
| 311 * Returns: %TRUE if the widget has shadows. This checks both the user-setting |
347 * Returns: %TRUE if the widget has shadows. This checks both the user-setting |
| 312 * and whether the widget can have shadows at all. |
348 * and whether the widget can have shadows at all. |
| 313 */ |
349 */ |
| 314 gboolean gnt_widget_has_shadow(GntWidget *widget); |
350 gboolean gnt_widget_has_shadow(GntWidget *widget); |