[evince/wip/recent-view] shell: Rename ev-minimal-toolbar to ev-recent-view



commit e2bf5a423955fa0aae7ced4a9ef633738ed01b1e
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Sun May 4 01:06:15 2014 -0700

    shell: Rename ev-minimal-toolbar to ev-recent-view
    
    Refactor and Rename files

 shell/Makefile.am                                  |    4 +-
 shell/ev-minimal-toolbar.h                         |   56 ---------------
 ...-minimal-toolbar.c => ev-recent-view-toolbar.c} |   72 ++++++++++----------
 shell/ev-recent-view-toolbar.h                     |   56 +++++++++++++++
 4 files changed, 94 insertions(+), 94 deletions(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index e314f71..a88e59a 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -35,8 +35,6 @@ evince_SOURCES=                               \
        ev-message-area.h               \
        ev-metadata.c                   \
        ev-metadata.h                   \
-       ev-minimal-toolbar.c            \
-       ev-minimal-toolbar.h            \
        ev-password-view.h              \
        ev-password-view.c              \
        ev-progress-message-area.h      \
@@ -49,6 +47,8 @@ evince_SOURCES=                               \
        ev-properties-license.h         \
        ev-recent-view.c                \
        ev-recent-view.h                \
+       ev-recent-view-toolbar.c        \
+       ev-recent-view-toolbar.h        \
        ev-toolbar.c                    \
        ev-toolbar.h                    \
        ev-utils.c                      \
diff --git a/shell/ev-minimal-toolbar.c b/shell/ev-recent-view-toolbar.c
similarity index 65%
rename from shell/ev-minimal-toolbar.c
rename to shell/ev-recent-view-toolbar.c
index f6f1392..b72b153 100644
--- a/shell/ev-minimal-toolbar.c
+++ b/shell/ev-recent-view-toolbar.c
@@ -1,4 +1,4 @@
-/* ev-minimal-toolbar.c
+/* ev-recent-view.c
  *  this file is part of evince, a gnome document viewer
  *
  * Copyright (C) 2012 Carlos Garcia Campos <carlosgc gnome org>
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include "ev-minimal-toolbar.h"
+#include "ev-recent-view-toolbar.h"
 #include <math.h>
 
 enum
@@ -32,23 +32,23 @@ enum
        PROP_WINDOW
 };
 
-struct _EvMinimalToolbarPrivate {
+struct _EvRecentViewToolbarPrivate {
        EvWindow  *window;
 };
 
-G_DEFINE_TYPE (EvMinimalToolbar, ev_minimal_toolbar, GTK_TYPE_TOOLBAR)
+G_DEFINE_TYPE (EvRecentViewToolbar, ev_recent_view_toolbar, GTK_TYPE_TOOLBAR)
 
 static void
-ev_minimal_toolbar_set_property (GObject      *object,
+ev_recent_view_toolbar_set_property (GObject      *object,
                                  guint         prop_id,
                                  const GValue *value,
                                  GParamSpec   *pspec)
 {
-       EvMinimalToolbar *ev_minimal_toolbar = EV_MINIMAL_TOOLBAR (object);
+       EvRecentViewToolbar *ev_recent_view_toolbar = EV_RECENT_VIEW_TOOLBAR (object);
 
        switch (prop_id) {
        case PROP_WINDOW:
-               ev_minimal_toolbar->priv->window = g_value_get_object (value);
+               ev_recent_view_toolbar->priv->window = g_value_get_object (value);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -56,7 +56,7 @@ ev_minimal_toolbar_set_property (GObject      *object,
 }
 
 static void
-ev_minimal_toolbar_set_button_image (EvMinimalToolbar *ev_minimal_toolbar,
+ev_recent_view_toolbar_set_button_image (EvRecentViewToolbar *ev_recent_view_toolbar,
                                      GtkButton *button)
 {
        GtkWidget *image;
@@ -66,7 +66,7 @@ ev_minimal_toolbar_set_button_image (EvMinimalToolbar *ev_minimal_toolbar,
 }
 
 static void
-ev_minimal_toolbar_set_button_action (EvMinimalToolbar *ev_toolbar,
+ev_recent_view_toolbar_set_button_action (EvRecentViewToolbar *ev_toolbar,
                                       GtkButton *button,
                                       GtkAction *action)
 {
@@ -76,26 +76,26 @@ ev_minimal_toolbar_set_button_action (EvMinimalToolbar *ev_toolbar,
 }
 
 static GtkWidget *
-ev_minimal_toolbar_create_button (EvMinimalToolbar *ev_toolbar,
+ev_recent_view_toolbar_create_button (EvRecentViewToolbar *ev_toolbar,
                                   GtkAction *action)
 {
        GtkWidget *button = gtk_button_new ();
 
-       ev_minimal_toolbar_set_button_image (ev_toolbar, GTK_BUTTON (button));
-       ev_minimal_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
+       ev_recent_view_toolbar_set_button_image (ev_toolbar, GTK_BUTTON (button));
+       ev_recent_view_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
 
        return button;
 }
 
 static GtkWidget *
-ev_minimal_toolbar_create_toggle_button (EvMinimalToolbar *ev_toolbar,
+ev_recent_view_toolbar_create_toggle_button (EvRecentViewToolbar *ev_toolbar,
                                          GtkAction *action)
 {
         GtkWidget *button = gtk_toggle_button_new ();
 
         gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
         gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
-        ev_minimal_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
+        ev_recent_view_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
 
         return button;
 }
@@ -108,80 +108,80 @@ keep_active_button_cb (GtkToggleButton *button,
 }
 
 static void
-ev_minimal_toolbar_constructed (GObject *object)
+ev_recent_view_toolbar_constructed (GObject *object)
 {
-       EvMinimalToolbar *ev_minimal_toolbar = EV_MINIMAL_TOOLBAR (object);
+       EvRecentViewToolbar *ev_recent_view_toolbar = EV_RECENT_VIEW_TOOLBAR (object);
        GtkActionGroup   *action_group;
        GtkWidget        *tool_item;
        GtkAction        *action;
        GtkWidget        *button;
 
-       G_OBJECT_CLASS (ev_minimal_toolbar_parent_class)->constructed (object);
+       G_OBJECT_CLASS (ev_recent_view_toolbar_parent_class)->constructed (object);
 
        /* Set the MENUBAR style class so it's possible to drag the app
         * using the toolbar. */
-       gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (ev_minimal_toolbar)),
+       gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (ev_recent_view_toolbar)),
                                     GTK_STYLE_CLASS_MENUBAR);
 
