[epiphany/wip/ephy-sync] ephy-notification-manager: Rename to ephy-notification-container



commit 6dfe8d3512a2ae30ca6992950ec90a4037d4118a
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Tue Aug 30 15:39:29 2016 +0300

    ephy-notification-manager: Rename to ephy-notification-container

 embed/Makefile.am                                  |    4 +-
 embed/ephy-embed.c                                 |   18 +++++-----
 embed/ephy-embed.h                                 |   34 +++++++++---------
 ...ion-manager.c => ephy-notification-container.c} |   37 ++++++++++---------
 ...ion-manager.h => ephy-notification-container.h} |   26 +++++++-------
 lib/widgets/ephy-password-notification.c           |    6 ++--
 src/ephy-window.c                                  |    4 +-
 7 files changed, 65 insertions(+), 64 deletions(-)
---
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 2e0feeb..50c9335 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -43,8 +43,8 @@ libephyembed_la_SOURCES = \
        ephy-file-monitor.h             \
        ephy-find-toolbar.c             \
        ephy-find-toolbar.h             \
-       ephy-notification-manager.c     \
-       ephy-notification-manager.h     \
+       ephy-notification-container.c   \
+       ephy-notification-container.h   \
        ephy-embed-prefs.c              \
        ephy-web-view.c                 \
        ephy-web-view.h                 \
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index ed2dbbc..6e649f2 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -29,7 +29,7 @@
 #include "ephy-embed-shell.h"
 #include "ephy-embed-utils.h"
 #include "ephy-find-toolbar.h"
-#include "ephy-notification-manager.h"
+#include "ephy-notification-container.h"
 #include "ephy-prefs.h"
 #include "ephy-settings.h"
 #include "ephy-string.h"
@@ -960,27 +960,27 @@ ephy_embed_inspector_is_loaded (EphyEmbed *embed)
 }
 
 void
-ephy_embed_attach_notification_manager (EphyEmbed *embed)
+ephy_embed_attach_notification_container (EphyEmbed *embed)
 {
-  EphyNotificationManager *manager;
+  EphyNotificationContainer *container;
 
   g_return_if_fail (EPHY_IS_EMBED (embed));
 
-  manager = ephy_notification_manager_get_default ();
-  gtk_overlay_add_overlay (GTK_OVERLAY (embed->overlay), GTK_WIDGET (manager));
+  container = ephy_notification_container_get_default ();
+  gtk_overlay_add_overlay (GTK_OVERLAY (embed->overlay), GTK_WIDGET (container));
 }
 
 void
-ephy_embed_detach_notification_manager (EphyEmbed *embed)
+ephy_embed_detach_notification_container (EphyEmbed *embed)
 {
-  EphyNotificationManager *manager;
+  EphyNotificationContainer *container;
 
   g_return_if_fail (EPHY_IS_EMBED (embed));
 
-  manager = ephy_notification_manager_get_default ();
+  container = ephy_notification_container_get_default ();
   /* Since the overlay container will own the one and only reference to the
    * notification widget, removing it from the container will destroy the
    * singleton. To prevent this, add a reference to it before removing it
    * from the container. */
-  gtk_container_remove (GTK_CONTAINER (embed->overlay), g_object_ref (manager));
+  gtk_container_remove (GTK_CONTAINER (embed->overlay), g_object_ref (container));
 }
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index 4da54dd..dbef883 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -31,23 +31,23 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (EphyEmbed, ephy_embed, EPHY, EMBED, GtkBox)
 
