[epiphany/overview: 13/31] ephy-window: make is-popup and chrome actual window properties



commit 5e9f03024d0d691e206f51581a5cdee9b6af794c
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed May 2 23:00:53 2012 +0300

    ephy-window: make is-popup and chrome actual window properties
    
    Removing them from EphyEmbedContainer.

 embed/ephy-embed-container.c |   52 ------------------------------
 embed/ephy-embed-container.h |    6 ---
 src/ephy-session.c           |    9 ++---
 src/ephy-window.c            |   73 ++++++++++++++++++++++++++++--------------
 src/ephy-window.h            |    4 ++
 5 files changed, 57 insertions(+), 87 deletions(-)
---
diff --git a/embed/ephy-embed-container.c b/embed/ephy-embed-container.c
index 7c9e5ed..67d1103 100644
--- a/embed/ephy-embed-container.c
+++ b/embed/ephy-embed-container.c
@@ -32,18 +32,6 @@ ephy_embed_container_base_init (gpointer g_class)
     initialized = TRUE;
 
     g_object_interface_install_property (g_class,
-                                         g_param_spec_flags ("chrome", NULL, NULL,
-                                                             EPHY_TYPE_WEB_VIEW_CHROME,
-                                                             EPHY_WEB_VIEW_CHROME_ALL,
-                                                             G_PARAM_CONSTRUCT_ONLY |
-                                                             G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
-
-    g_object_interface_install_property (g_class,
-                                         g_param_spec_boolean ("is-popup", NULL, NULL,
-                                                               FALSE,
-                                                               G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
-                                                               G_PARAM_CONSTRUCT_ONLY));
-    g_object_interface_install_property (g_class,
                                          g_param_spec_object ("active-child", NULL, NULL,
                                                               GTK_TYPE_WIDGET /* Can't use an interface type here */,
                                                               G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
@@ -178,43 +166,3 @@ ephy_embed_container_get_children (EphyEmbedContainer *container)
   iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
   return iface->get_children (container);
 }
-
-/**
- * ephy_embed_container_get_is_popup:
- * @container: an #EphyEmbedContainer
- *
- * Returns whether this embed container is a popup.
- *
- * Return value: %TRUE if it is a popup
- **/
-gboolean
-ephy_embed_container_get_is_popup (EphyEmbedContainer *container)
-{
-  EphyEmbedContainerIface *iface;
-
-  g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), FALSE);
-
-  iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
-  return iface->get_is_popup (container);
-}
-
-/**
- * ephy_embed_container_get_chrome:
- * @container: an #EphyEmbedContainer
- *
- * Returns the #EphyWebViewChrome flags indicating the visibility of several parts
- * of the UI.
- *
- * Return value: #EphyWebViewChrome flags.
- **/
-EphyWebViewChrome
-ephy_embed_container_get_chrome (EphyEmbedContainer *container)
-{
-  EphyEmbedContainerIface *iface;
-
-  g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), 0);
-
-  iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
-  return iface->get_chrome (container);
-}
-
diff --git a/embed/ephy-embed-container.h b/embed/ephy-embed-container.h
index b9b89b0..9514617 100644
--- a/embed/ephy-embed-container.h
+++ b/embed/ephy-embed-container.h
@@ -60,10 +60,6 @@ struct _EphyEmbedContainerIface
   EphyEmbed * (* get_active_child) (EphyEmbedContainer *container);
 
   GList * (* get_children)         (EphyEmbedContainer *container);
-
-  gboolean (* get_is_popup)        (EphyEmbedContainer *container);
-
-  EphyWebViewChrome (* get_chrome) (EphyEmbedContainer *container);
 };
 
 GType             ephy_embed_container_get_type         (void);
@@ -77,8 +73,6 @@ void              ephy_embed_container_remove_child     (EphyEmbedContainer *con
                                                          EphyEmbed          *child);
 EphyEmbed *       ephy_embed_container_get_active_child (EphyEmbedContainer *container);
 GList *           ephy_embed_container_get_children     (EphyEmbedContainer *container);
-gboolean          ephy_embed_container_get_is_popup     (EphyEmbedContainer *container);
-EphyWebViewChrome ephy_embed_container_get_chrome       (EphyEmbedContainer *container);
 
 G_END_DECLS
 
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 93ce7a2..69f665a 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1351,19 +1351,18 @@ ephy_session_remove_window (EphySession *session,
 EphyWindow *
 ephy_session_get_active_window (EphySession *session)
 {
-	EphyWindow *window = NULL;
-	EphyEmbedContainer *w;
+	EphyWindow *w, *window = NULL;
 	GList *l;
 
 	g_return_val_if_fail (EPHY_IS_SESSION (session), NULL);
 
 	for (l = session->priv->windows; l != NULL; l = l->next)
 	{
-		w = EPHY_EMBED_CONTAINER (l->data);
+		w = EPHY_WINDOW (l->data);
 
-		if (ephy_embed_container_get_is_popup (w) == FALSE)
+		if (ephy_window_get_is_popup (w) == FALSE)
 		{
-			window = EPHY_WINDOW (w);
+			window = w;
 			break;
 		}
 	}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index e6be252..741153c 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -372,7 +372,7 @@ enum
 	PROP_0,
 	PROP_ACTIVE_CHILD,
 	PROP_CHROME,
-	PROP_SINGLE_TAB_MODE,
+	PROP_IS_POPUP,
 	PROP_OVERVIEW_MODE
 };
 
@@ -513,18 +513,6 @@ impl_get_children (EphyEmbedContainer *container)
 	return gtk_container_get_children (GTK_CONTAINER (window->priv->notebook));
 }
 
