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

gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-92-g2dc3c8d)



The branch, master has been updated
       via  2dc3c8dad90b4b02a962929edf2b6ce5b75939aa (commit)
       via  12052ab6b3e17d275ee63a08f03305fbfee4c93b (commit)
       via  5f52ce5d7f4be7ee1eb2246b896135d01fb320c0 (commit)
      from  a13db9af93154fe25d39abe52a82fa369bdfc62b (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
=========

 gnetlist/src/s_net.c                |    2 +-
 gnetlist/src/s_netattrib.c          |    2 +-
 gschem/include/prototype.h          |    1 +
 gschem/src/o_arc.c                  |   20 +---
 gschem/src/o_attrib.c               |    2 +-
 gschem/src/o_basic.c                |   43 ++++++++
 gschem/src/o_box.c                  |   24 +---
 gschem/src/o_bus.c                  |   28 +----
 gschem/src/o_circle.c               |   24 +---
 gschem/src/o_delete.c               |    2 +-
 gschem/src/o_line.c                 |   21 +---
 gschem/src/o_misc.c                 |    2 +-
 gschem/src/o_move.c                 |    3 +-
 gschem/src/o_net.c                  |   28 +----
 gschem/src/o_path.c                 |   27 ++----
 gschem/src/o_picture.c              |   11 +--
 gschem/src/o_pin.c                  |   20 +---
 gschem/src/o_text.c                 |   13 +--
 gschem/src/x_dialog.c               |   25 +----
 libgeda/include/libgeda/prototype.h |    8 +-
 libgeda/include/libgeda/struct.h    |    4 +-
 libgeda/src/a_basic.c               |    2 +-
 libgeda/src/o_arc_basic.c           |   19 +---
 libgeda/src/o_attrib.c              |   11 +--
 libgeda/src/o_box_basic.c           |   20 +---
 libgeda/src/o_bus_basic.c           |   19 +---
 libgeda/src/o_circle_basic.c        |   19 +---
 libgeda/src/o_complex_basic.c       |  204 +----------------------------------
 libgeda/src/o_line_basic.c          |   19 +---
 libgeda/src/o_list.c                |    4 +-
 libgeda/src/o_net_basic.c           |   19 +---
 libgeda/src/o_path_basic.c          |   19 +---
 libgeda/src/o_picture.c             |    6 +-
 libgeda/src/o_pin_basic.c           |   19 +---
 libgeda/src/o_selection.c           |   33 +------
 libgeda/src/o_text_basic.c          |   40 +++----
 libgeda/src/s_basic.c               |    3 +-
 37 files changed, 154 insertions(+), 612 deletions(-)


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

commit 2dc3c8dad90b4b02a962929edf2b6ce5b75939aa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove OBJECT->saved_color field
    
    Rather than resetting the color of selected objects, we instead add a
    helper function, o_drawing_color(), which decides at drawing time what
    color an OBJECT should be drawn.
    
    o_drawing_color() checks if there are any color overrides in effect,
    and whether the OBJECT (or its parent, in the case of TEXT or COMPLEX
    prim_objs) is selected.
    
    Remove now unused functions:
      o_complex_set_color_save ();
      o_complex_unset_color ();
      o_complex_unset_color_single ();
      o_complex_set_saved_color_only ();

:100644 100644 ea94a98... 468399c... M	gschem/include/prototype.h
:100644 100644 594796e... f677b68... M	gschem/src/o_arc.c
:100644 100644 f8c4ccf... 86ef2f6... M	gschem/src/o_attrib.c
:100644 100644 4c23f38... 8c4a915... M	gschem/src/o_basic.c
:100644 100644 8c5207b... 36f2080... M	gschem/src/o_box.c
:100644 100644 70d90ff... d9a92bf... M	gschem/src/o_bus.c
:100644 100644 5f91cef... 67c5505... M	gschem/src/o_circle.c
:100644 100644 913bb85... 6ac1dc3... M	gschem/src/o_line.c
:100644 100644 76eca40... ee305e7... M	gschem/src/o_move.c
:100644 100644 cd738ff... f2a68c5... M	gschem/src/o_net.c
:100644 100644 3935eab... fc0140e... M	gschem/src/o_path.c
:100644 100644 07e137e... f4e0140... M	gschem/src/o_picture.c
:100644 100644 28866e0... 6a05f2f... M	gschem/src/o_pin.c
:100644 100644 a3ef176... 0a2b888... M	gschem/src/o_text.c
:100644 100644 fdb79a4... 54ce953... M	gschem/src/x_dialog.c
:100644 100644 b4013ee... c72abf5... M	libgeda/include/libgeda/prototype.h
:100644 100644 b2230f8... 2606798... M	libgeda/include/libgeda/struct.h
:100644 100644 6a6e11b... 3a7d3d6... M	libgeda/src/o_arc_basic.c
:100644 100644 92a7ffd... ce563cb... M	libgeda/src/o_attrib.c
:100644 100644 5c749de... 9c9d336... M	libgeda/src/o_box_basic.c
:100644 100644 4c1a899... 4f41895... M	libgeda/src/o_bus_basic.c
:100644 100644 f572d68... 586efa5... M	libgeda/src/o_circle_basic.c
:100644 100644 6e72ffd... c75310d... M	libgeda/src/o_complex_basic.c
:100644 100644 dec2ec5... a0462d1... M	libgeda/src/o_line_basic.c
:100644 100644 5ae3127... ac91886... M	libgeda/src/o_list.c
:100644 100644 1891304... 4ba97b7... M	libgeda/src/o_net_basic.c
:100644 100644 deae1b4... 991d6cc... M	libgeda/src/o_path_basic.c
:100644 100644 b9feb70... 21c0ff1... M	libgeda/src/o_picture.c
:100644 100644 9f8aa3b... 858b820... M	libgeda/src/o_pin_basic.c
:100644 100644 8ebe915... bb9fd97... M	libgeda/src/o_selection.c
:100644 100644 b0dcebb... 4439dd4... M	libgeda/src/o_text_basic.c
:100644 100644 3b4802c... 7ac3134... M	libgeda/src/s_basic.c

commit 12052ab6b3e17d275ee63a08f03305fbfee4c93b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Set the OBJECT->parent field on text prim_objs
    
    This allows us to keep track of the ownership of TEXT prim_objs.

:100644 100644 304e0f9... b0dcebb... M	libgeda/src/o_text_basic.c

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

    Rename OBJECT->complex_parent field to OBJECT->parent
    
    We might wish to track the ownership of text prim_objs as well
    as complex, so calling this field complex_parent is confusing.

:100644 100644 d3f57c3... 9b63a9e... M	gnetlist/src/s_net.c
:100644 100644 0467b31... b813869... M	gnetlist/src/s_netattrib.c
:100644 100644 0c0796c... 11fa039... M	gschem/src/o_delete.c
:100644 100644 cacfe02... 852267a... M	gschem/src/o_misc.c
:100644 100644 0ecd5a0... b2230f8... M	libgeda/include/libgeda/struct.h
:100644 100644 6038eef... e6fbdc0... M	libgeda/src/a_basic.c
:100644 100644 5bc6a90... 92a7ffd... M	libgeda/src/o_attrib.c
:100644 100644 a3bf769... 6e72ffd... M	libgeda/src/o_complex_basic.c
:100644 100644 a77008c... 3b4802c... M	libgeda/src/s_basic.c

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

commit 2dc3c8dad90b4b02a962929edf2b6ce5b75939aa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove OBJECT->saved_color field
    
    Rather than resetting the color of selected objects, we instead add a
    helper function, o_drawing_color(), which decides at drawing time what
    color an OBJECT should be drawn.
    
    o_drawing_color() checks if there are any color overrides in effect,
    and whether the OBJECT (or its parent, in the case of TEXT or COMPLEX
    prim_objs) is selected.
    
    Remove now unused functions:
      o_complex_set_color_save ();
      o_complex_unset_color ();
      o_complex_unset_color_single ();
      o_complex_set_saved_color_only ();

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index ea94a98..468399c 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -504,6 +504,7 @@ void o_invalidate_rect(GSCHEM_TOPLEVEL *w_current, int x1, int y1, int x2, int y
 void o_invalidate_all(GSCHEM_TOPLEVEL *w_current);
 void o_invalidate(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
 void o_invalidate_glist(GSCHEM_TOPLEVEL *w_current, GList *list);
+COLOR *o_drawing_color(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
 /* o_box.c */
 void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_box_fill_hollow(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
diff --git a/gschem/src/o_arc.c b/gschem/src/o_arc.c
index 594796e..f677b68 100644
--- a/gschem/src/o_arc.c
+++ b/gschem/src/o_arc.c
@@ -44,7 +44,6 @@
 void o_arc_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  COLOR *color;
 
   if (o_current->arc == NULL) {
     return;
@@ -53,11 +52,6 @@ void o_arc_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   if (toplevel->DONT_REDRAW == 1)
     return;
 
-  if (toplevel->override_color != -1 )
-    color = x_color_lookup (toplevel->override_color);
-  else
-    color = x_color_lookup (o_current->color);
-
   gschem_cairo_arc (w_current, o_current->line_width,
                                o_current->arc->x,
                                o_current->arc->y,
@@ -65,7 +59,8 @@ void o_arc_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
                                o_current->arc->start_angle,
                                o_current->arc->end_angle);
 
-  gschem_cairo_set_source_color (w_current, color);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   gschem_cairo_stroke (w_current, o_current->line_type,
                                   o_current->line_end,
                                   o_current->line_width,
@@ -109,23 +104,16 @@ void o_arc_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
  */
 void o_arc_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
-  int color;
-
   g_return_if_fail (o_current->arc != NULL);
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   gschem_cairo_arc (w_current, 0, o_current->arc->x + dx,
                                   o_current->arc->y + dy,
                                   o_current->arc->width / 2,
                                   o_current->arc->start_angle,
                                   o_current->arc->end_angle);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index f8c4ccf..86ef2f6 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -62,7 +62,7 @@ void o_attrib_add_selected(GSCHEM_TOPLEVEL *w_current, SELECTION *selection,
     a_current = a_iter->data;
 
     /* make sure object isn't selected already */
-    if (a_current->saved_color == -1) {
+    if (!a_current->selected) {
       o_selection_add (w_current->toplevel, selection, a_current);
       o_invalidate (w_current, a_current);
     }
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 4c23f38..8c4a915 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -574,3 +574,46 @@ void o_invalidate_glist (GSCHEM_TOPLEVEL *w_current, GList *list)
     o_invalidate_rect (w_current, s_left, s_top, s_right, s_bottom);
   }
 }
+
+
+/*! \brief Returns the color an object should be drawn in
+ *
+ *  \par Function Description
+ *  This function looks up and returns either the SELECT_COLOR, or the
+ *  OBJECT's natural colour, as appropriate. If toplevel->override_color
+ *  is set, that takes precedence.
+ *
+ *  The complex_parent field of the OBEJCT structure is used to recurse
+ *  down and check whether the OBEJCT being drawn is a prim_obj belonging
+ *  to some selected OBJECT. If so, SELECT_COLOR is used.
+ *
+ *  As a convenience, the appropriate color index is looked up using
+ *  x_color_lookup(), so that code is not duplicated in each drawing
+ *  function.
+ *
+ *  \param [in] w_current  The GSCHEM_TOPLEVEL object.
+ *  \param [in] object     The OBJECT whos color to return.
+ */
+COLOR *o_drawing_color (GSCHEM_TOPLEVEL *w_current, OBJECT *object)
+{
+  int color_idx;
+  OBJECT *temp;
+
+  color_idx = object->color;
+
+  if (object->selected)
+    color_idx = SELECT_COLOR;
+
+  /* Check if the object, or its parent(s) are selected */
+  for (temp = object; temp != NULL; temp = temp->complex_parent) {
+    if (temp->selected) {
+      color_idx = SELECT_COLOR;
+      break;
+    }
+  }
+
+  if (w_current->toplevel->override_color != -1)
+    color_idx = w_current->toplevel->override_color;
+
+  return x_color_lookup (color_idx);
+}
diff --git a/gschem/src/o_box.c b/gschem/src/o_box.c
index 8c5207b..36f2080 100644
--- a/gschem/src/o_box.c
+++ b/gschem/src/o_box.c
@@ -58,7 +58,6 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int angle1, pitch1, angle2, pitch2;
-  COLOR *color;
   FILL_FUNC fill_func;
 
   if (o_current->box == NULL) {
@@ -73,12 +72,6 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
    * draw the outline, the second is to draw the filling pattern inside
    * (if any). Finally the function takes care of the grips.
    */
-  if (toplevel->override_color != -1 ) {  /* Override */
-    color = x_color_lookup (toplevel->override_color);
-  } else {
-    color = x_color_lookup (o_current->color);
-  }
-
   /*
    * The values describing the line type are extracted from the <B>o_current</B>
    * pointed structure. These are the width of the line, the field called
@@ -164,11 +157,13 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     fill_func = o_box_fill_fill;
   }
 
-  (*fill_func) (w_current->drawable, w_current->gc, color,
+  (*fill_func) (w_current->drawable, w_current->gc,
+                o_drawing_color (w_current, o_current),
                 w_current, o_current->box,
                 o_current->fill_width, angle1, pitch1, angle2, pitch2);
 
-  gschem_cairo_set_source_color (w_current, color);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   gschem_cairo_box (w_current, o_current->line_width,
                     o_current->box->lower_x, o_current->box->lower_y,
                     o_current->box->upper_x, o_current->box->upper_y);
@@ -376,23 +371,16 @@ void o_box_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
  */
 void o_box_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
-  int color;
-
   if (o_current->box == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   gschem_cairo_box (w_current, 0, o_current->box->upper_x + dx,
                                   o_current->box->upper_y + dy,
                                   o_current->box->lower_x + dx,
                                   o_current->box->lower_y + dy);
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 1, -1, -1);
 }
 
diff --git a/gschem/src/o_bus.c b/gschem/src/o_bus.c
index 70d90ff..d9a92bf 100644
--- a/gschem/src/o_bus.c
+++ b/gschem/src/o_bus.c
@@ -55,14 +55,10 @@ void o_bus_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   if (toplevel->bus_style == THICK)
     size = BUS_WIDTH;
 
-  if (toplevel->override_color != -1 ) {
-    gschem_cairo_set_source_color (w_current, x_color_lookup (toplevel->override_color));
-  } else {
-    gschem_cairo_set_source_color (w_current, x_color_lookup (o_current->color));
-  }
-
   gschem_cairo_line (w_current, END_SQUARE, size, x1, y1, x2, y2);
 
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_SQUARE, size, -1, -1);
 
   if (o_current->selected && w_current->draw_grips) {
@@ -79,18 +75,11 @@ void o_bus_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 void o_bus_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
   int size = 0;
-  int color;
 
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   if (w_current->toplevel->bus_style == THICK)
     size = BUS_WIDTH;
 
@@ -98,7 +87,8 @@ void o_bus_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cur
                      o_current->line->x[0] + dx, o_current->line->y[0] + dy,
                      o_current->line->x[1] + dx, o_current->line->y[1] + dy);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, size, -1, -1);
 }
 
@@ -110,19 +100,12 @@ void o_bus_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cur
 void o_bus_draw_stretch (GSCHEM_TOPLEVEL *w_current,
                          int dx, int dy, int whichone, OBJECT *o_current)
 {
-  int color;
   int dx1= - 1, dy1 = - 1, dx2 = -1, dy2 = -1;
 
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   if (whichone == 0) {
     dx1 = dx;
     dy1 = dy;
@@ -139,7 +122,8 @@ void o_bus_draw_stretch (GSCHEM_TOPLEVEL *w_current,
                      o_current->line->x[0] + dx1, o_current->line->y[0] + dy1,
                      o_current->line->x[1] + dx2, o_current->line->y[1] + dy2);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index 5f91cef..67c5505 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -51,7 +51,6 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int angle1, pitch1, angle2, pitch2;
-  COLOR *color;
   FILL_FUNC fill_func;
 
   if (o_current->circle == NULL) {
@@ -71,12 +70,6 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
    *
    * Finally the function takes care of the grips.
    */
-  if (toplevel->override_color != -1 ) {
-    color = x_color_lookup (toplevel->override_color);
-  } else {
-    color = x_color_lookup (o_current->color);
-  }
-
 
   /*
    * The values needed for the fill operation are taken from the
@@ -146,7 +139,8 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   }
 
   (*fill_func) (w_current->drawable, w_current->gc,
-                color, w_current, o_current->circle,
+                o_drawing_color (w_current, o_current),
+                w_current, o_current->circle,
                 o_current->fill_width, angle1, pitch1, angle2, pitch2);
 
   gschem_cairo_arc (w_current, o_current->line_width,
@@ -154,7 +148,8 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
                                o_current->circle->center_y,
                                o_current->circle->radius, 0, 360);
 
-  gschem_cairo_set_source_color (w_current, color);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   if (o_current->fill_type == FILLING_FILL)
     cairo_fill_preserve (w_current->cr);
   gschem_cairo_stroke (w_current, o_current->line_type,
@@ -368,21 +363,14 @@ void o_circle_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
  */
 void o_circle_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
-  int color;
-
   g_return_if_fail (o_current->circle != NULL);
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   gschem_cairo_arc (w_current, 0, o_current->circle->center_x + dx,
                                   o_current->circle->center_y + dy,
                                   o_current->circle->radius, 0, 360);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_line.c b/gschem/src/o_line.c
index 913bb85..6ac1dc3 100644
--- a/gschem/src/o_line.c
+++ b/gschem/src/o_line.c
@@ -45,7 +45,6 @@ void o_line_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int x1, y1, x2, y2;
-  COLOR *color;
 
   if (o_current->line == NULL) {
     return;
@@ -56,17 +55,12 @@ void o_line_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     return;
   }
 
-  if (toplevel->override_color != -1)
-    color = x_color_lookup (toplevel->override_color);
-  else
-    color = x_color_lookup (o_current->color);
-
-
   gschem_cairo_line (w_current, o_current->line_end,
                                 o_current->line_width,
                                 x1, y1, x2, y2);
 
-  gschem_cairo_set_source_color (w_current, color);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   gschem_cairo_stroke (w_current, o_current->line_type,
                                   o_current->line_end,
                                   o_current->line_width,
@@ -106,22 +100,15 @@ void o_line_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
  */
 void o_line_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
-  int color;
-
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   gschem_cairo_line (w_current, END_NONE, 0,
                      o_current->line->x[0] + dx, o_current->line->y[0] + dy,
                      o_current->line->x[1] + dx, o_current->line->y[1] + dy);
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 76eca40..ee305e7 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -493,8 +493,7 @@ void o_move_check_endpoint(GSCHEM_TOPLEVEL *w_current, OBJECT * object)
       continue;
 
     /* really make sure that the object is not selected */
-    if (c_current->other_object->saved_color != -1 ||
-        c_current->other_object->selected == TRUE)
+    if (c_current->other_object->selected)
       continue;
 
     if (c_current->type != CONN_ENDPOINT &&
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index cd738ff..f2a68c5 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -98,13 +98,9 @@ void o_net_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   if (toplevel->net_style == THICK)
     size = NET_WIDTH;
 
-  if (toplevel->override_color != -1 ) {
-    gschem_cairo_set_source_color (w_current, x_color_lookup (toplevel->override_color));
-  } else {
-    gschem_cairo_set_source_color (w_current, x_color_lookup (o_current->color));
-  }
-
   gschem_cairo_line (w_current, END_SQUARE, size, x1, y1, x2, y2);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_SQUARE, size, -1, -1);
 
   if (o_current->selected && w_current->draw_grips) {
@@ -121,25 +117,19 @@ void o_net_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 void o_net_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
   int size = 0;
-  int color;
 
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   if (w_current->toplevel->net_style == THICK)
     size = NET_WIDTH;
 
   gschem_cairo_line (w_current, END_NONE, size,
                      o_current->line->x[0] + dx, o_current->line->y[0] + dy,
                      o_current->line->x[1] + dx, o_current->line->y[1] + dy);
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, size, -1, -1);
 }
 
@@ -151,19 +141,12 @@ void o_net_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cur
 void o_net_draw_stretch (GSCHEM_TOPLEVEL *w_current,
                          int dx, int dy, int whichone, OBJECT *o_current)
 {
-  int color;
   int dx1 = -1, dx2 = -1, dy1 = -1,dy2 = -1;
 
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   if (whichone == 0) {
     dx1 = dx;
     dy1 = dy;
@@ -180,7 +163,8 @@ void o_net_draw_stretch (GSCHEM_TOPLEVEL *w_current,
                      o_current->line->x[0] + dx1, o_current->line->y[0] + dy1,
                      o_current->line->x[1] + dx2, o_current->line->y[1] + dy2);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_path.c b/gschem/src/o_path.c
index 3935eab..fc0140e 100644
--- a/gschem/src/o_path.c
+++ b/gschem/src/o_path.c
@@ -300,8 +300,6 @@ void o_path_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   int angle1, pitch1, angle2, pitch2;
   FILL_FUNC fill_func;
 
-  COLOR *color;
-
   if (path == NULL) {
     return;
   }
@@ -309,12 +307,6 @@ void o_path_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   if (toplevel->DONT_REDRAW == 1)
     return;
 
-  if (toplevel->override_color != -1 ) {
-    color = x_color_lookup (toplevel->override_color);
-  } else {
-    color = x_color_lookup (o_current->color);
-  }
-
   angle1 = o_current->fill_angle1;
   pitch1 = o_current->fill_pitch1;
   angle2 = o_current->fill_angle2;
@@ -360,12 +352,15 @@ void o_path_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     fill_func = o_path_fill_fill;
   }
 
-  (*fill_func) (w_current->drawable, w_current->gc, color,
-                w_current, path, o_current->fill_width, angle1, pitch1, angle2, pitch2);
+  (*fill_func) (w_current->drawable, w_current->gc,
+                o_drawing_color (w_current, o_current),
+                w_current, path, o_current->fill_width,
+                angle1, pitch1, angle2, pitch2);
 
   path_path (w_current, o_current);
 
-  gschem_cairo_set_source_color (w_current, color);
+  gschem_cairo_set_source_color (w_current,
+                                 o_drawing_color (w_current, o_current));
 
   if (o_current->fill_type == FILLING_FILL)
     cairo_fill_preserve (w_current->cr);
@@ -457,7 +452,6 @@ void o_path_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
 void o_path_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
   OBJECT object;
-  int color;
 
   g_return_if_fail (o_current->path != NULL);
 
@@ -465,17 +459,12 @@ void o_path_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cu
   object.line_width = 0; /* clamped to 1 pixel in circle_path */
   object.path = path_copy_modify (o_current->path, dx, dy, 0, 0, -1);
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   path_path (w_current, &object);
   g_free (object.path->sections);
   g_free (object.path);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_picture.c b/gschem/src/o_picture.c
index 07e137e..f4e0140 100644
--- a/gschem/src/o_picture.c
+++ b/gschem/src/o_picture.c
@@ -419,24 +419,17 @@ void o_picture_draw_grips(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
  */
 void o_picture_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
-  int color;
-
   if (o_current->picture == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   gschem_cairo_box (w_current, 0, o_current->picture->upper_x + dx,
                                   o_current->picture->upper_y + dy,
                                   o_current->picture->lower_x + dx,
                                   o_current->picture->lower_y + dy);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
 }
 
diff --git a/gschem/src/o_pin.c b/gschem/src/o_pin.c
index 28866e0..6a05f2f 100644
--- a/gschem/src/o_pin.c
+++ b/gschem/src/o_pin.c
@@ -38,7 +38,6 @@ void o_pin_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   TOPLEVEL *toplevel = w_current->toplevel;
   int x1, y1, x2, y2;
   int size = 0;
-  COLOR *color;
 
   if (o_current->line == NULL) {
     return;
@@ -50,19 +49,14 @@ void o_pin_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     return;
   }
 
-  if (toplevel->override_color != -1 ) {
-    color = x_color_lookup (toplevel->override_color);
-  } else {
-    color = x_color_lookup (o_current->color);
-  }
-
   if (toplevel->DONT_REDRAW == 0) {
     if (toplevel->pin_style == THICK)
       size = o_current->line_width;
 
     gschem_cairo_line (w_current, END_NONE, size, x1, y1, x2, y2);
 
-    gschem_cairo_set_source_color (w_current, color);
+    gschem_cairo_set_source_color (w_current,
+                                   o_drawing_color (w_current, o_current));
     gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, size, -1, -1);
   }
 
@@ -88,18 +82,11 @@ void o_pin_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cur
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int size = 0;
-  int color;
 
   if (o_current->line == NULL) {
     return;
   }
 
-  if (o_current->saved_color != -1) {
-    color = o_current->saved_color;
-  } else {
-    color = o_current->color;
-  }
-
   if (toplevel->pin_style == THICK)
     size = o_current->line_width;
 
@@ -107,7 +94,8 @@ void o_pin_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cur
                      o_current->line->x[0] + dx, o_current->line->y[0] + dy,
                      o_current->line->x[1] + dx, o_current->line->y[1] + dy);
 
-  gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+  gschem_cairo_set_source_color (w_current,
+                                 x_color_lookup_dark (o_current->color));
   gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, size, -1, -1);
 }
 
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index a3ef176..0a2b888 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -228,7 +228,7 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 void o_text_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  int color, factor;
+  int factor;
 
   if (o_current->visibility == INVISIBLE && !toplevel->show_hidden_text) {
     return;
@@ -244,17 +244,12 @@ void o_text_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cu
     /* text is too small so go through and draw a line in
        it's place */
 
-    if (o_current->saved_color != -1) {
-      color = o_current->saved_color;
-    } else {
-      color = o_current->color;
-    }
-
     gschem_cairo_box (w_current, 0,
                       o_current->w_left  + dx, o_current->w_bottom + dy,
                       o_current->w_right + dx, o_current->w_top    + dy);
 
-    gschem_cairo_set_source_color (w_current, x_color_lookup_dark (color));
+    gschem_cairo_set_source_color (w_current,
+                                   x_color_lookup_dark (o_current->color));
     gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, 0, -1, -1);
   }
 }
@@ -340,7 +335,7 @@ void o_text_edit_end(GSCHEM_TOPLEVEL *w_current, char *string, int len, int text
 
         /* probably the text object should be extended to carry a color */
         /* and we should pass it here with a function parameter (?) */
-        object->saved_color = w_current->edit_color;
+        object->color = w_current->edit_color;
 
         /* only change text string if there is only ONE text object selected */
         if (numselect == 1 && string) {
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index fdb79a4..54ce953 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -2511,7 +2511,7 @@ create_color_menu (GSCHEM_TOPLEVEL *w_current)
 
   obj = o_select_return_first_object (w_current);
   if (obj != NULL)
-    w_current->edit_color = obj->saved_color;
+    w_current->edit_color = obj->color;
 
   /* The columns are: name of color, index of color. */
   store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
@@ -2573,27 +2573,8 @@ void color_edit_dialog_apply(GtkWidget *w, GSCHEM_TOPLEVEL *w_current)
       exit(-1);
     }
 
-    switch(object->type) {
-      case(OBJ_LINE):
-      case(OBJ_BOX):
-      case(OBJ_CIRCLE):
-      case(OBJ_NET):
-      case(OBJ_BUS):
-      case(OBJ_PIN):
-      case(OBJ_PATH):
-      case(OBJ_ARC):
-        object->saved_color = w_current->edit_color;
-        w_current->toplevel->page_current->CHANGED = 1;
-        break;
-
-      case(OBJ_TEXT):
-        object->saved_color = w_current->edit_color;
-        o_complex_set_saved_color_only(
-                                       object->text->prim_objs,
-                                       w_current->edit_color);
-        w_current->toplevel->page_current->CHANGED = 1;
-        break;
-    }
+    o_complex_set_color_single (object, w_current->edit_color);
+    w_current->toplevel->page_current->CHANGED = 1;
 
     s_current = g_list_next(s_current);
   }
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index b4013ee..c72abf5 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -172,10 +172,6 @@ OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current);
 OBJECT *o_complex_copy_embedded(TOPLEVEL *toplevel, OBJECT *o_current);
 void o_complex_set_color(GList *prim_objs, int color);
 void o_complex_set_color_single(OBJECT *o_current, int color);
-void o_complex_set_color_save(GList *list, int color);
-void o_complex_unset_color(GList *list);
-void o_complex_unset_color_single(OBJECT *o_current);
-void o_complex_set_saved_color_only(GList *list, int color);
 void o_complex_rotate_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object);
 void o_complex_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object);
 OBJECT *o_complex_find_pin_by_attribute(OBJECT *object, char *name, char *wanted_value);
