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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-37-gaa6e2f9)



The branch, master has been updated
       via  aa6e2f9f4eda4b6c3cd11eabd679c2a710b4f222 (commit)
       via  165de888d86506583241dab79573e81f2cf44dd7 (commit)
       via  1843d875be92a4935c3581a1f24e7a33f8f76042 (commit)
      from  6e8513e78fb37bfdeba7254a7670cb86e3608924 (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
=========

 gattrib/src/i_vars.c           |    2 -
 gattrib/src/s_object.c         |    8 +++---
 gschem/include/gschem_struct.h |   15 -------------
 gschem/src/a_zoom.c            |    3 +-
 gschem/src/gschem_toplevel.c   |   14 ------------
 gschem/src/i_vars.c            |   31 ----------------------------
 gschem/src/o_arc.c             |    9 +++----
 gschem/src/o_attrib.c          |   16 +++++++-------
 gschem/src/o_box.c             |    9 +++----
 gschem/src/o_bus.c             |    5 +--
 gschem/src/o_circle.c          |    9 +++----
 gschem/src/o_cue.c             |   10 ++++----
 gschem/src/o_grips.c           |    2 +-
 gschem/src/o_line.c            |   12 ++++------
 gschem/src/o_misc.c            |    2 +-
 gschem/src/o_net.c             |    7 ++---
 gschem/src/o_path.c            |    7 ++---
 gschem/src/o_picture.c         |    3 +-
 gschem/src/o_pin.c             |    5 +--
 gschem/src/o_place.c           |    3 +-
 gschem/src/o_select.c          |    3 +-
 gschem/src/o_slot.c            |    8 +++---
 gschem/src/o_text.c            |   21 ++++++++----------
 gschem/src/x_grid.c            |    5 +--
 gschem/src/x_stroke.c          |   28 ++++++++++++++++---------
 libgeda/include/struct.h       |    4 ---
 libgeda/scheme/color-map.scm   |    6 ++--
 libgeda/src/o_attrib.c         |   24 ++++++++++----------
 libgeda/src/s_color.c          |   44 ++++++++++++++++++++--------------------
 libgeda/src/s_cue.c            |    4 +-
 libgeda/src/s_toplevel.c       |    4 ---
 31 files changed, 123 insertions(+), 200 deletions(-)


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

commit aa6e2f9f4eda4b6c3cd11eabd679c2a710b4f222
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 20:11:22 2008 +0000

    libgeda: Fix mis-matched default colour map definition
    
    Reorder the mapping in color-map.scm into strictly numerical order,
    and annotate the default color maps with their index numbers so this
    kind of mistake is less likely to reoccur.

:100644 100644 41dd8db... a47ac01... M	libgeda/scheme/color-map.scm
:100644 100644 e29a78f... 4da5787... M	libgeda/src/s_color.c

commit 165de888d86506583241dab79573e81f2cf44dd7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 15:46:09 2008 +0000

    Remove GSCHEM_TOPLEVEL and TOPLEVEL indirection for fixed colour indices
    
    Colour indices such as grid_colour and select_color are not changed at
    run-time since (by definition) those graphic elements are always drawn
    with the sepcified index. Remove the indirection through GSCHEM_TOPLEVEL
    or TOPLEVEL, and use the appropriate index constant instead.
    
    The background_color indirection remains, since swapping this is used
    to override the background to white when exporting black and white image.

:100644 100644 37d7e50... 4b4573d... M	gattrib/src/i_vars.c
:100644 100644 b73a5c5... 5ba4995... M	gattrib/src/s_object.c
:100644 100644 df4386d... af40aa6... M	gschem/include/gschem_struct.h
:100644 100644 ff23c67... 01a464f... M	gschem/src/a_zoom.c
:100644 100644 d5ab97d... fc72529... M	gschem/src/gschem_toplevel.c
:100644 100644 1715d10... ce44770... M	gschem/src/i_vars.c
:100644 100644 006543f... 1d42f89... M	gschem/src/o_arc.c
:100644 100644 254a4e9... 555b12b... M	gschem/src/o_attrib.c
:100644 100644 1902fb2... bb22b86... M	gschem/src/o_box.c
:100644 100644 032cb32... 5403209... M	gschem/src/o_bus.c
:100644 100644 d04ce01... f8d6b26... M	gschem/src/o_circle.c
:100644 100644 47dbde3... c104804... M	gschem/src/o_cue.c
:100644 100644 628d755... cafc42c... M	gschem/src/o_grips.c
:100644 100644 bbc1f48... d5b75ae... M	gschem/src/o_line.c
:100644 100644 7f6586f... dac8ebe... M	gschem/src/o_misc.c
:100644 100644 af03da9... 74d4cdc... M	gschem/src/o_net.c
:100644 100644 3864620... f9d0da9... M	gschem/src/o_path.c
:100644 100644 b1b1f5a... 0b0ca49... M	gschem/src/o_picture.c
:100644 100644 951fb51... 121e550... M	gschem/src/o_pin.c
:100644 100644 60a16d5... b095c4e... M	gschem/src/o_place.c
:100644 100644 e69cd7f... f4b960a... M	gschem/src/o_select.c
:100644 100644 761b111... d827b5a... M	gschem/src/o_slot.c
:100644 100644 0700a6e... 5ae4189... M	gschem/src/o_text.c
:100644 100644 54f955e... 976635c... M	gschem/src/x_grid.c
:100644 100644 3c0fc9c... c3b5216... M	gschem/src/x_stroke.c
:100644 100644 ddfb00a... f1d0cfe... M	libgeda/include/struct.h
:100644 100644 0e026cb... 1c576d7... M	libgeda/src/o_attrib.c
:100644 100644 d53536a... c2a7511... M	libgeda/src/s_cue.c
:100644 100644 0a37cc8... d4631ef... M	libgeda/src/s_toplevel.c

commit 1843d875be92a4935c3581a1f24e7a33f8f76042
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 15:36:58 2008 +0000

    gschem: Invalidate region to erase damage due to stroke trails
    
    We don't erase things by painting to the background colour any more,
    that leaves drawing artifacts.

:100644 100644 2a1ba57... 3c0fc9c... M	gschem/src/x_stroke.c

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

commit aa6e2f9f4eda4b6c3cd11eabd679c2a710b4f222
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 20:11:22 2008 +0000

    libgeda: Fix mis-matched default colour map definition
    
    Reorder the mapping in color-map.scm into strictly numerical order,
    and annotate the default color maps with their index numbers so this
    kind of mistake is less likely to reoccur.

diff --git a/libgeda/scheme/color-map.scm b/libgeda/scheme/color-map.scm
index 41dd8db..a47ac01 100644
--- a/libgeda/scheme/color-map.scm
+++ b/libgeda/scheme/color-map.scm
@@ -19,12 +19,12 @@
     (stroke . 14)
     (lock . 15)
     (output-background . 16)
-    (junction . 21)
-
     (freestyle1 . 17)
     (freestyle2 . 18)
     (freestyle3 . 19)
-    (freestyle4 . 20)))
+    (freestyle4 . 20)
+    (junction . 21)
+   ))
 
 ;; Look up the internal system ID for a symbolic color
 (define (color-map-name-to-index val)
diff --git a/libgeda/src/s_color.c b/libgeda/src/s_color.c
index e29a78f..4da5787 100644
--- a/libgeda/src/s_color.c
+++ b/libgeda/src/s_color.c
@@ -40,28 +40,28 @@ COLOR print_colors[MAX_COLORS];
 #define ENDMAP  {0x00, 0x00, 0x00, 0x00, FALSE}
 
 static COLOR default_colors[] = {
-  WHITE,           /* background         */
-  BLACK,           /* pin                */
-  BLACK,           /* net-endpoint       */
-  BLACK,           /* graphic            */
-  BLACK,           /* net                */
-  BLACK,           /* attribute          */
-  BLACK,           /* logic-bubble       */
-  BLACK,           /* grid               */
-  BLACK,           /* detached-attribute */
-  BLACK,           /* text               */
-  BLACK,           /* bus                */
-  GRAY,            /* select             */
-  GRAY,            /* bounding-box       */
-  GRAY,            /* zoom-box           */
-  GRAY,            /* stroke             */
-  BLACK,           /* lock               */
-  NOCOLOR,         /* output-background  */
-  BLACK,           /* junction           */
-  NOCOLOR,         /* freestyle1         */
-  NOCOLOR,         /* freestyle2         */
-  NOCOLOR,         /* freestyle3         */
-  NOCOLOR,         /* freestyle4         */
+  WHITE,           /*  0: background         */
+  BLACK,           /*  1: pin                */
+  BLACK,           /*  2: net-endpoint       */
+  BLACK,           /*  3: graphic            */
+  BLACK,           /*  4: net                */
+  BLACK,           /*  5: attribute          */
+  BLACK,           /*  6: logic-bubble       */
+  BLACK,           /*  7: grid               */
+  BLACK,           /*  8: detached-attribute */
+  BLACK,           /*  9: text               */
+  BLACK,           /* 10: bus                */
+  GRAY,            /* 11: select             */
+  GRAY,            /* 12: bounding-box       */
+  GRAY,            /* 13: zoom-box           */
+  GRAY,            /* 14: stroke             */
+  BLACK,           /* 15: lock               */
+  NOCOLOR,         /* 16: output-background  */
+  NOCOLOR,         /* 17: freestyle1         */
+  NOCOLOR,         /* 18: freestyle2         */
+  NOCOLOR,         /* 19: freestyle3         */
+  NOCOLOR,         /* 20: freestyle4         */
+  BLACK,           /* 21: junction           */
   ENDMAP
 };
 

commit 165de888d86506583241dab79573e81f2cf44dd7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 15:46:09 2008 +0000

    Remove GSCHEM_TOPLEVEL and TOPLEVEL indirection for fixed colour indices
    
    Colour indices such as grid_colour and select_color are not changed at
    run-time since (by definition) those graphic elements are always drawn
    with the sepcified index. Remove the indirection through GSCHEM_TOPLEVEL
    or TOPLEVEL, and use the appropriate index constant instead.
    
    The background_color indirection remains, since swapping this is used
    to override the background to white when exporting black and white image.

diff --git a/gattrib/src/i_vars.c b/gattrib/src/i_vars.c
index 37d7e50..4b4573d 100644
--- a/gattrib/src/i_vars.c
+++ b/gattrib/src/i_vars.c
@@ -46,7 +46,6 @@
 /*------------------------------------------------------------------
  * Define the vars we'll use later
  *------------------------------------------------------------------*/
-int   default_attribute_color = ATTRIBUTE_COLOR;
 int   default_paper_width = 11000; /* letter size */
 int   default_paper_height = 85000;
 
@@ -58,7 +57,6 @@ void i_vars_set(TOPLEVEL * pr_current)
 {
   i_vars_libgeda_set(pr_current);
 
-  pr_current->attribute_color = default_attribute_color;
   pr_current->paper_width = default_paper_width;
   pr_current->paper_height = default_paper_height;
 }
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index b73a5c5..5ba4995 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -262,7 +262,7 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
   OBJECT *o_current;
   OBJECT *new_obj;
 
-  color = pr_current->detachedattr_color;
+  color = DETACHED_ATTRIBUTE_COLOR;
 
   o_current = object;
 
@@ -273,13 +273,13 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
     case (OBJ_COMPLEX):
       world_x = o_current->complex->x;
       world_y = o_current->complex->y;
-      color = pr_current->attribute_color;
+      color = ATTRIBUTE_COLOR;
       break;
 
     case (OBJ_NET):
       world_x = o_current->complex->x;
       world_y = o_current->complex->y;
-      color = pr_current->attribute_color;
+      color = ATTRIBUTE_COLOR;
       break;
 
     default:
@@ -296,7 +296,7 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
     world_y = top;
 
     /* printf("%d %d\n", world_x, world_y); */
-    color = pr_current->detachedattr_color;
+    color = DETACHED_ATTRIBUTE_COLOR;
   }
 
   /* first create text item */
