add -svgexport flag to drawtool that by default suppresses SVG export

[email protected] Wed, 22 Oct 2003 11:06:04 -0700
Newsgroups gmane.comp.lib.ivtools.patches
Message-ID <a04320403bbbc773d14c6@[68.124.70.56]>
Patch:    ivtools-031022-johnston-082
For:      ivtools-1.0.7
Author:   [email protected]
Subject:  add -svgexport flag to drawtool that by default suppresses SVG export
Requires:

This is an intermediate patch to ivtools-1.0.7.  To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:

	patch -p0 <ThisFile

Summary of Changes:

- add -svgexport flag to drawtool that by default suppresses (the
incomplete) SVG export mechanism.

Index: drawtool/main.c
diff -c drawtool/main.c:1.1 drawtool/main.c:1.2
*** drawtool/main.c:1.1	Fri Sep 13 09:51:30 2002
--- src/drawtool/main.c	Wed Oct 22 11:00:13 2003
***************
*** 159,164 ****
--- 159,165 ----
       { "*opaque_off",    "false"  },
       { "*ptrloc",        "false"  },
       { "*dithermap",     "false"  },
+     { "*svgexport",     "false"  },
   #ifdef HAVE_ACE
       { "*import",        "20001" },
   #endif
***************
*** 194,199 ****
--- 195,201 ----
       { "-opoff", "*opaque_off", OptionValueImplicit, "true" },
       { "-ptrloc", "*ptrloc", OptionValueImplicit, "true" },
       { "-dithermap", "*dithermap", OptionValueImplicit, "true" },
+     { "-svgexport", "*svgexport", OptionValueImplicit, "true" },
   #ifdef HAVE_ACE
       { "-import", "*import", OptionValueNext },
   #endif
***************
*** 208,222 ****
   "Usage: drawtool [any idraw parameter] [-color5] [-dithermap] 
[-gray5] [-gray6] \n\
   [-gray7] [-import port] [-nocolor6] [-opaque_off|-opoff] 
[-pagecols|-ncols n] \n\
   [-pagerows|-nrows n] [-panner_align|-pal 
tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
! [-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] \n\
! [-slider_off|-soff] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
   #else
   static char* usage =
   "Usage: drawtool [any idraw parameter] [-color5] [-dithermap] 
[-gray5] [-gray6] \n\
   [-gray7] [-nocolor6] [-opaque_off|-opoff] [-pagecols|-ncols n] \n\
   [-pagerows|-nrows n] [-panner_align|-pal 
tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
! [-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] \n\
! [-slider_off|-soff] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
   #endif
 
/*****************************************************************************/

--- 210,224 ----
   "Usage: drawtool [any idraw parameter] [-color5] [-dithermap] 
[-gray5] [-gray6] \n\
   [-gray7] [-import port] [-nocolor6] [-opaque_off|-opoff] 
[-pagecols|-ncols n] \n\
   [-pagerows|-nrows n] [-panner_align|-pal 
tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
! [-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] 
[-slider_off|-soff]\n\
! [-svgexport] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
   #else
   static char* usage =
   "Usage: drawtool [any idraw parameter] [-color5] [-dithermap] 
[-gray5] [-gray6] \n\
   [-gray7] [-nocolor6] [-opaque_off|-opoff] [-pagecols|-ncols n] \n\
   [-pagerows|-nrows n] [-panner_align|-pal 
tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
! [-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] 
[-slider_off|-soff]\n\
! [-svgexport] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
   #endif
 
/*****************************************************************************/

Index: OverlayUnidraw/ovexport.c
diff -c OverlayUnidraw/ovexport.c:1.3 OverlayUnidraw/ovexport.c:1.4
*** OverlayUnidraw/ovexport.c:1.3	Mon Oct  7 13:01:56 2002
--- src/OverlayUnidraw/ovexport.c	Wed Oct 22 11:00:08 2003
***************
*** 113,122 ****
   	style = new Style(Session::instance()->style());
   	style->attribute("subcaption", "Export selected graphics to file:");
   	style->attribute("open", "Export");
! 	const char *formats[] = {"EPS", "idraw EPS", "drawtool", "SVG"};
   	const char *commands[] = {"ghostview %s", "idraw %s", 
"drawtool %s", "netscape %s"};
   	chooser_ = new ExportChooser(".", WidgetKit::instance(), style,
! 				     formats, 
sizeof(formats)/sizeof(char*), commands, nil, true);
   	Resource::ref(chooser_);
       } else {
   	style = chooser_->style();
--- 113,127 ----
   	style = new Style(Session::instance()->style());
   	style->attribute("subcaption", "Export selected graphics to file:");
   	style->attribute("open", "Export");
! 	const char *formats_svg[] = {"EPS", "idraw EPS", "drawtool", "SVG"};
! 	const char *formats_nosvg[] = {"EPS", "idraw EPS", "drawtool"};
!         const char *svg_arg = 
unidraw->GetCatalog()->GetAttribute("svgexport");
!         const boolean svg_flag = svg_arg && strcmp(svg_arg, "true")==0;
! 	const char **formats = svg_flag ? formats_svg : formats_nosvg;
! 	int nformats = (svg_flag ? sizeof(formats_svg) : 
sizeof(formats_nosvg)) / sizeof(char*);
   	const char *commands[] = {"ghostview %s", "idraw %s", 
"drawtool %s", "netscape %s"};
   	chooser_ = new ExportChooser(".", WidgetKit::instance(), style,
! 				     formats, nformats, commands, nil, true);
   	Resource::ref(chooser_);
       } else {
   	style = chooser_->style();
*** /dev/null	 Wed Oct 22 11:00:37 PDT 2003
--- patches/ivtools-031022-johnston-082
*************** patches/ivtools-031022-johnston-082
*** 0 ****
--- 1 ----
+ ivtools-031022-johnston-082


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54