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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-94-g15ed098)



The branch, master has been updated
       via  15ed098497ddac2bc671657c4d4347eb509f7449 (commit)
       via  4971020530b55ac275cf30e48fd4c10cd6d8fb4c (commit)
      from  44fba5a262c283f927f08f51966c74d62dca7988 (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/src/g_hook.c           |    2 +-
 gschem/src/o_complex.c        |    6 +++---
 gschem/src/o_misc.c           |    4 ++--
 gschem/src/o_net.c            |    4 ++--
 libgeda/include/prototype.h   |    3 ++-
 libgeda/src/o_complex_basic.c |   22 ++++++++--------------
 libgeda/src/s_page.c          |   14 ++++++++++++++
 7 files changed, 32 insertions(+), 23 deletions(-)


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

commit 15ed098497ddac2bc671657c4d4347eb509f7449
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 31 17:25:50 2008 +0000

    Refactor o_complex_promote_attribs() not to link the promoted objects.
    
    By returning the GList of promoted attributes, we allow the caller to
    use whatever specialised linking procedures are appropriate for the
    list they are linking to. For example, linking objects into the PAGE's
    object_list might in future require calling notification functions.

:100644 100644 aa1435c... 51614c4... M	gschem/src/g_hook.c
:100644 100644 59f3902... f5be3a4... M	gschem/src/o_complex.c
:100644 100644 dac8ebe... 7b356c5... M	gschem/src/o_misc.c
:100644 100644 483247a... 8c96100... M	gschem/src/o_net.c
:100644 100644 dd96a2b... 1289c60... M	libgeda/include/prototype.h
:100644 100644 98ab771... f7b6c46... M	libgeda/src/o_complex_basic.c

commit 4971020530b55ac275cf30e48fd4c10cd6d8fb4c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 31 17:25:43 2008 +0000

    libgeda: Add new API for adding a GList of objects to the page
    
    s_page_append_list (PAGE *page, GList *obj_list) will take the GList
    passed as an argument and append it to the page's object list.
    
    The passed GList is not copied, so the caller must not free it after
    calling this function.

:100644 100644 c665356... dd96a2b... M	libgeda/include/prototype.h
:100644 100644 0a80c92... f5926e4... M	libgeda/src/s_page.c

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

commit 15ed098497ddac2bc671657c4d4347eb509f7449
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 31 17:25:50 2008 +0000

    Refactor o_complex_promote_attribs() not to link the promoted objects.
    
    By returning the GList of promoted attributes, we allow the caller to
    use whatever specialised linking procedures are appropriate for the
    list they are linking to. For example, linking objects into the PAGE's
    object_list might in future require calling notification functions.

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index aa1435c..51614c4 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -706,8 +706,8 @@ SCM g_add_component(SCM page_smob, SCM scm_comp_name, SCM scm_x, SCM scm_y,
 
   new_obj = o_complex_new (toplevel, 'C', DEFAULT_COLOR, x, y, angle, mirror,
                            clib, comp_name, selectable);
+  s_page_append_list (page, o_complex_promote_attribs (toplevel, new_obj));
   s_page_append (page, new_obj);
-  o_complex_promote_attribs (toplevel, new_obj, &page->object_list);
   
   /* 
    * For now, do not redraw the newly added complex, since this might cause
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 59f3902..f5be3a4 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -111,11 +111,11 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
                                 0, 0, 0, 0, sym, sym_name, 1);
 
     toplevel->page_current->place_list =
+      g_list_concat (toplevel->page_current->place_list,
+        o_complex_promote_attribs (toplevel, new_object));
+    toplevel->page_current->place_list =
       g_list_append (toplevel->page_current->place_list, new_object);
 
-    o_complex_promote_attribs (toplevel, new_object,
-                               &toplevel->page_current->place_list);
-
     toplevel->ADDING_SEL = 0;
 
     /* Flag the symbol as embedded if necessary */
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index dac8ebe..7b356c5 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -711,8 +711,8 @@ void o_update_component(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
                                clib, o_current->complex_basename,
                                1);
 
-  temp_list = g_list_append (NULL, new_complex);
-  o_complex_promote_attribs (toplevel, new_complex, &temp_list);
+  temp_list = o_complex_promote_attribs (toplevel, new_complex);
+  temp_list = g_list_append (temp_list, new_complex);
 
   /* updating the old complex with data from the new one */
   /* first process the prim_objs: */
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 483247a..8c96100 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -1246,9 +1246,9 @@ int o_net_add_busrippers(GSCHEM_TOPLEVEL *w_current, OBJECT *net_obj,
                                    complex_angle, 0,
                                    rippersym,
                                    toplevel->bus_ripper_symname, 1);
+          s_page_append_list (toplevel->page_current,
+                              o_complex_promote_attribs (toplevel, new_obj));
           s_page_append (toplevel->page_current, new_obj);
-          o_complex_promote_attribs (toplevel, new_obj,
-                                     &toplevel->page_current->object_list);
 
           o_invalidate (w_current, new_obj);
         } else {
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index dd96a2b..1289c60 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -188,7 +188,7 @@ int world_get_object_glist_bounds(TOPLEVEL *toplevel, GList *o_list,
 int o_complex_is_embedded(OBJECT *o_current);
 GList *o_complex_get_toplevel_attribs (TOPLEVEL *toplevel, GList *obj_list);
 GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int detach);
-void o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object, GList **obj_list);
+GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object);
 void o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *object);
 OBJECT *o_complex_new(TOPLEVEL *toplevel, char type, int color, int x, int y, int angle, int mirror, const CLibSymbol *clib_sym, const gchar *basename, int selectable);
 OBJECT *o_complex_new_embedded(TOPLEVEL *toplevel, char type, int color, int x, int y, int angle, int mirror, const gchar *basename, int selectable);
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 98ab771..f7b6c46 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -324,32 +324,26 @@ GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int detach)
 }
 
 
