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

gEDA-cvs: branch: master updated (1.1.2.20070818-72-gf217428)



The branch, master has been updated
       via  f217428f8248d6e8491d943256d30d5e11d808d1 (commit)
       via  185958029cb58e26d37854c7580bef1b0869a7c9 (commit)
       via  38d3c48fd5a2ea57af5d772854393b39fd3b7e78 (commit)
      from  9d2dc8032dffadc662d30723a274a7a0d104559b (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
=========

 gschem/include/globals.h    |    2 +-
 gschem/include/prototype.h  |    3 +-
 gschem/src/globals.c        |    2 +-
 gschem/src/i_basic.c        |   38 ++------
 gschem/src/i_callbacks.c    |   88 +++++-----------
 gschem/src/o_basic.c        |  249 +++++++++++++-----------------------------
 gschem/src/o_buffer.c       |   75 ++++---------
 gschem/src/o_complex.c      |    5 +-
 gschem/src/o_copy.c         |    4 +-
 gschem/src/o_move.c         |    6 +-
 gschem/src/o_text.c         |   64 +++++------
 gschem/src/x_event.c        |   44 +++-----
 libgeda/include/prototype.h |    2 +-
 libgeda/include/struct.h    |    3 +-
 libgeda/src/o_list.c        |  125 ++++++++++------------
 libgeda/src/s_page.c        |   10 +-
 16 files changed, 252 insertions(+), 468 deletions(-)


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

commit f217428f8248d6e8491d943256d30d5e11d808d1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:01 2007 +0100

    Remove OBJECT* linked list argument to o_drawbounding().
    
    All code is now passing GLists of objects to this function.

:100644 100644 3e8b1bc... 319a081... M	gschem/include/prototype.h
:100644 100644 6c47e1f... 6d2d2b1... M	gschem/src/o_basic.c
:100644 100644 0fa8fa3... 85cfac4... M	gschem/src/o_buffer.c
:100644 100644 90c11d0... c5e4ce0... M	gschem/src/o_complex.c
:100644 100644 dcba046... 0e4656f... M	gschem/src/o_copy.c
:100644 100644 8cca01a... bb9e3da... M	gschem/src/o_move.c
:100644 100644 eaaf5dd... 509b31d... M	gschem/src/o_text.c
:100644 100644 fc5cf90... 0f95cba... M	gschem/src/x_event.c

commit 185958029cb58e26d37854c7580bef1b0869a7c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:01 2007 +0100

    Use GLists to store OBJECTs in the "object_buffers[]" paste buffers.
    
    Replaces o_list_copy_all_selection2() with o_glist_copy_all_to_glist().

:100644 100644 5173ccb... 8075a25... M	gschem/include/globals.h
:100644 100644 ee1880a... c7c10d2... M	gschem/src/globals.c
:100644 100644 0f2813a... 2397782... M	gschem/src/i_basic.c
:100644 100644 9ae3886... 0ed83ab... M	gschem/src/i_callbacks.c
:100644 100644 6bd401f... 0fa8fa3... M	gschem/src/o_buffer.c
:100644 100644 1567d7a... b4e2a96... M	libgeda/include/prototype.h
:100644 100644 15de6b2... bb38fb0... M	libgeda/src/o_list.c

commit 38d3c48fd5a2ea57af5d772854393b39fd3b7e78
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:00 2007 +0100

    Make attribute / text placing use a new attrib_place_list GList.

:100644 100644 5e3169a... 9ae3886... M	gschem/src/i_callbacks.c
:100644 100644 7d94c0c... 6c47e1f... M	gschem/src/o_basic.c
:100644 100644 711c37d... eaaf5dd... M	gschem/src/o_text.c
:100644 100644 644f1b7... fc5cf90... M	gschem/src/x_event.c
:100644 100644 2743824... 1a677f1... M	libgeda/include/struct.h
:100644 100644 44f2a1e... 6506685... M	libgeda/src/s_page.c

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

commit f217428f8248d6e8491d943256d30d5e11d808d1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:01 2007 +0100

    Remove OBJECT* linked list argument to o_drawbounding().
    
    All code is now passing GLists of objects to this function.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 3e8b1bc..319a081 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -474,8 +474,7 @@ void o_draw_list(TOPLEVEL *w_current, GList *list);
 void o_draw_selected(TOPLEVEL *w_current);
 void o_erase_selected(TOPLEVEL *w_current);
 void o_erase_single(TOPLEVEL *w_current, OBJECT *object);
-void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, 
-		    GList *o_glist, GdkColor *color, int firsttime);
+void o_drawbounding(TOPLEVEL *w_current, GList *o_glist, GdkColor *color, int firsttime);
 int o_erase_rubber(TOPLEVEL *w_current);
 int o_redraw_cleanstates(TOPLEVEL *w_current);
 /* o_box.c */
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 6c47e1f..6d2d2b1 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -56,7 +56,7 @@ void o_redraw_all(TOPLEVEL *w_current)
         /* continue */
       case(ENDCOPY):
       case(ENDMCOPY):