-EphyWebView*     ephy_embed_get_web_view                (EphyEmbed  *embed);
-EphyFindToolbar* ephy_embed_get_find_toolbar            (EphyEmbed  *embed);
-void             ephy_embed_add_top_widget              (EphyEmbed  *embed,
-                                                         GtkWidget  *widget,
-                                                         gboolean    destroy_on_transition);
-void             ephy_embed_remove_top_widget           (EphyEmbed  *embed,
-                                                         GtkWidget  *widget);
-void             ephy_embed_entering_fullscreen         (EphyEmbed *embed);
-void             ephy_embed_leaving_fullscreen          (EphyEmbed *embed);
-void             ephy_embed_set_delayed_load_request    (EphyEmbed *embed,
-                                                         WebKitURIRequest          *request,
-                                                         WebKitWebViewSessionState *state);
-gboolean         ephy_embed_has_load_pending            (EphyEmbed *embed);
-gboolean         ephy_embed_inspector_is_loaded         (EphyEmbed *embed);
-const char      *ephy_embed_get_title                   (EphyEmbed *embed);
-void             ephy_embed_attach_notification_manager (EphyEmbed *embed);
-void             ephy_embed_detach_notification_manager (EphyEmbed *embed);
+EphyWebView*     ephy_embed_get_web_view                  (EphyEmbed  *embed);
+EphyFindToolbar* ephy_embed_get_find_toolbar              (EphyEmbed  *embed);
+void             ephy_embed_add_top_widget                (EphyEmbed  *embed,
+                                                           GtkWidget  *widget,
+                                                           gboolean    destroy_on_transition);
+void             ephy_embed_remove_top_widget             (EphyEmbed  *embed,
+                                                           GtkWidget  *widget);
+void             ephy_embed_entering_fullscreen           (EphyEmbed *embed);
+void             ephy_embed_leaving_fullscreen            (EphyEmbed *embed);
+void             ephy_embed_set_delayed_load_request      (EphyEmbed *embed,
+                                                           WebKitURIRequest          *request,
+                                                           WebKitWebViewSessionState *state);
+gboolean         ephy_embed_has_load_pending              (EphyEmbed *embed);
+gboolean         ephy_embed_inspector_is_loaded           (EphyEmbed *embed);
+const char      *ephy_embed_get_title                     (EphyEmbed *embed);
+void             ephy_embed_attach_notification_container (EphyEmbed *embed);
+void             ephy_embed_detach_notification_container (EphyEmbed *embed);
 
 G_END_DECLS
 
diff --git a/embed/ephy-notification-manager.c b/embed/ephy-notification-container.c
similarity index 60%
rename from embed/ephy-notification-manager.c
rename to embed/ephy-notification-container.c
index f0b7151..44e2c89 100644
--- a/embed/ephy-notification-manager.c
+++ b/embed/ephy-notification-container.c
@@ -17,29 +17,30 @@
  */
 
 #include "config.h"
-#include "ephy-notification-manager.h"
+#include "ephy-notification-container.h"
 
-struct _EphyNotificationManager {
+struct _EphyNotificationContainer {
   GdNotification  parent_instance;
 
   GtkWidget      *grid;
 };
 
-struct _EphyNotificationManagerClass {
+struct _EphyNotificationContainerClass {
   GdNotificationClass parent_class;
 };
 
-G_DEFINE_TYPE (EphyNotificationManager, ephy_notification_manager, GD_TYPE_NOTIFICATION);
+G_DEFINE_TYPE (EphyNotificationContainer, ephy_notification_container, GD_TYPE_NOTIFICATION);
 
-static EphyNotificationManager *notification_manager = NULL;
+static EphyNotificationContainer *notification_container = NULL;
 
 static void
-ephy_notification_manager_init (EphyNotificationManager *self)
+ephy_notification_container_init (EphyNotificationContainer *self)
 {
   /* Globally accessible singleton */
-  g_assert (notification_manager == NULL);
-  notification_manager = self;
-  g_object_add_weak_pointer (G_OBJECT (notification_manager), (gpointer *)&notification_manager);
+  g_assert (notification_container == NULL);
+  notification_container = self;
+  g_object_add_weak_pointer (G_OBJECT (notification_container),
+                             (gpointer *)&notification_container);
 
   gtk_widget_set_halign (GTK_WIDGET (self), GTK_ALIGN_CENTER);
   gtk_widget_set_valign (GTK_WIDGET (self), GTK_ALIGN_START);
@@ -51,27 +52,27 @@ ephy_notification_manager_init (EphyNotificationManager *self)
 }
 
 static void
-ephy_notification_manager_class_init (EphyNotificationManagerClass *klass)
+ephy_notification_container_class_init (EphyNotificationContainerClass *klass)
 {
 }
 
-EphyNotificationManager *
-ephy_notification_manager_get_default (void)
+EphyNotificationContainer *
+ephy_notification_container_get_default (void)
 {
-  if (notification_manager != NULL)
-    return notification_manager;
+  if (notification_container != NULL)
+    return notification_container;
 
-  return g_object_new (EPHY_TYPE_NOTIFICATION_MANAGER,
+  return g_object_new (EPHY_TYPE_NOTIFICATION_CONTAINER,
                        "show-close-button", TRUE,
                        "timeout", -1,
                        NULL);
 }
 
 void
-ephy_notification_manager_add_notification (EphyNotificationManager *self,
-                                            GtkWidget               *notification)
+ephy_notification_container_add_notification (EphyNotificationContainer *self,
+                                              GtkWidget                 *notification)
 {
-  g_return_if_fail (EPHY_IS_NOTIFICATION_MANAGER (self));
+  g_return_if_fail (EPHY_IS_NOTIFICATION_CONTAINER (self));
   g_return_if_fail (GTK_IS_WIDGET (notification));
 
   gtk_container_add (GTK_CONTAINER (self->grid), notification);
diff --git a/embed/ephy-notification-manager.h b/embed/ephy-notification-container.h
similarity index 59%
rename from embed/ephy-notification-manager.h
rename to embed/ephy-notification-container.h
index 7159f12..30628ed 100644
--- a/embed/ephy-notification-manager.h
+++ b/embed/ephy-notification-container.h
@@ -16,36 +16,36 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef EPHY_NOTIFICATION_MANAGER_H
-#define EPHY_NOTIFICATION_MANAGER_H
+#ifndef EPHY_NOTIFICATION_CONTAINER_H
+#define EPHY_NOTIFICATION_CONTAINER_H
 
 #include <libgd/gd.h>
 
 G_BEGIN_DECLS
 
-#define EPHY_TYPE_NOTIFICATION_MANAGER (ephy_notification_manager_get_type ())
+#define EPHY_TYPE_NOTIFICATION_CONTAINER (ephy_notification_container_get_type ())
 
 /* FIXME: Replace this boilerplate with G_DECLARE_FINAL_TYPE. This won't prove
  * trivial, since G_DECLARE_FINAL_TYPE requires that an autocleanup function
  * has been declared for the parent type, and libgd doesn't have one yet.
  */
-#define EPHY_NOTIFICATION_MANAGER(obj) \
+#define EPHY_NOTIFICATION_CONTAINER(obj) \
   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-   EPHY_TYPE_NOTIFICATION_MANAGER, EphyNotificationManager))
+   EPHY_TYPE_NOTIFICATION_CONTAINER, EphyNotificationContainer))
 
