Codebase list xapp / d577768
xapp-gtk-window: Move the xlib include into the .c file - it can cause namespace collisions (notably synaptic.) It's ok to treat "Window" as an unsigned long, because that's what they are. Michael Webster 6 years ago
2 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
33 #include <stdlib.h>
44 #include <string.h>
55 #include <math.h>
6 #include <X11/Xlib.h>
67 #include <X11/Xatom.h>
78
89 #include <gdk/gdk.h>
419420 * xapp_gtk_window_set_progress:
420421 * @window: The #XAppGtkWindow to set the progress for
421422 * @progress: The value to set for progress.
422 *
423 *
423424 * Sets the progress hint for a window manager (like muffin) to make
424425 * available when applications want to display the application's progress
425 * in some operation. The value sent to the WM will be clamped to
426 * in some operation. The value sent to the WM will be clamped to
426427 * between 0 and 100.
427428 *
428429 * Note: If a window will stick around after progress is complete, you will
653654
654655 /**
655656 * xapp_set_xid_icon_name:
656 * @xid: (type gulong): The #Window to set the icon name for
657 * @xid: The Window to set the icon name for
657658 * @icon_name: (nullable): The icon name to set, or %NULL to unset.
658659 *
659660 * Sets the icon name hint for a window manager (like muffin) to make
664665 * the window's XID. Set to %NULL to unset.
665666 */
666667 void
667 xapp_set_xid_icon_name (Window xid,
668 xapp_set_xid_icon_name (gulong xid,
668669 const gchar *icon_name)
669670 {
670671 g_return_if_fail (xid > 0);
674675
675676 /**
676677 * xapp_set_xid_icon_from_file:
677 * @xid: (type gulong): The #Window to set the icon name for
678 * @xid: The Window to set the icon name for
678679 * @file_name: (nullable): The icon path to set, or %NULL to unset.
679680 *
680681 * Sets the icon name hint for a window manager (like muffin) to make
685686 * the window's XID. Set to %NULL to unset.
686687 */
687688 void
688 xapp_set_xid_icon_from_file (Window xid,
689 xapp_set_xid_icon_from_file (gulong xid,
689690 const gchar *file_name)
690691 {
691692
696697
697698 /**
698699 * xapp_set_xid_progress:
699 * @xid: (type gulong): The #Window to set the progress for
700 * @xid: The Window to set the progress for
700701 * @progress: The value to set for progress.
701702 *
702703 * Sets the progress hint for a window manager (like muffin) to make
715716 * a given (possibly foreign) window, by passing the window's XID.
716717 */
717718 void
718 xapp_set_xid_progress (Window xid,
719 xapp_set_xid_progress (gulong xid,
719720 gint progress)
720721 {
721722 g_return_if_fail (xid > 0);
726727
727728 /**
728729 * xapp_set_xid_progress_pulse:
729 * @xid: (type gulong): The #Window to set the progress for
730 * @xid: The Window to set the progress for
730731 * @pulse: Whether to have pulsing set or not.
731732 *
732733 * Sets the progress pulse hint hint for a window manager (like muffin)
740741 * Setting an explicit progress value will unset this flag.
741742 */
742743 void
743 xapp_set_xid_progress_pulse (Window xid,
744 gboolean pulse)
744 xapp_set_xid_progress_pulse (gulong xid,
745 gboolean pulse)
745746 {
746747 g_return_if_fail (xid > 0);
747748
44
55 #include <glib-object.h>
66 #include <gtk/gtk.h>
7 #include <X11/Xlib.h>
87
98 G_BEGIN_DECLS
109
3837 void xapp_set_window_progress_pulse (GtkWindow *window,
3938 gboolean pulse);
4039 /* Low level for X11 Window xid's */
41 void xapp_set_xid_icon_name (Window xid,
40 void xapp_set_xid_icon_name (gulong xid,
4241 const gchar *icon_name);
43 void xapp_set_xid_icon_from_file (Window xid,
42 void xapp_set_xid_icon_from_file (gulong xid,
4443 const gchar *file_name);
45 void xapp_set_xid_progress (Window xid,
44 void xapp_set_xid_progress (gulong xid,
4645 gint progress);
47 void xapp_set_xid_progress_pulse (Window xid,
46 void xapp_set_xid_progress_pulse (gulong xid,
4847 gboolean pulse);
4948
5049 G_END_DECLS