ekiga r6961 - in trunk: . lib/gui



Author: dsandras
Date: Sun Sep 14 10:07:59 2008
New Revision: 6961
URL: http://svn.gnome.org/viewvc/ekiga?rev=6961&view=rev

Log:
Added API method to get the size of the GMWindow. It returns the size
the window should have, following the config, not the real size of the
window.


Modified:
   trunk/ChangeLog
   trunk/lib/gui/gmwindow.c
   trunk/lib/gui/gmwindow.h

Modified: trunk/lib/gui/gmwindow.c
==============================================================================
--- trunk/lib/gui/gmwindow.c	(original)
+++ trunk/lib/gui/gmwindow.c	Sun Sep 14 10:07:59 2008
@@ -412,3 +412,30 @@
 
   g_object_set (GM_WINDOW (window), "key", key, NULL);
 }
+
+
+void 
+gm_window_get_size (GmWindow *self,
+                    int *x,
+                    int *y)
+{
+  gchar *conf_key_size = NULL;
+  gchar *size = NULL;
+  gchar **couple = NULL;
+
+  g_return_if_fail (self != NULL);
+
+  conf_key_size = g_strdup_printf ("%s/size", self->priv->key);
+  size = gm_conf_get_string (conf_key_size);
+  if (size)
+    couple = g_strsplit (size, ",", 0);
+
+  if (x && couple && couple [0])
+    *x = atoi (couple [0]);
+  if (y && couple && couple [1])
+    *y = atoi (couple [1]);
+
+  g_free (conf_key_size);
+  g_free (size);
+  g_strfreev (couple);
+}

Modified: trunk/lib/gui/gmwindow.h
==============================================================================
--- trunk/lib/gui/gmwindow.h	(original)
+++ trunk/lib/gui/gmwindow.h	Sun Sep 14 10:07:59 2008
@@ -105,6 +105,15 @@
                         const char *key);
 
 
+/** Return the size of the GmWindow.
+ * @param window is the GmWindow
+ * @param x is the width
+ * @param y is the height
+ */
+void gm_window_get_size (GmWindow *window,
+                         int *x,
+                         int *y);
+
 G_END_DECLS
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]