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

gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-244-g2d07ac4)



The branch, master has been updated
       via  2d07ac4933633837fc394e5001a452c7db290d13 (commit)
       via  45cb94eff246e342a0331bf8b0c908fdccda1359 (commit)
       via  37f3c42bf3d509bde85dec3150bfdca0a3e81551 (commit)
       via  bb27719f730b078dc250196af40141ff7cac8636 (commit)
      from  de3e47e27d27cd745afafce54541fc12ef71244e (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 2d07ac4933633837fc394e5001a452c7db290d13
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

:100644 100644 83d3d99... f88c0f6... M	libgeda/src/o_complex_basic.c

commit 45cb94eff246e342a0331bf8b0c908fdccda1359
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

:100644 100644 6e5f90c... 03ccefc... M	libgeda/include/prototype_priv.h
:100644 100644 5406537... 30d6835... M	libgeda/src/f_print.c
:100644 100644 76b91ff... 743e970... M	libgeda/src/o_basic.c
:100644 100644 7c9dcc4... 83d3d99... M	libgeda/src/o_complex_basic.c
:100644 100644 4c90057... 0c26e21... M	libgeda/src/o_text_basic.c

commit 37f3c42bf3d509bde85dec3150bfdca0a3e81551
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

:100644 100644 e3dad86... 6e5f90c... M	libgeda/include/prototype_priv.h
:100644 100644 7630829... 76b91ff... M	libgeda/src/o_basic.c
:100644 100644 9322634... 7c9dcc4... M	libgeda/src/o_complex_basic.c
:100644 100644 6830674... 4c90057... M	libgeda/src/o_text_basic.c

commit bb27719f730b078dc250196af40141ff7cac8636
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

:100644 100644 fdebc21... 7630829... M	libgeda/src/o_basic.c

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

commit 2d07ac4933633837fc394e5001a452c7db290d13
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

diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 83d3d99..f88c0f6 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -347,6 +347,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 */
@@ -391,6 +394,7 @@ static void o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *obj
     }
   }
 
+  o_bounds_invalidate (toplevel, object);
   g_list_free (promotable);
 }
 

commit 45cb94eff246e342a0331bf8b0c908fdccda1359
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

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 6e5f90c..03ccefc 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -115,6 +115,7 @@ double o_shortest_distance_full(OBJECT *object, int x, int y, int force_solid);
 PAGE *o_get_page_compat (TOPLEVEL *toplevel, OBJECT *object);
 void o_emit_pre_change_notify(TOPLEVEL *toplevel, OBJECT *object);
 void o_emit_change_notify(TOPLEVEL *toplevel, OBJECT *object);
+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 5406537..30d6835 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -299,7 +299,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");
@@ -656,7 +656,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 76b91ff..743e970 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -771,6 +771,21 @@ o_emit_change_notify (TOPLEVEL *toplevel, OBJECT *object)
   }
 }
 
+/*! \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 7c9dcc4..83d3d99 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 4c90057..0c26e21 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -303,7 +303,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 37f3c42bf3d509bde85dec3150bfdca0a3e81551
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

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index e3dad86..6e5f90c 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -115,6 +115,7 @@ double o_shortest_distance_full(OBJECT *object, int x, int y, int force_solid);
 PAGE *o_get_page_compat (TOPLEVEL *toplevel, OBJECT *object);
 void o_emit_pre_change_notify(TOPLEVEL *toplevel, OBJECT *object);
 void o_emit_change_notify(TOPLEVEL *toplevel, OBJECT *object);
+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 7630829..76b91ff 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -770,3 +770,24 @@ o_emit_change_notify (TOPLEVEL *toplevel, OBJECT *object)
     }
   }
 }
+
+/*! \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 9322634..7c9dcc4 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -333,7 +333,7 @@ GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object)
     for (iter = promotable; iter != NULL; iter = g_list_next (iter)) {
       OBJECT *o_kept = (OBJECT *) iter->data;
       OBJECT *o_copy = o_object_copy (toplevel, o_kept);
-      o_kept->visibility = INVISIBLE;
+      o_set_visibility (toplevel, o_kept, INVISIBLE);
       o_copy->parent = NULL;
       promoted = g_list_prepend (promoted, o_copy);
     }
@@ -382,7 +382,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 6830674..4c90057 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -281,7 +281,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 bb27719f730b078dc250196af40141ff7cac8636
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

diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index fdebc21..7630829 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -555,11 +555,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
  *
@@ -567,7 +566,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