]> granicus.if.org Git - graphviz/commitdiff
provide a GVDEVICE_NO_WRITER feature flag for those device that don't use gvdevice_wr...
authorellson <devnull@localhost>
Thu, 4 Oct 2007 01:41:04 +0000 (01:41 +0000)
committerellson <devnull@localhost>
Thu, 4 Oct 2007 01:41:04 +0000 (01:41 +0000)
plugin/gd/gvdevice_gd.c
plugin/gd/gvrender_gd.c
plugin/ming/gvrender_ming.c
plugin/pango/gvrender_pango.c

index 9e2e347e08b1c60ad278cf395e45e18fcc21ff2c..5aefc51b88db8234e9ab9a62545a1d5a647b784a 100644 (file)
@@ -189,6 +189,15 @@ static gvdevice_features_t device_features_gd = {
     {0.,0.},                    /* default page width, height - points */
     {96.,96.},                  /* dpi */
 };
+
+static gvdevice_features_t device_features_gd_no_writer = {
+    GVDEVICE_BINARY_FORMAT
+      | GVDEVICE_NO_WRITER
+      | GVDEVICE_DOES_TRUECOLOR,/* flags */
+    {0.,0.},                    /* default margin - points */
+    {0.,0.},                    /* default page width, height - points */
+    {96.,96.},                  /* dpi */
+};
 #endif
 #endif
 
@@ -211,8 +220,8 @@ gvplugin_installed_t gvdevice_gd_types[] = {
     {FORMAT_PNG, "png:cairo", 5, &gd_engine, &device_features_gd},
 #endif
 
-    {FORMAT_GD, "gd:cairo", 5, &gd_engine, &device_features_gd},
-    {FORMAT_GD2, "gd2:cairo", 5, &gd_engine, &device_features_gd},
+    {FORMAT_GD, "gd:cairo", 5, &gd_engine, &device_features_gd_no_writer},
+    {FORMAT_GD2, "gd2:cairo", 5, &gd_engine, &device_features_gd_no_writer},
 
 #if 0
 /* libgd only supports reading of xpm files */
index 77e269396263b8256a662f5e717cfcab96be6fa3..c2747e6d759585859221b47b13a301b9bcb427fc 100644 (file)
@@ -657,6 +657,14 @@ static gvdevice_features_t device_features_gd_tc = {
     {96.,96.},                 /* default dpi */
 };
 
+static gvdevice_features_t device_features_gd_tc_no_writer = {
+    GVDEVICE_DOES_TRUECOLOR
+      | GVDEVICE_NO_WRITER,    /* flags */
+    {0.,0.},                   /* default margin - points */
+    {0.,0.},                    /* default page width, height - points */
+    {96.,96.},                 /* default dpi */
+};
+
 #endif
 
 gvplugin_installed_t gvrender_gd_types[] = {
@@ -683,8 +691,8 @@ gvplugin_installed_t gvdevice_gd_types2[] = {
     {FORMAT_PNG, "png:gd", 1, NULL, &device_features_gd_tc},
 #endif
 
-    {FORMAT_GD, "gd:gd", 1, NULL, &device_features_gd_tc},
-    {FORMAT_GD2, "gd2:gd", 1, NULL, &device_features_gd_tc},
+    {FORMAT_GD, "gd:gd", 1, NULL, &device_features_gd_tc_no_writer},
+    {FORMAT_GD2, "gd2:gd", 1, NULL, &device_features_gd_tc_no_writer},
 
 #if 0
 /* libgd has no support for xbm as output */
index 2002f380e51b19a728dad4d9d2547e17bde32814..7ced406f54e7537d33600ce811e548af3d058065 100644 (file)
@@ -289,6 +289,7 @@ static gvrender_features_t render_features_ming = {
 
 static gvdevice_features_t device_features_ming = {
     GVDEVICE_DOES_PAGES
+       | GVDEVICE_NO_WRITER
        | GVDEVICE_DOES_TRUECOLOR, /* flags */
     {0.,0.},                   /* default margin - points */
     {0.,0.},                    /* default page width, height - points */
index ee401cf013ffaa4742ab85f6b30eb5a4389adcc0..f2fbadeab700b6b015c7378aceefcaabef45a889 100644 (file)
@@ -107,14 +107,14 @@ static fenv_t fenv; /* FIXME - not thread safe */
 #endif
 #endif
 
-extern size_t gvdevice_write(GVJ_t * job, char *s, unsigned int len);
-
 static void cairogen_set_color(cairo_t * cr, gvcolor_t * color)
 {
     cairo_set_source_rgba(cr, color->u.RGBA[0], color->u.RGBA[1],
                         color->u.RGBA[2], color->u.RGBA[3]);
 }
 
+extern size_t gvdevice_write(GVJ_t * job, char *s, unsigned int len);
+
 static cairo_status_t
 writer (void *closure, const unsigned char *data, unsigned int length)
 {