[ekiga] Pushed the gnomemeeting_window_is_visible function to lib/gui/gmwindow.h
- From: Julien Puydt <jpuydt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [ekiga] Pushed the gnomemeeting_window_is_visible function to lib/gui/gmwindow.h
- Date: Tue, 20 Oct 2009 19:29:32 +0000 (UTC)
commit fb02c8a4fd15a3c29a8c859bc0f02dab6bc65375
Author: Julien Puydt <jpuydt gnome org>
Date: Tue Oct 20 17:54:51 2009 +0200
Pushed the gnomemeeting_window_is_visible function to lib/gui/gmwindow.h
... and renamed it to gm_window_is_visible while I was at it, for naming
coherence.
lib/gui/gmwindow.c | 8 ++++++++
lib/gui/gmwindow.h | 5 +++++
src/gui/callbacks.cpp | 3 ++-
src/gui/misc.cpp | 16 ++++------------
src/gui/misc.h | 10 +---------
5 files changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/lib/gui/gmwindow.c b/lib/gui/gmwindow.c
index aacfabd..48765a9 100644
--- a/lib/gui/gmwindow.c
+++ b/lib/gui/gmwindow.c
@@ -516,6 +516,14 @@ gm_window_set_always_on_top (GdkWindow *window,
#endif
}
+
+gboolean
+gm_window_is_visible (GtkWidget* w)
+{
+ return (GTK_WIDGET_VISIBLE (w) && !(gdk_window_get_state (GDK_WINDOW (w->window)) & GDK_WINDOW_STATE_ICONIFIED));
+}
+
+
/* Stolen from GDK */
#ifndef WIN32
static void
diff --git a/lib/gui/gmwindow.h b/lib/gui/gmwindow.h
index af90955..7eaa4c7 100644
--- a/lib/gui/gmwindow.h
+++ b/lib/gui/gmwindow.h
@@ -133,6 +133,11 @@ gboolean gm_window_get_hide_on_delete (GmWindow *window);
void gm_window_set_always_on_top (GdkWindow* window,
gboolean enable);
+/** Check whether a window is visible or not
+ * @param window is a GtkWidget
+ **/
+gboolean gm_window_is_visible (GtkWidget* window);
+
G_END_DECLS
#endif
diff --git a/src/gui/callbacks.cpp b/src/gui/callbacks.cpp
index e9de128..1efe2c6 100644
--- a/src/gui/callbacks.cpp
+++ b/src/gui/callbacks.cpp
@@ -47,6 +47,7 @@
#include "gmentrydialog.h"
#include "gmconf.h"
#include "gmdialog.h"
+#include "gmwindow.h"
#include "gmconnectbutton.h"
#include "gmmenuaddon.h"
#include "gmstockicons.h"
@@ -89,7 +90,7 @@ void
hide_window_cb (G_GNUC_UNUSED GtkWidget *widget,
gpointer data)
{
- if (gnomemeeting_window_is_visible (GTK_WIDGET (data)))
+ if (gm_window_is_visible (GTK_WIDGET (data)))
gnomemeeting_window_hide (GTK_WIDGET (data));
}
diff --git a/src/gui/misc.cpp b/src/gui/misc.cpp
index 2533d5f..1bc7fdf 100644
--- a/src/gui/misc.cpp
+++ b/src/gui/misc.cpp
@@ -44,6 +44,7 @@
#include "callbacks.h"
#include "gmdialog.h"
+#include "gmwindow.h"
#include "gmconf.h"
#include <glib/gi18n.h>
@@ -71,15 +72,6 @@ gnomemeeting_button_new (const char *lbl,
}
-
-
-gboolean
-gnomemeeting_window_is_visible (GtkWidget *w)
-{
- return (GTK_WIDGET_VISIBLE (w) && !(gdk_window_get_state (GDK_WINDOW (w->window)) & GDK_WINDOW_STATE_ICONIFIED));
-}
-
-
void
gnomemeeting_window_show (GtkWidget *w)
{
@@ -95,7 +87,7 @@ gnomemeeting_window_show (GtkWidget *w)
g_return_if_fail (GTK_IS_WINDOW (w));
- if (gnomemeeting_window_is_visible (w)) {
+ if (gm_window_is_visible (w)) {
gtk_window_present (GTK_WINDOW (w));
return;
@@ -110,7 +102,7 @@ gnomemeeting_window_show (GtkWidget *w)
conf_key_size =
g_strdup_printf ("%s%s/size", USER_INTERFACE_KEY, window_name);
- if (!gnomemeeting_window_is_visible (w)) {
+ if (!gm_window_is_visible (w)) {
position = gm_conf_get_string (conf_key_position);
if (position)
@@ -181,7 +173,7 @@ gnomemeeting_window_hide (GtkWidget *w)
/* If the window is visible, save its position and hide the window */
- if (gnomemeeting_window_is_visible (w)) {
+ if (gm_window_is_visible (w)) {
gtk_window_get_position (GTK_WINDOW (w), &x, &y);
position = g_strdup_printf ("%d,%d", x, y);
diff --git a/src/gui/misc.h b/src/gui/misc.h
index 72b4ab5..f9bbefd 100644
--- a/src/gui/misc.h
+++ b/src/gui/misc.h
@@ -50,17 +50,9 @@
*/
GtkWidget *
gnomemeeting_button_new (const char *label,
- GtkWidget *pixmap);
+ GtkWidget *pixmap);
-/* DESCRIPTION : /
- * BEHAVIOR : Returns TRUE if the specified window is present and visible
- * on the current workspace, FALSE otherwise.
- * PRE : Argument is a GtkWindow *.
- */
-gboolean gnomemeeting_window_is_visible (GtkWidget *w);
-
-
/* DESCRIPTION : This callback is called when a window of gnomemeeting
* (addressbook, prefs, ...) has to be shown.
* BEHAVIOR : Restore its size (if applicable) and position from the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]