@@ -254,8 +250,8 @@ SELECTION *o_selection_new( void );
 void o_selection_add(TOPLEVEL *toplevel, SELECTION *selection, OBJECT *o_selected);
 void o_selection_print_all(const SELECTION *selection);
 void o_selection_remove(TOPLEVEL *toplevel, SELECTION *selection, OBJECT *o_selected);
-void o_selection_select(TOPLEVEL *toplevel, OBJECT *object, int color); /* DEPRECATED */
-void o_selection_unselect(TOPLEVEL *toplevel, OBJECT *object);          /* DEPRECATED */
+void o_selection_select(TOPLEVEL *toplevel, OBJECT *object);   /* DEPRECATED */
+void o_selection_unselect(TOPLEVEL *toplevel, OBJECT *object); /* DEPRECATED */
 
 /* o_text_basic.c */
 void o_text_init(void);
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index b2230f8..2606798 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -268,7 +268,6 @@ struct st_object {
   void (*draw_func)();			/* Draw function */
 
   int color; 				/* Which color */
-  int saved_color; 			/* Saved color */
   int dont_redraw;			/* Flag to skip redrawing */
   int selected;				/* object selected flag */
   int locked_color; 			/* Locked color (used to save */
diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 6a6e11b..3a7d3d6 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -133,15 +133,8 @@ OBJECT *o_arc_new(TOPLEVEL *toplevel,
 OBJECT *o_arc_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
-  new_obj = o_arc_new (toplevel, OBJ_ARC, color,
+  new_obj = o_arc_new (toplevel, OBJ_ARC, o_current->color,
                        o_current->arc->x, o_current->arc->y,
                        o_current->arc->width / 2,
                        o_current->arc->start_angle,
@@ -314,7 +307,6 @@ OBJECT *o_arc_read (TOPLEVEL *toplevel, char buf[],
  */
 char *o_arc_save(OBJECT *object)
 {
-  int color;
   int x, y, radius, start_angle, end_angle;
   int arc_width, arc_length, arc_space;
   char *buf;
@@ -335,16 +327,9 @@ char *o_arc_save(OBJECT *object)
   arc_length = object->line_length;
   arc_space  = object->line_space;
 
-  /* Save the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
   /* Describe a circle with post-20000704 file format */
   buf = g_strdup_printf("%c %d %d %d %d %d %d %d %d %d %d %d", object->type,
-			x, y, radius, start_angle, end_angle, color,
+			x, y, radius, start_angle, end_angle, object->color,
 			arc_width, arc_end, arc_type, arc_length, arc_space);
 
   return(buf);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 92a7ffd..ce563cb 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -71,13 +71,8 @@ static void o_attrib_set_color(TOPLEVEL *toplevel, OBJECT *attrib, int color)
 {
   g_return_if_fail (attrib->type == OBJ_TEXT);
 
-  if (attrib->saved_color == -1) {
-    o_complex_set_color (attrib->text->prim_objs, color);
-    attrib->color = color;
-  } else {
-    o_complex_set_saved_color_only (attrib->text->prim_objs, color);
-    attrib->saved_color = color;
-  }
+  o_complex_set_color (attrib->text->prim_objs, color);
+  attrib->color = color;
 }
 
 
diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index 5c749de..9c9d336 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -107,17 +107,10 @@ OBJECT *o_box_new(TOPLEVEL *toplevel,
 OBJECT *o_box_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-	
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   /* A new box object is created with #o_box_new().
    * Values for its fields are default and need to be modified. */
-  new_obj = o_box_new (toplevel, OBJ_BOX, color, 0, 0, 0, 0);
+  new_obj = o_box_new (toplevel, OBJ_BOX, o_current->color, 0, 0, 0, 0);
 
   /*
    * The dimensions of the new box are set with the ones of the original box.
@@ -352,7 +345,6 @@ char *o_box_save(OBJECT *object)
 {
   int x1, y1; 
   int width, height;
-  int color;
   int box_width, box_space, box_length;
   int fill_width, angle1, pitch1, angle2, pitch2;
   OBJECT_END box_end;
@@ -393,17 +385,9 @@ char *o_box_save(OBJECT *object)
   angle2     = object->fill_angle2;
   pitch2     = object->fill_pitch2;
 
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
-
   buf = g_strdup_printf("%c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", 
 			object->type,
-			x1, y1, width, height, color,
+			x1, y1, width, height, object->color,
 			box_width, box_end, box_type, box_length, box_space, 
 			box_fill,
 			fill_width, angle1, pitch1, angle2, pitch2);
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 4c1a899..4f41895 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -212,7 +212,6 @@ OBJECT *o_bus_read (TOPLEVEL *toplevel, char buf[],
 char *o_bus_save(OBJECT *object)
 {
   int x1, x2, y1, y2;
-  int color;
   char *buf;
 
   x1 = object->line->x[0];
@@ -220,15 +219,8 @@ char *o_bus_save(OBJECT *object)
   x2 = object->line->x[1];
   y2 = object->line->y[1];
 
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
   buf = g_strdup_printf("%c %d %d %d %d %d %d", object->type,
-          x1, y1, x2, y2, color, object->bus_ripper_direction);
+          x1, y1, x2, y2, object->color, object->bus_ripper_direction);
   return(buf);
 }
        
@@ -269,19 +261,12 @@ void o_bus_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
 OBJECT *o_bus_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   /* make sure you fix this in pin and bus as well */
   /* still doesn't work... you need to pass in the new values */
   /* or don't update and update later */
   /* I think for now I'll disable the update and manually update */
-  new_obj = o_bus_new (toplevel, OBJ_BUS, color,
+  new_obj = o_bus_new (toplevel, OBJ_BUS, o_current->color,
                        o_current->line->x[0], o_current->line->y[0],
                        o_current->line->x[1], o_current->line->y[1],
                        o_current->bus_ripper_direction);
diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c
index f572d68..586efa5 100644
--- a/libgeda/src/o_circle_basic.c
+++ b/libgeda/src/o_circle_basic.c
@@ -121,17 +121,10 @@ OBJECT *o_circle_new(TOPLEVEL *toplevel,
 OBJECT *o_circle_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   /* A new circle object is created with #o_circle_new().
    * Values for its fields are default and need to be modified. */
-  new_obj = o_circle_new (toplevel, OBJ_CIRCLE, color, 0, 0, 0);
+  new_obj = o_circle_new (toplevel, OBJ_CIRCLE, o_current->color, 0, 0, 0);
 
   /*
    * The parameters of the new circle are set with the ones of the original
@@ -330,7 +323,6 @@ char *o_circle_save(OBJECT *object)
 {
   int x,y;
   int radius;
-  int color;
   int circle_width, circle_space, circle_length;
   int fill_width, angle1, pitch1, angle2, pitch2;
   char *buf;
@@ -358,15 +350,8 @@ char *o_circle_save(OBJECT *object)
   angle2       = object->fill_angle2;
   pitch2       = object->fill_pitch2;
   
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-  
   buf = g_strdup_printf("%c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", 
-			object->type, x, y, radius, color,
+			object->type, x, y, radius, object->color,
 			circle_width, circle_end, circle_type, circle_length, 
 			circle_space, circle_fill,
 			fill_width, angle1, pitch1, angle2, pitch2);
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 6e72ffd..c75310d 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -777,23 +777,16 @@ void o_complex_translate_world(TOPLEVEL *toplevel, int dx, int dy,
 OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj=NULL;
-  int color;
   int selectable;
   const CLibSymbol *clib = NULL;
 
   g_return_val_if_fail(o_current != NULL, NULL);
 
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
-
   selectable = (o_current->sel_func != NULL);
 
   clib = s_clib_get_symbol_by_name (o_current->complex_basename);
 
-  new_obj = o_complex_new (toplevel, o_current->type, color,
+  new_obj = o_complex_new (toplevel, o_current->type, o_current->color,
                            o_current->complex->x, o_current->complex->y,
                            o_current->complex->angle,
                            o_current->complex->mirror,
@@ -826,20 +819,13 @@ OBJECT *o_complex_copy_embedded(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj=NULL;
   GList *iter;
-  int color;
   int selectable;
 
   g_return_val_if_fail(o_current != NULL, NULL);
 
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
-
   selectable = (o_current->sel_func != NULL);
 
-  new_obj = o_complex_new_embedded (toplevel, o_current->type, color,
+  new_obj = o_complex_new_embedded (toplevel, o_current->type, o_current->color,
                                     o_current->complex->x, o_current->complex->y,
                                     o_current->complex->angle,
                                     o_current->complex->mirror,
@@ -953,186 +939,6 @@ void o_complex_set_color_single(OBJECT *o_current, int color)
   }
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void o_complex_set_color_save (GList *list, int color)
-{
-  OBJECT *o_current=NULL;
-  GList *iter;
-
-  iter = list;
-
-  while ( iter != NULL ) {
-    o_current = (OBJECT *)iter->data;
-    switch(o_current->type) {
-      case(OBJ_LINE):
-      case(OBJ_NET):
-      case(OBJ_BUS):
-      case(OBJ_BOX):
-      case(OBJ_PICTURE):
-      case(OBJ_CIRCLE):
-      case(OBJ_PATH):
-      case(OBJ_PIN):
-      case(OBJ_ARC):
-        o_current->saved_color = o_current->color;
-        o_current->color = color;
-        break;
-
-      case(OBJ_TEXT):
-        o_current->saved_color = o_current->color;
-        o_current->color = color;
-        o_complex_set_color_save(
-                                 o_current->text->prim_objs, 
-                                 color);
-        break;
-
-      case(OBJ_COMPLEX):
-      case(OBJ_PLACEHOLDER):
-        o_current->saved_color = o_current->color;
-        o_current->color = color;
-        o_complex_set_color_save(o_current->complex->
-                                 prim_objs,
-                                 color);
-        break;
-
-    }
-    iter = g_list_next (iter);
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void o_complex_unset_color (GList *list)
-{
-  OBJECT *o_current=NULL;
-  GList *iter;
-
-  iter = list;
-
-  while (iter != NULL) {
-    o_current = (OBJECT *)iter->data;
-    switch(o_current->type) {
-      case(OBJ_LINE):
-      case(OBJ_NET):
-      case(OBJ_BUS):
-      case(OBJ_BOX):
-      case(OBJ_PICTURE):
-      case(OBJ_CIRCLE):
-      case(OBJ_PATH):
-      case(OBJ_PIN):
-      case(OBJ_ARC):
-        o_current->color = o_current->saved_color;
-        o_current->saved_color = -1;
-        break;
-
-      case(OBJ_TEXT):
-        o_current->color = o_current->saved_color;
-        o_current->saved_color = -1;
-        o_complex_unset_color(o_current->text->prim_objs);
-        break;
-
-      case(OBJ_COMPLEX):
-      case(OBJ_PLACEHOLDER):
-        o_current->color = o_current->saved_color;
-        o_current->saved_color = -1;
-        o_complex_unset_color(o_current->complex->
-                              prim_objs);
-
-        break;
-
-    }
-    iter = g_list_next (iter);
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void o_complex_unset_color_single(OBJECT *o_current)
-{
-  g_return_if_fail(o_current != NULL);
-
-  switch(o_current->type) {
-    case(OBJ_LINE):
-    case(OBJ_NET):
-    case(OBJ_BUS):
-    case(OBJ_BOX):
-    case(OBJ_PICTURE):
-    case(OBJ_CIRCLE):
-    case(OBJ_PATH):
-    case(OBJ_PIN):
-    case(OBJ_ARC):
-    o_current->color = o_current->saved_color;
-    o_current->saved_color = -1;
-    break;
-
-    case(OBJ_TEXT):
-    o_current->color = o_current->saved_color;
-    o_current->saved_color = -1;
-    o_complex_unset_color(o_current->text->prim_objs);
-    break;
-
-    case(OBJ_COMPLEX):
-    case(OBJ_PLACEHOLDER):
-    o_current->color = o_current->saved_color;
-    o_current->saved_color = -1;
-    o_complex_unset_color(o_current->complex->prim_objs);
-
-    break;
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void o_complex_set_saved_color_only (GList *list, int color)
-{
-  OBJECT *o_current=NULL;
-  GList *iter;
-
-  iter = list;
-
-  while (iter != NULL) {
-    o_current = (OBJECT *)iter->data;
-    switch(o_current->type) {
-      case(OBJ_LINE):
-      case(OBJ_NET):
-      case(OBJ_BUS):
-      case(OBJ_BOX):
-      case(OBJ_PICTURE):
-      case(OBJ_CIRCLE):
-      case(OBJ_PATH):
-      case(OBJ_PIN):
-      case(OBJ_ARC):
-        o_current->saved_color = color;
-        break;
-
-      case(OBJ_TEXT):
-        o_current->saved_color = color;
-        o_complex_set_saved_color_only(o_current->text->prim_objs, color);
-        break;
-
-      case(OBJ_COMPLEX):
-      case(OBJ_PLACEHOLDER):
-        o_current->saved_color = color;
-        o_complex_set_saved_color_only(o_current->complex->prim_objs, color);
-        break;
-
-    }
-    iter = g_list_next (iter);
-  }
-}
-
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index dec2ec5..a0462d1 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -109,17 +109,10 @@ OBJECT *o_line_new(TOPLEVEL *toplevel,
 OBJECT *o_line_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   /* A new line object is created with #o_line_new().
    * Values for its fields are default and need to be modified. */
-  new_obj = o_line_new (toplevel, OBJ_LINE, color,
+  new_obj = o_line_new (toplevel, OBJ_LINE, o_current->color,
                         o_current->line->x[0], o_current->line->y[0],
                         o_current->line->x[1], o_current->line->y[1]);
 
@@ -306,7 +299,6 @@ OBJECT *o_line_read (TOPLEVEL *toplevel, char buf[],
 char *o_line_save(OBJECT *object)
 {
   int x1, x2, y1, y2;
-  int color;
   int line_width, line_space, line_length;
   char *buf;
   OBJECT_END line_end;
@@ -325,15 +317,8 @@ char *o_line_save(OBJECT *object)
   line_length= object->line_length;
   line_space = object->line_space;
   
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-  
   buf = g_strdup_printf("%c %d %d %d %d %d %d %d %d %d %d", object->type,
-			x1, y1, x2, y2, color,
+			x1, y1, x2, y2, object->color,
 			line_width, line_end, line_type,
 			line_length, line_space);
 
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 5ae3127..ac91886 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -183,7 +183,7 @@ GList *o_glist_copy_all (TOPLEVEL *toplevel,
 
     /* reselect it */
     if (selected_save)
-      o_selection_select (toplevel, src_object, SELECT_COLOR);
+      o_selection_select (toplevel, src_object);
 
     src = g_list_next(src);
   }
@@ -216,7 +216,7 @@ GList *o_glist_copy_all (TOPLEVEL *toplevel,
 
     /* reselect it */
     if (selected_save)
-      o_selection_select (toplevel, src_object, SELECT_COLOR);
+      o_selection_select (toplevel, src_object);
 
     src = g_list_next(src);
   }
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 1891304..4ba97b7 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -198,7 +198,6 @@ OBJECT *o_net_read (TOPLEVEL *toplevel, char buf[],
 char *o_net_save(OBJECT *object)
 {
   int x1, x2, y1, y2;
-  int color;
   char *buf;
 
   x1 = object->line->x[0];
@@ -206,14 +205,7 @@ char *o_net_save(OBJECT *object)
   x2 = object->line->x[1];
   y2 = object->line->y[1];
 
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
-  buf = g_strdup_printf("%c %d %d %d %d %d", object->type, x1, y1, x2, y2, color);
+  buf = g_strdup_printf("%c %d %d %d %d %d", object->type, x1, y1, x2, y2, object->color);
   return (buf);
 }
 
@@ -256,19 +248,12 @@ void o_net_translate_world(TOPLEVEL *toplevel, int dx, int dy,
 OBJECT *o_net_copy(TOPLEVEL *toplevel,  OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   /* make sure you fix this in pin and bus as well */
   /* still doesn't work... you need to pass in the new values */
   /* or don't update and update later */
   /* I think for now I'll disable the update and manually update */
-  new_obj = o_net_new (toplevel, OBJ_NET, color,
+  new_obj = o_net_new (toplevel, OBJ_NET, o_current->color,
                        o_current->line->x[0], o_current->line->y[0],
                        o_current->line->x[1], o_current->line->y[1]);
 
diff --git a/libgeda/src/o_path_basic.c b/libgeda/src/o_path_basic.c
index deae1b4..991d6cc 100644
--- a/libgeda/src/o_path_basic.c
+++ b/libgeda/src/o_path_basic.c
@@ -116,16 +116,9 @@ OBJECT *o_path_copy (TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
   char *path_string;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
   path_string = s_path_string_from_path (o_current->path);
-  new_obj = o_path_new (toplevel, OBJ_PATH, color, path_string);
+  new_obj = o_path_new (toplevel, OBJ_PATH, o_current->color, path_string);
   g_free (path_string);
 
   /* copy the path type and filling options */
@@ -251,7 +244,6 @@ OBJECT *o_path_read (TOPLEVEL *toplevel,
  */
 char *o_path_save (OBJECT *object)
 {
-  int color;
   int line_width, line_space, line_length;
   char *buf;
   int num_lines;
@@ -276,17 +268,10 @@ char *o_path_save (OBJECT *object)
   angle2       = object->fill_angle2;
   pitch2       = object->fill_pitch2;
 
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
   path_string = s_path_string_from_path (object->path);
   num_lines = o_text_num_lines (path_string);
   buf = g_strdup_printf ("%c %d %d %d %d %d %d %d %d %d %d %d %d %d\n%s",
-                         object->type, color, line_width, line_end,
+                         object->type, object->color, line_width, line_end,
                          line_type, line_length, line_space, fill_type,
                          fill_width, angle1, pitch1, angle2, pitch2,
                          num_lines, path_string);
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index b9feb70..21c0ff1 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -682,11 +682,7 @@ OBJECT *o_picture_copy(TOPLEVEL *toplevel, OBJECT *object)
   picture = g_malloc(sizeof(PICTURE));
   new_node->picture = picture;
 
-  if (object->saved_color == -1) {
-    new_node->color = object->color;
-  } else {
-    new_node->color = object->saved_color;
-  }
+  new_node->color = object->color;
 
   /* describe the picture with its upper left and lower right corner */
   picture->upper_x = object->picture->upper_x;
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 9f8aa3b..858b820 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -216,7 +216,6 @@ OBJECT *o_pin_read (TOPLEVEL *toplevel, char buf[],
 char *o_pin_save(OBJECT *object)
 {
   int x1, x2, y1, y2;
-  int color;
   int pin_type, whichend;
   char *buf;
   
@@ -224,19 +223,12 @@ char *o_pin_save(OBJECT *object)
   y1 = object->line->y[0];
   x2 = object->line->x[1];
   y2 = object->line->y[1];
-  
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
 
   pin_type = object->pin_type;
   whichend = object->whichend;
   
   buf = g_strdup_printf("%c %d %d %d %d %d %d %d", object->type,
-		   x1, y1, x2, y2, color, pin_type, whichend);
+		   x1, y1, x2, y2, object->color, pin_type, whichend);
   return(buf);
 }
 
@@ -277,15 +269,8 @@ void o_pin_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
 OBJECT *o_pin_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
-  new_obj = o_pin_new (toplevel, OBJ_PIN, color,
+  new_obj = o_pin_new (toplevel, OBJ_PIN, o_current->color,
                        o_current->line->x[0], o_current->line->y[0],
                        o_current->line->x[1], o_current->line->y[1],
                        o_current->pin_type, o_current->whichend);
diff --git a/libgeda/src/o_selection.c b/libgeda/src/o_selection.c
index 8ebe915..bb9fd97 100644
--- a/libgeda/src/o_selection.c
+++ b/libgeda/src/o_selection.c
@@ -50,7 +50,7 @@ SELECTION *o_selection_new( void )
  */
 void o_selection_add (TOPLEVEL *toplevel, SELECTION *selection, OBJECT *o_selected)
 {
-  o_selection_select (toplevel, o_selected, SELECT_COLOR);
+  o_selection_select (toplevel, o_selected);
   geda_list_add( (GedaList *)selection, o_selected );
 }
 
@@ -106,28 +106,15 @@ void o_selection_print_all(const SELECTION *selection)
  *
  *  \param [in] toplevel  The TOPLEVEL object
  *  \param [in] object    Object to select.
- *  \param [in] color     color of the selected object.
  */
-void o_selection_select(TOPLEVEL *toplevel, OBJECT *object, int color)
+void o_selection_select(TOPLEVEL *toplevel, OBJECT *object)
 {
   if (object->selected == TRUE) {
     printf("object already selected == TRUE\n");
     return;
   }
 
-  if (object->saved_color != -1) {
-    printf("object already saved_color != -1\n");
-    return;
-  }
-
   object->selected = TRUE;
-  object->saved_color = object->color;
-  object->color = color;
-  if (object->type == OBJ_COMPLEX || object->type == OBJ_PLACEHOLDER) { 
-    o_complex_set_color_save(object->complex->prim_objs, color);
-  } else if (object->type == OBJ_TEXT) {
-    o_complex_set_color_save(object->text->prim_objs, color);
-  }
 }
 
 /*! \brief Unselects the given object.
@@ -141,21 +128,5 @@ void o_selection_select(TOPLEVEL *toplevel, OBJECT *object, int color)
 void o_selection_unselect (TOPLEVEL *toplevel, OBJECT *object)
 {
   object->selected = FALSE;
-  object->color = object->saved_color;
-  if (object->type == OBJ_COMPLEX || object->type == OBJ_PLACEHOLDER) { 
-    if (!object->complex) {
-      fprintf(stderr, "o_selection_unselect: Called with NULL object.\n");
-      return;
-    }
-    o_complex_unset_color(object->complex->prim_objs);
-  } else if (object->type == OBJ_TEXT) {
-    if (!object->text) {
-      fprintf(stderr, "o_selection_unselect: Called with NULL object.\n");
-      return;
-    }
-    o_complex_unset_color(object->text->prim_objs);
-  }
-
-  object->saved_color = -1;
 }
 
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index b0dcebb..4439dd4 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -1293,7 +1293,6 @@ void o_text_set_info_font(char buf[])
 char *o_text_save(OBJECT *object)
 {
   int x, y;
-  int color;
   int size;
   char *string;
   char *buf;
@@ -1305,20 +1304,13 @@ char *o_text_save(OBJECT *object)
   string = object->text->string;
   size = object->text->size;
 
-  /* Use the right color */
-  if (object->saved_color == -1) {
-    color = object->color;
-  } else {
-    color = object->saved_color;
-  }
-
   /* string can have multiple lines (seperated by \n's) */
   num_lines = o_text_num_lines(string);
 
-  buf = g_strdup_printf("%c %d %d %d %d %d %d %d %d %d\n%s", object->type,
-                        x, y, color, size, object->visibility, 
-			object->show_name_value, object->text->angle, 
-			object->text->alignment, num_lines, string);
+  buf = g_strdup_printf ("%c %d %d %d %d %d %d %d %d %d\n%s", object->type,
+                         x, y, object->color, size, object->visibility,
+                         object->show_name_value, object->text->angle,
+                         object->text->alignment, num_lines, string);
 
   return(buf);
 }
@@ -1359,8 +1351,6 @@ void o_text_recreate(TOPLEVEL *toplevel, OBJECT *o_current)
          iter != NULL; iter = g_list_next (iter))
       ((OBJECT *)iter->data)->parent = o_current;
 
-    o_complex_set_saved_color_only(text->prim_objs,
-                                   o_current->saved_color);
     text->displayed_width = o_text_width (toplevel,
                                           text->disp_string,
                                           text->size/2);
@@ -1412,15 +1402,8 @@ void o_text_translate_world(TOPLEVEL *toplevel,
 OBJECT *o_text_copy(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   OBJECT *new_obj;
-  int color;
-
-  if (o_current->saved_color == -1) {
-    color = o_current->color;
-  } else {
-    color = o_current->saved_color;
-  }
 
-  new_obj = o_text_new (toplevel, OBJ_TEXT, color,
+  new_obj = o_text_new (toplevel, OBJ_TEXT, o_current->color,
                         o_current->text->x, o_current->text->y,
                         o_current->text->alignment,
                         o_current->text->angle,
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 3b4802c..7ac3134 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -107,7 +107,6 @@ OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name)
 		
   /* Setup the color */
   new_node->color = DEFAULT_COLOR;
-  new_node->saved_color = -1;
   new_node->selected = FALSE;
   new_node->dont_redraw = FALSE;
   new_node->locked_color = -1;

commit 12052ab6b3e17d275ee63a08f03305fbfee4c93b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Set the OBJECT->parent field on text prim_objs
    
    This allows us to keep track of the ownership of TEXT prim_objs.

diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 304e0f9..b0dcebb 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -973,6 +973,7 @@ OBJECT *o_text_new(TOPLEVEL *toplevel,
   TEXT *text;
   char *name = NULL;
   char *value = NULL;
+  GList *iter;
 
   if (string == NULL) {
     return(NULL);
@@ -1009,7 +1010,12 @@ OBJECT *o_text_new(TOPLEVEL *toplevel,
     new_node->text->prim_objs =
       o_text_create_string (toplevel,
                            text->disp_string, size, color,
-                           x, y, alignment, angle); 
+                           x, y, alignment, angle);
+    /* set the parent field */
+    for (iter = new_node->text->prim_objs;
+         iter != NULL; iter = g_list_next (iter))
+      ((OBJECT *)iter->data)->parent = new_node;
+
     new_node->text->displayed_width = o_text_width(toplevel,
                                                    text->disp_string, size/2);
     new_node->text->displayed_height = o_text_height(text->disp_string, size);
@@ -1330,6 +1336,7 @@ void o_text_recreate(TOPLEVEL *toplevel, OBJECT *o_current)
   char *name = NULL;
   char *value = NULL;
   TEXT *text = o_current->text;
+  GList *iter;
 
   update_disp_string (o_current);
 
@@ -1347,6 +1354,10 @@ void o_text_recreate(TOPLEVEL *toplevel, OBJECT *o_current)
                                             text->y,
                                             text->alignment,
                                             text->angle);
+    /* set the parent field */
+    for (iter = text->prim_objs;
+         iter != NULL; iter = g_list_next (iter))
+      ((OBJECT *)iter->data)->parent = o_current;
 
     o_complex_set_saved_color_only(text->prim_objs,
                                    o_current->saved_color);

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

    Rename OBJECT->complex_parent field to OBJECT->parent
    
    We might wish to track the ownership of text prim_objs as well
    as complex, so calling this field complex_parent is confusing.

diff --git a/gnetlist/src/s_net.c b/gnetlist/src/s_net.c
index d3f57c3..9b63a9e 100644
--- a/gnetlist/src/s_net.c
+++ b/gnetlist/src/s_net.c
@@ -159,7 +159,7 @@ char *s_net_return_connected_string(TOPLEVEL * pr_current, OBJECT * object,
     printf("found pinnum: %s\n", pinnum);
 #endif
 
-    scm_uref = g_scm_c_get_uref(pr_current, o_current->complex_parent);
+    scm_uref = g_scm_c_get_uref(pr_current, o_current->parent);
 
     if (scm_is_string( scm_uref )) {
       temp_uref = scm_to_locale_string( scm_uref );
diff --git a/gnetlist/src/s_netattrib.c b/gnetlist/src/s_netattrib.c
index 0467b31..b813869 100644
--- a/gnetlist/src/s_netattrib.c
+++ b/gnetlist/src/s_netattrib.c
@@ -316,7 +316,7 @@ char *s_netattrib_return_netname(TOPLEVEL * pr_current, OBJECT * o_current,
 #endif
 
     /* use hierarchy tag here to make this net uniq */
-    temp_netname = s_netattrib_net_search(o_current->complex_parent,
+    temp_netname = s_netattrib_net_search(o_current->parent,
                                           current_pin);
 
     netname =
diff --git a/gschem/src/o_delete.c b/gschem/src/o_delete.c
index 0c0796c..11fa039 100644
--- a/gschem/src/o_delete.c
+++ b/gschem/src/o_delete.c
@@ -58,7 +58,7 @@ void o_delete (GSCHEM_TOPLEVEL *w_current, OBJECT *object)
       for (iter = prev_conn_objects; iter != NULL; iter = iter_next) {
         OBJECT *conn_obj = iter->data;
         iter_next = g_list_next (iter);
-        if (conn_obj->complex_parent == object)
+        if (conn_obj->parent == object)
           prev_conn_objects = g_list_delete_link (prev_conn_objects, iter);
       }
     }
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index cacfe02..852267a 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -733,7 +733,7 @@ void o_update_component(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
        po_iter != NULL;
        po_iter = g_list_next (po_iter)) {
     OBJECT *tmp = po_iter->data;
-    tmp->complex_parent = o_current;
+    tmp->parent = o_current;
   }
 
   /*   - reset the new complex prim_objs */
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index 0ecd5a0..b2230f8 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -259,8 +259,7 @@ struct st_object {
 
   gboolean complex_embedded;                    /* is embedded component? */
   gchar *complex_basename;              /* Component Library Symbol name */
-  OBJECT *complex_parent;		/* Complex parent object pointer */
-  /* used only in complex head nodes */
+  OBJECT *parent;                       /* Parent object pointer */
 
   /* unused for now */
   void (*action_func)();			/* Execute function */
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 6038eef..e6fbdc0 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -459,7 +459,7 @@ GList *o_read_buffer (TOPLEVEL *toplevel, GList *object_list,
           for (iter = new_obj->complex->prim_objs;
                iter != NULL; iter = g_list_next (iter)) {
             OBJECT *tmp = iter->data;
-            tmp->complex_parent = new_obj;
+            tmp->parent = new_obj;
           }
 
           o_recalc_single_object (toplevel, new_obj);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 5bc6a90..92a7ffd 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -886,5 +886,5 @@ GList * o_attrib_return_attribs (OBJECT *object)
 int o_attrib_is_inherited (OBJECT *attrib)
 {
   return (attrib->attached_to == NULL &&
-          attrib->complex_parent != NULL);
+          attrib->parent != NULL);
 }
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index a3bf769..6e72ffd 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -294,7 +294,7 @@ static GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int
       continue;
 
     if (detach) {
-      tmp->complex_parent = NULL;
+      tmp->parent = NULL;
       object->complex->prim_objs =
         g_list_remove (object->complex->prim_objs, tmp);
     }
@@ -536,7 +536,7 @@ OBJECT *o_complex_new(TOPLEVEL *toplevel,
   /* set the parent field now */
   for (iter = prim_objs; iter != NULL; iter = g_list_next (iter)) {
     OBJECT *tmp = iter->data;
-    tmp->complex_parent = new_node;
+    tmp->parent = new_node;
   }
 
   o_complex_recalc(toplevel, new_node);
@@ -855,7 +855,7 @@ OBJECT *o_complex_copy_embedded(TOPLEVEL *toplevel, OBJECT *o_current)
   /* set the parent field now */
   for (iter = new_obj->complex->prim_objs; iter != NULL; iter = g_list_next (iter)) {
     OBJECT *tmp = iter->data;
-    tmp->complex_parent = new_obj;
+    tmp->parent = new_obj;
   }
 
   o_complex_recalc(toplevel, new_obj);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index a77008c..3b4802c 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -103,7 +103,7 @@ OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name)
   new_node->conn_list = NULL;
 
   new_node->complex_basename = NULL;
-  new_node->complex_parent = NULL;
+  new_node->parent = NULL;
 		
   /* Setup the color */
   new_node->color = DEFAULT_COLOR;




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