-#define EPHY_IS_NOTIFICATION_MANAGER(obj) \
+#define EPHY_IS_NOTIFICATION_CONTAINER(obj) \
   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
-   EPHY_TYPE_NOTIFICATION_MANAGER))
+   EPHY_TYPE_NOTIFICATION_CONTAINER))
 
-typedef struct _EphyNotificationManager      EphyNotificationManager;
-typedef struct _EphyNotificationManagerClass EphyNotificationManagerClass;
+typedef struct _EphyNotificationContainer      EphyNotificationContainer;
+typedef struct _EphyNotificationContainerClass EphyNotificationContainerClass;
 
-GType                    ephy_notification_manager_get_type         (void) G_GNUC_CONST;
+GType                      ephy_notification_container_get_type         (void) G_GNUC_CONST;
 
-EphyNotificationManager *ephy_notification_manager_get_default      (void);
+EphyNotificationContainer *ephy_notification_container_get_default      (void);
 
-void                     ephy_notification_manager_add_notification (EphyNotificationManager *self,
-                                                                     GtkWidget               *notification);
+void                       ephy_notification_container_add_notification (EphyNotificationContainer *self,
+                                                                         GtkWidget                 
*notification);
 
 G_END_DECLS
 
diff --git a/lib/widgets/ephy-password-notification.c b/lib/widgets/ephy-password-notification.c
index eee3be1..2b553b1 100644
--- a/lib/widgets/ephy-password-notification.c
+++ b/lib/widgets/ephy-password-notification.c
@@ -19,7 +19,7 @@
 #include "config.h"
 #include "ephy-password-notification.h"
 
-#include "ephy-notification-manager.h"
+#include "ephy-notification-container.h"
 
 #include <glib/gi18n.h>
 
@@ -160,6 +160,6 @@ ephy_password_notification_show (EphyPasswordNotification *self)
 {
   g_return_if_fail (EPHY_IS_PASSWORD_NOTIFICATION (self));
 
-  ephy_notification_manager_add_notification (ephy_notification_manager_get_default (),
-                                              GTK_WIDGET (self));
+  ephy_notification_container_add_notification (ephy_notification_container_get_default (),
+                                                GTK_WIDGET (self));
 }
diff --git a/src/ephy-window.c b/src/ephy-window.c
index dd68654..abe7c58 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2075,7 +2075,7 @@ ephy_window_connect_active_embed (EphyWindow *window)
   view = ephy_embed_get_web_view (embed);
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
 
-  ephy_embed_attach_notification_manager (window->active_embed);
+  ephy_embed_attach_notification_container (window->active_embed);
 
   sync_tab_security (view, NULL, window);
   sync_tab_document_type (view, NULL, window);
@@ -2157,7 +2157,7 @@ ephy_window_disconnect_active_embed (EphyWindow *window)
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
   view = EPHY_WEB_VIEW (web_view);
 
-  ephy_embed_detach_notification_manager (window->active_embed);
+  ephy_embed_detach_notification_container (window->active_embed);
 
   g_signal_handlers_disconnect_by_func (web_view,
                                         G_CALLBACK (sync_tab_zoom),


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