gtk+ r20304 - in trunk: . docs/reference/gtk gtk
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20304 - in trunk: . docs/reference/gtk gtk
- Date: Tue, 3 Jun 2008 17:39:20 +0000 (UTC)
Author: walters
Date: Tue Jun 3 17:39:20 2008
New Revision: 20304
URL: http://svn.gnome.org/viewvc/gtk+?rev=20304&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/docs/reference/gtk/gtk-sections.txt
trunk/gtk/gtk.symbols
trunk/gtk/gtkstatusicon.c
trunk/gtk/gtkstatusicon.h
Modified: trunk/docs/reference/gtk/gtk-sections.txt
==============================================================================
--- trunk/docs/reference/gtk/gtk-sections.txt (original)
+++ trunk/docs/reference/gtk/gtk-sections.txt Tue Jun 3 17:39:20 2008
@@ -3402,6 +3402,7 @@
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
Modified: trunk/gtk/gtk.symbols
==============================================================================
--- trunk/gtk/gtk.symbols (original)
+++ trunk/gtk/gtk.symbols Tue Jun 3 17:39:20 2008
@@ -1123,6 +1123,7 @@
gtk_status_icon_is_embedded
gtk_status_icon_position_menu
gtk_status_icon_get_geometry
+gtk_status_icon_get_x11_window_id
#endif
#endif
Modified: trunk/gtk/gtkstatusicon.c
==============================================================================
--- trunk/gtk/gtkstatusicon.c (original)
+++ trunk/gtk/gtkstatusicon.c Tue Jun 3 17:39:20 2008
@@ -41,6 +41,10 @@
#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 @@
#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"
Modified: trunk/gtk/gtkstatusicon.h
==============================================================================
--- trunk/gtk/gtkstatusicon.h (original)
+++ trunk/gtk/gtkstatusicon.h Tue Jun 3 17:39:20 2008
@@ -122,6 +122,8 @@
GdkRectangle *area,
GtkOrientation *orientation);
+guint32 gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon);
+
G_END_DECLS
#endif /* __GTK_STATUS_ICON_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]