Debian Codegraph @

testsuite/gdk/clipboard-data/test.txt

raw
1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25 #ifndef __GTK_WIDGET_H__
26 #define __GTK_WIDGET_H__
27
28 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 #error "Only <gtk/gtk.h> can be included directly."
30 #endif
31
32 #include <gdk/gdk.h>
33 #include <gsk/gsk.h>
34 #include <gtk/gtkaccelgroup.h>
35 #include <gtk/gtkborder.h>
36 #include <gtk/gtkshortcut.h>
37 #include <gtk/gtkshortcutaction.h>
38 #include <gtk/gtktypes.h>
39
40 G_BEGIN_DECLS
41
42 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
43 * Macros for testing whether widget or klass are of type GTK_TYPE_WIDGET.
44 */
45 #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
46 #define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
47 #define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
48 #define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
49 #define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
50 #define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
51
52 #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ())
53
54 typedef struct _GtkWidgetPrivate GtkWidgetPrivate;
55 typedef struct _GtkWidgetClass GtkWidgetClass;
56 typedef struct _GtkWidgetClassPrivate GtkWidgetClassPrivate;
57
58 /**
59 * GtkAllocation:
60 * @x: the X position of the widget’s area relative to its parents allocation.
61 * @y: the Y position of the widget’s area relative to its parents allocation.
62 * @width: the width of the widget’s allocated area.
63 * @height: the height of the widget’s allocated area.
64 *
65 * The rectangle representing the area allocated for a widget by its parent.
66 */
67 typedef GdkRectangle GtkAllocation;
68
69 /**
70 * GtkTickCallback:
71 * @widget: the widget
72 * @frame_clock: the frame clock for the widget (same as calling gtk_widget_get_frame_clock())
73 * @user_data: user data passed to gtk_widget_add_tick_callback().
74 *
75 * Callback type for adding a function to update animations. See gtk_widget_add_tick_callback().
76 *
77 * Returns: %G_SOURCE_CONTINUE if the tick callback should continue to be called,
78 * %G_SOURCE_REMOVE if the tick callback should be removed.
79 */
80 typedef gboolean (*GtkTickCallback) (GtkWidget *widget,
81 GdkFrameClock *frame_clock,
82 gpointer user_data);
83
84 /**
85 * GtkRequisition:
86 * @width: the widget’s desired width
87 * @height: the widget’s desired height
88 *
89 * A #GtkRequisition-struct represents the desired size of a widget. See
90 * [GtkWidget’s geometry management section][geometry-management] for
91 * more information.
92 */
93 struct _GtkRequisition
94 {
95 int width;
96 int height;
97 };
98
99 /* The widget is the base of the tree for displayable objects.
100 * (A displayable object is one which takes up some amount
101 * of screen real estate). It provides a common base and interface
102 * which actual widgets must adhere to.
103 */
104 struct _GtkWidget
105 {
106 GInitiallyUnowned parent_instance;
107
108 /*< private >*/
109
110 GtkWidgetPrivate *priv;
111 };
112
113 /**
114 * GtkWidgetClass:
115 * @parent_class: The object class structure needs to be the first
116 * element in the widget class structure in order for the class mechanism
117 * to work correctly. This allows a GtkWidgetClass pointer to be cast to
118 * a GObjectClass pointer.
119 * @show: Signal emitted when widget is shown
120 * @hide: Signal emitted when widget is hidden.
121 * @map: Signal emitted when widget is going to be mapped, that is
122 * when the widget is visible (which is controlled with
123 * gtk_widget_set_visible()) and all its parents up to the toplevel
124 * widget are also visible.
125 * @unmap: Signal emitted when widget is going to be unmapped, which
126 * means that either it or any of its parents up to the toplevel
127 * widget have been set as hidden.
128 * @realize: Signal emitted when widget is associated with a
129 * #GdkSurface, which means that gtk_widget_realize() has been called or
130 * the widget has been mapped (that is, it is going to be drawn).
131 * @unrealize: Signal emitted when the GdkSurface associated with
132 * widget is destroyed, which means that gtk_widget_unrealize() has
133 * been called or the widget has been unmapped (that is, it is going
134 * to be hidden).
135 * @root: Called when the widget gets added to a #GtkRoot widget. Must chain up
136 * @unroot: Called when the widget is about to be removed from its #GtkRoot widget. Must chain up
137 * @size_allocate: Called to set the allocation, if the widget does
138 * not have a layout manager.
139 * @state_flags_changed: Signal emitted when the widget state changes,
140 * see gtk_widget_get_state_flags().
141 * @direction_changed: Signal emitted when the text direction of a
142 * widget changes.
143 * @get_request_mode: Called to get the request mode, if the widget
144 * does not have a layout manager.
145 * This allows a widget to tell its parent container whether
146 * it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
147 * %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
148 * %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
149 * #GtkWidgetClass.measure() called first to get the default width (passing
150 * a for_size of -1), then again to get the height for said default width.
151 * %GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
152 * width-for-height geometry management for said widget and is the
153 * default return.
154 * It’s important to note that any widget
155 * which trades height-for-width or width-for-height must respond properly
156 * to a for_size value >= -1 passed to #GtkWidgetClass.measure, for both
157 * possible orientations.
158 * @measure: Called to obtain the minimum and natural size of the widget,
159 * if the widget does not have a layout manager.
160 * Depending on the orientation parameter, the passed for_size can be
161 * interpreted as width or height. A widget will never be allocated less
162 * than its minimum size.
163 * @mnemonic_activate: Activates the @widget if @group_cycling is
164 * %FALSE, and just grabs the focus if @group_cycling is %TRUE.
165 * @grab_focus: Causes @widget to have the keyboard focus for the
166 * #GtkWindow it’s inside.
167 * @focus: Vfunc for gtk_widget_child_focus()
168 * @set_focus_child: Sets the focused child of a widget. Must chain up
169 * @move_focus: Signal emitted when a change of focus is requested
170 * @keynav_failed: Signal emitted if keyboard navigation fails.
171 * @query_tooltip: Signal emitted when “has-tooltip” is %TRUE and the
172 * hover timeout has expired with the cursor hovering “above”
173 * widget; or emitted when widget got focus in keyboard mode.
174 * @compute_expand: Computes whether a container should give this
175 * widget extra space when possible.
176 * @css_changed: Vfunc called when the CSS used by widget was changed. Widgets
177 * should then discard their caches that depend on CSS and queue resizes or
178 * redraws accordingly. The default implementation will take care of this for
179 * all the default CSS properties, so implementations must chain up.
180 * @system_setting_changed: Emitted when a system setting was changed. Must chain up.
181 * @snapshot: Vfunc called when a new snapshot of the widget has to be taken.
182 * @contains: Vfunc for gtk_widget_contains().
183 */
184 struct _GtkWidgetClass
185 {
186 GInitiallyUnownedClass parent_class;
187
188 /*< public >*/
189
190 /* basics */
191 void (* show) (GtkWidget *widget);
192 void (* hide) (GtkWidget *widget);
193 void (* map) (GtkWidget *widget);
194 void (* unmap) (GtkWidget *widget);
195 void (* realize) (GtkWidget *widget);
196 void (* unrealize) (GtkWidget *widget);
197 void (* root) (GtkWidget *widget);
198 void (* unroot) (GtkWidget *widget);
199 void (* size_allocate) (GtkWidget *widget,
200 int width,
201 int height,
202 int baseline);
203 void (* state_flags_changed) (GtkWidget *widget,
204 GtkStateFlags previous_state_flags);
205 void (* direction_changed) (GtkWidget *widget,
206 GtkTextDirection previous_direction);
207
208 /* size requests */
209 GtkSizeRequestMode (* get_request_mode) (GtkWidget *widget);
210 void (* measure) (GtkWidget *widget,
211 GtkOrientation orientation,
212 int for_size,
213 int *minimum,
214 int *natural,
215 int *minimum_baseline,
216 int *natural_baseline);
217
218 /* Mnemonics */
219 gboolean (* mnemonic_activate) (GtkWidget *widget,
220 gboolean group_cycling);
221
222 /* explicit focus */
223 gboolean (* grab_focus) (GtkWidget *widget);
224 gboolean (* focus) (GtkWidget *widget,
225 GtkDirectionType direction);
226 void (* set_focus_child) (GtkWidget *widget,
227 GtkWidget *child);
228
229 /* keyboard navigation */
230 void (* move_focus) (GtkWidget *widget,
231 GtkDirectionType direction);
232 gboolean (* keynav_failed) (GtkWidget *widget,
233 GtkDirectionType direction);
234
235 gboolean (* query_tooltip) (GtkWidget *widget,
236 int x,
237 int y,
238 gboolean keyboard_tooltip,
239 GtkTooltip *tooltip);
240
241 void (* compute_expand) (GtkWidget *widget,
242 gboolean *hexpand_p,
243 gboolean *vexpand_p);
244
245 void (* css_changed) (GtkWidget *widget,
246 GtkCssStyleChange *change);
247
248 void (* system_setting_changed) (GtkWidget *widget,
249 GtkSystemSetting settings);
250
251 void (* snapshot) (GtkWidget *widget,
252 GtkSnapshot *snapshot);
253
254 gboolean (* contains) (GtkWidget *widget,
255 double x,
256 double y);
257
258 /*< private >*/
259
260 GtkWidgetClassPrivate *priv;
261
262 gpointer padding[8];
263 };
264
265
266 GDK_AVAILABLE_IN_ALL
267 GType gtk_widget_get_type (void) G_GNUC_CONST;
268 GDK_AVAILABLE_IN_ALL
269 void gtk_widget_unparent (GtkWidget *widget);
270 GDK_AVAILABLE_IN_ALL
271 void gtk_widget_show (GtkWidget *widget);
272 GDK_AVAILABLE_IN_ALL
273 void gtk_widget_hide (GtkWidget *widget);
274 GDK_AVAILABLE_IN_ALL
275 void gtk_widget_map (GtkWidget *widget);
276 GDK_AVAILABLE_IN_ALL
277 void gtk_widget_unmap (GtkWidget *widget);
278 GDK_AVAILABLE_IN_ALL
279 void gtk_widget_realize (GtkWidget *widget);
280 GDK_AVAILABLE_IN_ALL
281 void gtk_widget_unrealize (GtkWidget *widget);
282
283 /* Queuing draws */
284 GDK_AVAILABLE_IN_ALL
285 void gtk_widget_queue_draw (GtkWidget *widget);
286 GDK_AVAILABLE_IN_ALL
287 void gtk_widget_queue_resize (GtkWidget *widget);
288 GDK_AVAILABLE_IN_ALL
289 void gtk_widget_queue_allocate (GtkWidget *widget);
290 GDK_AVAILABLE_IN_ALL
291 GdkFrameClock* gtk_widget_get_frame_clock (GtkWidget *widget);
292
293 GDK_AVAILABLE_IN_ALL
294 void gtk_widget_size_allocate (GtkWidget *widget,
295 const GtkAllocation *allocation,
296 int baseline);
297 GDK_AVAILABLE_IN_ALL
298 void gtk_widget_allocate (GtkWidget *widget,
299 int width,
300 int height,
301 int baseline,
302 GskTransform *transform);
303
304 GDK_AVAILABLE_IN_ALL
305 GtkSizeRequestMode gtk_widget_get_request_mode (GtkWidget *widget);
306 GDK_AVAILABLE_IN_ALL
307 void gtk_widget_measure (GtkWidget *widget,
308 GtkOrientation orientation,
309 int for_size,
310 int *minimum,
311 int *natural,
312 int *minimum_baseline,
313 int *natural_baseline);
314 GDK_AVAILABLE_IN_ALL
315 void gtk_widget_get_preferred_size (GtkWidget *widget,
316 GtkRequisition *minimum_size,
317 GtkRequisition *natural_size);
318
319 GDK_AVAILABLE_IN_ALL
320 void gtk_widget_set_layout_manager (GtkWidget *widget,
321 GtkLayoutManager *layout_manager);
322 GDK_AVAILABLE_IN_ALL
323 GtkLayoutManager * gtk_widget_get_layout_manager (GtkWidget *widget);
324
325 GDK_AVAILABLE_IN_ALL
326 void gtk_widget_class_set_layout_manager_type (GtkWidgetClass *widget_class,
327 GType type);
328 GDK_AVAILABLE_IN_ALL
329 GType gtk_widget_class_get_layout_manager_type (GtkWidgetClass *widget_class);
330
331 GDK_AVAILABLE_IN_ALL
332 void gtk_widget_class_add_binding (GtkWidgetClass *widget_class,
333 guint keyval,
334 GdkModifierType mods,
335 GtkShortcutFunc callback,
336 const char *format_string,
337 ...);
338 GDK_AVAILABLE_IN_ALL
339 void gtk_widget_class_add_binding_signal
340 (GtkWidgetClass *widget_class,
341 guint keyval,
342 GdkModifierType mods,
343 const char *signal,
344 const char *format_string,
345 ...);
346 GDK_AVAILABLE_IN_ALL
347 void gtk_widget_class_add_binding_action
348 (GtkWidgetClass *widget_class,
349 guint keyval,
350 GdkModifierType mods,
351 const char *action_name,
352 const char *format_string,
353 ...);
354 GDK_AVAILABLE_IN_ALL
355 void gtk_widget_class_add_shortcut (GtkWidgetClass *widget_class,
356 GtkShortcut *shortcut);
357
358 GDK_AVAILABLE_IN_ALL
359 void gtk_widget_class_set_activate_signal (GtkWidgetClass *widget_class,
360 guint signal_id);
361 GDK_AVAILABLE_IN_ALL
362 void gtk_widget_class_set_activate_signal_from_name (GtkWidgetClass *widget_class,
363 const char *signal_name);
364 GDK_AVAILABLE_IN_ALL
365 guint gtk_widget_class_get_activate_signal (GtkWidgetClass *widget_class);
366
367 GDK_AVAILABLE_IN_ALL
368 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
369 gboolean group_cycling);
370 GDK_AVAILABLE_IN_ALL
371 gboolean gtk_widget_activate (GtkWidget *widget);
372
373 GDK_AVAILABLE_IN_ALL
374 void gtk_widget_set_can_focus (GtkWidget *widget,
375 gboolean can_focus);
376 GDK_AVAILABLE_IN_ALL
377 gboolean gtk_widget_get_can_focus (GtkWidget *widget);
378 GDK_AVAILABLE_IN_ALL
379 void gtk_widget_set_focusable (GtkWidget *widget,
380 gboolean focusable);
381 GDK_AVAILABLE_IN_ALL
382 gboolean gtk_widget_get_focusable (GtkWidget *widget);
383 GDK_AVAILABLE_IN_ALL
384 gboolean gtk_widget_has_focus (GtkWidget *widget);
385 GDK_AVAILABLE_IN_ALL
386 gboolean gtk_widget_is_focus (GtkWidget *widget);
387 GDK_AVAILABLE_IN_ALL
388 gboolean gtk_widget_has_visible_focus (GtkWidget *widget);
389 GDK_AVAILABLE_IN_ALL
390 gboolean gtk_widget_grab_focus (GtkWidget *widget);
391 GDK_AVAILABLE_IN_ALL
392 void gtk_widget_set_focus_on_click (GtkWidget *widget,
393 gboolean focus_on_click);
394 GDK_AVAILABLE_IN_ALL
395 gboolean gtk_widget_get_focus_on_click (GtkWidget *widget);
396
397 GDK_AVAILABLE_IN_ALL
398 void gtk_widget_set_can_target (GtkWidget *widget,
399 gboolean can_target);
400 GDK_AVAILABLE_IN_ALL
401 gboolean gtk_widget_get_can_target (GtkWidget *widget);
402
403 GDK_AVAILABLE_IN_ALL
404 gboolean gtk_widget_has_default (GtkWidget *widget);
405
406 GDK_AVAILABLE_IN_ALL
407 void gtk_widget_set_receives_default (GtkWidget *widget,
408 gboolean receives_default);
409 GDK_AVAILABLE_IN_ALL
410 gboolean gtk_widget_get_receives_default (GtkWidget *widget);
411
412
413 GDK_AVAILABLE_IN_ALL
414 void gtk_widget_set_name (GtkWidget *widget,
415 const char *name);
416 GDK_AVAILABLE_IN_ALL
417 const char * gtk_widget_get_name (GtkWidget *widget);
418
419
420 GDK_AVAILABLE_IN_ALL
421 void gtk_widget_set_state_flags (GtkWidget *widget,
422 GtkStateFlags flags,
423 gboolean clear);
424 GDK_AVAILABLE_IN_ALL
425 void gtk_widget_unset_state_flags (GtkWidget *widget,
426 GtkStateFlags flags);
427 GDK_AVAILABLE_IN_ALL
428 GtkStateFlags gtk_widget_get_state_flags (GtkWidget *widget);
429
430 GDK_AVAILABLE_IN_ALL
431 void gtk_widget_set_sensitive (GtkWidget *widget,
432 gboolean sensitive);
433 GDK_AVAILABLE_IN_ALL
434 gboolean gtk_widget_get_sensitive (GtkWidget *widget);
435 GDK_AVAILABLE_IN_ALL
436 gboolean gtk_widget_is_sensitive (GtkWidget *widget);
437
438 GDK_AVAILABLE_IN_ALL
439 void gtk_widget_set_visible (GtkWidget *widget,
440 gboolean visible);
441 GDK_AVAILABLE_IN_ALL
442 gboolean gtk_widget_get_visible (GtkWidget *widget);
443 GDK_AVAILABLE_IN_ALL
444 gboolean gtk_widget_is_visible (GtkWidget *widget);
445
446 GDK_AVAILABLE_IN_ALL
447 gboolean gtk_widget_is_drawable (GtkWidget *widget);
448 GDK_AVAILABLE_IN_ALL
449 gboolean gtk_widget_get_realized (GtkWidget *widget);
450 GDK_AVAILABLE_IN_ALL
451 gboolean gtk_widget_get_mapped (GtkWidget *widget);
452
453 GDK_AVAILABLE_IN_ALL
454 void gtk_widget_set_parent (GtkWidget *widget,
455 GtkWidget *parent);
456 GDK_AVAILABLE_IN_ALL
457 GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
458
459 GDK_AVAILABLE_IN_ALL
460 GtkRoot * gtk_widget_get_root (GtkWidget *widget);
461
462 GDK_AVAILABLE_IN_ALL
463 GtkNative * gtk_widget_get_native (GtkWidget *widget);
464
465 GDK_AVAILABLE_IN_ALL
466 void gtk_widget_set_child_visible (GtkWidget *widget,
467 gboolean child_visible);
468 GDK_AVAILABLE_IN_ALL
469 gboolean gtk_widget_get_child_visible (GtkWidget *widget);
470
471 GDK_AVAILABLE_IN_ALL
472 int gtk_widget_get_allocated_width (GtkWidget *widget);
473 GDK_AVAILABLE_IN_ALL
474 int gtk_widget_get_allocated_height (GtkWidget *widget);
475 GDK_AVAILABLE_IN_ALL
476 int gtk_widget_get_allocated_baseline (GtkWidget *widget);
477
478 GDK_AVAILABLE_IN_ALL
479 void gtk_widget_get_allocation (GtkWidget *widget,
480 GtkAllocation *allocation);
481 GDK_AVAILABLE_IN_ALL
482 gboolean gtk_widget_compute_transform (GtkWidget *widget,
483 GtkWidget *target,
484 graphene_matrix_t *out_transform) G_GNUC_WARN_UNUSED_RESULT;
485 GDK_AVAILABLE_IN_ALL
486 gboolean gtk_widget_compute_bounds (GtkWidget *widget,
487 GtkWidget *target,
488 graphene_rect_t *out_bounds) G_GNUC_WARN_UNUSED_RESULT;
489 GDK_AVAILABLE_IN_ALL
490 gboolean gtk_widget_compute_point (GtkWidget *widget,
491 GtkWidget *target,
492 const graphene_point_t *point,
493 graphene_point_t *out_point) G_GNUC_WARN_UNUSED_RESULT;
494
495 GDK_AVAILABLE_IN_ALL
496 int gtk_widget_get_width (GtkWidget *widget);
497 GDK_AVAILABLE_IN_ALL
498 int gtk_widget_get_height (GtkWidget *widget);
499 GDK_AVAILABLE_IN_ALL
500 int gtk_widget_get_size (GtkWidget *widget,
501 GtkOrientation orientation);
502
503 GDK_AVAILABLE_IN_ALL
504 gboolean gtk_widget_child_focus (GtkWidget *widget,
505 GtkDirectionType direction);
506 GDK_AVAILABLE_IN_ALL
507 gboolean gtk_widget_keynav_failed (GtkWidget *widget,
508 GtkDirectionType direction);
509 GDK_AVAILABLE_IN_ALL
510 void gtk_widget_error_bell (GtkWidget *widget);
511
512 GDK_AVAILABLE_IN_ALL
513 void gtk_widget_set_size_request (GtkWidget *widget,
514 int width,
515 int height);
516 GDK_AVAILABLE_IN_ALL
517 void gtk_widget_get_size_request (GtkWidget *widget,
518 int *width,
519 int *height);
520 GDK_AVAILABLE_IN_ALL
521 void gtk_widget_set_opacity (GtkWidget *widget,
522 double opacity);
523 GDK_AVAILABLE_IN_ALL
524 double gtk_widget_get_opacity (GtkWidget *widget);
525 GDK_AVAILABLE_IN_ALL
526 void gtk_widget_set_overflow (GtkWidget *widget,
527 GtkOverflow overflow);
528 GDK_AVAILABLE_IN_ALL
529 GtkOverflow gtk_widget_get_overflow (GtkWidget *widget);
530
531 GDK_AVAILABLE_IN_ALL
532 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
533 GType widget_type);
534
535 GDK_AVAILABLE_IN_ALL
536 int gtk_widget_get_scale_factor (GtkWidget *widget);
537 GDK_AVAILABLE_IN_ALL
538 GdkDisplay * gtk_widget_get_display (GtkWidget *widget);
539 GDK_AVAILABLE_IN_ALL
540 GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
541 GDK_AVAILABLE_IN_ALL
542 GdkClipboard *gtk_widget_get_clipboard (GtkWidget *widget);
543 GDK_AVAILABLE_IN_ALL
544 GdkClipboard *gtk_widget_get_primary_clipboard (GtkWidget *widget);
545
546
547 /* Expand flags and related support */
548 GDK_AVAILABLE_IN_ALL
549 gboolean gtk_widget_get_hexpand (GtkWidget *widget);
550 GDK_AVAILABLE_IN_ALL
551 void gtk_widget_set_hexpand (GtkWidget *widget,
552 gboolean expand);
553 GDK_AVAILABLE_IN_ALL
554 gboolean gtk_widget_get_hexpand_set (GtkWidget *widget);
555 GDK_AVAILABLE_IN_ALL
556 void gtk_widget_set_hexpand_set (GtkWidget *widget,
557 gboolean set);
558 GDK_AVAILABLE_IN_ALL
559 gboolean gtk_widget_get_vexpand (GtkWidget *widget);
560 GDK_AVAILABLE_IN_ALL
561 void gtk_widget_set_vexpand (GtkWidget *widget,
562 gboolean expand);
563 GDK_AVAILABLE_IN_ALL
564 gboolean gtk_widget_get_vexpand_set (GtkWidget *widget);
565 GDK_AVAILABLE_IN_ALL
566 void gtk_widget_set_vexpand_set (GtkWidget *widget,
567 gboolean set);
568 GDK_AVAILABLE_IN_ALL
569 gboolean gtk_widget_compute_expand (GtkWidget *widget,
570 GtkOrientation orientation);
571
572 /* Margin and alignment */
573 GDK_AVAILABLE_IN_ALL
574 GtkAlign gtk_widget_get_halign (GtkWidget *widget);
575 GDK_AVAILABLE_IN_ALL
576 void gtk_widget_set_halign (GtkWidget *widget,
577 GtkAlign align);
578 GDK_AVAILABLE_IN_ALL
579 GtkAlign gtk_widget_get_valign (GtkWidget *widget);
580 GDK_AVAILABLE_IN_ALL
581 void gtk_widget_set_valign (GtkWidget *widget,
582 GtkAlign align);
583 GDK_AVAILABLE_IN_ALL
584 int gtk_widget_get_margin_start (GtkWidget *widget);
585 GDK_AVAILABLE_IN_ALL
586 void gtk_widget_set_margin_start (GtkWidget *widget,
587 int margin);
588 GDK_AVAILABLE_IN_ALL
589 int gtk_widget_get_margin_end (GtkWidget *widget);
590 GDK_AVAILABLE_IN_ALL
591 void gtk_widget_set_margin_end (GtkWidget *widget,
592 int margin);
593 GDK_AVAILABLE_IN_ALL
594 int gtk_widget_get_margin_top (GtkWidget *widget);
595 GDK_AVAILABLE_IN_ALL
596 void gtk_widget_set_margin_top (GtkWidget *widget,
597 int margin);
598 GDK_AVAILABLE_IN_ALL
599 int gtk_widget_get_margin_bottom (GtkWidget *widget);
600 GDK_AVAILABLE_IN_ALL
601 void gtk_widget_set_margin_bottom (GtkWidget *widget,
602 int margin);
603
604 GDK_AVAILABLE_IN_ALL
605 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
606 GtkWidget *ancestor);
607
608 GDK_AVAILABLE_IN_ALL
609 gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
610 GtkWidget *dest_widget,
611 double src_x,
612 double src_y,
613 double *dest_x,
614 double *dest_y);
615
616 GDK_AVAILABLE_IN_ALL
617 gboolean gtk_widget_contains (GtkWidget *widget,
618 double x,
619 double y);
620 GDK_AVAILABLE_IN_ALL
621 GtkWidget * gtk_widget_pick (GtkWidget *widget,
622 double x,
623 double y,
624 GtkPickFlags flags);
625
626 GDK_AVAILABLE_IN_ALL
627 void gtk_widget_add_controller (GtkWidget *widget,
628 GtkEventController *controller);
629 GDK_AVAILABLE_IN_ALL
630 void gtk_widget_remove_controller (GtkWidget *widget,
631 GtkEventController *controller);
632
633 GDK_AVAILABLE_IN_ALL
634 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
635 GDK_AVAILABLE_IN_ALL
636 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
637 GDK_AVAILABLE_IN_ALL
638 void gtk_widget_set_font_options (GtkWidget *widget,
639 const cairo_font_options_t *options);
640 GDK_AVAILABLE_IN_ALL
641 const cairo_font_options_t *gtk_widget_get_font_options (GtkWidget *widget);
642 GDK_AVAILABLE_IN_ALL
643 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
644 const char *text);
645
646 /* Functions for setting directionality for widgets */
647
648 GDK_AVAILABLE_IN_ALL
649 void gtk_widget_set_direction (GtkWidget *widget,
650 GtkTextDirection dir);
651 GDK_AVAILABLE_IN_ALL
652 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
653
654 GDK_AVAILABLE_IN_ALL
655 void gtk_widget_set_default_direction (GtkTextDirection dir);
656 GDK_AVAILABLE_IN_ALL
657 GtkTextDirection gtk_widget_get_default_direction (void);
658
659 GDK_AVAILABLE_IN_ALL
660 void gtk_widget_set_cursor (GtkWidget *widget,
661 GdkCursor *cursor);
662 GDK_AVAILABLE_IN_ALL
663 void gtk_widget_set_cursor_from_name (GtkWidget *widget,
664 const char *name);
665 GDK_AVAILABLE_IN_ALL
666 GdkCursor * gtk_widget_get_cursor (GtkWidget *widget);
667
668 GDK_AVAILABLE_IN_ALL
669 GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
670 GDK_AVAILABLE_IN_ALL
671 void gtk_widget_add_mnemonic_label (GtkWidget *widget,
672 GtkWidget *label);
673 GDK_AVAILABLE_IN_ALL
674 void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
675 GtkWidget *label);
676
677 GDK_AVAILABLE_IN_ALL
678 void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
679 GDK_AVAILABLE_IN_ALL
680 void gtk_widget_set_tooltip_text (GtkWidget *widget,
681 const char *text);
682 GDK_AVAILABLE_IN_ALL
683 const char * gtk_widget_get_tooltip_text (GtkWidget *widget);
684 GDK_AVAILABLE_IN_ALL
685 void gtk_widget_set_tooltip_markup (GtkWidget *widget,
686 const char *markup);
687 GDK_AVAILABLE_IN_ALL
688 const char * gtk_widget_get_tooltip_markup (GtkWidget *widget);
689 GDK_AVAILABLE_IN_ALL
690 void gtk_widget_set_has_tooltip (GtkWidget *widget,
691 gboolean has_tooltip);
692 GDK_AVAILABLE_IN_ALL
693 gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
694
695 GDK_AVAILABLE_IN_ALL
696 GType gtk_requisition_get_type (void) G_GNUC_CONST;
697 GDK_AVAILABLE_IN_ALL
698 GtkRequisition *gtk_requisition_new (void) G_GNUC_MALLOC;
699 GDK_AVAILABLE_IN_ALL
700 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
701 GDK_AVAILABLE_IN_ALL
702 void gtk_requisition_free (GtkRequisition *requisition);
703
704 GDK_AVAILABLE_IN_ALL
705 gboolean gtk_widget_in_destruction (GtkWidget *widget);
706
707 GDK_AVAILABLE_IN_ALL
708 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
709
710 GDK_AVAILABLE_IN_ALL
711 void gtk_widget_class_set_css_name (GtkWidgetClass *widget_class,
712 const char *name);
713 GDK_AVAILABLE_IN_ALL
714 const char * gtk_widget_class_get_css_name (GtkWidgetClass *widget_class);
715
716 GDK_AVAILABLE_IN_ALL
717 guint gtk_widget_add_tick_callback (GtkWidget *widget,
718 GtkTickCallback callback,
719 gpointer user_data,
720 GDestroyNotify notify);
721
722 GDK_AVAILABLE_IN_ALL
723 void gtk_widget_remove_tick_callback (GtkWidget *widget,
724 guint id);
725
726 /**
727 * gtk_widget_class_bind_template_callback:
728 * @widget_class: a #GtkWidgetClass
729 * @callback: the callback symbol
730 *
731 * Binds a callback function defined in a template to the @widget_class.
732 *
733 * This macro is a convenience wrapper around the
734 * gtk_widget_class_bind_template_callback_full() function. It is not
735 * supported after gtk_widget_class_set_template_scope() has been used
736 * on @widget_class.
737 */
738 #define gtk_widget_class_bind_template_callback(widget_class, callback) \
739 gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (widget_class), \
740 #callback, \
741 G_CALLBACK (callback))
742
743 /**
744 * gtk_widget_class_bind_template_child:
745 * @widget_class: a #GtkWidgetClass
746 * @TypeName: the type name of this widget
747 * @member_name: name of the instance member in the instance struct for @data_type
748 *
749 * Binds a child widget defined in a template to the @widget_class.
750 *
751 * This macro is a convenience wrapper around the
752 * gtk_widget_class_bind_template_child_full() function.
753 *
754 * This macro will use the offset of the @member_name inside the @TypeName
755 * instance structure.
756 */
757 #define gtk_widget_class_bind_template_child(widget_class, TypeName, member_name) \
758 gtk_widget_class_bind_template_child_full (widget_class, \
759 #member_name, \
760 FALSE, \
761 G_STRUCT_OFFSET (TypeName, member_name))
762
763 /**
764 * gtk_widget_class_bind_template_child_internal:
765 * @widget_class: a #GtkWidgetClass
766 * @TypeName: the type name, in CamelCase
767 * @member_name: name of the instance member in the instance struct for @data_type
768 *
769 * Binds a child widget defined in a template to the @widget_class, and
770 * also makes it available as an internal child in GtkBuilder, under the
771 * name @member_name.
772 *
773 * This macro is a convenience wrapper around the
774 * gtk_widget_class_bind_template_child_full() function.
775 *
776 * This macro will use the offset of the @member_name inside the @TypeName
777 * instance structure.
778 */
779 #define gtk_widget_class_bind_template_child_internal(widget_class, TypeName, member_name) \
780 gtk_widget_class_bind_template_child_full (widget_class, \
781 #member_name, \
782 TRUE, \
783 G_STRUCT_OFFSET (TypeName, member_name))
784
785 /**
786 * gtk_widget_class_bind_template_child_private:
787 * @widget_class: a #GtkWidgetClass
788 * @TypeName: the type name of this widget
789 * @member_name: name of the instance private member in the private struct for @data_type
790 *
791 * Binds a child widget defined in a template to the @widget_class.
792 *
793 * This macro is a convenience wrapper around the
794 * gtk_widget_class_bind_template_child_full() function.
795 *
796 * This macro will use the offset of the @member_name inside the @TypeName
797 * private data structure (it uses G_PRIVATE_OFFSET(), so the private struct
798 * must be added with G_ADD_PRIVATE()).
799 */
800 #define gtk_widget_class_bind_template_child_private(widget_class, TypeName, member_name) \
801 gtk_widget_class_bind_template_child_full (widget_class, \
802 #member_name, \
803 FALSE, \
804 G_PRIVATE_OFFSET (TypeName, member_name))
805
806 /**
807 * gtk_widget_class_bind_template_child_internal_private:
808 * @widget_class: a #GtkWidgetClass
809 * @TypeName: the type name, in CamelCase
810 * @member_name: name of the instance private member on the private struct for @data_type
811 *
812 * Binds a child widget defined in a template to the @widget_class, and
813 * also makes it available as an internal child in GtkBuilder, under the
814 * name @member_name.
815 *
816 * This macro is a convenience wrapper around the
817 * gtk_widget_class_bind_template_child_full() function.
818 *
819 * This macro will use the offset of the @member_name inside the @TypeName
820 * private data structure.
821 */
822 #define gtk_widget_class_bind_template_child_internal_private(widget_class, TypeName, member_name) \
823 gtk_widget_class_bind_template_child_full (widget_class, \
824 #member_name, \
825 TRUE, \
826 G_PRIVATE_OFFSET (TypeName, member_name))
827
828 GDK_AVAILABLE_IN_ALL
829 void gtk_widget_init_template (GtkWidget *widget);
830 GDK_AVAILABLE_IN_ALL
831 GObject *gtk_widget_get_template_child (GtkWidget *widget,
832 GType widget_type,
833 const char *name);
834 GDK_AVAILABLE_IN_ALL
835 void gtk_widget_class_set_template (GtkWidgetClass *widget_class,
836 GBytes *template_bytes);
837 GDK_AVAILABLE_IN_ALL
838 void gtk_widget_class_set_template_from_resource (GtkWidgetClass *widget_class,
839 const char *resource_name);
840 GDK_AVAILABLE_IN_ALL
841 void gtk_widget_class_bind_template_callback_full (GtkWidgetClass *widget_class,
842 const char *callback_name,
843 GCallback callback_symbol);
844 GDK_AVAILABLE_IN_ALL
845 void gtk_widget_class_set_template_scope (GtkWidgetClass *widget_class,
846 GtkBuilderScope *scope);
847 GDK_AVAILABLE_IN_ALL
848 void gtk_widget_class_bind_template_child_full (GtkWidgetClass *widget_class,
849 const char *name,
850 gboolean internal_child,
851 gssize struct_offset);
852
853 GDK_AVAILABLE_IN_ALL
854 void gtk_widget_insert_action_group (GtkWidget *widget,
855 const char *name,
856 GActionGroup *group);
857
858 GDK_AVAILABLE_IN_ALL
859 gboolean gtk_widget_activate_action (GtkWidget *widget,
860 const char *name,
861 const char *format_string,
862 ...);
863 GDK_AVAILABLE_IN_ALL
864 gboolean gtk_widget_activate_action_variant (GtkWidget *widget,
865 const char *name,
866 GVariant *args);
867
868 GDK_AVAILABLE_IN_ALL
869 void gtk_widget_activate_default (GtkWidget *widget);
870
871 GDK_AVAILABLE_IN_ALL
872 void gtk_widget_set_font_map (GtkWidget *widget,
873 PangoFontMap *font_map);
874 GDK_AVAILABLE_IN_ALL
875 PangoFontMap * gtk_widget_get_font_map (GtkWidget *widget);
876
877 GDK_AVAILABLE_IN_ALL
878 GtkWidget * gtk_widget_get_first_child (GtkWidget *widget);
879 GDK_AVAILABLE_IN_ALL
880 GtkWidget * gtk_widget_get_last_child (GtkWidget *widget);
881 GDK_AVAILABLE_IN_ALL
882 GtkWidget * gtk_widget_get_next_sibling (GtkWidget *widget);
883 GDK_AVAILABLE_IN_ALL
884 GtkWidget * gtk_widget_get_prev_sibling (GtkWidget *widget);
885 GDK_AVAILABLE_IN_ALL
886 GListModel * gtk_widget_observe_children (GtkWidget *widget);
887 GDK_AVAILABLE_IN_ALL
888 GListModel * gtk_widget_observe_controllers (GtkWidget *widget);
889 GDK_AVAILABLE_IN_ALL
890 void gtk_widget_insert_after (GtkWidget *widget,
891 GtkWidget *parent,
892 GtkWidget *previous_sibling);
893 GDK_AVAILABLE_IN_ALL
894 void gtk_widget_insert_before (GtkWidget *widget,
895 GtkWidget *parent,
896 GtkWidget *next_sibling);
897 GDK_AVAILABLE_IN_ALL
898 void gtk_widget_set_focus_child (GtkWidget *widget,
899 GtkWidget *child);
900 GDK_AVAILABLE_IN_ALL
901 GtkWidget * gtk_widget_get_focus_child (GtkWidget *widget);
902
903 GDK_AVAILABLE_IN_ALL
904 void gtk_widget_snapshot_child (GtkWidget *widget,
905 GtkWidget *child,
906 GtkSnapshot *snapshot);
907 GDK_AVAILABLE_IN_ALL
908 gboolean gtk_widget_should_layout (GtkWidget *widget);
909 GDK_AVAILABLE_IN_ALL
910 const char * gtk_widget_get_css_name (GtkWidget *self) G_GNUC_PURE;
911 GDK_AVAILABLE_IN_ALL
912 void gtk_widget_add_css_class (GtkWidget *widget,
913 const char *css_class);
914 GDK_AVAILABLE_IN_ALL
915 void gtk_widget_remove_css_class (GtkWidget *widget,
916 const char *css_class);
917 GDK_AVAILABLE_IN_ALL
918 gboolean gtk_widget_has_css_class (GtkWidget *widget,
919 const char *css_class);
920 GDK_AVAILABLE_IN_ALL
921 char ** gtk_widget_get_css_classes (GtkWidget *widget);
922 GDK_AVAILABLE_IN_ALL
923 void gtk_widget_set_css_classes (GtkWidget *widget,
924 const char **classes);
925
926
927
928
929 /**
930 * GtkWidgetActionActivateFunc:
931 * @widget: the widget to which the action belongs
932 * @action_name: the action name
933 * @parameter: parameter for activation
934 *
935 * The type of the callback functions used for activating
936 * actions installed with gtk_widget_class_install_action().
937 *
938 * The @parameter must match the @parameter_type of the action.
939 */
940 typedef void (* GtkWidgetActionActivateFunc) (GtkWidget *widget,
941 const char *action_name,
942 GVariant *parameter);
943
944 GDK_AVAILABLE_IN_ALL
945 void gtk_widget_class_install_action (GtkWidgetClass *widget_class,
946 const char *action_name,
947 const char *parameter_type,
948 GtkWidgetActionActivateFunc activate);
949
950 GDK_AVAILABLE_IN_ALL
951 void gtk_widget_class_install_property_action (GtkWidgetClass *widget_class,
952 const char *action_name,
953 const char *property_name);
954
955 GDK_AVAILABLE_IN_ALL
956 gboolean gtk_widget_class_query_action (GtkWidgetClass *widget_class,
957 guint index_,
958 GType *owner,
959 const char **action_name,
960 const GVariantType **parameter_type,
961 const char **property_name);
962
963 GDK_AVAILABLE_IN_ALL
964 void gtk_widget_action_set_enabled (GtkWidget *widget,
965 const char *action_name,
966 gboolean enabled);
967
968
969 GDK_AVAILABLE_IN_ALL
970 void gtk_widget_class_set_accessible_role (GtkWidgetClass *widget_class,
971 GtkAccessibleRole accessible_role);
972 GDK_AVAILABLE_IN_ALL
973 GtkAccessibleRole gtk_widget_class_get_accessible_role (GtkWidgetClass *widget_class);
974
975 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWidget, g_object_unref)
976 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRequisition, gtk_requisition_free)
977
978 G_END_DECLS
979
980 #endif /* __GTK_WIDGET_H__ */