-       action_group = ev_window_get_minimal_toolbar_action_group (ev_minimal_toolbar->priv->window);
+       action_group = ev_window_get_recent_view_toolbar_action_group (ev_recent_view_toolbar->priv->window);
 
        /* View of recent items */
        action = gtk_action_group_get_action (action_group, "RecentViewHide");
-       button = ev_minimal_toolbar_create_toggle_button (ev_minimal_toolbar, action);
+       button = ev_recent_view_toolbar_create_toggle_button (ev_recent_view_toolbar, action);
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
        tool_item = GTK_WIDGET (gtk_tool_item_new ());
        gtk_container_add (GTK_CONTAINER (tool_item), button);
        gtk_widget_show (button);
        gtk_widget_set_margin_right (tool_item, 6);
-       gtk_container_add (GTK_CONTAINER (ev_minimal_toolbar), tool_item);
+       gtk_container_add (GTK_CONTAINER (ev_recent_view_toolbar), tool_item);
        g_signal_connect (button, "toggled",
                          G_CALLBACK (keep_active_button_cb), NULL);
        gtk_widget_show (tool_item);
 
        /* Button for file open dialog */
        action = gtk_action_group_get_action (action_group, "ToolbarOpenDocument");
-       button = ev_minimal_toolbar_create_button (ev_minimal_toolbar, action);
+       button = ev_recent_view_toolbar_create_button (ev_recent_view_toolbar, action);
        tool_item = GTK_WIDGET (gtk_tool_item_new ());
        gtk_container_add (GTK_CONTAINER (tool_item), button);
        gtk_widget_show (button);
-       gtk_container_add (GTK_CONTAINER (ev_minimal_toolbar), tool_item);
+       gtk_container_add (GTK_CONTAINER (ev_recent_view_toolbar), tool_item);
        gtk_widget_show (tool_item);
 
        /* Separator */
        tool_item = GTK_WIDGET (gtk_tool_item_new ());
        gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE);
-       gtk_container_add (GTK_CONTAINER (ev_minimal_toolbar), tool_item);
+       gtk_container_add (GTK_CONTAINER (ev_recent_view_toolbar), tool_item);
        gtk_widget_show (tool_item);
 
        /* About Button */
        action = gtk_action_group_get_action (action_group, "ToolbarAbout");
-       button = ev_minimal_toolbar_create_button (ev_minimal_toolbar, action);
+       button = ev_recent_view_toolbar_create_button (ev_recent_view_toolbar, action);
        gtk_widget_set_halign (button, GTK_ALIGN_END);
        tool_item = GTK_WIDGET (gtk_tool_item_new ());
        gtk_widget_set_margin_right (tool_item, 6);
        gtk_container_add (GTK_CONTAINER (tool_item), button);
        gtk_widget_show (button);
-       gtk_container_add (GTK_CONTAINER (ev_minimal_toolbar), tool_item);
+       gtk_container_add (GTK_CONTAINER (ev_recent_view_toolbar), tool_item);
        gtk_widget_show (tool_item);
 
        /* Close Button */
        action = gtk_action_group_get_action (action_group, "ToolbarCloseWindow");
-       button = ev_minimal_toolbar_create_button (ev_minimal_toolbar, action);
+       button = ev_recent_view_toolbar_create_button (ev_recent_view_toolbar, action);
        gtk_widget_set_halign (button, GTK_ALIGN_END);
        tool_item = GTK_WIDGET (gtk_tool_item_new ());
        gtk_container_add (GTK_CONTAINER (tool_item), button);
        gtk_widget_show (button);
