Codebase list xapp / 142bdf3
all: Fix build warnings, documentation. Michael Webster 6 years ago
4 changed file(s) with 123 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
9696
9797 GOBJECT_INTROSPECTION_CHECK([0.9.7])
9898
99 CFLAGS="$CFLAGS -Wno-declaration-after-statement"
100
99101 AC_CONFIG_FILES([
100102 Makefile
101103 docs/Makefile
77 ]>
88 <book id="index">
99 <bookinfo>
10 <title>Xapp Reference Manual</title>
10 <title>XApp Reference Manual</title>
1111 <releaseinfo>
1212 for &package_string;.
1313 </releaseinfo>
1515
1616 <chapter>
1717 <title>API reference</title>
18 <xi:include href="xml/xapp-kbd-layout-controller.xml"/>
18 <xi:include href="xml/xapp-kbd-layout-controller.xml"/>
1919 <xi:include href="xml/xapp-monitor-blanker.xml"/>
20 <xi:include href="xml/xapp-gtk-window.xml"/>
2021
2122 </chapter>
2223 <chapter id="object-tree">
1313 #define ICON_NAME_HINT "_NET_WM_XAPP_ICON_NAME"
1414 #define PROGRESS_HINT "_NET_WM_XAPP_PROGRESS"
1515 #define PROGRESS_PULSE_HINT "_NET_WM_XAPP_PROGRESS_PULSE"
16
17 /**
18 * SECTION:xapp-gtk-window
19 * @Short_description: A subclass of %GtkWindow that allows additional
20 communication with the window manager.
21 * @Title: XAppGtkWindow
22 *
23 * This widget is a simple subclass of GtkWindow that provides the following
24 * additional capabilities:
25 *
26 * - Ability to set an icon name or icon file path for the window manager to
27 * make use of, rather than relying on a desktop file or fixed-size window-
28 * backed icon that Gtk normally generates. The window manager must support
29 * the NET_WM_XAPP_ICON_NAME hint.
30 *
31 * - Ability to send progress info to the window manager, in the form of an integer,
32 * 0-100, which can then be used to display this progress in some manner in a task
33 * manager or window list. The window manager must support the NET_WM_XAPP_PROGRESS
34 * hint.
35 *
36 * - Ability to signal a 'pulsing' progress state, of potentially indeterminate value,
37 * in the form of a boolean, which can be passed on to a window list. The window
38 * manager must support the NET_WM_XAPP_PROGRESS_PULSE hint
39 *
40 * Wrappers:
41 *
42 * Also provided are corresponding wrapper functions for normal GtkWindows.
43 * They are not class methods - they are called with the target widget as their first
44 * argument.
45 *
46 * For example:
47 *
48 * win = Gtk.Window()
49 * XApp.set_window_icon_name(win, "foobar")
50 *
51 * These functions mirror those of the #XappGtkWindow class, but allow the properties
52 * to work with normal GtkWindows and descendants of GtkWindow.
53 */
1654
1755 struct _XAppGtkWindowPrivate
1856 {
267305 static void
268306 xapp_gtk_window_unrealize (GtkWidget *widget)
269307 {
270 XAppGtkWindow *window = XAPP_GTK_WINDOW (widget);
271
272308 GTK_WIDGET_CLASS (xapp_gtk_window_parent_class)->unrealize (widget);
273309 }
274310
467503 * GtkDialogs. Sets gtk_window_set_icon_name as well, to avoid needing
468504 * to have two calls each time. Set to %NULL to unset.
469505 */
470
471506 void
472507 xapp_set_window_icon_name (GtkWindow *window,
473508 const gchar *icon_name)
1212 #include <libgnomekbd/gkbd-configuration.h>
1313
1414 #include "xapp-kbd-layout-controller.h"
15
16 /**
17 * SECTION:xapp-kbd-layout-controller
18 * @Short_description: Keyboard layout selection UI element provider.
19 * @Title: XAppKbdLayoutController
20 *
21 * A GObject wrapper for Gkbd that provides additional UI element
22 * support for keyboard layout flags and abbreviations, as well as
23 * Wfacilities to distinguish regional and hardware-based variants
24 * which might otherwise appear identical in a layout list.
25 */
1526
1627 enum
1728 {
6071 {
6172 GkbdConfiguration *config;
6273
63 gint num_groups;
74 guint num_groups;
6475
6576 GPtrArray *group_data;
6677
129140
130141 /* Populate the GroupData pointer array */
131142
132 gint i, j, group_dupe_id, variant_dupe_id;
143 gint group_dupe_id, variant_dupe_id;
144 guint i, j;
145
133146 GPtrArray *list = g_ptr_array_new_with_free_func ((GDestroyNotify) group_data_free);
134147
135148 for (i = 0; i < priv->num_groups; i++)
385398 0, G_TYPE_NONE);
386399 }
387400
401 /**
402 * xapp_kbd_layout_controller_new
403 *
404 * Creates a new XAppKbdLayoutController instance.
405 *
406 * Returns: (transfer full): a new #XAppKbdLayoutController instance
407 */
388408 XAppKbdLayoutController *
389409 xapp_kbd_layout_controller_new (void)
390410 {
391411 return g_object_new (XAPP_TYPE_KBD_LAYOUT_CONTROLLER, NULL);
392412 }
393413
414 /**
415 * xapp_kbd_layout_controller_get_enabled:
416 * @controller: the #XAppKbdLayoutController
417 *
418 * Returns whether or not the layout controller is enabled
419 */
394420 gboolean
395421 xapp_kbd_layout_controller_get_enabled (XAppKbdLayoutController *controller)
396422 {
397423 return controller->priv->enabled;
398424 }
399425
426 /**
427 * xapp_kbd_layout_controller_get_current_group:
428 * @controller: the #XAppKbdLayoutController
429 *
430 * Selects the previous group in the group list.
431 */
400432 guint
401433 xapp_kbd_layout_controller_get_current_group (XAppKbdLayoutController *controller)
402434 {
405437 return gkbd_configuration_get_current_group (controller->priv->config);
406438 }
407439
440 /**
441 * xapp_kbd_layout_controller_set_current_group
442 * @controller: the #XAppKbdLayoutController
443 * @group: the group number to make active
444 *
445 * Selects the given group number as active.
446 */
408447 void
409448 xapp_kbd_layout_controller_set_current_group (XAppKbdLayoutController *controller,
410449 guint group)
420459 }
421460 }
422461
462 /**
463 * xapp_kbd_layout_controller_next_group
464 * @controller: the #XAppKbdLayoutController
465 *
466 * Selects the next group in the group list.
467 */
423468 void
424469 xapp_kbd_layout_controller_next_group (XAppKbdLayoutController *controller)
425470 {
428473 gkbd_configuration_lock_next_group (controller->priv->config);
429474 }
430475
476 /**
477 * xapp_kbd_layout_controller_previous_group
478 * @controller: the #XAppKbdLayoutController
479 *
480 * Selects the previous group in the group list.
481 */
431482 void
432483 xapp_kbd_layout_controller_previous_group (XAppKbdLayoutController *controller)
433484 {
451502
452503 /**
453504 * xapp_kbd_layout_controller_get_current_name:
505 * @controller: the #XAppKbdLayoutController
454506 *
455507 * Returns the full name of the current keyboard layout.
456508 *
467519
468520 /**
469521 * xapp_kbd_layout_controller_get_all_names:
522 * @controller: the #XAppKbdLayoutController
470523 *
471524 * Returns an array of all full layout names
472525 *
482535
483536 /**
484537 * xapp_kbd_layout_controller_get_current_icon_name:
538 * @controller: the #XAppKbdLayoutController
485539 *
486540 * Returns the icon file name (no path or extension) to use for the current layout
487541 *
501555
502556 /**
503557 * xapp_kbd_layout_controller_get_icon_name_for_group:
558 * @controller: the #XAppKbdLayoutController
559 * @group: a group number
504560 *
505561 * Returns the icon file name (no path or extension) to use for the specified layout.
506562 *
520576
521577 /**
522578 * xapp_kbd_layout_controller_get_current_flag_id:
579 * @controller: the #XAppKbdLayoutController
523580 *
524581 * Returns the duplicate id for the current layout
525582 *
540597
541598 /**
542599 * xapp_kbd_layout_controller_flag_id_for_group:
600 * @controller: the #XAppKbdLayoutController
601 * @group: a group number
543602 *
544603 * Returns the duplicate id for the specified layout
545604 *
559618
560619 /**
561620 * xapp_kbd_layout_controller_get_current_short_group_label:
621 * @controller: the #XAppKbdLayoutController
562622 *
563623 * Returns the short group label (and subscript, if any) of the current layout
564624 *
578638
579639 /**
580640 * xapp_kbd_layout_controller_get_short_group_label_for_group:
641 * @controller: the #XAppKbdLayoutController
642 * @group: a group number
581643 *
582644 * Returns the short group label and subscript of the specified layout.
583645 *
598660
599661 /**
600662 * xapp_kbd_layout_controller_get_current_variant_label:
663 * @controller: the #XAppKbdLayoutController
601664 *
602665 * Returns the variant label (and subscript, if any) of the current layout
603666 *
617680
618681 /**
619682 * xapp_kbd_layout_controller_get_variant_label_for_group:
683 * @controller: the #XAppKbdLayoutController
684 * @group: a group number
620685 *
621686 * Returns the variant label and subscript of the specified layout.
622687 *
635700 return g_strdup (GROUP_DATA (priv->group_data, group)->variant_label);
636701 }
637702
703 /**
704 * xapp_kbd_layout_controller_render_cairo_subscript:
705 * @cr: a #cairo_t
706 * @x: the x position of the drawing area
707 * @y: the y position of the drawing area
708 * @width: the width of the drawing area
709 * @height: the height of the drawing area
710 * @subscript: the number to render
711 *
712 * Renders a subscript number in the given work area. This should
713 * be called from within a "draw" or "paint" widget/actor function,
714 * where a valid cairo_t is provided to draw with.
715 */
638716 void
639717 xapp_kbd_layout_controller_render_cairo_subscript (cairo_t *cr,
640718 gdouble x,