]> Pileus Git - ~andy/gtk/commitdiff
Bug 535303 – add _get_implementation to GtkStatusIcon
authorColin Walters <walters@redhat.com>
Tue, 3 Jun 2008 17:39:20 +0000 (17:39 +0000)
committerColin Walters <walters@src.gnome.org>
Tue, 3 Jun 2008 17:39:20 +0000 (17:39 +0000)
2008-06-03  Colin Walters  <walters@redhat.com>

Bug 535303 – add _get_implementation to GtkStatusIcon

* gtk/gtkstatusicon.c (gtk_status_icon_get_x11_window_id): New
function to retrieve internal X11 window ID, useful for libnotify.
* gtk/gtkstatusicon.h: Prototype it.
* docs/reference/gtk/gtk-sections.txt: Add to docs.
* gtk/gtk.symbols: Export it.

svn path=/trunk/; revision=20304

ChangeLog
docs/reference/gtk/gtk-sections.txt
gtk/gtk.symbols
gtk/gtkstatusicon.c
gtk/gtkstatusicon.h

index be7d51f16243295e5a2e419d0a6816830008b208..70165ae039076f074e8dfa49063241fab186e902 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-06-03  Colin Walters  <walters@redhat.com>
+       
+       Bug 535303 – add _get_implementation to GtkStatusIcon
+
+       * gtk/gtkstatusicon.c (gtk_status_icon_get_x11_window_id): New
+       function to retrieve internal X11 window ID, useful for libnotify.
+       * gtk/gtkstatusicon.h: Prototype it.
+       * docs/reference/gtk/gtk-sections.txt: Add to docs.
+       * gtk/gtk.symbols: Export it.
+
 2008-06-03  Tor Lillqvist  <tml@novell.com>
 
        * gtk/updateiconcache.c (build_cache): Use g_open().
index b262ac6af1f57b8694e3016828472e3fe4bb510d..b66a16147f15fb1d1fcbf35ef40d6e2690cb88b3 100644 (file)
@@ -3402,6 +3402,7 @@ gtk_status_icon_get_blinking
 gtk_status_icon_is_embedded
 gtk_status_icon_position_menu
 gtk_status_icon_get_geometry
+gtk_status_icon_get_x11_window_id
 
 <SUBSECTION Standard>
 GTK_TYPE_STATUS_ICON
index 19cb6f13c22cc1daa442dd10849c2183088ca286..70d0add28f6ca3a9f28e7883f9ff0adbfb16d629 100644 (file)
@@ -1123,6 +1123,7 @@ gtk_status_icon_get_blinking
 gtk_status_icon_is_embedded
 gtk_status_icon_position_menu
 gtk_status_icon_get_geometry
+gtk_status_icon_get_x11_window_id
 #endif
 #endif
 
index 060d260f72d5e74b71cac7062c8578811bc82430..4e8a008dd3b140c66dd018d008adf7bf697a9206 100755 (executable)
 #include "gtkprivate.h"
 #include "gtkwidget.h"
 
+#ifdef GDK_WINDOWING_X11
+#include "gdk/x11/gdkx.h"
+#endif
+
 #ifdef GDK_WINDOWING_WIN32
 #include "gtkicontheme.h"
 #include "gtklabel.h"
@@ -2095,6 +2099,36 @@ gtk_status_icon_get_geometry (GtkStatusIcon    *status_icon,
 #endif /* GDK_WINDOWING_X11 */
 }
 
+/**
+ * gtk_status_icon_get_x11_window_id:
+ * @status_icon: a #GtkStatusIcon
+ *
+ * This function is only useful on the X11/freedesktop.org platform.
+ * It returns a window ID for the widget in the underlying
+ * status icon implementation.  This is useful for the Galago 
+ * notification service, which can send a window ID in the protocol 
+ * in order for the server to position notification windows 
+ * pointing to a status icon reliably.
+ *
+ * This function is not intended for other use cases which are
+ * more likely to be met by one of the non-X11 specific methods, such
+ * as gtk_status_icon_position_menu().
+ *
+ * Return value: An 32 bit unsigned integer identifier for the 
+ * underlying X11 Window
+ *
+ * Since: 2.14
+ */
+guint32
+gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon)
+{
+#ifdef GDK_WINDOWING_X11
+  gtk_widget_realize (GTK_WIDGET (status_icon->priv->tray_icon));
+  return GDK_WINDOW_XID (GTK_WIDGET (status_icon->priv->tray_icon)->window);
+#else
+  return 0;
+#endif
+}
 
 #define __GTK_STATUS_ICON_C__
 #include "gtkaliasdef.c"
index ed51a2745cac84e4204f102eba39b12bc1710865..dbb95207e0e1b2a2eb5a360aa754f77d6e822a1b 100755 (executable)
@@ -122,6 +122,8 @@ gboolean              gtk_status_icon_get_geometry       (GtkStatusIcon      *st
                                                          GdkRectangle       *area,
                                                          GtkOrientation     *orientation);
 
+guint32               gtk_status_icon_get_x11_window_id  (GtkStatusIcon      *status_icon);
+
 G_END_DECLS
 
 #endif /* __GTK_STATUS_ICON_H__ */