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

gEDA-cvs: gaf.git: branch: stable-1.6 updated (1.6.1-20100214-19-ge1c3ba4)



The branch, stable-1.6 has been updated
       via  e1c3ba4c453716f3b0cb475a9cc358f34a4683d9 (commit)
       via  28ee546a15e360ab1b870205437905abc876e82e (commit)
       via  c538d2c97885876d695ff45a8457c8d74e872809 (commit)
       via  06f09ecaee96c130825f238689aef530657f892f (commit)
      from  6e54d862d31c1cd97ae54eb457c980f8053b4f10 (commit)

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


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

 libgeda/include/prototype_priv.h |    2 +
 libgeda/src/f_print.c            |    4 +-
 libgeda/src/o_basic.c            |   49 +++++++++++++++++++++++++++++++++----
 libgeda/src/o_complex_basic.c    |   15 +++++++----
 libgeda/src/o_text_basic.c       |    5 ++-
 5 files changed, 60 insertions(+), 15 deletions(-)


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

commit e1c3ba4c453716f3b0cb475a9cc358f34a4683d9
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: invalidate bounds in attribute promotion
    
    Call o_bounds_invalidate in o_complex_promote_attribs
    and in o_complex_remove_promotable_attribs.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Closes-bug: lp-700841
    
    (cherry picked from commit 2d07ac4933633837fc394e5001a452c7db290d13)

:100644 100644 58a372e... eddd343... M	libgeda/src/o_complex_basic.c

commit 28ee546a15e360ab1b870205437905abc876e82e
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: getter for object visibility field
    
    Add method o_is_visible to query value of visibility field.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    Affects-bug: lp-701431
    
    (cherry picked from commit 45cb94eff246e342a0331bf8b0c908fdccda1359)

:100644 100644 48e1e1b... d0ec1e3... M	libgeda/include/prototype_priv.h
:100644 100644 8afa46a... 74bed77... M	libgeda/src/f_print.c
:100644 100644 16d48ab... e816a07... M	libgeda/src/o_basic.c
:100644 100644 69b638a... 58a372e... M	libgeda/src/o_complex_basic.c
:100644 100644 b8e5883... aa65a73... M	libgeda/src/o_text_basic.c

commit c538d2c97885876d695ff45a8457c8d74e872809
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: setter for object visibility field
    
    Add method o_set_visibility to change value of visibility field.
    If object visibility is changed, mark its cached bounds as invalid.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    Affects-bug: lp-701431
    
    (cherry picked from commit 37f3c42bf3d509bde85dec3150bfdca0a3e81551)

:100644 100644 fce2c75... 48e1e1b... M	libgeda/include/prototype_priv.h
:100644 100644 d43b609... 16d48ab... M	libgeda/src/o_basic.c
:100644 100644 b83a90c... 69b638a... M	libgeda/src/o_complex_basic.c
:100644 100644 41022e4... b8e5883... M	libgeda/src/o_text_basic.c

commit 06f09ecaee96c130825f238689aef530657f892f
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: add recursion in o_bounds_invalidate
    
    Instead of invalidating cached bounds for single object, follow the
    hierarchy and invalidate cached bounds of all parents as well.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    
    (cherry picked from commit bb27719f730b078dc250196af40141ff7cac8636)

:100644 100644 635ede4... d43b609... M	libgeda/src/o_basic.c

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

commit e1c3ba4c453716f3b0cb475a9cc358f34a4683d9
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: invalidate bounds in attribute promotion
    
    Call o_bounds_invalidate in o_complex_promote_attribs
    and in o_complex_remove_promotable_attribs.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Closes-bug: lp-700841
    
    (cherry picked from commit 2d07ac4933633837fc394e5001a452c7db290d13)

diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 58a372e..eddd343 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -348,6 +348,9 @@ GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object)
         g_list_remove (object->complex->prim_objs, o_removed);
     }
     promoted = promotable;
+    /* Invalidate the object's bounds since we may have
+     * stolen objects from inside it. */
+    o_bounds_invalidate (toplevel, object);
   }
 
   /* Attach promoted attributes to the original complex object */
@@ -392,6 +395,7 @@ static void o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *obj
     }
   }
 
+  o_bounds_invalidate (toplevel, object);
   g_list_free (promotable);
 }
 