diff --git a/gschem/include/gschem_struct.h b/gschem/include/gschem_struct.h
index df4386d..af40aa6 100644
--- a/gschem/include/gschem_struct.h
+++ b/gschem/include/gschem_struct.h
@@ -128,21 +128,6 @@ struct st_gschem_toplevel {
   /* ------------------ */
   /* rc/user parameters */
   /* ------------------ */
-  int graphic_color;
-  int net_color;
-  int bus_color;
-  int pin_color;
-  int text_color;
-
-  /* not used anywhere yet, but will be */
-  int logic_bubble_color;
-  int zoom_box_color;
-  int grid_color;
-  int select_color;
-  int bb_color;
-  int lock_color;
-  int stroke_color;       /* color of the stroke points */
-
   int text_caps;
   int text_size;
 
diff --git a/gschem/src/a_zoom.c b/gschem/src/a_zoom.c
index ff23c67..01a464f 100644
--- a/gschem/src/a_zoom.c
+++ b/gschem/src/a_zoom.c
@@ -313,8 +313,7 @@ void a_zoom_box_rubberband_xor(GSCHEM_TOPLEVEL *w_current)
   box_left   = min(x1, x2);
   box_top    = min(y1, y2);
 
-  gdk_gc_set_foreground(w_current->xor_gc,				
-			x_get_darkcolor(w_current->zoom_box_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (ZOOM_BOX_COLOR));
   gdk_draw_rectangle (w_current->drawable, w_current->xor_gc, FALSE,
                       box_left, box_top, box_width, box_height);
 }
diff --git a/gschem/src/gschem_toplevel.c b/gschem/src/gschem_toplevel.c
index d5ab97d..fc72529 100644
--- a/gschem/src/gschem_toplevel.c
+++ b/gschem/src/gschem_toplevel.c
@@ -145,20 +145,6 @@ GSCHEM_TOPLEVEL *gschem_toplevel_new ()
   /* ------------------ */
   /* rc/user parameters */
   /* ------------------ */
-  w_current->graphic_color      = 0;
-  w_current->net_color          = 0;
-  w_current->bus_color          = 0;
-  w_current->pin_color          = 0;
-  w_current->text_color         = 0;
-
-  w_current->logic_bubble_color = 0;
-  w_current->zoom_box_color     = 0;
-  w_current->grid_color         = 0;
-  w_current->select_color       = 0;
-  w_current->bb_color           = 0;
-  w_current->lock_color         = 0;
-  w_current->stroke_color       = 0;
-
   w_current->text_caps = 0;
   w_current->text_size = 0;
 
diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c
index 1715d10..ce44770 100644
--- a/gschem/src/i_vars.c
+++ b/gschem/src/i_vars.c
@@ -36,15 +36,11 @@
 /* Absolute default used when default_... strings are NULL */
 #define DEFAULT_PRINT_COMMAND "lpr"
 
-int   default_graphic_color = GRAPHIC_COLOR;
-int   default_text_color = TEXT_COLOR;
 int   default_text_size = 10;
 int   default_text_caps = LOWER;
 float default_postscript_font_scale = 1.0;
 int   default_attribute_color = ATTRIBUTE_COLOR;
 int   default_detachattr_color = DETACHED_ATTRIBUTE_COLOR;
-int   default_net_color = NET_COLOR;
-int   default_bus_color = BUS_COLOR;
 int   default_net_endpoint_color = NET_ENDPOINT_COLOR;
 int   default_junction_color = JUNCTION_COLOR;
 int   default_override_net_color = -1;
@@ -54,18 +50,11 @@ int   default_net_endpoint_mode = FILLEDBOX;
 int   default_net_midpoint_mode = FILLED;
 int   default_net_direction_mode = TRUE;
 int   default_net_selection_mode = 0;
-int   default_pin_color = PIN_COLOR;
 int   default_pin_style = THICK;
 int   default_net_style = THICK;
 int   default_bus_style = THICK;
 int   default_line_style = THICK;
-int   default_grid_color = GRID_COLOR;
 int   default_background_color = BACKGROUND_COLOR;
-int   default_select_color = SELECT_COLOR;
-int   default_bb_color = BOUNDINGBOX_COLOR;
-int   default_lock_color = LOCK_COLOR;
-int   default_zoom_box_color = ZOOM_BOX_COLOR;
-int   default_logic_bubble_color = LOGIC_BUBBLE_COLOR;
 int   default_actionfeedback_mode = OUTLINE;
 int   default_zoom_with_pan = TRUE;
 int   default_object_clipping = TRUE;
@@ -75,7 +64,6 @@ int   default_embed_complex = FALSE;
 int   default_include_complex = FALSE;
 int   default_text_output = VECTOR_FONTS;
 int   default_snap_size = 100;
-int   default_stroke_color = STROKE_COLOR;
 
 int   default_paper_width = 11000; /* letter size */
 int   default_paper_height = 85000;
@@ -163,28 +151,13 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current)
 
   logging_dest = default_logging_dest;
 
