[gegl-gtk] GeglGtkView: Add convenience for hooking up to a GeglBuffer



commit 09eb0f91bcbe2ac2cf76e75d57d482157cdc116d
Author: Jon Nordby <jononor gmail com>
Date:   Wed Jan 23 21:00:38 2013 +0100

    GeglGtkView: Add convenience for hooking up to a GeglBuffer
    
    gegl_gtk_view_new_for_buffer()

 gegl-gtk/gegl-gtk-view.c |    8 ++++++++
 gegl-gtk/gegl-gtk-view.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gegl-gtk/gegl-gtk-view.c b/gegl-gtk/gegl-gtk-view.c
index dd48323..e0007c1 100644
--- a/gegl-gtk/gegl-gtk-view.c
+++ b/gegl-gtk/gegl-gtk-view.c
@@ -462,6 +462,14 @@ gegl_gtk_view_new()
     return GEGL_GTK_VIEW(g_object_new(GEGL_GTK_TYPE_VIEW, NULL));
 }
 
+GeglGtkView *
+gegl_gtk_view_new_for_buffer(GeglBuffer *buffer)
+{
+    GeglNode *node = gegl_node("gegl:buffer-source",
+                     "buffer", buffer, NULL);
+    return gegl_gtk_view_new_for_node(node);
+}
+
 /**
  * gegl_gtk_view_new_for_node:
  * @node: The #GeglNode to display
diff --git a/gegl-gtk/gegl-gtk-view.h b/gegl-gtk/gegl-gtk-view.h
index 4642f6d..d6611c7 100644
--- a/gegl-gtk/gegl-gtk-view.h
+++ b/gegl-gtk/gegl-gtk-view.h
@@ -55,6 +55,7 @@ GType           gegl_gtk_view_get_type(void) G_GNUC_CONST;
 
 GeglGtkView *gegl_gtk_view_new(void);
 GeglGtkView *gegl_gtk_view_new_for_node(GeglNode *node);
+GeglGtkView *gegl_gtk_view_new_for_buffer(GeglBuffer *buffer);
 
 void gegl_gtk_view_set_node(GeglGtkView *self, GeglNode *node);
 GeglNode *gegl_gtk_view_get_node(GeglGtkView *self);



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