[nautilus/wip/csoriano/destktop-split2] canvas-view: allow creation of canvas view container subclasses
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/destktop-split2] canvas-view: allow creation of canvas view container subclasses
- Date: Mon, 4 Apr 2016 10:36:39 +0000 (UTC)
commit 978ab1f6294d4ca034fdb05b165b927cade2fa5f
Author: Carlos Soriano <csoriano gnome org>
Date: Mon Apr 4 11:14:11 2016 +0200
canvas-view: allow creation of canvas view container subclasses
This will be used by the desktop, so it can use its own
canvas-view-container.
src/nautilus-canvas-view.c | 18 ++++++++++++++++--
src/nautilus-canvas-view.h | 2 ++
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 5fda1fb..619828c 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1640,11 +1640,22 @@ store_layout_timestamp (NautilusCanvasContainer *container,
static NautilusCanvasContainer *
create_canvas_container (NautilusCanvasView *canvas_view)
{
- NautilusCanvasContainer *canvas_container;
+ return NAUTILUS_CANVAS_VIEW_CLASS (G_OBJECT_GET_CLASS (canvas_view))->create_canvas_container
(canvas_view);
+}
+
+static NautilusCanvasContainer *
+real_create_canvas_container (NautilusCanvasView *canvas_view)
+{
+ return nautilus_canvas_view_container_new (canvas_view);
+}
+
+static void
+initialize_canvas_container (NautilusCanvasView *canvas_view,
+ NautilusCanvasContainer *canvas_container)
+{
GtkWidget *content_widget;
content_widget = nautilus_files_view_get_content_widget (NAUTILUS_FILES_VIEW (canvas_view));
- canvas_container = nautilus_canvas_view_container_new (canvas_view);
canvas_view->details->canvas_container = GTK_WIDGET (canvas_container);
g_object_add_weak_pointer (G_OBJECT (canvas_container),
(gpointer *) &canvas_view->details->canvas_container);
@@ -1877,6 +1888,8 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
oclass->finalize = nautilus_canvas_view_finalize;
GTK_WIDGET_CLASS (klass)->destroy = nautilus_canvas_view_destroy;
+
+ klass->create_canvas_container = real_create_canvas_container;
nautilus_files_view_class->add_file = nautilus_canvas_view_add_file;
nautilus_files_view_class->begin_loading = nautilus_canvas_view_begin_loading;
@@ -1951,6 +1964,7 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view)
canvas_view->details->icon = g_themed_icon_new ("view-grid-symbolic");
canvas_container = create_canvas_container (canvas_view);
+ initialize_canvas_container (canvas_view, canvas_container);
g_signal_connect_swapped (nautilus_preferences,
"changed::" NAUTILUS_PREFERENCES_DEFAULT_SORT_ORDER,
diff --git a/src/nautilus-canvas-view.h b/src/nautilus-canvas-view.h
index 994b51f..3e515b4 100644
--- a/src/nautilus-canvas-view.h
+++ b/src/nautilus-canvas-view.h
@@ -52,6 +52,8 @@ struct NautilusCanvasView {
struct NautilusCanvasViewClass {
NautilusFilesViewClass parent_class;
+
+ NautilusCanvasContainer * (* create_canvas_container) (NautilusCanvasView *canvas_view);
};
/* GObject support */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]