-  w_current->graphic_color = default_graphic_color;
-  w_current->text_color    = default_text_color;
   w_current->text_size     = default_text_size;
   w_current->text_caps     = default_text_caps;
   toplevel->postscript_font_scale = default_postscript_font_scale;
 
-  toplevel->attribute_color    = default_attribute_color;
-  toplevel->detachedattr_color = default_detachattr_color;
-  w_current->logic_bubble_color = default_logic_bubble_color;
-
-  w_current->grid_color       = default_grid_color;
   toplevel->background_color = default_background_color;
-  w_current->select_color     = default_select_color;
-  w_current->stroke_color     = default_stroke_color;
-
-  w_current->bb_color = default_bb_color;
-  w_current->zoom_box_color = default_zoom_box_color;
-  w_current->lock_color = default_lock_color;
 
-  w_current->net_color          = default_net_color;
   toplevel->net_style          = default_net_style;
-  toplevel->net_endpoint_color = default_net_endpoint_color;
   w_current->net_endpoint_mode  = default_net_endpoint_mode;
   w_current->net_midpoint_mode  = default_net_midpoint_mode;
   w_current->net_direction_mode = default_net_direction_mode;
@@ -192,13 +165,9 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current)
 
   toplevel->override_net_color = default_override_net_color;
 
