* src/hildon-gtk.c, (hildon_gtk_window_set_progress_indicator): * src/hildon-gtk...
authorAlejandro G. Castro <alex@igalia.com>
Fri, 12 Sep 2008 13:07:20 +0000 (13:07 +0000)
committerAlejandro G. Castro <alex@igalia.com>
Fri, 12 Sep 2008 13:07:20 +0000 (13:07 +0000)
ChangeLog
src/hildon-gtk.c
src/hildon-gtk.h

index b57622d..f17f526 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-12  Alejandro G. Castro         <alex@igalia.com>
+
+       * src/hildon-gtk.c,
+       (hildon_gtk_window_set_progress_indicator):
+       * src/hildon-gtk.h: Added the new API
+       hildon_gtk_window_set_progress_indicator, it changes the state of
+       the window progress hint.
+
 2008-09-12  Alberto Garcia  <agarcia@igalia.com>
 
        * src/hildon-button.c
index 0affdb2..c9585b3 100644 (file)
@@ -24,6 +24,9 @@
  * easily perform frequent tasks.
  */
 
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
+
 #include "hildon-gtk.h"
 
 #define                                         HILDON_HEIGHT_FINGER 70
@@ -278,3 +281,30 @@ hildon_gtk_icon_view_new_with_model             (HildonUIMode  mode,
 {
     return g_object_new (GTK_TYPE_ICON_VIEW, "hildon-ui-mode", mode, "model", model, NULL);
 }
+
+/**
+ * hildon_gtk_window_set_progress_indicator:
+ * @window: The window, we want to define its state
+ * @state: The state we want to set: 1 -> show progress indicator, 0
+ *          -> hide progress indicator.
+ *
+ * This functions notifies the window manager that it should add a
+ * progress indicator in the title of the window. It applies to
+ * #HildonDialog and #HildonWindow.
+ *
+ **/
+void
+hildon_gtk_window_set_progress_indicator        (GtkWindow    *window,
+                                                 guint        state)
+{
+  GtkWidget *widget = GTK_WIDGET (window);
+  GdkDisplay *display;
+  Atom atom;
+
+  display = gdk_drawable_get_display (widget->window);
+  atom = gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_WM_WINDOW_PROGRESS_INDICATOR");
+
+  XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (widget->window),
+                   atom, XA_INTEGER, 32, PropModeReplace,
+                   (guchar *)&state, 1);
+}
index 6b8431c..1ce5c43 100644 (file)
@@ -63,6 +63,10 @@ GtkWidget *
 hildon_gtk_icon_view_new_with_model             (HildonUIMode  mode,
                                                  GtkTreeModel *model);
 
+void
+hildon_gtk_window_set_progress_indicator        (GtkWindow    *window,
+                                                 guint        state);
+
 G_END_DECLS
 
 #endif /* __HILDON_GTK_H__ */