]> Pileus Git - ~andy/gtk/commitdiff
allow positioning bubbles
authorMatthias Clasen <matthiasc@src.gnome.org>
Thu, 25 May 2006 05:53:42 +0000 (05:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 25 May 2006 05:53:42 +0000 (05:53 +0000)
ChangeLog
ChangeLog.pre-2-10
docs/reference/ChangeLog
docs/reference/gtk/gtk-sections.txt
gtk/gtk.symbols
gtk/gtkstatusicon.c
gtk/gtkstatusicon.h

index cc8143eee321ae709c75277a1a4dbf675cf0cec8..40537fcceb42d9cacc10cddb12b6bcdcd0787070 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-05-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkstatusicon.h:
+       * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry):
+       New function that can be used to e.g. position 
+       notification bubbles wrt to the status icon.  
+       (#341450, Christian Persch, Havoc Pennington)
+
 2006-05-25  Matthias Clasen  <mclasen@redhat.com>
 
        Make GTK+ work as an untrusted X client. (#136571,
index cc8143eee321ae709c75277a1a4dbf675cf0cec8..40537fcceb42d9cacc10cddb12b6bcdcd0787070 100644 (file)
@@ -1,3 +1,12 @@
+2006-05-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkstatusicon.h:
+       * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry):
+       New function that can be used to e.g. position 
+       notification bubbles wrt to the status icon.  
+       (#341450, Christian Persch, Havoc Pennington)
+
 2006-05-25  Matthias Clasen  <mclasen@redhat.com>
 
        Make GTK+ work as an untrusted X client. (#136571,
index 1f22ce49fc1607e93cd76f78dc8e799ecd975390..0ca7c73c816119d4d829e40b2d50715d28baf6ce 100644 (file)
@@ -1,3 +1,7 @@
+2006-05-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk-sections.txt: Updates
+
 2006-05-23  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk-sections.txt: Additions
index fc1a843a1079ac0b9962ab49c3cfe0c8103677cd..cfdb2f497ff09becad93fa4d087bd08c99bd1566 100644 (file)
@@ -3242,6 +3242,8 @@ gtk_status_icon_set_blinking
 gtk_status_icon_get_blinking
 gtk_status_icon_is_embedded
 gtk_status_icon_position_menu
+gtk_status_icon_get_geometry
+
 <SUBSECTION Standard>
 GTK_TYPE_STATUS_ICON
 GTK_STATUS_ICON
index 088069a8bf820b3e02f32cf880e455c052def2b7..2f20fe523867a411af4ef62054111a4c32cd56e5 100644 (file)
@@ -1065,6 +1065,7 @@ gtk_status_icon_set_blinking
 gtk_status_icon_get_blinking
 gtk_status_icon_is_embedded
 gtk_status_icon_position_menu
+gtk_status_icon_get_geometry
 #endif
 #endif
 
index 22a9395df4ee3feb13c7d7774e229c469828cc79..61a62fc000c9fdc37d3757d31c721551b063861a 100755 (executable)
@@ -1631,5 +1631,60 @@ gtk_status_icon_position_menu (GtkMenu  *menu,
 #endif /* GDK_WINDOWING_X11 */
 }
 
+/**
+ * gtk_status_icon_get_geometry:
+ * @status_icon: a #GtkStatusIcon
+ * @screen: return location for the screen 
+ * @area: return location for the area occupied by the status icon
+ * @orientation: return location for the orientation of the panel 
+ *    in which the status icon is embedded. A panel at the top or
+ *    bottom of the screen is horizontal, a panel at the left or
+ *    right is vertical.
+ *
+ * Obtains information about the location of the status icon
+ * on screen. This information can be used to e.g. position 
+ * popups like notification bubbles. 
+ * See gtk_status_icon_position_menu() for a more convenient 
+ * alternative for positioning menus.
+ *
+ * Note that some platforms do not allow GTK+ to provide 
+ * this information.
+ *
+ * Return value: %TRUE if the location information has 
+ *               been filled in
+ *
+ * Since: 2.10
+ */
+gboolean  
+gtk_status_icon_get_geometry (GtkStatusIcon    *status_icon,
+                             GdkScreen       **screen,
+                             GdkRectangle     *area,
+                             GtkOrientation   *orientation)
+{
+#ifdef GDK_WINDOWING_X11   
+  GtkWidget *widget;
+  GtkStatusIconPrivate *priv;
+  gint x, y;
+
+  g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
+
+  priv = status_icon->priv;
+  widget = priv->tray_icon;
+
+  *screen = gtk_widget_get_screen (widget);
+  gdk_window_get_origin (widget->window, &x, &y);
+  area->x = x;
+  area->y = y;
+  area->width = widget->allocation.width;
+  area->height = widget->allocation.height;
+  *orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (widget));
+
+  return TRUE;
+#else
+  return FALSE;
+#endif /* GDK_WINDOWING_X11 */
+}
+
+
 #define __GTK_STATUS_ICON_C__
 #include "gtkaliasdef.c"
index 265b006e53f4787e1582307632a9cf4ee3616448..47b7d5be80b79c52ea33df00f171ecf407ccb39d 100755 (executable)
@@ -109,6 +109,10 @@ void                  gtk_status_icon_position_menu      (GtkMenu            *me
                                                          gint               *y,
                                                          gboolean           *push_in,
                                                          gpointer            user_data);
+gboolean              gtk_status_icon_get_geometry       (GtkStatusIcon      *status_icon,
+                                                         GdkScreen         **screen,
+                                                         GdkRectangle       *area,
+                                                         GtkOrientation     *orientation);
 
 G_END_DECLS