-       gtk_container_add (GTK_CONTAINER (ev_minimal_toolbar), tool_item);
+       gtk_container_add (GTK_CONTAINER (ev_recent_view_toolbar), tool_item);
        gtk_widget_show (tool_item);
 }
 
 static void
-ev_minimal_toolbar_class_init (EvMinimalToolbarClass *klass)
+ev_recent_view_toolbar_class_init (EvRecentViewToolbarClass *klass)
 {
        GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
 
-       g_object_class->set_property = ev_minimal_toolbar_set_property;
-       g_object_class->constructed = ev_minimal_toolbar_constructed;
+       g_object_class->set_property = ev_recent_view_toolbar_set_property;
+       g_object_class->constructed = ev_recent_view_toolbar_constructed;
 
        g_object_class_install_property (g_object_class,
                                         PROP_WINDOW,
@@ -193,21 +193,21 @@ ev_minimal_toolbar_class_init (EvMinimalToolbarClass *klass)
                                         G_PARAM_CONSTRUCT_ONLY |
                                         G_PARAM_STATIC_STRINGS));
 
-       g_type_class_add_private (g_object_class, sizeof (EvMinimalToolbarPrivate));
+       g_type_class_add_private (g_object_class, sizeof (EvRecentViewToolbarPrivate));
 }
 
 static void
-ev_minimal_toolbar_init (EvMinimalToolbar *ev_minimal_toolbar)
+ev_recent_view_toolbar_init (EvRecentViewToolbar *ev_recent_view_toolbar)
 {
-       ev_minimal_toolbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (ev_minimal_toolbar, EV_TYPE_MINIMAL_TOOLBAR, 
EvMinimalToolbarPrivate);
+       ev_recent_view_toolbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (ev_recent_view_toolbar, 
EV_TYPE_RECENT_VIEW_TOOLBAR, EvRecentViewToolbarPrivate);
 }
 
 GtkWidget *
-ev_minimal_toolbar_new (EvWindow *window)
+ev_recent_view_toolbar_new (EvWindow *window)
 {
        g_return_val_if_fail (EV_IS_WINDOW (window), NULL);
 
-       return GTK_WIDGET (g_object_new (EV_TYPE_MINIMAL_TOOLBAR,
+       return GTK_WIDGET (g_object_new (EV_TYPE_RECENT_VIEW_TOOLBAR,
                                         "window", window,
                                         NULL));
 }
diff --git a/shell/ev-recent-view-toolbar.h b/shell/ev-recent-view-toolbar.h
new file mode 100644
index 0000000..6074973
--- /dev/null
+++ b/shell/ev-recent-view-toolbar.h
@@ -0,0 +1,56 @@
+/* ev-recent-view-toolbar.h
+ *  this file is part of evince, a gnome document viewer
+ *
+ * Copyright (C) 2012 Carlos Garcia Campos <carlosgc gnome org>
+ * Copyright (C) 2013 Aakash Goenka <aakash goenka gmail com>
+ *
+ * Evince is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EV_RECENT_VIEW_TOOLBAR_H__
+#define __EV_RECENT_VIEW_TOOLBAR_H__
+
+#include <gtk/gtk.h>
+#include "ev-window.h"
+
+G_BEGIN_DECLS
+
+#define EV_TYPE_RECENT_VIEW_TOOLBAR              (ev_recent_view_toolbar_get_type())
+#define EV_RECENT_VIEW_TOOLBAR(object)           (G_TYPE_CHECK_INSTANCE_CAST((object), 
EV_TYPE_RECENT_VIEW_TOOLBAR, EvRecentViewToolbar))
+#define EV_IS_RECENT_VIEW_TOOLBAR(object)        (G_TYPE_CHECK_INSTANCE_TYPE((object), 
EV_TYPE_RECENT_VIEW_TOOLBAR))
+#define EV_RECENT_VIEW_TOOLBAR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), 
EV_TYPE_RECENT_VIEW_TOOLBAR, EvRecentViewToolbarClass))
+#define EV_IS_RECENT_VIEW_TOOLBAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), 
EV_TYPE_RECENT_VIEW_TOOLBAR))
+#define EV_RECENT_VIEW_TOOLBAR_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), 
EV_TYPE_RECENT_VIEW_TOOLBAR, EvRecentViewToolbarClass))
+
+typedef struct _EvRecentViewToolbar        EvRecentViewToolbar;
+typedef struct _EvRecentViewToolbarClass   EvRecentViewToolbarClass;
+typedef struct _EvRecentViewToolbarPrivate EvRecentViewToolbarPrivate;
+
+struct _EvRecentViewToolbar {
+       GtkToolbar base_instance;
+
+       EvRecentViewToolbarPrivate *priv;
+};
+
+struct _EvRecentViewToolbarClass {
+       GtkToolbarClass base_class;
+};
+
+GType      ev_recent_view_toolbar_get_type           (void);
+GtkWidget *ev_recent_view_toolbar_new                (EvWindow *window);
+
+G_END_DECLS
+
+#endif /* __EV_RECENT_VIEW_TOOLBAR_H__ */


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