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

gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-59-g5fa030a)



The branch, master has been updated
       via  5fa030a92ea9dfe72b9f3adede046d27183c5e5a (commit)
      from  93b7f2a69b17cb853583975c0e849553242df2dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 libgeda/include/prototype_priv.h |    2 +-
 libgeda/src/f_print.c            |   19 +++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)


=================
 Commit Messages
=================

commit 5fa030a92ea9dfe72b9f3adede046d27183c5e5a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Allow support for not printing the background
    
    If the colour map background is set to #f, don't print anything.
    
    This is handy if you wish to composite the resulting pdf file with
    anything else, and don't want the opaque background.

:100644 100644 ab5e9a8... b240e0b... M	libgeda/include/prototype_priv.h
:100644 100644 26f5db5... 2032ddb... M	libgeda/src/f_print.c

=========
 Changes
=========

commit 5fa030a92ea9dfe72b9f3adede046d27183c5e5a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Allow support for not printing the background
    
    If the colour map background is set to #f, don't print anything.
    
    This is handy if you wish to composite the resulting pdf file with
    anything else, and don't want the opaque background.

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index ab5e9a8..b240e0b 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -3,7 +3,7 @@ gchar *o_save_objects(TOPLEVEL *toplevel, const GList *object_list, gboolean sav
 
 /* f_print.c */
 void f_print_set_line_width(FILE *fp, int width);
-void f_print_set_color(TOPLEVEL *toplevel, FILE *fp, int color);
+int f_print_set_color(TOPLEVEL *toplevel, FILE *fp, int color);
 int f_print_header(TOPLEVEL *toplevel, PAGE *page, FILE *fp, int paper_size_x, int paper_size_y, int eps);
 void f_print_footer(FILE *fp);
 void f_print_objects(TOPLEVEL *toplevel, FILE *fp, const GList *obj_list, int start_x, int start_y, float scale, int unicode_count, gunichar *unicode_table);
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 26f5db5..2032ddb 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -65,24 +65,28 @@ void f_print_set_line_width(FILE *fp, int width)
  *  \param [in]     toplevel The current #TOPLEVEL structure.
  *  \param [in]     fp     The postscript document to print the color to.
  *  \param [in]     color  Integer color to convert and print.
+ *
+ *  \returns 1 if the colour is enabled, 0 if disabled.
  */
-void f_print_set_color(TOPLEVEL *toplevel, FILE *fp, int color) 
+int f_print_set_color(TOPLEVEL *toplevel, FILE *fp, int color)
 {
   gchar *string;
 
-  if (!toplevel->print_color || (toplevel->last_ps_color == color)) return;
+  if (!toplevel->print_color || (toplevel->last_ps_color == color)) return 1;
 
   string = s_color_ps_string(color);
 
   if (string) {
     fprintf(fp, "%s setrgbcolor\n", string);
   } else {
-    fprintf(fp, "0 0 0 setrgbcolor\n");
+    toplevel->last_ps_color = -1;
+    return 0;
   }
 
   g_free (string);
 
   toplevel->last_ps_color = color;
+  return 1;
 }
 
 /*! \brief Prints the header to a postscript document.
@@ -573,11 +577,10 @@ int f_print_stream(TOPLEVEL *toplevel, PAGE *page, FILE *fp)
 
   /* Now the output is defined in terms of mils */
   /* Draw a box with the background colour covering the whole page */
-  if (toplevel->print_color) {
-    f_print_set_color(toplevel, fp, toplevel->print_color_background);
-    fprintf(fp,"%d %d 0 0 fbox\n",
-	    toplevel->paper_height,
-	    toplevel->paper_width);
+  if (toplevel->print_color &&
+      f_print_set_color(toplevel, fp, toplevel->print_color_background)) {
+    fprintf (fp, "%d %d 0 0 fbox\n", toplevel->paper_height,
+                                     toplevel->paper_width);
   }
 
   /* Now rotate and translate the graphics to fit onto the desired




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs