[libgd] Add MainViewGeneric.get_model()
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] Add MainViewGeneric.get_model()
- Date: Mon, 29 Oct 2012 20:16:40 +0000 (UTC)
commit 4178979a7b22037e1e53a14e242649808ed3c506
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Oct 29 21:03:38 2012 +0200
Add MainViewGeneric.get_model()
https://bugzilla.gnome.org/show_bug.cgi?id=686832
libgd/gd-main-icon-view.c | 7 +++++++
libgd/gd-main-list-view.c | 7 +++++++
libgd/gd-main-view-generic.c | 15 +++++++++++++++
libgd/gd-main-view-generic.h | 2 ++
4 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/libgd/gd-main-icon-view.c b/libgd/gd-main-icon-view.c
index b68f123..43a0007 100644
--- a/libgd/gd-main-icon-view.c
+++ b/libgd/gd-main-icon-view.c
@@ -188,10 +188,17 @@ gd_main_icon_view_set_model (GdMainViewGeneric *mv,
gtk_icon_view_set_model (GTK_ICON_VIEW (mv), model);
}
+static GtkTreeModel *
+gd_main_icon_view_get_model (GdMainViewGeneric *mv)
+{
+ return gtk_icon_view_get_model (GTK_ICON_VIEW (mv));
+}
+
static void
gd_main_view_generic_iface_init (GdMainViewGenericIface *iface)
{
iface->set_model = gd_main_icon_view_set_model;
+ iface->get_model = gd_main_icon_view_get_model;
iface->get_path_at_pos = gd_main_icon_view_get_path_at_pos;
iface->scroll_to_path = gd_main_icon_view_scroll_to_path;
iface->set_selection_mode = gd_main_icon_view_set_selection_mode;
diff --git a/libgd/gd-main-list-view.c b/libgd/gd-main-list-view.c
index 12eec1b..7a136b5 100644
--- a/libgd/gd-main-list-view.c
+++ b/libgd/gd-main-list-view.c
@@ -195,10 +195,17 @@ gd_main_list_view_set_model (GdMainViewGeneric *mv,
gtk_tree_view_set_model (GTK_TREE_VIEW (mv), model);
}
+static GtkTreeModel *
+gd_main_list_view_get_model (GdMainViewGeneric *mv)
+{
+ return gtk_tree_view_get_model (GTK_TREE_VIEW (mv));
+}
+
static void
gd_main_view_generic_iface_init (GdMainViewGenericIface *iface)
{
iface->set_model = gd_main_list_view_set_model;
+ iface->get_model = gd_main_list_view_get_model;
iface->get_path_at_pos = gd_main_list_view_get_path_at_pos;
iface->scroll_to_path = gd_main_list_view_scroll_to_path;
iface->set_selection_mode = gd_main_list_view_set_selection_mode;
diff --git a/libgd/gd-main-view-generic.c b/libgd/gd-main-view-generic.c
index 44d1e0a..da7c888 100644
--- a/libgd/gd-main-view-generic.c
+++ b/libgd/gd-main-view-generic.c
@@ -81,6 +81,21 @@ gd_main_view_generic_scroll_to_path (GdMainViewGeneric *self,
(* iface->scroll_to_path) (self, path);
}
+/**
+ * gd_main_view_generic_get_model:
+ *
+ * Returns: (transfer none): The associated model
+ */
+GtkTreeModel *
+gd_main_view_generic_get_model (GdMainViewGeneric *self)
+{
+ GdMainViewGenericInterface *iface;
+
+ iface = GD_MAIN_VIEW_GENERIC_GET_IFACE (self);
+
+ (* iface->get_model) (self);
+}
+
static gboolean
build_selection_uris_foreach (GtkTreeModel *model,
GtkTreePath *path,
diff --git a/libgd/gd-main-view-generic.h b/libgd/gd-main-view-generic.h
index 3f86bcc..4e086c0 100644
--- a/libgd/gd-main-view-generic.h
+++ b/libgd/gd-main-view-generic.h
@@ -72,6 +72,7 @@ struct _GdMainViewGenericIface
/* vtable */
void (* set_model) (GdMainViewGeneric *self,
GtkTreeModel *model);
+ GtkTreeModel * (* get_model) (GdMainViewGeneric *self);
GtkTreePath * (* get_path_at_pos) (GdMainViewGeneric *self,
gint x,
@@ -86,6 +87,7 @@ GType gd_main_view_generic_get_type (void) G_GNUC_CONST;
void gd_main_view_generic_set_model (GdMainViewGeneric *self,
GtkTreeModel *model);
+GtkTreeModel * gd_main_view_generic_get_model (GdMainViewGeneric *self);
void gd_main_view_generic_scroll_to_path (GdMainViewGeneric *self,
GtkTreePath *path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]