-static gboolean
-impl_get_is_popup (EphyEmbedContainer *container)
-{
-	return EPHY_WINDOW (container)->priv->is_popup;
-}
-
-static EphyWebViewChrome
-impl_get_chrome (EphyEmbedContainer *container)
-{
-	return EPHY_WINDOW (container)->priv->chrome;
-}
-
 static void
 ephy_window_embed_container_iface_init (EphyEmbedContainerIface *iface)
 {
@@ -533,10 +521,41 @@ ephy_window_embed_container_iface_init (EphyEmbedContainerIface *iface)
 	iface->remove_child = impl_remove_child;
 	iface->get_active_child = impl_get_active_child;
 	iface->get_children = impl_get_children;
-	iface->get_is_popup = impl_get_is_popup;
-	iface->get_chrome = impl_get_chrome;
 }
 
+/**
+ * ephy_window_get_is_popup:
+ * @window: a #EphyWindow
+ *
+ * Returns whether this window is a popup.
+ *
+ * Return value: %TRUE if it is a popup
+ **/
+gboolean
+ephy_window_get_is_popup (EphyWindow *window)
+ {
+	g_return_val_if_fail (EPHY_IS_WINDOW (window), FALSE);
+
+	return window->priv->is_popup;
+ }
+
+/**
+ * ephy_window_get_chrome:
+ * @window: a #EphyWindow
+ *
+ * Returns the #EphyWebViewChrome flags indicating the visibility of several parts
+ * of @window.
+ *
+ * Return value: #EphyWebViewChrome flags.
+ **/
+EphyWebViewChrome
+ephy_window_get_chrome (EphyWindow *window)
+ {
+	g_return_val_if_fail (EPHY_IS_WINDOW (window), 0);
+
+	return window->priv->chrome;
+ }
+
 static EphyEmbed *
 ephy_window_open_link (EphyLink *link,
 		       const char *address,
@@ -3300,7 +3319,7 @@ ephy_window_set_property (GObject *object,
 		case PROP_CHROME:
 			ephy_window_set_chrome (window, g_value_get_flags (value));
 			break;
-		case PROP_SINGLE_TAB_MODE:
+		case PROP_IS_POPUP:
 			ephy_window_set_is_popup (window, g_value_get_boolean (value));
 			break;
 		case PROP_OVERVIEW_MODE:
@@ -3328,7 +3347,7 @@ ephy_window_get_property (GObject *object,
 		case PROP_CHROME:
 			g_value_set_flags (value, window->priv->chrome);
 			break;
-		case PROP_SINGLE_TAB_MODE:
+		case PROP_IS_POPUP:
 			g_value_set_boolean (value, window->priv->is_popup);
 			break;
 		case PROP_OVERVIEW_MODE:
@@ -3799,13 +3818,19 @@ ephy_window_class_init (EphyWindowClass *klass)
 					  PROP_ACTIVE_CHILD,
 					  "active-child");
 
-	g_object_class_override_property (object_class,
-					  PROP_SINGLE_TAB_MODE,
-					  "is-popup");
-
-	g_object_class_override_property (object_class,
-					  PROP_CHROME,
-					  "chrome");
+	g_object_class_install_property (object_class,
+					 PROP_CHROME,
+					 g_param_spec_flags ("chrome", NULL, NULL,
+							     EPHY_TYPE_WEB_VIEW_CHROME,
+							     EPHY_WEB_VIEW_CHROME_ALL,
+							     G_PARAM_CONSTRUCT_ONLY |
+							     G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+	g_object_class_install_property (object_class,
+					 PROP_IS_POPUP,
+					 g_param_spec_boolean ("is-popup", NULL, NULL,
+							       FALSE,
+							       G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
+							       G_PARAM_CONSTRUCT_ONLY));
 
 	g_object_class_install_property (object_class,
 					 PROP_OVERVIEW_MODE,
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 881274f..1b7f994 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -78,6 +78,10 @@ void              ephy_window_set_overview_mode   (EphyWindow *window, gboolean
 void		  ephy_window_activate_location	  (EphyWindow *window);
 const char       *ephy_window_get_location        (EphyWindow *window);
 
+gboolean          ephy_window_get_is_popup        (EphyWindow *window);
+
+EphyWebViewChrome ephy_window_get_chrome          (EphyWindow *window);
+
 G_END_DECLS
 
 #endif



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