-/*! \brief Promote attributes from the passed OBJECT
+/*! \brief Promote attributes from the passed complex OBJECT
  *
  *  \par Function Description
- *  Promotes attributes from the passed OBJECT, linking them into the
- *  OBJECT linked list immediately prior to the passed OBJECT.
+ *  Promotes attributes from the passed complex OBJECT, detaching
+ *  them from inside the object and returning them in a list.
  *
  *  \param [in]  toplevel The toplevel environment.
- *  \param [in]  object   The complex object who's attributes are being promtoed.
- *  \param [in]  obj_list The object list which recieves the new objects
- *  \returns The start
+ *  \param [in]  object   The complex who's attributes are being promoted.
+ *  \return A GList list of promoted attributes.
  */
-void o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object,
-                                GList **obj_list)
+GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object)
 {
-  GList *promoted, *last;
+  GList *promoted;
 
   promoted = o_complex_get_promotable (toplevel, object, TRUE);
 
   /* Attach promoted attributes to the original complex object */
   o_attrib_attach_list (toplevel, promoted, object, TRUE);
 
-  /* Insert the promoted attributes before the tail of the object list */
-  last = g_list_last (*obj_list);
-  *obj_list = g_list_remove_link (*obj_list, last);
-  *obj_list = g_list_concat (*obj_list, promoted);
-  *obj_list = g_list_concat (*obj_list, last);
+  return promoted;
 }
 
 

commit 4971020530b55ac275cf30e48fd4c10cd6d8fb4c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 31 17:25:43 2008 +0000

    libgeda: Add new API for adding a GList of objects to the page
    
    s_page_append_list (PAGE *page, GList *obj_list) will take the GList
    passed as an argument and append it to the page's object list.
    
    The passed GList is not copied, so the caller must not free it after
    calling this function.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index c665356..dd96a2b 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -414,6 +414,7 @@ void s_page_clear_changed (GedaPageList *list);
 void s_page_autosave_init(TOPLEVEL *toplevel);
 gint s_page_autosave (TOPLEVEL *toplevel);
 void s_page_append (PAGE *page, OBJECT *object);
+void s_page_append_list (PAGE *page, GList *obj_list);
 void s_page_remove (PAGE *page, OBJECT *object);
 void s_page_delete_objects (TOPLEVEL *toplevel, PAGE *page);
 GList *s_page_objects_in_region (TOPLEVEL *toplevel, PAGE *page, int min_x, int min_y, int max_x, int max_y);
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 0a80c92..f5926e4 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -523,6 +523,20 @@ void s_page_append (PAGE *page, OBJECT *object)
   page->object_list = g_list_append (page->object_list, object);
 }
 
+/*! \brief Append a GList of OBJECTs to the PAGE
+ *
+ *  \par Function Description
+ *  Links the passed OBJECT GList to the end of the PAGE's
+ *  object_list.
+ *
+ *  \param [in] page      The PAGE the objects are being added to.
+ *  \param [in] obj_list  The OBJECT list being added to the page.
+ */
+void s_page_append_list (PAGE *page, GList *obj_list)
+{
+  page->object_list = g_list_concat (page->object_list, obj_list);
+}
+
 /*! \brief Remove an OBJECT from the PAGE
  *
  *  \par Function Description




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