]> granicus.if.org Git - graphviz/commitdiff
consolidating file output into gvdevice framework
authorellson <devnull@localhost>
Wed, 3 Oct 2007 16:59:11 +0000 (16:59 +0000)
committerellson <devnull@localhost>
Wed, 3 Oct 2007 16:59:11 +0000 (16:59 +0000)
plugin/ming/gvrender_ming.c
plugin/xlib/gvdevice_xlib.c

index 2d0ce037fc7c79753e0214e070ffc64a11bc6804..2002f380e51b19a728dad4d9d2547e17bde32814 100644 (file)
 
 #include <ming.h>
 
+static char *script = 
+    "createTextField(\"greet\", 0, 0, 0, 100, 100);\n"
+    "greet.text = \"Hello, world!\";\n";
+       
 #define SWFVERSION 6
 #define SWFCOMPRESSION 9
 #define SWFFRAMERATE .5
@@ -33,6 +37,7 @@ typedef enum { FORMAT_SWF } format_type;
 static void ming_begin_job(GVJ_t * job)
 {
     SWFMovie movie;
+    SWFAction action;
 
     Ming_init();
     Ming_useSWFVersion(SWFVERSION);
@@ -41,6 +46,9 @@ static void ming_begin_job(GVJ_t * job)
     SWFMovie_setRate(movie, SWFFRAMERATE);
     SWFMovie_setDimension(movie, job->width, job->height);
 
+    action = newSWFAction(script);
+    SWFMovie_add(movie, (SWFBlock)action);
+
     job->context = (void*) movie;
 }
 
@@ -50,6 +58,7 @@ static void ming_end_job(GVJ_t * job)
 
     SWFMovie_output_to_stream(movie, job->output_file);
     destroySWFMovie(movie);
+//    destroySWFAction(action);
     job->context = NULL;
 }
 
index 244c4af7fa6025a4689ac2dbd8a9e93ebcd42af0..6be9ae2355b4e731b00deda79635ff5ef41f3104 100644 (file)
@@ -441,7 +441,7 @@ static int handle_file_events(GVJ_t *job, int inotify_fd)
 }
 #endif
 
-static void initialize_xlib(GVJ_t *firstjob)
+static void xlib_initialize(GVJ_t *firstjob)
 {
     Display *dpy;
     KeySym keysym;
@@ -480,7 +480,7 @@ static void initialize_xlib(GVJ_t *firstjob)
     firstjob->device_sets_dpi = TRUE;
 }
 
-static void finalize_xlib(GVJ_t *firstjob)
+static void xlib_finalize(GVJ_t *firstjob)
 {
     GVJ_t *job;
     Display *dpy = (Display *)(firstjob->display);
@@ -586,10 +586,9 @@ static gvdevice_features_t device_features_xlib = {
 };
 
 static gvdevice_engine_t device_engine_xlib = {
-    initialize_xlib,
-    NULL,
-    NULL,
-    finalize_xlib,
+    xlib_initialize,
+    NULL,              /* xlib_format */
+    xlib_finalize,
 };
 #endif