-  toplevel->junction_color = default_junction_color;
-
-  w_current->bus_color          = default_bus_color;
   toplevel->bus_style          = default_bus_style;
   toplevel->override_bus_color = default_override_bus_color;
 
-  w_current->pin_color          = default_pin_color;
   toplevel->pin_style          = default_pin_style;
   toplevel->override_pin_color = default_override_pin_color;
 
diff --git a/gschem/src/o_arc.c b/gschem/src/o_arc.c
index 006543f..1d42f89 100644
--- a/gschem/src/o_arc.c
+++ b/gschem/src/o_arc.c
@@ -302,9 +302,9 @@ void o_arc_end4(GSCHEM_TOPLEVEL *w_current, int radius,
   OBJECT *new_obj;
 
   /* create, initialize and link the new arc object */
-  new_obj = o_arc_new(toplevel, OBJ_ARC, w_current->graphic_color,
-                      w_current->first_wx, w_current->first_wy,
-                      radius, start_angle, end_angle);
+  new_obj = o_arc_new (toplevel, OBJ_ARC, GRAPHIC_COLOR,
+                       w_current->first_wx, w_current->first_wy,
+                       radius, start_angle, end_angle);
   s_page_append (toplevel->page_current, new_obj);
 
   /* draw the new object */
@@ -424,8 +424,7 @@ void o_arc_rubberarc_xor(GSCHEM_TOPLEVEL *w_current)
   WORLDtoSCREEN(toplevel, w_current->first_wx, w_current->first_wy, &cx, &cy);
   radius = SCREENabs(toplevel, w_current->distance);
   
-  gdk_gc_set_foreground(w_current->xor_gc,
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_gc_set_line_attributes(w_current->xor_gc, 0, 
 			     GDK_LINE_SOLID, GDK_CAP_NOT_LAST, 
 			     GDK_JOIN_MITER);
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 254a4e9..555b12b 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -171,7 +171,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
   int left, right, top, bottom;
   OBJECT *o_current;
 
-  color = toplevel->detachedattr_color;
+  color = DETACHED_ATTRIBUTE_COLOR;
 
   o_current = object;
 
@@ -183,25 +183,25 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
       case(OBJ_PLACEHOLDER):
         world_x = o_current->complex->x;
         world_y = o_current->complex->y;
-        color = toplevel->attribute_color;
+        color = ATTRIBUTE_COLOR;
         break;
 
       case(OBJ_ARC):
         world_x = o_current->arc->x;
         world_y = o_current->arc->y;
-        color = toplevel->attribute_color;
+        color = ATTRIBUTE_COLOR;
         break;
 
       case(OBJ_CIRCLE):
         world_x = o_current->circle->center_x;
         world_y = o_current->circle->center_y;
-        color = toplevel->attribute_color;
+        color = ATTRIBUTE_COLOR;
         break;
 
       case(OBJ_BOX):
         world_x = o_current->box->upper_x;
         world_y = o_current->box->upper_y;
-        color = toplevel->attribute_color;
+        color = ATTRIBUTE_COLOR;
         break;
 
       case(OBJ_LINE):
@@ -210,7 +210,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
       case(OBJ_BUS):
         world_x = o_current->line->x[0];
         world_y = o_current->line->y[0];
-        color = toplevel->attribute_color;
+        color = ATTRIBUTE_COLOR;
         break;
 
       case(OBJ_TEXT):
@@ -218,7 +218,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
         world_x = o_current->text->x;
         world_y = o_current->text->y;
 			
-        color = toplevel->detachedattr_color;
+        color = DETACHED_ATTRIBUTE_COLOR;
 
 	o_current = NULL;
         break;
@@ -233,7 +233,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
     world_y = top;  
 
     /* printf("%d %d\n", world_x, world_y); */
-    color = toplevel->detachedattr_color;
+    color = DETACHED_ATTRIBUTE_COLOR;
   }
 
   /* first create text item */
diff --git a/gschem/src/o_box.c b/gschem/src/o_box.c
index 1902fb2..bb22b86 100644
--- a/gschem/src/o_box.c
+++ b/gschem/src/o_box.c
@@ -525,9 +525,9 @@ void o_box_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   }
 
   /* create the object */
-  new_obj = o_box_new(toplevel, OBJ_BOX, w_current->graphic_color,
-                      box_left, box_top,
-                      box_left + box_width, box_top - box_height);
+  new_obj = o_box_new (toplevel, OBJ_BOX, GRAPHIC_COLOR,
+                       box_left, box_top,
+                       box_left + box_width, box_top - box_height);
   s_page_append (toplevel->page_current, new_obj);
 
   /* draw it */
@@ -617,8 +617,7 @@ void o_box_rubberbox_xor(GSCHEM_TOPLEVEL *w_current)
   box_top    = min(y1, y2);
   
   /* draw the box from the previous variables */
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_gc_set_line_attributes(w_current->xor_gc, 0, 
 			     GDK_LINE_SOLID, GDK_CAP_NOT_LAST, 
 			     GDK_JOIN_MITER);
diff --git a/gschem/src/o_bus.c b/gschem/src/o_bus.c
index 032cb32..5403209 100644
--- a/gschem/src/o_bus.c
+++ b/gschem/src/o_bus.c
@@ -224,7 +224,7 @@ int o_bus_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   g_assert( w_current->inside_action != 0 );
 
   if (toplevel->override_bus_color == -1) {
-    color = w_current->bus_color;
+    color = BUS_COLOR;
   } else {
     color = toplevel->override_bus_color;
   }
@@ -361,8 +361,7 @@ void o_bus_rubberbus_xor(GSCHEM_TOPLEVEL *w_current)
                                GDK_JOIN_MITER);
   }
 
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_draw_line (w_current->drawable, w_current->xor_gc, x1, y1, x2, y2);
 
   if (toplevel->bus_style == THICK ) {
diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index d04ce01..f8d6b26 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -521,9 +521,9 @@ void o_circle_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   }
 
   /* create the object */
