gegl r2859 - in trunk: . bin bin/node-editors operations/external



Author: ok
Date: Tue Jan  6 11:15:26 2009
New Revision: 2859
URL: http://svn.gnome.org/viewvc/gegl?rev=2859&view=rev

Log:
Stripped away most of the GTK+ GUI code originally ripped out of
bauxite, leaving the gegl binary as a commandline tool and not a
half broken editor (using the SDL display op, it also allows showing
GEGL compositions similarly to before as well.)
* bin/gegl.c: (main): removed references to GTK+.
* operations/external/display.c: (init_sdl), (idle), (process): spin
the SDL event loop in an idle handler.
* bin/Makefile.am: removed references to now removed files (the
following)
* bin/editor-optype.c: 
* bin/editor-optype.h:
* bin/editor.c: 
* bin/editor.h:
* bin/export.c:
* bin/export.h:
* bin/gegl-node-editor-plugin.h:
* bin/gegl-node-editor.c:
* bin/gegl-node-editor.h:
* bin/gegl-store.c:
* bin/gegl-store.h:
* bin/gegl-tree-editor-action.c:
* bin/gegl-tree-editor-action.h:
* bin/gegl-tree-editor.c:
* bin/gegl-tree-editor.h:
* bin/gegl-view.c:
* bin/gegl-view.h:
* bin/node-editors/Makefile.am:
* bin/node-editors/brightness-contrast.c:
* bin/node-editors/gaussian-blur.c:
* bin/node-editors/level.c:
* bin/node-editors/unsharp-mask.c:
* bin/node-editors/whitebalance.c:


Removed:
   trunk/bin/editor-optype.c
   trunk/bin/editor-optype.h
   trunk/bin/editor.c
   trunk/bin/editor.h
   trunk/bin/export.c
   trunk/bin/export.h
   trunk/bin/gegl-node-editor-plugin.h
   trunk/bin/gegl-node-editor.c
   trunk/bin/gegl-node-editor.h
   trunk/bin/gegl-store.c
   trunk/bin/gegl-store.h
   trunk/bin/gegl-tree-editor-action.c
   trunk/bin/gegl-tree-editor-action.h
   trunk/bin/gegl-tree-editor.c
   trunk/bin/gegl-tree-editor.h
   trunk/bin/gegl-view.c
   trunk/bin/gegl-view.h
   trunk/bin/node-editors/Makefile.am
   trunk/bin/node-editors/brightness-contrast.c
   trunk/bin/node-editors/gaussian-blur.c
   trunk/bin/node-editors/level.c
   trunk/bin/node-editors/unsharp-mask.c
   trunk/bin/node-editors/whitebalance.c
Modified:
   trunk/ChangeLog
   trunk/bin/Makefile.am
   trunk/bin/gegl.c
   trunk/operations/external/display.c

Modified: trunk/bin/Makefile.am
==============================================================================
--- trunk/bin/Makefile.am	(original)
+++ trunk/bin/Makefile.am	Tue Jan  6 11:15:26 2009
@@ -1,34 +1,8 @@
-#if HAVE_GTK
-#SUBDIRS = node-editors
-#endif
-
 bin_PROGRAMS = gegl
 
 libbuffer = $(top_builddir)/gegl/buffer/libbuffer.la
 libmodule = $(top_builddir)/gegl/module/libmodule.la
 
-if HAVE_GTK
-gui_sources = \
-	editor.c				\
-	editor.h				\
-	editor-optype.c				\
-	editor-optype.h				\
-	export.c				\
-	export.h				\
-	gegl-bin-gui-types.h			\
-	gegl-node-editor.c			\
-	gegl-node-editor.h			\
-	gegl-store.c				\
-	gegl-store.h				\
-	gegl-tree-editor-action.c		\
-	gegl-tree-editor-action.h		\
-	gegl-node-editor-plugin.h		\
-	gegl-tree-editor.c			\
-	gegl-tree-editor.h			\
-	gegl-view.c				\
-	gegl-view.h
-endif
-
 
 gegl_SOURCES =			\
 	gegl.c			\
@@ -58,8 +32,8 @@
 	-I$(top_srcdir)/gegl/buffer \
 	-I$(top_srcdir)/gegl/operation \
 	-I$(top_srcdir)/gegl/module \
