[epiphany/overview: 4/30] Add the base EphyOverviewStore model



commit 3a1826a0c32373673e75ab13a3873d84bc667904
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Jan 25 18:23:00 2012 +0200

    Add the base EphyOverviewStore model
    
    This should be subclassed by the models for the history and/or
    currently open views.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=455173

 lib/widgets/Makefile.am           |    2 +
 lib/widgets/ephy-overview-store.c |   46 +++++++++++++++++++++++++
 lib/widgets/ephy-overview-store.h |   66 +++++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+), 0 deletions(-)
---
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index fa51804..551f3e9 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -15,6 +15,8 @@ libephywidgets_la_SOURCES = \
 	ephy-middle-clickable-button.h		\
 	ephy-node-view.c			\
 	ephy-node-view.h			\
+	ephy-overview-store.c			\
+	ephy-overview-store.h			\
 	ephy-search-entry.c			\
 	ephy-search-entry.h			\
 	ephy-tree-model-node.c			\
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
new file mode 100644
index 0000000..cf55905
--- /dev/null
+++ b/lib/widgets/ephy-overview-store.c
@@ -0,0 +1,46 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ *  Copyright  2012 Igalia S.L.
+ *
+ *  This program 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, or (at your option)
+ *  any later version.
+ *
+ *  This program 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.
+ *
+ */
+
+#include "config.h"
+#include "ephy-overview-store.h"
+
+G_DEFINE_TYPE (EphyOverviewStore, ephy_overview_store, GTK_TYPE_LIST_STORE)
+
+static void
+ephy_overview_store_class_init (EphyOverviewStoreClass *klass)
+{
+}
+
+static void
+ephy_overview_store_init (EphyOverviewStore *self)
+{
+  GType types[EPHY_OVERVIEW_STORE_NCOLS];
+
+  types[EPHY_OVERVIEW_STORE_ID] = G_TYPE_STRING;
+  types[EPHY_OVERVIEW_STORE_URI] = G_TYPE_STRING;
+  types[EPHY_OVERVIEW_STORE_TITLE] = G_TYPE_STRING;
+  types[EPHY_OVERVIEW_STORE_AUTHOR] = G_TYPE_STRING;
+  types[EPHY_OVERVIEW_STORE_SNAPSHOT] = GDK_TYPE_PIXBUF;
+  types[EPHY_OVERVIEW_STORE_LAST_VISIT] = G_TYPE_LONG;
+  types[EPHY_OVERVIEW_STORE_SELECTED] = G_TYPE_BOOLEAN;
+
+  gtk_list_store_set_column_types (GTK_LIST_STORE (self),
+                                   EPHY_OVERVIEW_STORE_NCOLS, types);
+}
diff --git a/lib/widgets/ephy-overview-store.h b/lib/widgets/ephy-overview-store.h
new file mode 100644
index 0000000..34d22ce
--- /dev/null
+++ b/lib/widgets/ephy-overview-store.h
@@ -0,0 +1,66 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ *  Copyright  2012 Igalia S.L.
+ *
+ *  This program 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, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 _EPHY_OVERVIEW_STORE_H
+#define _EPHY_OVERVIEW_STORE_H
+
+#include <gtk/gtk.h>
+
+#include "gd-main-view.h"
+
+G_BEGIN_DECLS
+
+#define EPHY_TYPE_OVERVIEW_STORE            (ephy_overview_store_get_type())
+#define EPHY_OVERVIEW_STORE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_OVERVIEW_STORE, EphyOverviewStore))
+#define EPHY_OVERVIEW_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_OVERVIEW_STORE, EphyOverviewStoreClass))
+#define EPHY_IS_OVERVIEW_STORE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_OVERVIEW_STORE))
+#define EPHY_IS_OVERVIEW_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EPHY_TYPE_OVERVIEW_STORE))
+#define EPHY_OVERVIEW_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EPHY_TYPE_OVERVIEW_STORE, EphyOverviewStoreClass))
+
+typedef struct _EphyOverviewStore        EphyOverviewStore;
+typedef struct _EphyOverviewStoreClass   EphyOverviewStoreClass;
+typedef struct _EphyOverviewStorePrivate EphyOverviewStorePrivate;
+
+struct _EphyOverviewStore
+{
+  GtkListStore parent;
+};
+
+struct _EphyOverviewStoreClass
+{
+  GtkListStoreClass parent_class;
+};
+
+enum {
+  EPHY_OVERVIEW_STORE_ID = GD_MAIN_COLUMN_ID,
+  EPHY_OVERVIEW_STORE_URI = GD_MAIN_COLUMN_URI,
+  EPHY_OVERVIEW_STORE_TITLE = GD_MAIN_COLUMN_TITLE,
+  EPHY_OVERVIEW_STORE_AUTHOR = GD_MAIN_COLUMN_AUTHOR,
+  EPHY_OVERVIEW_STORE_SNAPSHOT = GD_MAIN_COLUMN_ICON,
+  EPHY_OVERVIEW_STORE_LAST_VISIT = GD_MAIN_COLUMN_MTIME,
+  EPHY_OVERVIEW_STORE_SELECTED = GD_MAIN_COLUMN_SELECTED,
+  EPHY_OVERVIEW_STORE_NCOLS
+};
+
+GType ephy_overview_store_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* _EPHY_OVERVIEW_STORE_H */



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