-  new_obj = o_circle_new(toplevel, OBJ_CIRCLE, w_current->graphic_color,
-                         w_current->first_wx, w_current->first_wy,
-                         w_current->distance);
+  new_obj = o_circle_new (toplevel, OBJ_CIRCLE, GRAPHIC_COLOR,
+                          w_current->first_wx, w_current->first_wy,
+                          w_current->distance);
   s_page_append (toplevel->page_current, new_obj);
 
   /* draw it */
@@ -600,8 +600,7 @@ void o_circle_rubbercircle_xor(GSCHEM_TOPLEVEL *w_current)
   radius = SCREENabs(toplevel, w_current->distance);
 
   /* draw the circle from the w_current variables */
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_draw_line (w_current->drawable, w_current->xor_gc,
                  cx, cy, cx + radius, cy);
   gdk_draw_arc (w_current->drawable, w_current->xor_gc, FALSE,
diff --git a/gschem/src/o_cue.c b/gschem/src/o_cue.c
index 47dbde3..c104804 100644
--- a/gschem/src/o_cue.c
+++ b/gschem/src/o_cue.c
@@ -167,7 +167,7 @@ void o_cue_draw_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *object, int whichon
       if (object->type == OBJ_NET) { /* only nets have these cues */
         if (count < 1) { /* Didn't find anything connected there */
           if (toplevel->DONT_REDRAW == 0) {
-            o_cue_set_color (w_current, toplevel->net_endpoint_color);
+            o_cue_set_color (w_current, NET_ENDPOINT_COLOR);
             cairo_move_to (w_current->cr, screen_x - size, screen_y - size);
             cairo_rel_line_to (w_current->cr, x2size + 1, 0);
             cairo_rel_line_to (w_current->cr, 0, x2size + 1);
@@ -186,7 +186,7 @@ void o_cue_draw_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *object, int whichon
           }
           x2size = 2 * size;
           if (toplevel->DONT_REDRAW == 0) {
-            o_cue_set_color(w_current, toplevel->junction_color);
+            o_cue_set_color (w_current, JUNCTION_COLOR);
             cairo_arc (w_current->cr, screen_x + 0.5, screen_y + 0.5, size, 0, 2. * M_PI);
             cairo_fill (w_current->cr);
 
@@ -205,7 +205,7 @@ void o_cue_draw_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *object, int whichon
           }
 
           if (toplevel->DONT_REDRAW == 0) {
-            o_cue_set_color(w_current, toplevel->net_endpoint_color);
+            o_cue_set_color (w_current, NET_ENDPOINT_COLOR);
             if (object->line->y[whichone] == object->line->y[otherone]) {
               /* horizontal line */
               if (object->line->x[whichone] <= object->line->x[otherone]) {
@@ -251,7 +251,7 @@ void o_cue_draw_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *object, int whichon
       x2size = size * 2;
 
       if (toplevel->DONT_REDRAW == 0) {
-	o_cue_set_color(w_current, toplevel->junction_color);
+        o_cue_set_color (w_current, JUNCTION_COLOR);
         cairo_arc (w_current->cr, screen_x + 0.5, screen_y + 0.5, size, 0, 2. * M_PI);
         cairo_fill (w_current->cr);
       }
@@ -280,7 +280,7 @@ void o_cue_draw_lowlevel_midpoints(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
   if (toplevel->override_color != -1 ) {
     gschem_cairo_set_source_color(w_current->cr, x_color_lookup (w_current->toplevel->override_color));
   } else {
-    gschem_cairo_set_source_color(w_current->cr, x_color_lookup (w_current->toplevel->junction_color));
+    gschem_cairo_set_source_color(w_current->cr, x_color_lookup (JUNCTION_COLOR));
   }
   
   cl_current = object->conn_list;
diff --git a/gschem/src/o_grips.c b/gschem/src/o_grips.c
index 628d755..cafc42c 100644
--- a/gschem/src/o_grips.c
+++ b/gschem/src/o_grips.c
@@ -1584,7 +1584,7 @@ void o_grips_draw(GSCHEM_TOPLEVEL *w_current, int x, int y)
     color = x_get_color(toplevel->override_color);
   } else {
     /* use the normal selection color */
-    color = x_get_color(w_current->select_color);
+    color = x_get_color (SELECT_COLOR);
   }
   /* set the color for the grip */
   gdk_gc_set_foreground(w_current->gc, color);
diff --git a/gschem/src/o_line.c b/gschem/src/o_line.c
index bbc1f48..d5b75ae 100644
--- a/gschem/src/o_line.c
+++ b/gschem/src/o_line.c
@@ -231,10 +231,9 @@ void o_line_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   }
 
   /* create the line object and draw it */
-  new_obj = o_line_new(toplevel, OBJ_LINE,
-                       w_current->graphic_color,
-                       w_current->first_wx, w_current->first_wy,
-                       w_current->second_wx, w_current->second_wy);
+  new_obj = o_line_new (toplevel, OBJ_LINE, GRAPHIC_COLOR,
+                        w_current->first_wx, w_current->first_wy,
+                        w_current->second_wx, w_current->second_wy);
   s_page_append (toplevel->page_current, new_obj);
 
   /* draw it */
@@ -306,7 +305,7 @@ void o_line_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 /*! \brief Draw line from GSCHEM_TOPLEVEL object.
  *  \par Function Description
  *  This function draws a line with an exclusive or function over the sheet.
- *  The color of the box is <B>w_current->select_color</B>. The line is
+ *  The color of the box is <B>SELECT_COLOR</B>. The line is
  *  described by the two points (<B>w_current->first_wx</B>,
  *  <B>w_current->first_wy</B>) and (<B>w_current->second_wx</B>,<B>w_current->second_wy</B>).
  *
@@ -322,8 +321,7 @@ void o_line_rubberline_xor(GSCHEM_TOPLEVEL *w_current)
 
   /* draw the circle from the w_current variables */
   /* with xor-function */
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_gc_set_line_attributes(w_current->xor_gc, 0,
 			     GDK_LINE_SOLID, GDK_CAP_NOT_LAST, 
 			     GDK_JOIN_MITER);
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 7f6586f..dac8ebe 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -119,7 +119,7 @@ void o_lock(GSCHEM_TOPLEVEL *w_current)
       if (object->locked_color == -1) {
         object->sel_func = NULL;
         object->locked_color = object->color;
-        object->color = w_current->lock_color;
+        object->color = LOCK_COLOR;
         w_current->toplevel->page_current->CHANGED=1;
       } else {
         s_log_message(_("Object already locked\n"));
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index af03da9..74d4cdc 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -646,7 +646,7 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   save_wy = w_current->third_wy;
 
   if (toplevel->override_net_color == -1) {
-    color = w_current->net_color;
+    color = NET_COLOR;
   } else {
     color = toplevel->override_net_color;
   }
@@ -844,8 +844,7 @@ void o_net_drawrubber(GSCHEM_TOPLEVEL *w_current)
   }
   size = max(size, 0);
 
-  gdk_gc_set_foreground(w_current->xor_gc,
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
 
   if (w_current->magneticnet_mode) {
     if (w_current->magnetic_wx != -1 && w_current->magnetic_wy != -1) {
@@ -968,7 +967,7 @@ int o_net_add_busrippers(GSCHEM_TOPLEVEL *w_current, OBJECT *net_obj,
   }
 
   if (toplevel->override_net_color == -1) {
-    color = w_current->net_color;
+    color = NET_COLOR;
   } else {
     color = toplevel->override_net_color;
   }
diff --git a/gschem/src/o_path.c b/gschem/src/o_path.c
index 3864620..f9d0da9 100644
--- a/gschem/src/o_path.c
+++ b/gschem/src/o_path.c
@@ -661,7 +661,7 @@ void o_path_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 /*! \brief Draw path from GSCHEM_TOPLEVEL object.
  *  \par Function Description
  *  This function draws a path with an exclusive or function over the sheet.
- *  The color of the box is <B>w_current->select_color</B>. The path is
+ *  The color of the box is <B>SELECT_COLOR</B>. The path is
  *  described by the two points (<B>w_current->first_wx</B>,
  *  <B>w_current->first_wy</B>) and (<B>w_current->second_wx</B>,<B>w_current->second_wy</B>).
  *
@@ -687,8 +687,7 @@ void o_path_rubberpath_xor(GSCHEM_TOPLEVEL *w_current)
     return;
   }
 
-  gdk_gc_set_foreground(w_current->xor_gc,
-                        x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_gc_set_line_attributes(w_current->xor_gc, 0, GDK_LINE_SOLID,
                              GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
 
@@ -734,7 +733,7 @@ static void o_path_xor_control_lines (GSCHEM_TOPLEVEL *w_current,
     gc = w_current->gc;
   } else {
     /* use the normal selection color */
-    color = x_get_darkcolor(w_current->select_color);
+    color = x_get_darkcolor (SELECT_COLOR);
     gc = w_current->outline_xor_gc;
   }
 
diff --git a/gschem/src/o_picture.c b/gschem/src/o_picture.c
index b1b1f5a..0b0ca49 100644
--- a/gschem/src/o_picture.c
+++ b/gschem/src/o_picture.c
@@ -294,8 +294,7 @@ void o_picture_rubberbox_xor(GSCHEM_TOPLEVEL *w_current)
 	 picture_left, picture_top, picture_width, picture_height);
 #endif
   /* draw the picture from the previous variables */
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color)); 
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_gc_set_line_attributes(w_current->xor_gc, 0, 
 			     GDK_LINE_SOLID, GDK_CAP_NOT_LAST, 
 			     GDK_JOIN_MITER);
diff --git a/gschem/src/o_pin.c b/gschem/src/o_pin.c
index 951fb51..121e550 100644
--- a/gschem/src/o_pin.c
+++ b/gschem/src/o_pin.c
@@ -163,7 +163,7 @@ void o_pin_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   g_assert( w_current->inside_action != 0 );
 
   if (toplevel->override_pin_color == -1) {
-    color = w_current->pin_color;
+    color = PIN_COLOR;
   } else {
     color = toplevel->override_pin_color;
   }
@@ -284,8 +284,7 @@ void o_pin_rubberpin_xor(GSCHEM_TOPLEVEL *w_current)
                                GDK_JOIN_MITER);
   }
 
-  gdk_gc_set_foreground(w_current->xor_gc, 
-			x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground (w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_draw_line (w_current->drawable, w_current->xor_gc, x1, y1, x2, y2);
 
   if (toplevel->net_style == THICK ) {
diff --git a/gschem/src/o_place.c b/gschem/src/o_place.c
index 60a16d5..b095c4e 100644
--- a/gschem/src/o_place.c
+++ b/gschem/src/o_place.c
@@ -297,7 +297,8 @@ void o_place_rubberplace_xor (GSCHEM_TOPLEVEL *w_current, int drawing)
     WORLDtoSCREEN(toplevel, left + diff_x, top + diff_y, &s_left, &s_top);
     WORLDtoSCREEN(toplevel, right + diff_x, bottom + diff_y, &s_right, &s_bottom);
 
-    gdk_gc_set_foreground(w_current->bounding_xor_gc, x_get_darkcolor (w_current->bb_color));
+    gdk_gc_set_foreground (w_current->bounding_xor_gc,
+                           x_get_darkcolor (BOUNDINGBOX_COLOR));
     gdk_draw_rectangle (w_current->drawable,
                         w_current->bounding_xor_gc, FALSE,
                         s_left, s_bottom,
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index e69cd7f..f4b960a 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -326,8 +326,7 @@ void o_select_box_rubberband_xor(GSCHEM_TOPLEVEL *w_current)
   box_left = min(x1, x2);
   box_top = min(y1, y2);
 
-  gdk_gc_set_foreground(w_current->xor_gc,
-                        x_get_darkcolor(w_current->select_color));
+  gdk_gc_set_foreground(w_current->xor_gc, x_get_darkcolor (SELECT_COLOR));
   gdk_draw_rectangle (w_current->drawable, w_current->xor_gc,
                       FALSE,
                       box_left, box_top, box_width, box_height);
diff --git a/gschem/src/o_slot.c b/gschem/src/o_slot.c
index 761b111..d827b5a 100644
--- a/gschem/src/o_slot.c
+++ b/gschem/src/o_slot.c
@@ -175,10 +175,10 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, const char *string, int len)
     } else {
       /* here you need to do the add the slot
          attribute since it doesn't exist */
-      new_obj = o_text_new(toplevel, OBJ_TEXT, toplevel->attribute_color,
-                           object->complex->x, object->complex->y,
-                           LOWER_LEFT, 0, /* zero is angle */
-                           string, 10, INVISIBLE, SHOW_NAME_VALUE);
+      new_obj = o_text_new (toplevel, OBJ_TEXT, ATTRIBUTE_COLOR,
+                            object->complex->x, object->complex->y,
+                            LOWER_LEFT, 0, /* zero is angle */
+                            string, 10, INVISIBLE, SHOW_NAME_VALUE);
       s_page_append (toplevel->page_current, new_obj);
 
       /* manually attach attribute */
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index 0700a6e..5ae4189 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -137,8 +137,7 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
                               x_get_color(toplevel->override_color));
       } else {
 
-        gdk_gc_set_foreground(w_current->gc, 
-                              x_get_color(w_current->lock_color));
+        gdk_gc_set_foreground (w_current->gc, x_get_color (LOCK_COLOR));
       }
 
       offset = SCREENabs(toplevel, 10);
@@ -196,8 +195,7 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
                           x_get_color(toplevel->override_color));
   } else {
 
-    gdk_gc_set_foreground(w_current->gc, 
-                          x_get_color(w_current->lock_color));
+    gdk_gc_set_foreground (w_current->gc, x_get_color (LOCK_COLOR));
   }
 
   if (toplevel->DONT_REDRAW == 0) {
@@ -287,14 +285,13 @@ void o_text_prepare_place(GSCHEM_TOPLEVEL *w_current, char *text)
   /* here you need to add OBJ_TEXT when it's done */
   toplevel->page_current->place_list =
     g_list_append(toplevel->page_current->place_list,
-                  o_text_new(toplevel,
-                             OBJ_TEXT, w_current->text_color,
-                             0, 0, LOWER_LEFT, 0, /* zero is angle */
-                             text,
-                             w_current->text_size,
-                             /* has to be visible so you can place it */
-                             /* visibility is set when you create the object */
-                             VISIBLE, SHOW_NAME_VALUE));
+                  o_text_new (toplevel, OBJ_TEXT, TEXT_COLOR,
+                              0, 0, LOWER_LEFT, 0, /* zero is angle */
+                              text,
+                              w_current->text_size,
+                              /* has to be visible so you can place it */
+                              /* visibility is set when you create the object */
+                              VISIBLE, SHOW_NAME_VALUE));
 
   w_current->inside_action = 1;
   i_set_state (w_current, ENDTEXT);
diff --git a/gschem/src/x_grid.c b/gschem/src/x_grid.c
index 54f955e..976635c 100644
--- a/gschem/src/x_grid.c
+++ b/gschem/src/x_grid.c
@@ -93,8 +93,7 @@ void x_grid_draw_region (GSCHEM_TOPLEVEL *w_current,
   printf("y2 %d\n", pix_y(w_current, 200));
 #endif
 
-  gdk_gc_set_foreground(w_current->gc,
-                        x_get_color(w_current->grid_color));
+  gdk_gc_set_foreground(w_current->gc, x_get_color (GRID_COLOR));
 
   SCREENtoWORLD (toplevel, x - 1, y + height + 1, &x_start, &y_start);
   SCREENtoWORLD (toplevel, x + width + 1, y - 1, &x_end, &y_end);
@@ -166,7 +165,7 @@ void x_draw_tiles(GSCHEM_TOPLEVEL *w_current)
   int width, height;
   char *tempstring;
 
-  gdk_gc_set_foreground(w_current->gc, x_get_color(w_current->lock_color));
+  gdk_gc_set_foreground (w_current->gc, x_get_color (LOCK_COLOR));
 
   font = gdk_fontset_load ("fixed");
   for (j = 0; j < MAX_TILES_Y; j++) {
diff --git a/gschem/src/x_stroke.c b/gschem/src/x_stroke.c
index 3c0fc9c..c3b5216 100644
--- a/gschem/src/x_stroke.c
+++ b/gschem/src/x_stroke.c
@@ -102,8 +102,7 @@ x_stroke_record (GSCHEM_TOPLEVEL *w_current, gint x, gint y)
 
     g_array_append_val (stroke_points, point);
 
-    gdk_gc_set_foreground (w_current->gc,
-                           x_get_color (w_current->stroke_color));
+    gdk_gc_set_foreground (w_current->gc, x_get_color (STROKE_COLOR));
     gdk_draw_point (w_current->window, w_current->gc, x, y);
   }
 
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index ddfb00a..f1d0cfe 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -482,11 +482,7 @@ struct st_toplevel {
   int snap_size;		
 
   /* BLOCK SET IN GSCHEM, BUT USED IN LIBGEDA - NEEDS A RETHINK */
-  int attribute_color;
-  int detachedattr_color;
   int background_color;
-  int net_endpoint_color;
-  int junction_color;
   int override_net_color;
   int override_bus_color;
   int override_pin_color;
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 0e026cb..1c576d7 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -121,7 +121,7 @@ void o_attrib_free(TOPLEVEL *toplevel, OBJECT *current)
 
   /* \todo this makes me nervous... very nervous */
   current->attached_to=NULL;
-  current->color = toplevel->detachedattr_color;
+  current->color = DETACHED_ATTRIBUTE_COLOR;
 
   if (current->type == OBJ_TEXT) {
     o_complex_set_color(current->text->prim_objs,
@@ -133,12 +133,12 @@ void o_attrib_free(TOPLEVEL *toplevel, OBJECT *current)
   /* \todo not sure on this */
   if (current->saved_color != -1) {
     if (current->type == OBJ_TEXT) {
-      o_complex_set_saved_color_only(current->text->prim_objs,
-                                     toplevel->detachedattr_color);
+      o_complex_set_saved_color_only (current->text->prim_objs,
+                                      DETACHED_ATTRIBUTE_COLOR);
     } else {
       printf("Tried to set the color on a complex!\nlibgeda/src/o_attrib_free 2\n");
     }
-    current->saved_color = toplevel->detachedattr_color;
+    current->saved_color = DETACHED_ATTRIBUTE_COLOR;
   }
 }
 
@@ -178,10 +178,10 @@ void o_attrib_attach (TOPLEVEL *toplevel, OBJECT *attrib, OBJECT *object,
 
   if (set_color) {
     if (attrib->saved_color == -1) {
-      attrib->color = toplevel->attribute_color;
+      attrib->color = ATTRIBUTE_COLOR;
       o_complex_set_color (attrib->text->prim_objs, attrib->color);
     } else {
-      attrib->saved_color = toplevel->attribute_color;
+      attrib->saved_color = ATTRIBUTE_COLOR;
       o_complex_set_saved_color_only (attrib->text->prim_objs, attrib->saved_color);
     }
   }
@@ -477,14 +477,14 @@ void o_attrib_set_color(TOPLEVEL *toplevel, GList *attributes)
         o_complex_set_color(a_current->text->prim_objs, SELECT_COLOR);
         a_current->color = SELECT_COLOR;
 
-        o_complex_set_saved_color_only(a_current->text->prim_objs,
-                                       toplevel->attribute_color);
-        a_current->saved_color = toplevel->attribute_color;
+        o_complex_set_saved_color_only (a_current->text->prim_objs,
+                                        ATTRIBUTE_COLOR);
+        a_current->saved_color = ATTRIBUTE_COLOR;
 
       } else {
-        o_complex_set_color(a_current->text->prim_objs,
-                            toplevel->attribute_color);
-        a_current->color = toplevel->attribute_color;
+        o_complex_set_color (a_current->text->prim_objs,
+                             ATTRIBUTE_COLOR);
+        a_current->color = ATTRIBUTE_COLOR;
       }
     }
 
diff --git a/libgeda/src/s_cue.c b/libgeda/src/s_cue.c
index d53536a..c2a7511 100644
--- a/libgeda/src/s_cue.c
+++ b/libgeda/src/s_cue.c
@@ -46,7 +46,7 @@ void s_cue_postscript_fillbox(TOPLEVEL * toplevel, FILE * fp, int x,
   offset = CUE_BOX_SIZE;
   offset2 = offset*2;
 
-  f_print_set_color(toplevel, fp, toplevel->net_endpoint_color);
+  f_print_set_color(toplevel, fp, NET_ENDPOINT_COLOR);
 
   fprintf(fp, "%d %d %d %d fbox\n", 
 	   offset2, offset2, x-offset, y-offset);
@@ -68,7 +68,7 @@ void s_cue_postscript_fillcircle(TOPLEVEL * toplevel, FILE * fp,
     offset2 = CUE_CIRCLE_SMALL_SIZE;
   }
 
-  f_print_set_color(toplevel, fp, toplevel->junction_color);
+  f_print_set_color(toplevel, fp, JUNCTION_COLOR);
 
   fprintf(fp, "newpath\n");
   fprintf(fp, "%d %d\n", x, y);
diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
index 0a37cc8..d4631ef 100644
--- a/libgeda/src/s_toplevel.c
+++ b/libgeda/src/s_toplevel.c
@@ -78,11 +78,7 @@ TOPLEVEL *s_toplevel_new (void)
   toplevel->snap_size = 100;
 
   /* BLOCK SET IN GSCHEM, BUT USED IN LIBGEDA - NEEDS A RETHINK */
-  toplevel->attribute_color    = 0;
-  toplevel->detachedattr_color = 0;
   toplevel->background_color   = 0;
-  toplevel->net_endpoint_color = 0;
-  toplevel->junction_color     = 0;
   toplevel->override_net_color = -1;
   toplevel->override_bus_color = -1;
   toplevel->override_pin_color = -1;

commit 1843d875be92a4935c3581a1f24e7a33f8f76042
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Dec 25 15:36:58 2008 +0000

    gschem: Invalidate region to erase damage due to stroke trails
    
    We don't erase things by painting to the background colour any more,
    that leaves drawing artifacts.

diff --git a/gschem/src/x_stroke.c b/gschem/src/x_stroke.c
index 2a1ba57..3c0fc9c 100644
--- a/gschem/src/x_stroke.c
+++ b/gschem/src/x_stroke.c
@@ -128,20 +128,29 @@ gint
 x_stroke_translate_and_execute (GSCHEM_TOPLEVEL *w_current)
 {
   gchar sequence[STROKE_MAX_SEQUENCE];
+  StrokePoint *point;
+  int min_x, min_y, max_x, max_y;
   gint i;
 
   g_assert (stroke_points != NULL);
 
-  /* erase footprint */
-  for (i = 0; i < stroke_points->len; i++) {
-    StrokePoint *point = &g_array_index (stroke_points, StrokePoint, i);
+  if (stroke_points->len == 0)
+    return 0;
 
-    gdk_gc_set_foreground (w_current->gc,
-                           x_get_color (
-                             w_current->toplevel->background_color));
-    gdk_draw_point (w_current->window, w_current->gc,
-                    point->x, point->y);
+  point = &g_array_index (stroke_points, StrokePoint, 0);
+  min_x = max_x = point->x;
+  min_y = max_y = point->y;
+
+  for (i = 1; i < stroke_points->len; i++) {
+    point = &g_array_index (stroke_points, StrokePoint, i);
+    min_x = min (min_x, point->x);
+    min_y = min (min_y, point->y);
+    max_x = max (max_x, point->x);
+    max_y = max (max_y, point->y);
   }
+
+  o_invalidate_rect (w_current, min_x, min_y, max_x + 1, max_y + 1);
+
   /* resets length of array */
   stroke_points->len = 0;
 




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