From 7819a117c7ac214e224791e0408235f6c1ed5ab3 Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 3 Oct 2007 16:59:11 +0000 Subject: [PATCH] consolidating file output into gvdevice framework --- plugin/ming/gvrender_ming.c | 9 +++++++++ plugin/xlib/gvdevice_xlib.c | 11 +++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plugin/ming/gvrender_ming.c b/plugin/ming/gvrender_ming.c index 2d0ce037f..2002f380e 100644 --- a/plugin/ming/gvrender_ming.c +++ b/plugin/ming/gvrender_ming.c @@ -24,6 +24,10 @@ #include +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; } diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index 244c4af7f..6be9ae235 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -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 -- 2.40.0