-        o_drawbounding(w_current, NULL,
+        o_drawbounding(w_current,
                        geda_list_get_glist( w_current->page_current->selection_list ),
                        x_get_darkcolor(w_current->bb_color), FALSE);
 
@@ -64,16 +64,13 @@ void o_redraw_all(TOPLEVEL *w_current)
 
       case(DRAWCOMP):
       case(ENDCOMP):
-        o_drawbounding(w_current,
-                       NULL,
-                       w_current->page_current->complex_place_list,
+        o_drawbounding(w_current, w_current->page_current->complex_place_list,
                        x_get_darkcolor(w_current->bb_color), FALSE);
         break;
 
       case(DRAWTEXT):
       case(ENDTEXT):
-        o_drawbounding(w_current, NULL,
-                       w_current->page_current->attrib_place_list,
+        o_drawbounding(w_current, w_current->page_current->attrib_place_list,
                        x_get_darkcolor(w_current->bb_color), FALSE);
         break;
       case (GRIPS):
@@ -246,7 +243,7 @@ void o_erase_single(TOPLEVEL *w_current, OBJECT *object)
  */
 /* both outline and boundingbox work! */
 /* name is blah */
-void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist, 
+void o_drawbounding(TOPLEVEL *w_current, GList *o_glist,
 		    GdkColor *color, int firsttime)
 {
   int diff_x, diff_y;
@@ -257,7 +254,7 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
   static int rleft, rtop, rbottom, rright;
   static int w_rleft, w_rtop, w_rbottom, w_rright;
 
-  if (!o_list && !o_glist) {
+  if (o_glist == NULL) {
     return;
   }
 
@@ -273,30 +270,15 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
     gdk_gc_set_foreground(w_current->bounding_xor_gc,
                           x_get_color(
                                       w_current->background_color));
-    if (o_list) {
-      o_complex_translate_display(w_current,
-                                  diff_x,
-                                  diff_y,
-                                  o_list);
-    } else if (o_glist) {
-      o_complex_translate_display_object_glist(w_current, diff_x, diff_y, o_glist);
-    }
+    o_complex_translate_display_object_glist(w_current, diff_x, diff_y, o_glist);
 
     gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
 
-    if (o_list) {
-      world_get_object_list_bounds(w_current, o_list,
-                             &w_rleft  ,
-                             &w_rtop   ,
-                             &w_rright ,
-                             &w_rbottom);
-    } else if (o_glist) {
-      world_get_object_glist_bounds(w_current, o_glist,
-                                    &w_rleft  ,
-                                    &w_rtop   ,
-                                    &w_rright ,
-                                    &w_rbottom);
-    }
+    world_get_object_glist_bounds(w_current, o_glist,
+                                  &w_rleft  ,
+                                  &w_rtop   ,
+                                  &w_rright ,
+                                  &w_rbottom);
 
     WORLDtoSCREEN( w_current, w_rleft, w_rtop, 
                    &rleft, &rtop );
@@ -315,50 +297,35 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
   if ((w_current->last_drawb_mode == BOUNDINGBOX) &&
       (w_current->actionfeedback_mode == OUTLINE)) {
 #if DEBUG
-        printf("going to outline\n");
+    printf("going to outline\n");
 #endif
 
-        if (o_list) {
-          world_get_object_list_bounds(w_current, o_list,
-				 &w_rleft  ,
-				 &w_rtop   ,
-				 &w_rright ,
-				 &w_rbottom);
-        } else if (o_glist) {
-	  world_get_object_glist_bounds(w_current, o_glist,
-				  &w_rleft  ,
-				  &w_rtop   ,
-				  &w_rright ,
-				  &w_rbottom);
-	}
+    world_get_object_glist_bounds(w_current, o_glist,
+                                  &w_rleft  ,
+                                  &w_rtop   ,
+                                  &w_rright ,
+                                  &w_rbottom);
 
-        diff_x = w_current->last_x - w_current->start_x;
-        diff_y = w_current->last_y - w_current->start_y;
-        gdk_gc_set_foreground(w_current->gc,
-                              x_get_color(
-                                          w_current->background_color) );
-        WORLDtoSCREEN( w_current, w_rleft, w_rtop, 
-                       &rleft, &rtop );
-        WORLDtoSCREEN( w_current, w_rright, w_rbottom, 
-                       &rright, &rbottom );
-        gdk_draw_rectangle(w_current->window,
-                           w_current->gc, FALSE,
-                           rleft   + diff_x,
-                           rtop    + diff_y,
-                           rright  - rleft ,
-                           rbottom - rtop  );
-
-        if (o_list) {
-          o_complex_translate_display(w_current,
-                                      diff_x,
-                                      diff_y,
-                                      o_list);
-        } else if (o_glist) {
-	  o_complex_translate_display_object_glist(w_current, 
-						   diff_x, diff_y, o_glist);
-	}
-	
-      }
+    diff_x = w_current->last_x - w_current->start_x;
+    diff_y = w_current->last_y - w_current->start_y;
+    gdk_gc_set_foreground(w_current->gc,
+                          x_get_color(w_current->background_color));
+
+    WORLDtoSCREEN( w_current, w_rleft, w_rtop,
+                   &rleft, &rtop );
+    WORLDtoSCREEN( w_current, w_rright, w_rbottom,
+                   &rright, &rbottom );
+    gdk_draw_rectangle(w_current->window,
+                       w_current->gc, FALSE,
+                       rleft   + diff_x,
+                       rtop    + diff_y,
+                       rright  - rleft ,
+                       rbottom - rtop  );
+
+    o_complex_translate_display_object_glist(w_current,
+                                             diff_x, diff_y, o_glist);
+
+  }
 
   w_current->last_drawb_mode = w_current->actionfeedback_mode;
 
@@ -377,30 +344,15 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
     w_current->drawbounding_action_mode = CONSTRAINED;
 
     if (w_current->actionfeedback_mode == OUTLINE) {
-      if (o_list) {
-        o_complex_translate_display(w_current,
-                                    diff_x,
-                                    diff_y,
-                                    o_list);
-      } else if (o_glist) {
-	o_complex_translate_display_object_glist(w_current, 
-						 diff_x, diff_y, o_glist);
-      }
-      
+      o_complex_translate_display_object_glist(w_current,
+                                               diff_x, diff_y, o_glist);
+
     } else {
-      if (o_list) {
-        world_get_object_list_bounds(w_current, o_list,
-			       &w_rleft  ,
-			       &w_rtop   ,
-			       &w_rright ,
-			       &w_rbottom);
-      } else if (o_glist) {
-	world_get_object_glist_bounds(w_current, o_glist,
-				&w_rleft  ,
-				&w_rtop   ,
-				&w_rright ,
-				&w_rbottom);
-      }
+      world_get_object_glist_bounds(w_current, o_glist,
+                                    &w_rleft  ,
+                                    &w_rtop   ,
+                                    &w_rright ,
+                                    &w_rbottom);
 
       gdk_gc_set_foreground(w_current->bounding_xor_gc,
                             color);
@@ -428,31 +380,16 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
     diff_y = w_current->last_y - w_current->start_y;
 
     if (w_current->actionfeedback_mode == OUTLINE) {
-      if (o_list) {
-        o_complex_translate_display(w_current,
-                                    diff_x,
-                                    diff_y,
-                                    o_list);
-      } else if (o_glist) {
-	o_complex_translate_display_object_glist(w_current, 
-						 diff_x, diff_y, o_glist);
-      }
+      o_complex_translate_display_object_glist(w_current,
+                                               diff_x, diff_y, o_glist);
 
     } else {
-      if (o_list) {
-        world_get_object_list_bounds(w_current, o_list,
-			       &w_rleft  ,
-			       &w_rtop   ,
-			       &w_rright ,
-			       &w_rbottom);
-      } else if (o_glist) {
-	world_get_object_glist_bounds(w_current, o_glist,
-				&w_rleft  ,
-				&w_rtop   ,
-				&w_rright ,
-				&w_rbottom);
-      }
-      
+      world_get_object_glist_bounds(w_current, o_glist,
+                                    &w_rleft  ,
+                                    &w_rtop   ,
+                                    &w_rright ,
+                                    &w_rbottom);
+
       gdk_gc_set_foreground(w_current->bounding_xor_gc,
                             color);
       WORLDtoSCREEN( w_current, w_rleft, w_rtop, 
@@ -483,38 +420,19 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
         w_current->drawbounding_action_mode = FREE;
         if (w_current->actionfeedback_mode == OUTLINE) {
           /* do it twice to get rid of old outline */
-          if (o_list) {
-            o_complex_translate_display(w_current,
-                                        diff_x,
-                                        diff_y,
-                                        o_list);
-            o_complex_translate_display(w_current,
-                                        diff_x,
-                                        diff_y,
-                                        o_list);
-          } else if (o_glist) {
-	    o_complex_translate_display_object_glist(w_current, 
-						     diff_x, diff_y, o_glist);
-	    o_complex_translate_display_object_glist(w_current,
-						     diff_x, diff_y, o_glist);
-	  }
-	  
+          o_complex_translate_display_object_glist(w_current,
+                                                   diff_x, diff_y, o_glist);
+          o_complex_translate_display_object_glist(w_current,
+                                                   diff_x, diff_y, o_glist);
+
         } else {
           /*! \todo why are we doing this here...?
            * probably a reason */
-          if (o_list) {
-            world_get_object_list_bounds(w_current, o_list,
-				   &w_rleft  ,
-				   &w_rtop   ,
-				   &w_rright ,
-				   &w_rbottom);
-          } else if (o_glist) {
-	    world_get_object_glist_bounds(w_current, o_glist,
-				    &w_rleft  ,
-				    &w_rtop   ,
-				    &w_rright ,
-				    &w_rbottom);
-	  }
+          world_get_object_glist_bounds(w_current, o_glist,
+                                        &w_rleft  ,
+                                        &w_rtop   ,
+                                        &w_rright ,
+                                        &w_rbottom);
 
         }
         if (w_current->netconn_rubberband) {
@@ -536,20 +454,12 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
   if (w_current->actionfeedback_mode == BOUNDINGBOX) {
 
     if (firsttime == TRUE) {
-      if (o_list) {
-        world_get_object_list_bounds(w_current, o_list,
-			       &w_rleft  ,
-			       &w_rtop   ,
-			       &w_rright ,
-			       &w_rbottom);
-      } else if (o_glist) {
-	world_get_object_glist_bounds(w_current, o_glist,
-				&w_rleft  ,
-				&w_rtop   ,
-				&w_rright ,
-				&w_rbottom);
-      }
-      
+      world_get_object_glist_bounds(w_current, o_glist,
+                                    &w_rleft  ,
+                                    &w_rtop   ,
+                                    &w_rright ,
+                                    &w_rbottom);
+
       /*printf("once\n");*/
     
     }
@@ -576,12 +486,8 @@ void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
   /*! \todo have I mentioned how temp this is? Make this general
    * so that all lists can be moved ...
    */
-  if (o_list) {
-    o_complex_translate_display(w_current, diff_x, diff_y, o_list);
-  } else if (o_glist) {
-    o_complex_translate_display_object_glist(w_current, 
-					     diff_x, diff_y, o_glist);
-  }
+  o_complex_translate_display_object_glist(w_current,
+                                           diff_x, diff_y, o_glist);
 }
 
 
diff --git a/gschem/src/o_buffer.c b/gschem/src/o_buffer.c
index 0fa8fa3..85cfac4 100644
--- a/gschem/src/o_buffer.c
+++ b/gschem/src/o_buffer.c
@@ -134,7 +134,7 @@ void o_buffer_paste_start(TOPLEVEL *w_current, int screen_x, int screen_y,
   /* store the buffer number for future use */
   w_current->buffer_number = buf_num;
 
-  o_drawbounding(w_current, NULL, object_buffer[buf_num],
+  o_drawbounding(w_current, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), TRUE);
 }
 
@@ -161,7 +161,7 @@ void o_buffer_paste_end(TOPLEVEL *w_current, int screen_x, int screen_y,
   }
 
   /* erase old image */
-  o_drawbounding(w_current, NULL, object_buffer[buf_num],
+  o_drawbounding(w_current, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), FALSE);
 
   /* get the location where we ended */
@@ -233,7 +233,7 @@ void o_buffer_paste_end(TOPLEVEL *w_current, int screen_x, int screen_y,
  */
 void o_buffer_paste_rubberpaste(TOPLEVEL *w_current, int buf_num)
 {
-  o_drawbounding(w_current, NULL, object_buffer[buf_num],
+  o_drawbounding(w_current, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
 
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 90c11d0..c5e4ce0 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -167,9 +167,7 @@ void o_complex_start(TOPLEVEL *w_current, int screen_x, int screen_y)
   o_complex_place_changed_run_hook (w_current);
   w_current->DONT_REDRAW = redraw_state;
 
-  o_drawbounding(w_current, 
-                 NULL,
-                 w_current->page_current->complex_place_list,
+  o_drawbounding(w_current, w_current->page_current->complex_place_list,
                  x_get_darkcolor(w_current->bb_color), TRUE);
 }
 
@@ -455,7 +453,6 @@ void o_complex_end(TOPLEVEL *w_current, int screen_x, int screen_y)
 void o_complex_rubbercomplex(TOPLEVEL *w_current)
 {
   o_drawbounding(w_current,
-                 NULL,
                  w_current->page_current->complex_place_list,
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
diff --git a/gschem/src/o_copy.c b/gschem/src/o_copy.c
index dcba046..0e4656f 100644
--- a/gschem/src/o_copy.c
+++ b/gschem/src/o_copy.c
@@ -53,7 +53,7 @@ void o_copy_start(TOPLEVEL *w_current, int x, int y)
 
     w_current->last_x = w_current->start_x = fix_x(w_current, x);
     w_current->last_y = w_current->start_y = fix_y(w_current, y);
-    o_drawbounding(w_current, NULL,
+    o_drawbounding(w_current,
                    geda_list_get_glist( w_current->page_current->selection_list ),
                    x_get_darkcolor(w_current->bb_color), TRUE);
     w_current->inside_action = 1;
@@ -499,7 +499,7 @@ void o_copy_end(TOPLEVEL *w_current)
 
   /* erase the bounding box */
   if (w_current->actionfeedback_mode == BOUNDINGBOX) {
-    o_drawbounding(w_current, NULL,
+    o_drawbounding(w_current,
                    geda_list_get_glist( w_current->page_current->selection_list ),
                    x_get_darkcolor(w_current->bb_color), TRUE);
   }
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 8cca01a..bb9e3da 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -50,7 +50,7 @@ void o_move_start(TOPLEVEL * w_current, int x, int y)
 
     o_erase_selected(w_current);
 
-    o_drawbounding(w_current, NULL,
+    o_drawbounding(w_current,
                    geda_list_get_glist( w_current->page_current->selection_list ),
                    x_get_darkcolor(w_current->bb_color), TRUE);
 
@@ -207,7 +207,7 @@ void o_move_end(TOPLEVEL * w_current)
   }
 
   if (w_current->actionfeedback_mode == OUTLINE) {
-    o_drawbounding(w_current, NULL,
+    o_drawbounding(w_current,
                    geda_list_get_glist( w_current->page_current->selection_list ),
                    x_get_darkcolor(w_current->bb_color), TRUE);
   }
@@ -278,7 +278,7 @@ void o_move_end(TOPLEVEL * w_current)
 
   /* erase the bounding box */
   if (w_current->actionfeedback_mode == BOUNDINGBOX) {
-    o_drawbounding(w_current, NULL,
+    o_drawbounding(w_current,
                    geda_list_get_glist( w_current->page_current->selection_list ),
                    x_get_darkcolor(w_current->bb_color), FALSE);
   }
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index eaaf5dd..509b31d 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -375,8 +375,7 @@ void o_text_start(TOPLEVEL *w_current, int screen_x, int screen_y)
     }
   }
 
-  o_drawbounding(w_current, NULL,
-                 w_current->page_current->attrib_place_list,
+  o_drawbounding(w_current, w_current->page_current->attrib_place_list,
                  x_get_darkcolor(w_current->bb_color), TRUE);
 }
 
@@ -417,14 +416,10 @@ void o_text_end(TOPLEVEL *w_current)
 
   /* erase the old bounding box / outline */
   if (w_current->actionfeedback_mode == OUTLINE) {
-    o_drawbounding(
-                   w_current, NULL,
-                   w_current->page_current->attrib_place_list,
+    o_drawbounding(w_current, w_current->page_current->attrib_place_list,
                    x_get_color(w_current->text_color), FALSE);
   } else {
-    o_drawbounding(
-                   w_current, NULL,
-                   w_current->page_current->attrib_place_list,
+    o_drawbounding(w_current, w_current->page_current->attrib_place_list,
                    x_get_darkcolor(w_current->select_color), FALSE);
   }
 
@@ -454,8 +449,7 @@ void o_text_end(TOPLEVEL *w_current)
  */
 void o_text_rubberattrib(TOPLEVEL *w_current)
 {
-  o_drawbounding(w_current, NULL,
-                 w_current->page_current->attrib_place_list,
+  o_drawbounding(w_current, w_current->page_current->attrib_place_list,
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
 
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index fc5cf90..0f95cba 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -88,16 +88,16 @@ gint x_event_expose(GtkWidget *widget, GdkEventExpose *event,
       case(COPY): 
       case(ENDCOPY):
       case(ENDMCOPY):
-        o_drawbounding(w_current, NULL,
+        o_drawbounding(w_current,
                        geda_list_get_glist( w_current->page_current->selection_list ),
                        x_get_darkcolor(w_current->bb_color), FALSE);
         break;
       case(DRAWCOMP):
       case(ENDCOMP):
       case(ENDPASTE):
-	o_drawbounding(w_current, NULL,
-		       w_current->page_current->complex_place_list,
-                       x_get_darkcolor(w_current->bb_color), FALSE); 
+        o_drawbounding(w_current,
+                       w_current->page_current->complex_place_list,
+                       x_get_darkcolor(w_current->bb_color), FALSE);
         break;
 
       case(BUSCONT):
@@ -772,10 +772,8 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 
     if (w_current->inside_action) {
       if (w_current->event_state == ENDCOMP) {
-        o_drawbounding(w_current,
-                       NULL,
-		       w_current->page_current->complex_place_list,
-		       x_get_darkcolor(w_current->bb_color), TRUE);
+        o_drawbounding(w_current, w_current->page_current->complex_place_list,
+                       x_get_darkcolor(w_current->bb_color), TRUE);
 
         w_current->complex_rotate = 
         (w_current->complex_rotate + 90) % 360;
@@ -789,32 +787,27 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 	o_complex_place_changed_run_hook (w_current);	
         w_current->DONT_REDRAW = prev_state;
 	  
-        o_drawbounding(w_current,
-                       NULL,
-		       w_current->page_current->complex_place_list,
-		       x_get_darkcolor(w_current->bb_color), TRUE);
+        o_drawbounding(w_current, w_current->page_current->complex_place_list,
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         return(0);
       } else if (w_current->event_state == ENDTEXT) {
-        o_drawbounding(w_current, NULL,
-                       w_current->page_current->attrib_place_list,
-		       x_get_darkcolor(w_current->bb_color), TRUE);
+        o_drawbounding(w_current, w_current->page_current->attrib_place_list,
+                       x_get_darkcolor(w_current->bb_color), TRUE);
 
         w_current->complex_rotate = 
         (w_current->complex_rotate + 90) % 360;
 
         o_text_place_rotate(w_current);
 
-        o_drawbounding(w_current, NULL,
-                       w_current->page_current->attrib_place_list,
-		       x_get_darkcolor(w_current->bb_color), TRUE);
+        o_drawbounding(w_current, w_current->page_current->attrib_place_list,
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         return(0);
 
       }
       else if (w_current->event_state == ENDMOVE) {
 	prev_state = w_current->event_state;
 	
-	o_drawbounding(w_current, NULL,
-		       w_current->page_current->complex_place_list,
+	o_drawbounding(w_current, w_current->page_current->complex_place_list,
 		       x_get_darkcolor(w_current->bb_color), TRUE);
 	
 	/* Don't allow o_rotate_90 to erase the selection, neither to
@@ -832,8 +825,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 	w_current->rotated_inside ++;	
 	w_current->event_state = prev_state;
 
-	o_drawbounding(w_current, NULL,
-		       w_current->page_current->complex_place_list,
+	o_drawbounding(w_current, w_current->page_current->complex_place_list,
 		       x_get_darkcolor(w_current->bb_color), TRUE);
 	
         return(0);
@@ -1088,12 +1080,12 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
     case(ENDMCOPY):
     case(MCOPY):
     if (w_current->inside_action) {
-      o_drawbounding(w_current, NULL,
+      o_drawbounding(w_current,
                      geda_list_get_glist( w_current->page_current->selection_list ),
                      x_get_darkcolor(w_current->bb_color), FALSE);
       w_current->last_x = fix_x(w_current,  (int) event->x);
       w_current->last_y = fix_y(w_current,  (int) event->y);
-      o_drawbounding(w_current, NULL,
+      o_drawbounding(w_current,
                      geda_list_get_glist( w_current->page_current->selection_list ),
                      x_get_darkcolor(w_current->bb_color), FALSE);
     }

commit 185958029cb58e26d37854c7580bef1b0869a7c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:01 2007 +0100

    Use GLists to store OBJECTs in the "object_buffers[]" paste buffers.
    
    Replaces o_list_copy_all_selection2() with o_glist_copy_all_to_glist().

diff --git a/gschem/include/globals.h b/gschem/include/globals.h
index 5173ccb..8075a25 100644
--- a/gschem/include/globals.h
+++ b/gschem/include/globals.h
@@ -53,7 +53,7 @@ extern int auto_place_mode;
 
 #define MAX_BUFFERS 	5
 /* Global buffers */
-extern OBJECT *object_buffer[MAX_BUFFERS];
+extern GList *object_buffer[MAX_BUFFERS];
 
 /* Hooks */
 extern SCM add_component_hook;
diff --git a/gschem/src/globals.c b/gschem/src/globals.c
index ee1880a..c7c10d2 100644
--- a/gschem/src/globals.c
+++ b/gschem/src/globals.c
@@ -76,7 +76,7 @@ int stroke_info_mode = FALSE;
 int auto_place_mode = FALSE;
 
 /* Global buffers */
-OBJECT *object_buffer[MAX_BUFFERS];
+GList *object_buffer[MAX_BUFFERS];
 
 /* Hooks */
 SCM add_attribute_hook;
diff --git a/gschem/src/i_basic.c b/gschem/src/i_basic.c
index 0f2813a..2397782 100644
--- a/gschem/src/i_basic.c
+++ b/gschem/src/i_basic.c
@@ -471,39 +471,15 @@ void i_update_menus(TOPLEVEL *w_current)
     /* x_menus_popup_sensitivity(w_current, "/Up", FALSE);	*/
   }
 
-  if ((object_buffer[0] != NULL) && (object_buffer[0]->next != NULL)) {
-    x_menus_sensitivity(w_current, "Edit/Paste Buffer", TRUE);
-    x_menus_sensitivity(w_current, "Buffer/Paste from 1", TRUE);
-  } else {
-    x_menus_sensitivity(w_current, "Edit/Paste Buffer", FALSE);
-    x_menus_sensitivity(w_current, "Buffer/Paste from 1", FALSE);
-  }
-
-  if ((object_buffer[1] != NULL) && (object_buffer[1]->next != NULL)) {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 2", TRUE);
-  } else {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 2", FALSE);
-  }
-
-  if ((object_buffer[2] != NULL) && (object_buffer[2]->next != NULL)) {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 3", TRUE);
-  } else {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 3", FALSE);
-  }
-
-  if ((object_buffer[3] != NULL) && (object_buffer[3]->next != NULL)) {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 4", TRUE);
-  } else {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 4", FALSE);
-  }
+  x_menus_sensitivity(w_current, "Edit/Paste Buffer",   (object_buffer[0] != NULL));
+  x_menus_sensitivity(w_current, "Buffer/Paste from 1", (object_buffer[0] != NULL));
+  x_menus_sensitivity(w_current, "Buffer/Paste from 2", (object_buffer[1] != NULL));
+  x_menus_sensitivity(w_current, "Buffer/Paste from 3", (object_buffer[2] != NULL));
+  x_menus_sensitivity(w_current, "Buffer/Paste from 4", (object_buffer[3] != NULL));
+  x_menus_sensitivity(w_current, "Buffer/Paste from 5", (object_buffer[4] != NULL));
 
-  if ((object_buffer[4] != NULL) && (object_buffer[4]->next != NULL)) {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 5", TRUE);
-  } else {
-    x_menus_sensitivity(w_current, "Buffer/Paste from 5", FALSE);
-  }
 }
- 
+
 /*! \brief Set filename as gschem window title
  *  
  *  \par Function Description
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 9ae3886..0ed83ab 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -2051,13 +2051,11 @@ DEFINE_I_CALLBACK(buffer_paste1)
 
   i_update_middle_button(w_current, i_callback_buffer_paste1, _("Paste 1"));
   if (object_buffer[0] != NULL) {
-    if (object_buffer[0]->next != NULL) {
-      o_redraw_cleanstates(w_current);	
-      w_current->buffer_number = 0;
-      w_current->inside_action = 1;
-      i_set_state(w_current, STARTPASTE);
-    }
-  } else { 
+    o_redraw_cleanstates(w_current);
+    w_current->buffer_number = 0;
+    w_current->inside_action = 1;
+    i_set_state(w_current, STARTPASTE);
+  } else {
     i_set_state_msg(w_current, SELECT, _("Empty buffer"));
   }
 }
@@ -2075,12 +2073,10 @@ DEFINE_I_CALLBACK(buffer_paste2)
 
   i_update_middle_button(w_current, i_callback_buffer_paste2, _("Paste 2"));
   if (object_buffer[1] != NULL) {
-    if (object_buffer[1]->next != NULL) {
-      o_redraw_cleanstates(w_current);	
-      w_current->buffer_number = 1;
-      w_current->inside_action = 1;
-      i_set_state(w_current, STARTPASTE);
-    }
+    o_redraw_cleanstates(w_current);
+    w_current->buffer_number = 1;
+    w_current->inside_action = 1;
+    i_set_state(w_current, STARTPASTE);
   } else {
     i_set_state_msg(w_current, SELECT, _("Empty buffer"));
   }
@@ -2099,13 +2095,11 @@ DEFINE_I_CALLBACK(buffer_paste3)
 
   i_update_middle_button(w_current, i_callback_buffer_paste3, _("Paste 3"));
   if (object_buffer[2] != NULL) {
-    if (object_buffer[2]->next != NULL) {
-      o_redraw_cleanstates(w_current);	
-      w_current->buffer_number = 2;
-      w_current->inside_action = 1;
-      i_set_state(w_current, STARTPASTE);
-    }
-  } else { 
+    o_redraw_cleanstates(w_current);
+    w_current->buffer_number = 2;
+    w_current->inside_action = 1;
+    i_set_state(w_current, STARTPASTE);
+  } else {
     i_set_state_msg(w_current, SELECT, _("Empty buffer"));
   }
 }
@@ -2123,12 +2117,10 @@ DEFINE_I_CALLBACK(buffer_paste4)
 
   i_update_middle_button(w_current, i_callback_buffer_paste4, _("Paste 4"));
   if (object_buffer[3] != NULL) {
-    if (object_buffer[3]->next != NULL) {
-      o_redraw_cleanstates(w_current);	
-      w_current->buffer_number = 3;
-      w_current->inside_action = 1;
-      i_set_state(w_current, STARTPASTE);
-    }
+    o_redraw_cleanstates(w_current);
+    w_current->buffer_number = 3;
+    w_current->inside_action = 1;
+    i_set_state(w_current, STARTPASTE);
   } else {
     i_set_state_msg(w_current, SELECT, _("Empty buffer"));
   }
@@ -2147,12 +2139,10 @@ DEFINE_I_CALLBACK(buffer_paste5)
 
   i_update_middle_button(w_current, i_callback_buffer_paste5, _("Paste 5"));
   if (object_buffer[4] != NULL) {
-    if (object_buffer[4]->next != NULL) {
-      o_redraw_cleanstates(w_current);	
-      w_current->buffer_number = 4;
-      w_current->inside_action = 1;
-      i_set_state(w_current, STARTPASTE);
-    }
+    o_redraw_cleanstates(w_current);
+    w_current->buffer_number = 4;
+    w_current->inside_action = 1;
+    i_set_state(w_current, STARTPASTE);
   } else {
     i_set_state_msg(w_current, SELECT, _("Empty buffer"));
   }
@@ -2173,11 +2163,6 @@ DEFINE_I_CALLBACK(buffer_paste1_hotkey)
     return;
   }
 
-  if (object_buffer[0]->next == NULL)  {
-    return;
-	
-  }
-	
   o_buffer_paste_start(w_current, mouse_x, mouse_y, 0);
 }
 
@@ -2196,11 +2181,6 @@ DEFINE_I_CALLBACK(buffer_paste2_hotkey)
     return;
   }
 
-  if (object_buffer[1]->next == NULL)  {
-    return;
-	
-  }
-
   o_buffer_paste_start(w_current, mouse_x, mouse_y, 1);
 }
 
@@ -2219,11 +2199,6 @@ DEFINE_I_CALLBACK(buffer_paste3_hotkey)
     return;
   }
 
-  if (object_buffer[2]->next == NULL)  {
-    return;
-	
-  }
-
   o_buffer_paste_start(w_current, mouse_x, mouse_y, 2);
 }
 
@@ -2242,11 +2217,6 @@ DEFINE_I_CALLBACK(buffer_paste4_hotkey)
     return;
   }
 
-  if (object_buffer[3]->next == NULL)  {
-    return;
-	
-  }
-
   o_buffer_paste_start(w_current, mouse_x, mouse_y, 3);
 }
 
@@ -2265,11 +2235,6 @@ DEFINE_I_CALLBACK(buffer_paste5_hotkey)
     return;
   }
 
-  if (object_buffer[4]->next == NULL)  {
-    return;
-	
-  }
-
   o_buffer_paste_start(w_current, mouse_x, mouse_y, 4);
 }
 
diff --git a/gschem/src/o_buffer.c b/gschem/src/o_buffer.c
index 6bd401f..0fa8fa3 100644
--- a/gschem/src/o_buffer.c
+++ b/gschem/src/o_buffer.c
@@ -45,26 +45,16 @@ void o_buffer_copy(TOPLEVEL *w_current, int buf_num)
 
   s_current = geda_list_get_glist( w_current->page_current->selection_list );
 
-  if (object_buffer[buf_num] == NULL) {
-    object_buffer[buf_num] = s_basic_init_object("buffer0_head");
-    object_buffer[buf_num]->type = OBJ_HEAD;
-  } else {
-    o_list_delete_rest(w_current, object_buffer[buf_num]);
-    object_buffer[buf_num]->next = NULL;
+  if (object_buffer[buf_num] != NULL) {
+    s_delete_object_glist(w_current, object_buffer[buf_num]);
+    object_buffer[buf_num] = NULL;
   }
 
   w_current->ADDING_SEL = 1;
-  o_list_copy_all_selection2(w_current, s_current, 
-                             object_buffer[buf_num], SELECTION_FLAG);
+  object_buffer[buf_num] =
+    o_glist_copy_all_to_glist(w_current, s_current,
+                              object_buffer[buf_num], SELECTION_FLAG);
   w_current->ADDING_SEL = 0;
-        
-#if DEBUG
-  o_current = object_buffer[buf_num];
-  while(o_current != NULL) {
-    printf("- %s\n", o_current->name);
-    o_current = o_current->next;
-  }
-#endif
 }
 
 /*! \todo Finish function documentation!!!
@@ -83,27 +73,17 @@ void o_buffer_cut(TOPLEVEL *w_current, int buf_num)
 
   s_current = geda_list_get_glist( w_current->page_current->selection_list );
 
-  if (object_buffer[buf_num] == NULL) {
-    object_buffer[buf_num] = s_basic_init_object("buffer0_head");
-    object_buffer[buf_num]->type = OBJ_HEAD;
-  } else {
-    o_list_delete_rest(w_current, object_buffer[buf_num]);
-    object_buffer[buf_num]->next = NULL;
+  if (object_buffer[buf_num] != NULL) {
+    s_delete_object_glist(w_current, object_buffer[buf_num]);
+    object_buffer[buf_num] = NULL;
   }
         
   w_current->ADDING_SEL = 1;
-  o_list_copy_all_selection2(w_current, s_current, 
-                             object_buffer[buf_num], SELECTION_FLAG);
+  object_buffer[buf_num] =
+    o_glist_copy_all_to_glist(w_current, s_current,
+                              object_buffer[buf_num], SELECTION_FLAG);
   w_current->ADDING_SEL = 0;
   o_delete(w_current);
-
-#if DEBUG
-  o_current = object_buffer[buf_num];
-  while(o_current != NULL) {
-    printf("- %s\n", o_current->name);
-    o_current = o_current->next;
-  }
-#endif
 }
 
 /*! \todo Finish function documentation!!!
@@ -122,9 +102,9 @@ void o_buffer_paste_start(TOPLEVEL *w_current, int screen_x, int screen_y,
     return;
   }
 
-  if (!world_get_object_list_bounds(w_current, object_buffer[buf_num],
-                                    &rleft, &rtop,
-                                    &rright, &rbottom)) {
+  if (!world_get_object_glist_bounds(w_current, object_buffer[buf_num],
+                                     &rleft, &rtop,
+                                     &rright, &rbottom)) {
     /* If the paste buffer doesn't have any objects
      * to define its any bounds, we drop out here */
     return;
@@ -135,7 +115,7 @@ void o_buffer_paste_start(TOPLEVEL *w_current, int screen_x, int screen_y,
   y = snap_grid(w_current, rtop);
 
   w_current->ADDING_SEL = 1;
-  o_list_translate_world(w_current, -x, -y, object_buffer[buf_num]);
+  o_glist_translate_world(w_current, -x, -y, object_buffer[buf_num]);
   w_current->ADDING_SEL = 0;
 
   /* now translate selection to current position */
@@ -144,7 +124,7 @@ void o_buffer_paste_start(TOPLEVEL *w_current, int screen_x, int screen_y,
   y = snap_grid(w_current, y);
 
   w_current->ADDING_SEL = 1;
-  o_list_translate_world(w_current, x, y, object_buffer[buf_num]);
+  o_glist_translate_world(w_current, x, y, object_buffer[buf_num]);
   w_current->ADDING_SEL = 0;
 
   w_current->last_x = w_current->start_x = fix_x(w_current, screen_x);
@@ -154,9 +134,7 @@ void o_buffer_paste_start(TOPLEVEL *w_current, int screen_x, int screen_y,
   /* store the buffer number for future use */
   w_current->buffer_number = buf_num;
 
-  o_drawbounding(w_current,
-                 object_buffer[buf_num]->next,
-                 NULL,
+  o_drawbounding(w_current, NULL, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), TRUE);
 }
 
@@ -183,9 +161,7 @@ void o_buffer_paste_end(TOPLEVEL *w_current, int screen_x, int screen_y,
   }
 
   /* erase old image */
-  o_drawbounding(w_current,
-                 object_buffer[buf_num]->next,
-                 NULL,
+  o_drawbounding(w_current, NULL, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), FALSE);
 
   /* get the location where we ended */
@@ -204,11 +180,11 @@ void o_buffer_paste_end(TOPLEVEL *w_current, int screen_x, int screen_y,
   w_diff_x = w_x - w_start_x;
   w_diff_y = w_y - w_start_y;
   w_current->ADDING_SEL = 1;
-  o_list_translate_world(w_current, w_diff_x, w_diff_y,
-                         object_buffer[buf_num]);
+  o_glist_translate_world(w_current, w_diff_x, w_diff_y,
+                          object_buffer[buf_num]);
   w_current->ADDING_SEL = 0;
 
-  o_current = object_buffer[buf_num]->next;
+  o_current = object_buffer[buf_num]->data;
   p_current = w_current->page_current;
 
   o_saved = p_current->object_tail;	
@@ -257,9 +233,7 @@ void o_buffer_paste_end(TOPLEVEL *w_current, int screen_x, int screen_y,
  */
 void o_buffer_paste_rubberpaste(TOPLEVEL *w_current, int buf_num)
 {
-  o_drawbounding(w_current,
-                 object_buffer[buf_num]->next,
-                 NULL,
+  o_drawbounding(w_current, NULL, object_buffer[buf_num],
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
 
@@ -288,8 +262,7 @@ void o_buffer_free(TOPLEVEL *w_current)
 
   for (i = 0 ; i < MAX_BUFFERS; i++) {
     if (object_buffer[i]) {
-      s_delete_list_fromstart(w_current, 
-                              object_buffer[i]);
+      s_delete_object_glist(w_current, object_buffer[i]);
       object_buffer[i] = NULL;
     }
   }
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 1567d7a..b4e2a96 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -331,7 +331,7 @@ double o_line_length(OBJECT *object);
 /* o_list.c */
 OBJECT *o_list_copy_to(TOPLEVEL *toplevel, OBJECT *list_head, OBJECT *selected, int flag, OBJECT **return_end);
 OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head, OBJECT *dest_list_head, int flag);
-OBJECT *o_list_copy_all_selection2(TOPLEVEL *toplevel, GList *src_list_head, OBJECT *dest_list_head, int flag);
+GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel, GList *src_list, GList *dest_list, int flag);
 OBJECT *o_list_search(OBJECT *list, OBJECT *current);
 void o_list_delete(TOPLEVEL *toplevel, OBJECT *list, OBJECT *delete);
 void o_list_delete_rest(TOPLEVEL *toplevel, OBJECT *list);
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 15de6b2..bb38fb0 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -244,122 +244,113 @@ OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
  *  \par Function Description
  *  you need to pass in a head_node for dest_list_head
  *  flag is either NORMAL_FLAG or SELECTION_FLAG
- *  this function copies the objects in the src SELECTION list
- *  to the OBJECT list in dest_list_head
- *  this routine assumes that objects in src_list_head are selected
+ *  this function copies the objects in the src GList src_list
+ *  to the destination GList dest_list
+ *  this routine assumes that objects in src_list are selected
  *  objects are unselected before they are copied and then reselected
  *  this is necessary to preserve the color info
  *
  *  \param [in] toplevel       The TOPLEVEL object.
- *  \param [in] src_list_head   
- *  \param [in] dest_list_head  
+ *  \param [in] src_list       The GList to copy from.
+ *  \param [in] dest_list      The GList to copy to.
  *  \param [in] flag
- *  \return OBJECT pointer.
+ *  \return the dest_list GList with objects appended to it.
  */
-OBJECT *o_list_copy_all_selection2(TOPLEVEL *toplevel,
-				   GList *src_list_head, 
-				   OBJECT *dest_list_head, int flag)
+GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
+                                 GList *src_list,
+                                 GList *dest_list, int flag)
 {
-  GList *src;
-  OBJECT *object;
-  OBJECT *dest;
-  OBJECT *temp_parent=NULL;
+  GList *src, *dest;
+  OBJECT *src_object, *dst_object;
   int adding_sel_save;
 
-  src = src_list_head;
-  dest = dest_list_head;
-
-  temp_parent = toplevel->page_current->object_parent;
-  toplevel->page_current->object_parent = dest_list_head;
-
-  if (dest == NULL) {
-    toplevel->page_current->object_parent = temp_parent;
-    return(NULL);
-  }
+  src = src_list;
+  /* Reverse any existing items, as we will prepend, then reverse at the end */
+  dest = g_list_reverse (dest_list);
 
   if (src == NULL) {
-    toplevel->page_current->object_parent = temp_parent;
     return(NULL);
   }
 
+  /* Save ADDING_SEL as o_list_copy_to() sets it */
   adding_sel_save = toplevel->ADDING_SEL;
 
   /* first do all NON text items */
   while(src != NULL) {
-
-    object = (OBJECT *) src->data;
+    src_object = (OBJECT *) src->data;
 
     /* unselect the object before the copy */
-    o_selection_unselect(object);	
-
-    if (object->type != OBJ_TEXT && object->type != OBJ_HEAD) {
-      dest->next = o_list_copy_to(toplevel, NULL, object,
-                                  flag, NULL);
-      dest->next->prev = dest;
-      dest = dest->next;
-      dest->sid = global_sid++;
+    o_selection_unselect(src_object);
+
+    if (src_object->type != OBJ_TEXT && src_object->type != OBJ_HEAD) {
+      dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
+      dst_object->sid = global_sid++;
+      /* Link the OBJECT nodes in the GList to allow attrib attaching */
+      if (dest != NULL) {
+        dst_object->prev = (OBJECT *)dest->data;
+        dst_object->prev->next = dst_object;
+      } else {
+        dst_object->prev = NULL;
+      }
+      dst_object->next = NULL;
+      dest = g_list_prepend (dest, dst_object);
     }
 
     /* reselect it */
-    o_selection_select(object, SELECT_COLOR);
+    o_selection_select(src_object, SELECT_COLOR);
 
     src = g_list_next(src);
   }
 
-  src = src_list_head;
-  /*dest = dest_list_head; out since we want to add to the end */
-
-  if (dest == NULL) {
-    toplevel->page_current->object_parent = temp_parent;
-    return(NULL);
-  }
-
-  if (src == NULL) {
-    toplevel->page_current->object_parent = temp_parent;
-    return(NULL);
-  }
+  src = src_list;
 
   /* then do all text items */
   while(src != NULL) {
-
-    object = (OBJECT *) src->data;
+    src_object = (OBJECT *) src->data;
 
     /* unselect the object before the copy */
-    o_selection_unselect(object);	
-
-    if (object->type == OBJ_TEXT) {
-      dest->next = o_list_copy_to(toplevel, NULL, object,
-                                  flag, NULL);
-	
-      dest->next->prev = dest;
-      dest = dest->next;
-      dest->sid = global_sid++;
+    o_selection_unselect(src_object);
+
+    if (src_object->type == OBJ_TEXT) {
+      dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
+      dst_object->sid = global_sid++;
+      /* Link the OBJECT nodes in the GList to allow attrib attaching */
+      if (dest != NULL) {
+        dst_object->prev = (OBJECT *)dest->data;
+        dst_object->prev->next = dst_object;
+      } else {
+        dst_object->prev = NULL;
+      }
+      dst_object->next = NULL;
+      dest = g_list_prepend (dest, dst_object);
 
-      if (object->attached_to /*&& !toplevel->ADDING_SEL*/) {
-        if (object->attached_to->copied_to) {
+      if (src_object->attached_to /*&& !toplevel->ADDING_SEL*/) {
+        if (src_object->attached_to->copied_to) {
           o_attrib_attach(toplevel,
-                          toplevel->page_current->object_parent,
-                          dest, object->attached_to->copied_to);     
+                          (OBJECT *)dest->data, /* This param is a hack */
+                          dst_object, src_object->attached_to->copied_to);
         }
       }
     }
 
     /* reselect it */
-    o_selection_select(object, SELECT_COLOR);
+    o_selection_select(src_object, SELECT_COLOR);
 
     src = g_list_next(src);
   }
 
   /* Clean up dangling ATTRIB.copied_to pointers */
-  src = src_list_head;
+  src = src_list;
   while(src != NULL) {
-    object = src->data;
-    o_attrib_list_copied_to (object->attribs, NULL);
+    src_object = src->data;
+    o_attrib_list_copied_to (src_object->attribs, NULL);
     src = g_list_next (src);
   }
 
+  /* Reverse the list to be in the correct order */
+  dest = g_list_reverse (dest);
+
   toplevel->ADDING_SEL = adding_sel_save;
-  toplevel->page_current->object_parent = temp_parent;
 
   return(dest);
 }

commit 38d3c48fd5a2ea57af5d772854393b39fd3b7e78
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Oct 4 19:42:00 2007 +0100

    Make attribute / text placing use a new attrib_place_list GList.

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 5e3169a..9ae3886 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3486,8 +3486,8 @@ DEFINE_I_CALLBACK(cancel)
   }
 
   /* it is possible to cancel in the middle of a complex place
-   * so lets be sure to clean up the complex_place_head
-   * structure and also clean up the attrib_place_head.
+   * so lets be sure to clean up the complex_place_list
+   * structure and also clean up the attrib_place_list.
    * remember these don't remove the head structure */
 
   /* If it is a move command, then free the complex place list WITHOUT
@@ -3504,8 +3504,9 @@ DEFINE_I_CALLBACK(cancel)
   }
   w_current->page_current->complex_place_list = NULL;
 
-  o_list_delete_rest(w_current,
-                     w_current->page_current->attrib_place_head);
+  s_delete_object_glist(w_current,
+                        w_current->page_current->attrib_place_list);
+  w_current->page_current->attrib_place_list = NULL;
 
   /* also free internal current_attribute */
   o_attrib_free_current(w_current);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 7d94c0c..6c47e1f 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -72,10 +72,8 @@ void o_redraw_all(TOPLEVEL *w_current)
 
       case(DRAWTEXT):
       case(ENDTEXT):
-        o_drawbounding(w_current, w_current->
-                       page_current->
-                       attrib_place_head->next,
-                       NULL, 
+        o_drawbounding(w_current, NULL,
+                       w_current->page_current->attrib_place_list,
                        x_get_darkcolor(w_current->bb_color), FALSE);
         break;
       case (GRIPS):
@@ -699,17 +697,18 @@ int o_redraw_cleanstates(TOPLEVEL *w_current)
       /* from i_callback_cancel() */
       o_redraw_all(w_current);
       /* it is possible to cancel in the middle of a complex place
-       * so lets be sure to clean up the complex_place_head
-       * structure and also clean up the attrib_place_head.
+       * so lets be sure to clean up the complex_place_list
+       * structure and also clean up the attrib_place_list.
        * remember these don't remove the head structure */
       /* The complex place is a reference to the real objects, so don't
 	 free the objects here */
       g_list_free (w_current->page_current->complex_place_list);
       w_current->page_current->complex_place_list = NULL;
 
-      o_list_delete_rest(w_current,
-			 w_current->page_current->attrib_place_head);
- 
+      s_delete_object_glist (w_current,
+                             w_current->page_current->attrib_place_list);
+      w_current->page_current->attrib_place_list = NULL;
+
       /* also free internal current_attribute */
       o_attrib_free_current(w_current);     
       w_current->inside_action = 0;
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index 711c37d..eaaf5dd 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -334,10 +334,9 @@ void o_text_start(TOPLEVEL *w_current, int screen_x, int screen_y)
                 &x,
                 &y);
 
-  /* remove the old attrib list if it exists without killing the
-     head structure */
-  o_list_delete_rest(w_current,
-                     w_current->page_current->attrib_place_head);
+  /* remove the old attrib list if it exists */
+  s_delete_object_glist(w_current, w_current->page_current->attrib_place_list);
+  w_current->page_current->attrib_place_list = NULL;
 
   value = w_current->current_attribute;
 
@@ -357,18 +356,17 @@ void o_text_start(TOPLEVEL *w_current, int screen_x, int screen_y)
   }
 
   /* here you need to add OBJ_TEXT when it's done */
-  w_current->page_current->attrib_place_tail =
-  (OBJECT *) o_text_add(
-			w_current,
-			w_current->page_current->attrib_place_head,
-				/* type changed from TEXT to TEXT */
-			OBJ_TEXT, w_current->text_color,
-			x, y, LOWER_LEFT, 0, /* zero is angle */
-			w_current->current_attribute,
-			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->page_current->attrib_place_list =
+    g_list_append(w_current->page_current->attrib_place_list,
+                  o_text_add(w_current, NULL,
+                              /* type changed from TEXT to TEXT */
+                             OBJ_TEXT, w_current->text_color,
+                             x, y, LOWER_LEFT, 0, /* zero is angle */
+                             w_current->current_attribute,
+                             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));
 
   if (w_current->complex_rotate) {
     temp = w_current->complex_rotate / 90;
@@ -377,9 +375,8 @@ void o_text_start(TOPLEVEL *w_current, int screen_x, int screen_y)
     }
   }
 
-  o_drawbounding(w_current,
-                 w_current->page_current->attrib_place_head->next,
-                 NULL,
+  o_drawbounding(w_current, NULL,
+                 w_current->page_current->attrib_place_list,
                  x_get_darkcolor(w_current->bb_color), TRUE);
 }
 
@@ -421,15 +418,13 @@ void o_text_end(TOPLEVEL *w_current)
   /* erase the old bounding box / outline */
   if (w_current->actionfeedback_mode == OUTLINE) {
     o_drawbounding(
-                   w_current,
-                   w_current->page_current->attrib_place_head->next,
-                   NULL,
+                   w_current, NULL,
+                   w_current->page_current->attrib_place_list,
                    x_get_color(w_current->text_color), FALSE);
   } else {
     o_drawbounding(
-                   w_current,
-                   w_current->page_current->attrib_place_head->next,
-                   NULL,
+                   w_current, NULL,
+                   w_current->page_current->attrib_place_list,
                    x_get_darkcolor(w_current->select_color), FALSE);
   }
 
@@ -459,9 +454,8 @@ void o_text_end(TOPLEVEL *w_current)
  */
 void o_text_rubberattrib(TOPLEVEL *w_current)
 {
-  o_drawbounding(w_current,
-                 w_current->page_current->attrib_place_head->next,
-                 NULL,
+  o_drawbounding(w_current, NULL,
+                 w_current->page_current->attrib_place_list,
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
 
@@ -583,18 +577,21 @@ void o_text_change(TOPLEVEL *w_current, OBJECT *object, char *string,
 void o_text_place_rotate(TOPLEVEL *w_current)
 {
   OBJECT *o_current;
+  GList *iter;
+
   int x_local = -1;
   int y_local = -1;
 
-  o_current = w_current->page_current->attrib_place_head->next;
-  while(o_current) {
+  for (iter = w_current->page_current->attrib_place_list;
+       iter != NULL;
+       iter = g_list_next(iter)) {
+    o_current = iter->data;
     switch(o_current->type) {	
       case(OBJ_TEXT):
         x_local = o_current->text->x;
         y_local = o_current->text->y;
         break;
     }
-    o_current = o_current->next;
   }
 
   if (x_local == -1) {
@@ -602,14 +599,15 @@ void o_text_place_rotate(TOPLEVEL *w_current)
     return;
   }
 
-  o_current = w_current->page_current->attrib_place_head->next;
-  while(o_current) {
+  for (iter = w_current->page_current->attrib_place_list;
+       iter != NULL;
+       iter = g_list_next(iter)) {
+    o_current = iter->data;
     switch(o_current->type) {	
 
       case(OBJ_TEXT):
         o_text_rotate_world(w_current, x_local, y_local, 90, o_current);
         break;
     }
-    o_current = o_current->next;
   }
 }
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 644f1b7..fc5cf90 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -795,10 +795,8 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 		       x_get_darkcolor(w_current->bb_color), TRUE);
         return(0);
       } else if (w_current->event_state == ENDTEXT) {
-        o_drawbounding(w_current,
-                       w_current->page_current->
-                       attrib_place_head->next, 
-                       NULL, 
+        o_drawbounding(w_current, NULL,
+                       w_current->page_current->attrib_place_list,
 		       x_get_darkcolor(w_current->bb_color), TRUE);
 
         w_current->complex_rotate = 
@@ -806,10 +804,8 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 
         o_text_place_rotate(w_current);
 
-        o_drawbounding(w_current,
-                       w_current->page_current->
-                       attrib_place_head->next, 
-                       NULL, 
+        o_drawbounding(w_current, NULL,
+                       w_current->page_current->attrib_place_list,
 		       x_get_darkcolor(w_current->bb_color), TRUE);
         return(0);
 
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index 2743824..1a677f1 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -351,8 +351,7 @@ struct st_page {
   OBJECT *object_parent;
   SELECTION *selection_list; /* new selection mechanism */
   GList *complex_place_list;
-  OBJECT *attrib_place_head;
-  OBJECT *attrib_place_tail; 
+  GList *attrib_place_list;
   OBJECT *object_lastplace;
   STRETCH *stretch_head; 
   STRETCH *stretch_tail; 
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 44f2a1e..6506685 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -109,12 +109,8 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
   page->stretch_head = page->stretch_tail = s_stretch_new_head();
 
   page->complex_place_list = NULL;
+  page->attrib_place_list = NULL;
 
-  /* add p_attrib and p_attached_to */
-  page->attrib_place_tail = page->attrib_place_head = 
-  s_basic_init_object("attrib_place_head");
-  page->attrib_place_tail->type = OBJ_HEAD;
-	
   /* do this just to be sure that object tail is truely correct */
   page->object_tail = return_tail(page->object_head);
 
@@ -214,7 +210,9 @@ void s_page_delete (TOPLEVEL *toplevel, PAGE *page)
   /* So don't free the objects there. */
   g_list_free (page->complex_place_list);
   page->complex_place_list = NULL;
-  s_delete_list_fromstart (toplevel, page->attrib_place_head);
+  /* Free the objects in the attrib place list. */
+  s_delete_object_glist (toplevel, page->attrib_place_list);
+  page->attrib_place_list = NULL;
 
 #if DEBUG
   printf("Freeing page: %s\n", page->page_filename);




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