commit 28ee546a15e360ab1b870205437905abc876e82e
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: getter for object visibility field
    
    Add method o_is_visible to query value of visibility field.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    Affects-bug: lp-701431
    
    (cherry picked from commit 45cb94eff246e342a0331bf8b0c908fdccda1359)

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 48e1e1b..d0ec1e3 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -112,6 +112,7 @@ OBJECT *o_attrib_find_attrib_by_name(const GList *list, char *name, int count);
 /* o_basic.c */
 void o_bounds_invalidate(TOPLEVEL *toplevel, OBJECT *object);
 double o_shortest_distance_full(OBJECT *object, int x, int y, int force_solid);
+gboolean o_is_visible (TOPLEVEL *toplevel, OBJECT *object);
 void o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility);
 
 /* o_box_basic.c */
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 8afa46a..74bed77 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -298,7 +298,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
         break;
 
       case(OBJ_TEXT):
-        if (o_current->visibility == VISIBLE) {
+        if (o_is_visible (toplevel, o_current)) {
           /* Output text */
           save_last_ps_color = toplevel->last_ps_color;
           fprintf(fp, "gsave\n");
@@ -654,7 +654,7 @@ static int f_print_get_unicode_chars (TOPLEVEL *toplevel,
         break;
 
       case (OBJ_TEXT):
-        if (o_current->visibility == VISIBLE) {
+        if (o_is_visible (toplevel, o_current)) {
 
           aux = o_current->text->string;
           while (aux && ((gunichar) (*aux) != 0)) {
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 16d48ab..e816a07 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -585,6 +585,21 @@ void o_set_color (TOPLEVEL *toplevel, OBJECT *object, int color)
     o_glist_set_color (toplevel, object->complex->prim_objs, color);
 }
 
+/*! \brief Query visibility of the object.
+ *  \par Function Description
+ *  Attribute getter for the visible field within the object.
+ *
+ *  \param toplevel The TOPLEVEL structure
+ *  \param object   The OBJECT structure to be queried
+ *  \return TRUE when VISIBLE, FALSE otherwise
+ */
+gboolean
+o_is_visible (TOPLEVEL *toplevel, OBJECT *object)
+{
+  g_return_val_if_fail (object != NULL, FALSE);
+  return object->visibility == VISIBLE;
+}
+
 /*! \brief Set visibility of the object.
  *  \par Function Description
  *  Set value of visibility field within the object.
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 69b638a..58a372e 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -65,8 +65,8 @@ int world_get_single_object_bounds(TOPLEVEL *toplevel, OBJECT *o_current,
       case(OBJ_TEXT):
         /* only do bounding boxes for visible or doing show_hidden_text*/
         /* you might lose some attrs though */
-        if (! (o_current->visibility == VISIBLE ||
-               toplevel->show_hidden_text )) {
+        if (! (o_is_visible (toplevel, o_current) ||
+                toplevel->show_hidden_text)) {
           return 0;
         }
         /* This case falls through intentionally */
@@ -227,7 +227,8 @@ static int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object)
   }
 
   /* object is invisible and we do not want to promote invisible text */
-  if (object->visibility == INVISIBLE && toplevel->promote_invisible == FALSE)
+  if ((!o_is_visible (toplevel, object)) &&
+      (toplevel->promote_invisible == FALSE))
     return FALSE; /* attribute not eligible for promotion */
 
   /* yup, attribute can be promoted */
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index b8e5883..aa65a73 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -299,7 +299,8 @@ void o_text_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
 {
   int left, right, top, bottom;
 
-  if (o_current->visibility == INVISIBLE && !toplevel->show_hidden_text) {
+  if ((!o_is_visible (toplevel, o_current)) &&
+      (!toplevel->show_hidden_text)) {
     return;
   }
 

commit c538d2c97885876d695ff45a8457c8d74e872809
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: setter for object visibility field
    
    Add method o_set_visibility to change value of visibility field.
    If object visibility is changed, mark its cached bounds as invalid.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    Affects-bug: lp-701431
    
    (cherry picked from commit 37f3c42bf3d509bde85dec3150bfdca0a3e81551)

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index fce2c75..48e1e1b 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -112,6 +112,7 @@ OBJECT *o_attrib_find_attrib_by_name(const GList *list, char *name, int count);
 /* o_basic.c */
 void o_bounds_invalidate(TOPLEVEL *toplevel, OBJECT *object);
 double o_shortest_distance_full(OBJECT *object, int x, int y, int force_solid);
+void o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility);
 
 /* o_box_basic.c */
 OBJECT *o_box_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index d43b609..16d48ab 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -584,3 +584,24 @@ void o_set_color (TOPLEVEL *toplevel, OBJECT *object, int color)
       object->type == OBJ_PLACEHOLDER)
     o_glist_set_color (toplevel, object->complex->prim_objs, color);
 }
+
+/*! \brief Set visibility of the object.
+ *  \par Function Description
+ *  Set value of visibility field within the object.
+ *  If resulting visibility value is changed,
+ *  invalidate the bounds of the object and parent objects.
+ *
+ *  \param toplevel The #TOPLEVEL structure
+ *  \param object   The #OBJECT structure to be modified
+ */
+void
+o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility)
+{
+  g_return_if_fail (object != NULL);
+  if (visibility == LEAVE_VISIBILITY_ALONE)
+    return;
+  if (object->visibility != visibility) {
+    object->visibility = visibility;
+    o_bounds_invalidate (toplevel, object);
+  }
+}
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index b83a90c..69b638a 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -334,7 +334,7 @@ GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object)
       OBJECT *o_kept = (OBJECT *) iter->data;
       OBJECT *o_copy = o_object_copy (toplevel, o_kept,
                                       toplevel->ADDING_SEL);
-      o_kept->visibility = INVISIBLE;
+      o_set_visibility (toplevel, o_kept, INVISIBLE);
       o_copy->parent = NULL;
       promoted = g_list_prepend (promoted, o_copy);
     }