-	@DEP_CFLAGS@ @GTK_CFLAGS@ @BABL_CFLAGS@ @PNG_CFLAGS@
+	@DEP_CFLAGS@ @BABL_CFLAGS@ @PNG_CFLAGS@
 
 AM_LDFLAGS =  \
 	-no-undefined ../gegl/libgegl- GEGL_API_VERSION@.la \
-	@DEP_LIBS@ @GTK_LIBS@ @BABL_LIBS@ @PNG_LIBS@ @LIBSPIRO@
+	@DEP_LIBS@ @BABL_LIBS@ @PNG_LIBS@ @LIBSPIRO@

Modified: trunk/bin/gegl.c
==============================================================================
--- trunk/bin/gegl.c	(original)
+++ trunk/bin/gegl.c	Tue Jan  6 11:15:26 2009
@@ -43,13 +43,6 @@
 #define realpath(a,b) _fullpath(b,a,_MAX_PATH)
 #endif
 
-#if HAVE_GTK
-#include <gtk/gtk.h>
-#include "gegl-bin-gui-types.h"
-#include "editor.h"
-#endif
-
-
 #define DEFAULT_COMPOSITION \
 "<?xml version='1.0' encoding='UTF-8'?> <gegl> <node operation='gegl:crop'> <params> <param name='x'>0</param> <param name='y'>0</param> <param name='width'>690</param> <param name='height'>670</param> </params> </node> <node operation='gegl:over'> <node operation='gegl:translate'> <params> <param name='x'>14</param> <param name='y'>613</param> </params> </node> <node operation='gegl:opacity'> <params> <param name='value'>0.59999999999999998</param> </params> </node> <node name='text' operation='gegl:text'> <params> <param name='string'>2000-2008 ? Calvin Williamson, Caroline Dahloff, Manish Singh, Jay Cox, Daniel Rogers, Sven Neumann, Michael Natterer,  ?yvind Kol?s, Philip Lafleur, Dominik Ernst, Richard Kralovic, Kevin Cozens, Victor Bogado, Martin Nordholts, Geert Jordaens, Michael Schumacher, John Marshall, ?tienne Bersac, Mark Probst, H?kon Hitland, Tor Lillqvist, Hans Breuer, Deji Akingunola, Bradley Broom, Hans Petter Jansson, Jan Heller, dmacks netspace org, Sven An
 ders, Hubert Figui?re, Sam Hocevar, yahvuu at gmail.com, Nicolas Robidoux, Garry R. Osgood, Shlomi Fish, Jakub Steiner and Tonda Tavalec</param> <param name='font'>Sans</param> <param name='size'>8</param> <param name='color'>rgb(0.0000, 0.0000, 0.0000)</param> <param name='wrap'>628</param> <param name='alignment'>0</param> <param name='width'>622</param> <param name='height'>40</param> </params> </node> </node> <node operation='gegl:over'> <node operation='gegl:translate'> <params> <param name='x'>300</param> <param name='y'>500</param> </params> </node> <node operation='gegl:over'> <node operation='gegl:translate'> <params> <param name='x'>0</param> <param name='y'>0</param> </params> </node> <node operation='gegl:dropshadow'> <params> <param name='opacity'>1.2</param> <param name='x'>0</param> <param name='y'>0</param> <param name='radius'>8</param> </params> </node> <gegl:path d='M0,50 C0,78 24,100 50,100 C77,100 100,78 100,50 C100,45 99,40 98,35 C82,35 66,35 50,35 C42,
 35 35,42 35,50 C35,58 42,65 50,65 C56,65 61,61 64,56 C67,51 75,55 73,60 C69,69 60,75 50,75 C36,75 25,64 25,50 C25,36 36,25 50,25 L93,25 C83,9 67,0 49,0 C25,0 0,20 0,50 z' fill='white'/> </node> <node operation='gegl:over'> <node operation='gegl:translate'> <params> <param name='x'>88</param> <param name='y'>0</param> </params> </node> <node operation='gegl:dropshadow'> <params> <param name='opacity'>1.2</param> <param name='x'>0</param> <param name='y'>0</param> <param name='radius'>8</param> </params> </node> <node operation='gegl:path'> <params> <param name='d'>M50,0 C23,0 0,22 0,50 C0,77 22,100 50,100 C68,100 85,90 93,75 L40,75 C35,75 35,65 40,65 L98,65 C100,55 100,45 98,35 L40,35 C35,35 35,25 40,25 L93,25 C84,10 68,0 50,0 z</param> <param name='fill'>rgb(1.0000, 1.0000, 1.0000)</param> </params> </node> </node> <node operation='gegl:over'> <node operation='gegl:translate'> <params> <param name='x'>176</param> <param name='y'>0</param> </params> </node> <node operation='g
 egl:dropshadow'> <params> <param name='opacity'>1.2</param> <param name='x'>0</param> <param name='y'>0</param> <param name='radius'>8</param> </params> </node> <node operation='gegl:path'> <params> <param name='d'>M0,50 C0,78 24,100 50,100 C77,100 100,78 100,50 C100,45 99,40 98,35 C82,35 66,35 50,35 C42,35 35,42 35,50 C35,58 42,65 50,65 C56,65 61,61 64,56 C67,51 75,55 73,60 C69,69 60,75 50,75 C36,75 25,64 25,50 C25,36 36,25 50,25 L93,25 C83,9 67,0 49,0 C25,0 0,20 0,50 z</param> <param name='fill'>rgb(1.0000, 1.0000, 1.0000)</param> </params> </node> </node> <node operation='gegl:translate'> <params> <param name='x'>264</param> <param name='y'>0</param> </params> </node> <node operation='gegl:dropshadow'> <params> <param name='opacity'>1.2</param> <param name='x'>0</param> <param name='y'>0</param> <param name='radius'>8</param> </params> </node> <node operation='gegl:path'> <params> <param name='d'>M30,4 C12,13 0,30 0,50 C0,78 23,100 50,100 C71,100 88,88 96,71 L56,71 C42,71
  30,59 30,45 L30,4 z</param> <param name='fill'>rgb(1.0000, 1.0000, 1.0000)</param> </params> </node> </node> <node operation='gegl:rotate'> <params> <param name='origin-x'>0</param> <param name='origin-y'>0</param> <param name='filter'>linear</param> <param name='hard-edges'>false</param> <param name='lanczos-width'>3</param> <param name='degrees'>42</param> </params> </node> <node operation='gegl:checkerboard'> <params> <param name='x'>43</param> <param name='y'>44</param> <param name='x-offset'>0</param> <param name='y-offset'>0</param> <param name='color1'>rgb(0.7097, 0.7097, 0.7097)</param> <param name='color2'>rgb(0.7661, 0.7661, 0.7661)</param> </params> </node> </gegl>"
 