@@ -383,7 +383,7 @@ static void o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *obj
   for (iter = promotable; iter != NULL; iter = g_list_next (iter)) {
     OBJECT *a_object = iter->data;
     if (toplevel->keep_invisible == TRUE) {   /* Hide promotable attributes */
-      a_object->visibility = INVISIBLE;
+      o_set_visibility (toplevel, a_object, INVISIBLE);
     } else {                                /* Delete promotable attributes */
       object->complex->prim_objs =
         g_list_remove (object->complex->prim_objs, a_object);
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 41022e4..b8e5883 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -275,7 +275,7 @@ OBJECT *o_text_new(TOPLEVEL *toplevel,
   new_node->sel_func = select_func;  
 
   new_node->color = color;
-  new_node->visibility = visibility; 
+  o_set_visibility (toplevel, new_node, visibility);
   new_node->show_name_value = show_name_value;
 
   update_disp_string (new_node);

commit 06f09ecaee96c130825f238689aef530657f892f
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: add recursion in o_bounds_invalidate
    
    Instead of invalidating cached bounds for single object, follow the
    hierarchy and invalidate cached bounds of all parents as well.
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>
    Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
    Affects-bug: lp-700841
    
    (cherry picked from commit bb27719f730b078dc250196af40141ff7cac8636)

diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 635ede4..d43b609 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -548,11 +548,10 @@ double o_shortest_distance_full (OBJECT *object, int x, int y, int force_solid)
 
 /*! \brief Mark an OBJECT's cached bounds as invalid
  *  \par Function Description
- *  Marks the cached bounds of the given OBJECT as having been
- *  invalidated and in need of an update. They will be recalculated
- *  next time the OBJECT's bounds are requested (e.g. via
- *  world_get_single_object_bounds() ).
- *
+ *  Recursively marks the cached bounds of the given OBJECT and its
+ *  parents as having been invalidated and in need of an update. They
+ *  will be recalculated next time the OBJECT's bounds are requested
+ *  (e.g. via world_get_single_object_bounds() ).
  *  \param [in] toplevel
  *  \param [in] obj
  *
@@ -560,7 +559,9 @@ double o_shortest_distance_full (OBJECT *object, int x, int y, int force_solid)
  */
 void o_bounds_invalidate(TOPLEVEL *toplevel, OBJECT *obj)
 {
-  obj->w_bounds_valid = FALSE;
+  do {
+      obj->w_bounds_valid = FALSE;
+  } while ((obj = obj->parent) != NULL);
 }
 
 




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