@@ -226,11 +219,16 @@
   switch (o->mode)
     {
       case GEGL_RUN_MODE_EDITOR:
-#if HAVE_GTK
-	gtk_init (&argc, &argv);
-	editor_main (gegl, o);
-#endif
-	return 0;
+        {
+          GeglNode *output = gegl_node_new_child (gegl,
+						  "operation", "gegl:display",
+						  "window-title", o->file,
+						  NULL);
+          gegl_node_connect_from (output, "input", gegl_node_get_output_proxy (gegl, "output"), "output");
+          gegl_node_process (output);
+          g_object_unref (output);
+          g_main_loop_run (g_main_loop_new (NULL, TRUE));
+        }
         break;
       case GEGL_RUN_MODE_XML:
 	g_printf ("%s\n", gegl_node_to_xml (gegl, path_root));

Modified: trunk/operations/external/display.c
==============================================================================
--- trunk/operations/external/display.c	(original)
+++ trunk/operations/external/display.c	Tue Jan  6 11:15:26 2009
@@ -64,8 +64,8 @@
     {
       inited = 1;
 
-      signal (SIGINT, sighandler);
-      signal (SIGQUIT, sighandler);
+      /*signal (SIGINT, sighandler);
+      signal (SIGQUIT, sighandler);*/ 
 
       if (SDL_Init (SDL_INIT_VIDEO) < 0)
         {
@@ -79,6 +79,21 @@
 
 /*static int instances = 0;*/
 
+static gboolean idle (gpointer data)
+{
+  SDL_Event event;
+  while (SDL_PollEvent  (&event))
+    {
+      switch (event.type)
+        {
+          case SDL_QUIT:
+            sighandler (SIGQUIT);
+        }
+    }
+  return TRUE;
+}
+
+static guint handle = 0;
 
 static gboolean
 process (GeglOperation       *operation,
@@ -90,6 +105,8 @@
   SDL_Surface **sdl_outwin = NULL;      //op_sym (op, "sdl_outwin");
 
   init_sdl ();
+  if (!handle)
+    handle = g_idle_add (idle, NULL);
 
   if (!o->screen ||
        o->width  != result->width ||



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