[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-289-gc5a0980)
The branch, master has been updated
via c5a0980c4cd20ffaa32d24635ff92ae99f17bec9 (commit)
via 183f9cc1aca8a850ea4f749f8be53934016d8ac4 (commit)
via 4a9536ce1da2bc715d4d308fdb2ee2037a7efac3 (commit)
via 43251b8588235a7594a07ff083fbd18e5501c6d1 (commit)
via 5eef74de6e885d57df32617395cec3a012c9060b (commit)
via 2a6c81e6b88e23b9f391c80b2c8a042cf5a87a1a (commit)
via 0fad1e0c5aafa043387a8a5114795cdd352af3a6 (commit)
via 97c5273a7ec9792a852f5193455a4c19ba6b6035 (commit)
from 0f664b4c54ca3c38f31e169c642268091ae392f7 (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
=========
gattrib/src/s_object.c | 3 +--
gattrib/src/s_table.c | 3 ++-
gattrib/src/s_toplevel.c | 2 +-
gattrib/src/s_visibility.c | 7 +++----
gschem/src/g_hook.c | 4 +++-
gschem/src/o_attrib.c | 8 ++++----
gschem/src/o_find.c | 4 ++--
gschem/src/o_misc.c | 14 +++++++-------
gschem/src/o_select.c | 4 ++--
gschem/src/o_text.c | 12 ++++++------
gschem/src/x_attribedit.c | 2 +-
gschem/src/x_multiattrib.c | 34 +++++++++++++++++++++++-----------
libgeda/include/libgeda/defines.h | 1 -
libgeda/include/libgeda/prototype.h | 2 ++
libgeda/include/prototype_priv.h | 26 ++++++++++++--------------
libgeda/src/a_basic.c | 33 +++++++++++++++++----------------
libgeda/src/o_arc_basic.c | 3 ++-
libgeda/src/o_basic.c | 2 --
libgeda/src/o_box_basic.c | 3 ++-
libgeda/src/o_bus_basic.c | 3 ++-
libgeda/src/o_circle_basic.c | 3 ++-
libgeda/src/o_complex_basic.c | 3 ++-
libgeda/src/o_line_basic.c | 3 ++-
libgeda/src/o_net_basic.c | 3 ++-
libgeda/src/o_path_basic.c | 3 ++-
libgeda/src/o_picture.c | 3 ++-
libgeda/src/o_pin_basic.c | 3 ++-
libgeda/src/o_text_basic.c | 8 +++++---
28 files changed, 111 insertions(+), 88 deletions(-)
=================
Commit Messages
=================
commit c5a0980c4cd20ffaa32d24635ff92ae99f17bec9
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: remove LEAVE_VISIBILITY_ALONE
Closes-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 cf7432a... cf5aea7... M libgeda/include/libgeda/defines.h
:100644 100644 4c5d3a8... 37b941e... M libgeda/src/o_basic.c
commit 183f9cc1aca8a850ea4f749f8be53934016d8ac4
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gattrib: remove references to LEAVE_VISIBILITY_ALONE
None of the callers of s_visibility_set_cell passed
LEAVE_INVISIBILITY_ALONE as the visibility parameter.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 e561cec... f054017... M gattrib/src/s_toplevel.c
:100644 100644 539340a... 666a625... M gattrib/src/s_visibility.c
commit 4a9536ce1da2bc715d4d308fdb2ee2037a7efac3
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: use visibility getter in o_text_basic.c
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 db52e42... 0db8c2a... M libgeda/src/o_text_basic.c
commit 43251b8588235a7594a07ff083fbd18e5501c6d1
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: add TOPLEVEL* argument to o_XXX_save
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 e3dad86... ab5e9a8... M libgeda/include/prototype_priv.h
:100644 100644 617fea4... 158eb2d... M libgeda/src/a_basic.c
:100644 100644 67d0beb... d5612b8... M libgeda/src/o_arc_basic.c
:100644 100644 ab8e8d2... 65be37b... M libgeda/src/o_box_basic.c
:100644 100644 399dd60... 2a923e1... M libgeda/src/o_bus_basic.c
:100644 100644 118ee8e... 465a5d2... M libgeda/src/o_circle_basic.c
:100644 100644 9ef0e2e... c2496a6... M libgeda/src/o_complex_basic.c
:100644 100644 f690fd5... 6cd4a4b... M libgeda/src/o_line_basic.c
:100644 100644 2a970d9... 7187db7... M libgeda/src/o_net_basic.c
:100644 100644 fb33541... b36a704... M libgeda/src/o_path_basic.c
:100644 100644 6f9c8ee... 289f46c... M libgeda/src/o_picture.c
:100644 100644 2840e58... d3ba3c1... M libgeda/src/o_pin_basic.c
:100644 100644 582b9d4... db52e42... M libgeda/src/o_text_basic.c
commit 5eef74de6e885d57df32617395cec3a012c9060b
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gattrib: use accessors for object visibility
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 9a6c855... 24cc61d... M gattrib/src/s_object.c
:100644 100644 09294ed... ed8a3cc... M gattrib/src/s_table.c
commit 2a6c81e6b88e23b9f391c80b2c8a042cf5a87a1a
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: write object visibility field with setter
Replace direct write to visibility field with calls to o_set_visibility.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 2e29cc6... b06e636... M gschem/src/o_attrib.c
:100644 100644 3e197ea... 4da4f74... M gschem/src/o_misc.c
:100644 100644 f874648... e659547... M gschem/src/o_text.c
:100644 100644 15aea2e... a52b2a5... M gschem/src/x_multiattrib.c
commit 0fad1e0c5aafa043387a8a5114795cdd352af3a6
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: read object visibility field with getter
Replace direct attribute access with calls to o_is_visible.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 76e03c3... 1f2d5c8... M gschem/src/g_hook.c
:100644 100644 83f384f... 2e29cc6... M gschem/src/o_attrib.c
:100644 100644 e7499b5... df28894... M gschem/src/o_find.c
:100644 100644 4f4453b... 3e197ea... M gschem/src/o_misc.c
:100644 100644 a0f801e... baefa4e... M gschem/src/o_select.c
:100644 100644 b82eb5d... f874648... M gschem/src/o_text.c
:100644 100644 248218a... 70f7514... M gschem/src/x_attribedit.c
:100644 100644 974716b... 15aea2e... M gschem/src/x_multiattrib.c
commit 97c5273a7ec9792a852f5193455a4c19ba6b6035
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: export accessors for object visibility
o_is_visible and o_set_visibility are now in exported interface.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
:100644 100644 1dee3cb... fc58114... M libgeda/include/libgeda/prototype.h
:100644 100644 03ccefc... e3dad86... M libgeda/include/prototype_priv.h
=========
Changes
=========
commit c5a0980c4cd20ffaa32d24635ff92ae99f17bec9
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: remove LEAVE_VISIBILITY_ALONE
Closes-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/libgeda/include/libgeda/defines.h b/libgeda/include/libgeda/defines.h
index cf7432a..cf5aea7 100644
--- a/libgeda/include/libgeda/defines.h
+++ b/libgeda/include/libgeda/defines.h
@@ -60,7 +60,6 @@
/* for visibility in st_objects */
#define INVISIBLE 0
#define VISIBLE 1
-#define LEAVE_VISIBILITY_ALONE -1
/* For pin and net styles */
#define THIN 0
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 4c5d3a8..37b941e 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -799,8 +799,6 @@ 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);
commit 183f9cc1aca8a850ea4f749f8be53934016d8ac4
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gattrib: remove references to LEAVE_VISIBILITY_ALONE
None of the callers of s_visibility_set_cell passed
LEAVE_INVISIBILITY_ALONE as the visibility parameter.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index e561cec..f054017 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -1015,7 +1015,7 @@ s_toplevel_update_pin_attribs_in_toplevel (TOPLEVEL *toplevel,
o_pin,
new_attrib_name,
new_attrib_value,
- LEAVE_VISIBILITY_ALONE,
+ o_is_visible (toplevel, o_pin) ? VISIBLE : INVISIBLE,
LEAVE_NAME_VALUE_ALONE);
}
diff --git a/gattrib/src/s_visibility.c b/gattrib/src/s_visibility.c
index 539340a..666a625 100644
--- a/gattrib/src/s_visibility.c
+++ b/gattrib/src/s_visibility.c
@@ -375,10 +375,9 @@ void s_visibility_set_cell(gint cur_page, gint row, gint col,
}
/* Question: how to sanity check (row, col) selection? */
- if (visibility != LEAVE_VISIBILITY_ALONE) {
- local_table[row][col].visibility = visibility;
- sheet_head->CHANGED = 1; /* cell has been updated. */
- }
+ local_table[row][col].visibility = visibility;
+ sheet_head->CHANGED = 1; /* cell has been updated. */
+
if (show_name_value != LEAVE_NAME_VALUE_ALONE) {
local_table[row][col].show_name_value = show_name_value;
sheet_head->CHANGED = 1; /* cell has been updated. */
commit 4a9536ce1da2bc715d4d308fdb2ee2037a7efac3
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: use visibility getter in o_text_basic.c
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index db52e42..0db8c2a 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -492,7 +492,8 @@ char *o_text_save(TOPLEVEL *toplevel, OBJECT *object)
num_lines = o_text_num_lines(string);
buf = g_strdup_printf ("%c %d %d %d %d %d %d %d %d %d\n%s", object->type,
- x, y, object->color, size, object->visibility,
+ x, y, object->color, size,
+ o_is_visible (toplevel, object) ? VISIBLE : INVISIBLE,
object->show_name_value, object->text->angle,
object->text->alignment, num_lines, string);
@@ -552,7 +553,7 @@ OBJECT *o_text_copy(TOPLEVEL *toplevel, OBJECT *o_current)
o_current->text->angle,
o_current->text->string,
o_current->text->size,
- o_current->visibility,
+ o_is_visible (toplevel, o_current) ? VISIBLE : INVISIBLE,
o_current->show_name_value);
return new_obj;
commit 43251b8588235a7594a07ff083fbd18e5501c6d1
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: add TOPLEVEL* argument to o_XXX_save
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index e3dad86..ab5e9a8 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -1,5 +1,5 @@
/* a_basic.c */
-gchar *o_save_objects(const GList *object_list, gboolean save_attribs);
+gchar *o_save_objects(TOPLEVEL *toplevel, const GList *object_list, gboolean save_attribs);
/* f_print.c */
void f_print_set_line_width(FILE *fp, int width);
@@ -87,7 +87,7 @@ void m_transform_translate(TRANSFORM *transform, gdouble dx, gdouble dy);
/* o_arc_basic.c */
OBJECT *o_arc_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_arc_save(OBJECT *object);
+char *o_arc_save(TOPLEVEL *toplevel, OBJECT *object);
void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
@@ -118,7 +118,7 @@ void o_emit_change_notify(TOPLEVEL *toplevel, OBJECT *object);
/* o_box_basic.c */
OBJECT *o_box_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_box_save(OBJECT *object);
+char *o_box_save(TOPLEVEL *toplevel, OBJECT *object);
void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void o_box_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
@@ -135,7 +135,7 @@ void o_box_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_bus_basic.c */
OBJECT *o_bus_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_bus_save(OBJECT *object);
+char *o_bus_save(TOPLEVEL *toplevel, OBJECT *object);
void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void world_get_bus_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
gboolean o_bus_get_position(TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object);
@@ -143,7 +143,7 @@ void o_bus_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_circle_basic.c */
OBJECT *o_circle_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_circle_save(OBJECT *object);
+char *o_circle_save(TOPLEVEL *toplevel, OBJECT *object);
void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
@@ -160,7 +160,7 @@ void o_circle_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_complex_basic.c */
OBJECT *o_complex_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_complex_save(OBJECT *object);
+char *o_complex_save(TOPLEVEL *toplevel, OBJECT *object);
double o_complex_shortest_distance(OBJECT *object, int x, int y, int force_soild);
void world_get_complex_bounds(TOPLEVEL *toplevel, OBJECT *complex, int *left, int *top, int *right, int *bottom);
gboolean o_complex_get_position(TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object);
@@ -168,7 +168,7 @@ void o_complex_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_line_basic.c */
OBJECT *o_line_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_line_save(OBJECT *object);
+char *o_line_save(TOPLEVEL *toplevel, OBJECT *object);
void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
@@ -182,7 +182,7 @@ void o_line_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_net_basic.c */
OBJECT *o_net_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_net_save(OBJECT *object);
+char *o_net_save(TOPLEVEL *toplevel, OBJECT *object);
void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void world_get_net_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
gboolean o_net_get_position(TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object);
@@ -190,7 +190,7 @@ void o_net_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_path_basic.c */
OBJECT *o_path_read(TOPLEVEL *toplevel, const char *first_line, TextBuffer *tb, unsigned int release_ver, unsigned int fileformat_ver);
-char *o_path_save(OBJECT *object);
+char *o_path_save(TOPLEVEL *toplevel, OBJECT *object);
void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
double o_path_shortest_distance(OBJECT *object, int x, int y, int force_soild);
void world_get_path_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
@@ -200,7 +200,7 @@ void o_path_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_picture.c */
OBJECT *o_picture_read(TOPLEVEL *toplevel, const char *first_line, TextBuffer *tb, unsigned int release_ver, unsigned int fileformat_ver);
-char *o_picture_save(OBJECT *object);
+char *o_picture_save(TOPLEVEL *toplevel, OBJECT *object);
void o_picture_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
int origin_x, int origin_y);
double o_picture_shortest_distance(OBJECT *object, int x, int y, int force_soild);
@@ -210,7 +210,7 @@ void o_picture_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_pin_basic.c */
OBJECT *o_pin_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
-char *o_pin_save(OBJECT *object);
+char *o_pin_save(TOPLEVEL *toplevel, OBJECT *object);
void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
void world_get_pin_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
gboolean o_pin_get_position(TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object);
@@ -218,7 +218,7 @@ void o_pin_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
/* o_text_basic.c */
OBJECT *o_text_read(TOPLEVEL *toplevel, const char *first_line, TextBuffer *tb, unsigned int release_ver, unsigned int fileformat_ver);
-char *o_text_save(OBJECT *object);
+char *o_text_save(TOPLEVEL *toplevel, OBJECT *object);
void o_text_print_text_string(FILE *fp, char *string, int unicode_count, gunichar *unicode_table);
void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y, int unicode_count, gunichar *unicode_table);
double o_text_shortest_distance(OBJECT *object, int x, int y, int force_soild);
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 617fea4..158eb2d 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -71,7 +71,7 @@ gchar *o_save_buffer (TOPLEVEL *toplevel, const GList *object_list)
acc = g_string_new (o_file_format_header());
- buffer = o_save_objects (object_list, FALSE);
+ buffer = o_save_objects (toplevel, object_list, FALSE);
g_string_append (acc, buffer);
g_free (buffer);
@@ -89,11 +89,12 @@ gchar *o_save_buffer (TOPLEVEL *toplevel, const GList *object_list)
* we recurse for saving out those attributes, the function must be called
* with save_attribs passed as TRUE.
*
+ * \param [in] toplevel A TOPLEVEL structure.
* \param [in] object_list The head of a GList of objects to save.
* \param [in] save_attribs Should attribute objects encounterd be saved?
* \returns a buffer containing schematic data or NULL on failure.
*/
-gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
+gchar *o_save_objects (TOPLEVEL *toplevel, const GList *object_list, gboolean save_attribs)
{
OBJECT *o_current;
const GList *iter;
@@ -113,27 +114,27 @@ gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
switch (o_current->type) {
case(OBJ_LINE):
- out = o_line_save(o_current);
+ out = o_line_save(toplevel, o_current);
break;
case(OBJ_NET):
- out = o_net_save(o_current);
+ out = o_net_save(toplevel, o_current);
break;
case(OBJ_BUS):
- out = o_bus_save(o_current);
+ out = o_bus_save(toplevel, o_current);
break;
case(OBJ_BOX):
- out = o_box_save(o_current);
+ out = o_box_save(toplevel, o_current);
break;
case(OBJ_CIRCLE):
- out = o_circle_save(o_current);
+ out = o_circle_save(toplevel, o_current);
break;
case(OBJ_COMPLEX):
- out = o_complex_save(o_current);
+ out = o_complex_save(toplevel, o_current);
g_string_append_printf(acc, "%s\n", out);
already_wrote = TRUE;
g_free(out); /* need to free here because of the above flag */
@@ -141,7 +142,7 @@ gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
if (o_complex_is_embedded(o_current)) {
g_string_append(acc, "[\n");
- out = o_save_objects(o_current->complex->prim_objs, FALSE);
+ out = o_save_objects(toplevel, o_current->complex->prim_objs, FALSE);
g_string_append (acc, out);
g_free(out);
@@ -150,27 +151,27 @@ gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
break;
case(OBJ_PLACEHOLDER): /* new type by SDB 1.20.2005 */
- out = o_complex_save(o_current);
+ out = o_complex_save(toplevel, o_current);
break;
case(OBJ_TEXT):
- out = o_text_save(o_current);
+ out = o_text_save(toplevel, o_current);
break;
case(OBJ_PATH):
- out = o_path_save(o_current);
+ out = o_path_save(toplevel, o_current);
break;
case(OBJ_PIN):
- out = o_pin_save(o_current);
+ out = o_pin_save(toplevel, o_current);
break;
case(OBJ_ARC):
- out = o_arc_save(o_current);
+ out = o_arc_save(toplevel, o_current);
break;
case(OBJ_PICTURE):
- out = o_picture_save(o_current);
+ out = o_picture_save(toplevel, o_current);
break;
default:
@@ -197,7 +198,7 @@ gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
if (o_current->attribs != NULL) {
g_string_append (acc, "{\n");
- out = o_save_objects (o_current->attribs, TRUE);
+ out = o_save_objects (toplevel, o_current->attribs, TRUE);
g_string_append (acc, out);
g_free(out);
diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 67d0beb..d5612b8 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -304,10 +304,11 @@ OBJECT *o_arc_read (TOPLEVEL *toplevel, char buf[],
* A pointer to the new allocated and formated string is returned.
* The string must be freed at some point.
*
+ * \param [in] toplevel
* \param [in] object
* \return the string representation of the arc object
*/
-char *o_arc_save(OBJECT *object)
+char *o_arc_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x, y, radius, start_angle, end_angle;
int arc_width, arc_length, arc_space;
diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index ab8e8d2..65be37b 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -366,13 +366,14 @@ OBJECT *o_box_read (TOPLEVEL *toplevel, char buf[],
* It follows the post-20000704 release file format that handle the line type
* and fill options.
*
+ * \param [in] toplevel The TOPLEVEL structure.
* \param [in] object The BOX OBJECT to create string from.
* \return A pointer to the BOX character string.
*
* \warning
* Caller must g_free returned character string.
*/
-char *o_box_save(OBJECT *object)
+char *o_box_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x1, y1;
int width, height;
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 399dd60..2a923e1 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -200,10 +200,11 @@ OBJECT *o_bus_read (TOPLEVEL *toplevel, char buf[],
* This function takes a bus \a object and return a string
* according to the file format definition.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object a bus OBJECT
* \return the string representation of the bus OBJECT
*/
-char *o_bus_save(OBJECT *object)
+char *o_bus_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x1, x2, y1, y2;
char *buf;
diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c
index 118ee8e..465a5d2 100644
--- a/libgeda/src/o_circle_basic.c
+++ b/libgeda/src/o_circle_basic.c
@@ -314,6 +314,7 @@ OBJECT *o_circle_read (TOPLEVEL *toplevel, char buf[],
* It follows the post-20000704 release file format that handle the line
* type and fill options.
*
+ * \param [in] toplevel a TOPLEVEL structure.
* \param [in] object Circle OBJECT to create string from.
* \return A pointer to the circle OBJECT character string.
*
@@ -321,7 +322,7 @@ OBJECT *o_circle_read (TOPLEVEL *toplevel, char buf[],
* Caller must g_free returned character string.
*
*/
-char *o_circle_save(OBJECT *object)
+char *o_circle_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x,y;
int radius;
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 9ef0e2e..c2496a6 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -727,10 +727,11 @@ OBJECT *o_complex_read (TOPLEVEL *toplevel,
* This function takes a complex \a object and return a string
* according to the file format definition.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object a complex OBJECT
* \return the string representation of the complex OBJECT
*/
-char *o_complex_save(OBJECT *object)
+char *o_complex_save(TOPLEVEL *toplevel, OBJECT *object)
{
int selectable;
char *buf = NULL;
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index f690fd5..6cd4a4b 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -291,6 +291,7 @@ OBJECT *o_line_read (TOPLEVEL *toplevel, char buf[],
* It follows the post-20000704 release file format that handle the
* line type and fill options - filling is irrelevant here.
*
+ * \param [in] toplevel a TOPLEVEL structure.
* \param [in] object Line OBJECT to create string from.
* \return A pointer to the line OBJECT character string.
*
@@ -298,7 +299,7 @@ OBJECT *o_line_read (TOPLEVEL *toplevel, char buf[],
* Caller must g_free returned character string.
*
*/
-char *o_line_save(OBJECT *object)
+char *o_line_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x1, x2, y1, y2;
int line_width, line_space, line_length;
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 2a970d9..7187db7 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -186,10 +186,11 @@ OBJECT *o_net_read (TOPLEVEL *toplevel, char buf[],
* This function takes a net \a object and return a string
* according to the file format definition.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object a net OBJECT
* \return the string representation of the net OBJECT
*/
-char *o_net_save(OBJECT *object)
+char *o_net_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x1, x2, y1, y2;
char *buf;
diff --git a/libgeda/src/o_path_basic.c b/libgeda/src/o_path_basic.c
index fb33541..b36a704 100644
--- a/libgeda/src/o_path_basic.c
+++ b/libgeda/src/o_path_basic.c
@@ -235,6 +235,7 @@ OBJECT *o_path_read (TOPLEVEL *toplevel,
* The function formats a string in the buffer <B>*buff</B> to describe
* the path object <B>*object</B>.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object path OBJECT to create string from.
* \return A pointer to the path OBJECT character string.
*
@@ -242,7 +243,7 @@ OBJECT *o_path_read (TOPLEVEL *toplevel,
* Caller must g_free returned character string.
*
*/
-char *o_path_save (OBJECT *object)
+char *o_path_save (TOPLEVEL *toplevel, OBJECT *object)
{
int line_width, line_space, line_length;
char *buf;
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index 6f9c8ee..289f46c 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -215,6 +215,7 @@ OBJECT *o_picture_read (TOPLEVEL *toplevel,
* This function formats a string in the buffer <B>*buff</B> to describe
* the picture object <B>*object</B>.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object Picture OBJECT to create string from.
* \return A pointer to the picture OBJECT character string.
*
@@ -222,7 +223,7 @@ OBJECT *o_picture_read (TOPLEVEL *toplevel,
* Caller must g_free returned character string.
*
*/
-char *o_picture_save(OBJECT *object)
+char *o_picture_save(TOPLEVEL *toplevel, OBJECT *object)
{
int width, height, x1, y1;
gchar *encoded_picture=NULL;
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 2840e58..d3ba3c1 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -204,10 +204,11 @@ OBJECT *o_pin_read (TOPLEVEL *toplevel, char buf[],
* This function takes a pin \a object and return a string
* according to the file format definition.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object a pin OBJECT
* \return the string representation of the pin OBJECT
*/
-char *o_pin_save(OBJECT *object)
+char *o_pin_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x1, x2, y1, y2;
int pin_type, whichend;
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 582b9d4..db52e42 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -470,10 +470,11 @@ OBJECT *o_text_read (TOPLEVEL *toplevel,
* This function takes a text \a object and return a string
* according to the file format definition.
*
+ * \param [in] toplevel a TOPLEVEL structure
* \param [in] object a text OBJECT
* \return the string representation of the text OBJECT
*/
-char *o_text_save(OBJECT *object)
+char *o_text_save(TOPLEVEL *toplevel, OBJECT *object)
{
int x, y;
int size;
commit 5eef74de6e885d57df32617395cec3a012c9060b
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gattrib: use accessors for object visibility
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index 9a6c855..24cc61d 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -203,8 +203,7 @@ void s_object_replace_attrib_in_object(TOPLEVEL *toplevel,
new_attrib_text = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
g_free(a_current->text->string); /* remove old attrib string */
a_current->text->string = g_strdup(new_attrib_text); /* insert new attrib string */
- if (visibility != LEAVE_VISIBILITY_ALONE)
- a_current->visibility = visibility;
+ o_set_visibility (toplevel, a_current, visibility);
if (show_name_value != LEAVE_NAME_VALUE_ALONE)
a_current->show_name_value = show_name_value;
g_free(new_attrib_text);
diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index 09294ed..ed8a3cc 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -327,7 +327,8 @@ void s_table_add_toplevel_comp_items_to_comp_table (const GList *obj_list) {
attrib_text = g_strdup(a_current->text->string);
attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
- old_visibility = a_current->visibility;
+ old_visibility = o_is_visible (pr_current, a_current)
+ ? VISIBLE : INVISIBLE;
old_show_name_value = a_current->show_name_value;
/* Don't include "refdes" or "slot" because they form the row name. */
commit 2a6c81e6b88e23b9f391c80b2c8a042cf5a87a1a
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: write object visibility field with setter
Replace direct write to visibility field with calls to o_set_visibility.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 2e29cc6..b06e636 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -120,7 +120,7 @@ void o_attrib_toggle_visibility(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
o_invalidate (w_current, object);
}
- object->visibility = INVISIBLE;
+ o_set_visibility (toplevel, object, INVISIBLE);
if (toplevel->show_hidden_text) {
/* draw text so that little I is drawn */
@@ -134,7 +134,7 @@ void o_attrib_toggle_visibility(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
o_invalidate (w_current, object);
}
- object->visibility = VISIBLE;
+ o_set_visibility (toplevel, object, VISIBLE);
o_text_recreate(toplevel, object);
}
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 3e197ea..4da4f74 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -430,7 +430,7 @@ void o_edit_make_visible (GSCHEM_TOPLEVEL *w_current, const GList *o_list)
if (o_current->type == OBJ_TEXT) {
if (!o_is_visible (toplevel, o_current)) {
- o_current->visibility = VISIBLE;
+ o_set_visibility (toplevel, o_current, VISIBLE);
o_text_recreate(toplevel, o_current);
toplevel->page_current->CHANGED = 1;
@@ -579,7 +579,7 @@ void o_edit_hide_specific_text (GSCHEM_TOPLEVEL *w_current,
const gchar *str = o_text_get_string (w_current->toplevel, o_current);
if (!strncmp (stext, str, strlen (stext))) {
if (o_is_visible (toplevel, o_current)) {
- o_current->visibility = INVISIBLE;
+ o_set_visibility (toplevel, o_current, INVISIBLE);
o_text_recreate(toplevel, o_current);
toplevel->page_current->CHANGED = 1;
@@ -613,7 +613,7 @@ void o_edit_show_specific_text (GSCHEM_TOPLEVEL *w_current,
const gchar *str = o_text_get_string (w_current->toplevel, o_current);
if (!strncmp (stext, str, strlen (stext))) {
if (!o_is_visible (toplevel, o_current)) {
- o_current->visibility = VISIBLE;
+ o_set_visibility (toplevel, o_current, VISIBLE);
o_text_recreate(toplevel, o_current);
toplevel->page_current->CHANGED = 1;
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index f874648..e659547 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -701,7 +701,7 @@ void o_text_change(GSCHEM_TOPLEVEL *w_current, OBJECT *object, char *string,
o_text_set_string (toplevel, object, string);
- object->visibility = visibility;
+ o_set_visibility (toplevel, object, visibility);
object->show_name_value = show;
o_text_recreate(toplevel, object);
diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 15aea2e..a52b2a5 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -1033,7 +1033,7 @@ static void multiattrib_callback_toggled_visible(GtkCellRendererToggle *cell_ren
? INVISIBLE : VISIBLE;
/* actually modifies the attribute */
- o_attrib->visibility = visibility;
+ o_set_visibility (w_current->toplevel, o_attrib, visibility);
o_text_recreate (w_current->toplevel, o_attrib);
o_undo_savestate (w_current, UNDO_ALL);
commit 0fad1e0c5aafa043387a8a5114795cdd352af3a6
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: read object visibility field with getter
Replace direct attribute access with calls to o_is_visible.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 76e03c3..1f2d5c8 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -99,12 +99,14 @@ SCM g_set_attrib_value_x(SCM attrib_smob, SCM scm_value)
TOPLEVEL *toplevel;
OBJECT *o_attrib;
char *new_string;
+ int visibility;
returned = g_set_attrib_value_internal(attrib_smob, scm_value,
&toplevel, &o_attrib, &new_string);
+ visibility = o_is_visible (toplevel, o_attrib) ? VISIBLE : INVISIBLE;
o_text_change(global_window_current, o_attrib, new_string,
- o_attrib->visibility, o_attrib->show_name_value);
+ visibility, o_attrib->show_name_value);
g_free(new_string);
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 83f384f..2e29cc6 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -94,7 +94,7 @@ void o_attrib_deselect_invisible (GSCHEM_TOPLEVEL *w_current,
a_iter = g_list_next (a_iter)) {
a_current = a_iter->data;
- if (a_current->selected && a_current->visibility == INVISIBLE)
+ if (a_current->selected && !o_is_visible(w_current->toplevel, a_current))
o_selection_remove (w_current->toplevel, selection, a_current);
}
}
@@ -114,7 +114,7 @@ void o_attrib_toggle_visibility(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
g_return_if_fail (object != NULL && object->type == OBJ_TEXT);
- if (object->visibility == VISIBLE) {
+ if (o_is_visible (toplevel, object)) {
/* only erase if we are not showing hidden text */
if (!toplevel->show_hidden_text) {
o_invalidate (w_current, object);
diff --git a/gschem/src/o_find.c b/gschem/src/o_find.c
index e7499b5..df28894 100644
--- a/gschem/src/o_find.c
+++ b/gschem/src/o_find.c
@@ -51,7 +51,7 @@ static gboolean find_single_object (GSCHEM_TOPLEVEL *w_current, OBJECT *object,
{
TOPLEVEL *toplevel = w_current->toplevel;
if (object->sel_func != NULL &&
- (object->visibility == VISIBLE || toplevel->show_hidden_text) &&
+ (o_is_visible (toplevel, object) || toplevel->show_hidden_text) &&
inside_region (object->w_left - w_slack, object->w_top - w_slack,
object->w_right + w_slack, object->w_bottom + w_slack,
w_x, w_y) &&
@@ -176,7 +176,7 @@ gboolean o_find_selected_object(GSCHEM_TOPLEVEL *w_current,
printf("Screen pointer at: (%i,%i)\n", screen_x, screen_y);
#endif
if (o_current->sel_func != NULL &&
- (o_current->visibility == VISIBLE || toplevel->show_hidden_text)) {
+ (o_is_visible (toplevel, o_current) || toplevel->show_hidden_text)) {
return TRUE;
}
}
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 4f4453b..3e197ea 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -371,7 +371,7 @@ void o_edit_show_hidden_lowlevel (GSCHEM_TOPLEVEL *w_current,
iter = o_list;
while (iter != NULL) {
o_current = (OBJECT *)iter->data;
- if (o_current->type == OBJ_TEXT && o_current->visibility == INVISIBLE) {
+ if (o_current->type == OBJ_TEXT && !o_is_visible (toplevel, o_current)) {
/* don't toggle the visibility flag */
o_text_recreate (toplevel, o_current);
@@ -429,7 +429,7 @@ void o_edit_make_visible (GSCHEM_TOPLEVEL *w_current, const GList *o_list)
o_current = (OBJECT *)iter->data;
if (o_current->type == OBJ_TEXT) {
- if (o_current->visibility == INVISIBLE) {
+ if (!o_is_visible (toplevel, o_current)) {
o_current->visibility = VISIBLE;
o_text_recreate(toplevel, o_current);
@@ -578,7 +578,7 @@ void o_edit_hide_specific_text (GSCHEM_TOPLEVEL *w_current,
if (o_current->type == OBJ_TEXT) {
const gchar *str = o_text_get_string (w_current->toplevel, o_current);
if (!strncmp (stext, str, strlen (stext))) {
- if (o_current->visibility == VISIBLE) {
+ if (o_is_visible (toplevel, o_current)) {
o_current->visibility = INVISIBLE;
o_text_recreate(toplevel, o_current);
@@ -612,7 +612,7 @@ void o_edit_show_specific_text (GSCHEM_TOPLEVEL *w_current,
if (o_current->type == OBJ_TEXT) {
const gchar *str = o_text_get_string (w_current->toplevel, o_current);
if (!strncmp (stext, str, strlen (stext))) {
- if (o_current->visibility == INVISIBLE) {
+ if (!o_is_visible (toplevel, o_current)) {
o_current->visibility = VISIBLE;
o_text_recreate(toplevel, o_current);
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index a0f801e..baefa4e 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -359,7 +359,7 @@ void o_select_box_search(GSCHEM_TOPLEVEL *w_current)
while (iter != NULL) {
o_current = iter->data;
/* only select visible objects */
- if (o_current->visibility == VISIBLE || toplevel->show_hidden_text) {
+ if (o_is_visible (toplevel, o_current) || toplevel->show_hidden_text) {
if ( o_current->w_left >= left &&
o_current->w_right <= right &&
@@ -556,7 +556,7 @@ o_select_visible_unlocked (GSCHEM_TOPLEVEL *w_current)
OBJECT *obj = (OBJECT *) iter->data;
/* Skip invisible objects. */
- if (obj->visibility != VISIBLE && !toplevel->show_hidden_text)
+ if (!o_is_visible (toplevel, obj) && !toplevel->show_hidden_text)
continue;
/* Skip locked objects. */
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index b82eb5d..f874648 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -238,7 +238,7 @@ int o_text_get_rendered_bounds (void *user_data, OBJECT *o_current,
g_return_val_if_fail (o_current != NULL, FALSE);
g_return_val_if_fail (o_current->text != NULL, FALSE);
- if (o_current->visibility == INVISIBLE &&
+ if (!o_is_visible (toplevel, o_current) &&
!toplevel->show_hidden_text)
return FALSE;
@@ -383,7 +383,7 @@ static void o_text_draw_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
g_return_if_fail (o_current != NULL);
g_return_if_fail (o_current->text != NULL);
- if (o_current->visibility == INVISIBLE &&
+ if (!o_is_visible (toplevel, o_current) &&
!toplevel->show_hidden_text)
return;
@@ -442,7 +442,7 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
g_return_if_fail (o_current->type == OBJ_TEXT);
g_return_if_fail (o_current->text != NULL);
- if (o_current->visibility == INVISIBLE && !toplevel->show_hidden_text) {
+ if (!o_is_visible (toplevel, o_current) && !toplevel->show_hidden_text) {
return;
}
@@ -453,7 +453,7 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
/* Indicate on the schematic that the text is invisible by */
/* drawing a little I on the screen at the origin */
- if (o_current->visibility == INVISIBLE && toplevel->show_hidden_text) {
+ if (!o_is_visible (toplevel, o_current) && toplevel->show_hidden_text) {
if (toplevel->override_color != -1 ) {
gdk_gc_set_foreground(w_current->gc,
x_get_color(toplevel->override_color));
@@ -551,7 +551,7 @@ void o_text_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_cu
TOPLEVEL *toplevel = w_current->toplevel;
int factor;
- if (o_current->visibility == INVISIBLE && !toplevel->show_hidden_text) {
+ if (!o_is_visible (toplevel, o_current) && !toplevel->show_hidden_text) {
return;
}
diff --git a/gschem/src/x_attribedit.c b/gschem/src/x_attribedit.c
index 248218a..70f7514 100644
--- a/gschem/src/x_attribedit.c
+++ b/gschem/src/x_attribedit.c
@@ -490,7 +490,7 @@ void attrib_edit_dialog (GSCHEM_TOPLEVEL *w_current, OBJECT *attr_obj, int flag)
if (attr_obj) {
o_attrib_get_name_value (attr_obj, &name, &val);
attrib = attr_obj;
- if (attrib->visibility == VISIBLE) {
+ if (o_is_visible (toplevel, attrib)) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(visbutton), TRUE);
} else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(visbutton), FALSE);
diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 974716b..15aea2e 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -642,10 +642,12 @@ static void multiattrib_action_duplicate_attribute(GSCHEM_TOPLEVEL *w_current,
OBJECT *o_attrib)
{
OBJECT *o_new;
-
+ int visibility = o_is_visible (w_current->toplevel, o_attrib)
+ ? VISIBLE : INVISIBLE;
+
o_new = o_attrib_add_attrib (w_current,
o_text_get_string (w_current->toplevel, o_attrib),
- o_attrib->visibility,
+ visibility,
o_attrib->show_name_value,
object);
w_current->toplevel->page_current->CHANGED = 1;
@@ -665,11 +667,11 @@ static void multiattrib_action_promote_attribute (GSCHEM_TOPLEVEL *w_current,
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *o_new;
- if (o_attrib->visibility) {
+ if (o_is_visible (toplevel, o_attrib)) {
/* If the attribute we're promoting is visible, don't clone its location */
o_new = o_attrib_add_attrib (w_current,
o_text_get_string (w_current->toplevel, o_attrib),
- o_attrib->visibility,
+ VISIBLE,
o_attrib->show_name_value,
object);
} else {
@@ -780,6 +782,7 @@ static void multiattrib_column_set_data_visible(GtkTreeViewColumn *tree_column,
gpointer data)
{
OBJECT *o_attrib;
+ GschemDialog *dialog = GSCHEM_DIALOG (data);
int inherited;
gtk_tree_model_get (tree_model, iter,
@@ -790,7 +793,7 @@ static void multiattrib_column_set_data_visible(GtkTreeViewColumn *tree_column,
inherited = o_attrib_is_inherited (o_attrib);
g_object_set (cell,
- "active", (o_attrib->visibility == VISIBLE),
+ "active", o_is_visible (dialog->w_current->toplevel, o_attrib),
"sensitive", !inherited,
"activatable", !inherited,
NULL);
@@ -894,6 +897,7 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
OBJECT *o_attrib;
GSCHEM_TOPLEVEL *w_current;
gchar *value, *newtext;
+ int visibility;
model = gtk_tree_view_get_model (multiattrib->treeview);
w_current = GSCHEM_DIALOG (multiattrib)->w_current;
@@ -929,10 +933,12 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
return;
}
-
+ visibility = o_is_visible (w_current->toplevel, o_attrib)
+ ? VISIBLE : INVISIBLE;
+
/* actually modifies the attribute */
o_text_change (w_current, o_attrib,
- newtext, o_attrib->visibility, o_attrib->show_name_value);
+ newtext, visibility, o_attrib->show_name_value);
g_free (value);
g_free (newtext);
@@ -955,6 +961,7 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
OBJECT *o_attrib;
GSCHEM_TOPLEVEL *w_current;
gchar *name, *newtext;
+ int visibility;
model = gtk_tree_view_get_model (multiattrib->treeview);
w_current = GSCHEM_DIALOG (multiattrib)->w_current;
@@ -977,9 +984,12 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
return;
}
+ visibility = o_is_visible (w_current->toplevel, o_attrib)
+ ? VISIBLE : INVISIBLE;
+
/* actually modifies the attribute */
o_text_change (w_current, o_attrib,
- newtext, o_attrib->visibility, o_attrib->show_name_value);
+ newtext, visibility, o_attrib->show_name_value);
/* request an update of display for this row */
update_row_display (model, &iter);
@@ -1018,7 +1028,9 @@ static void multiattrib_callback_toggled_visible(GtkCellRendererToggle *cell_ren
g_assert (o_attrib->type == OBJ_TEXT);
o_invalidate (w_current, o_attrib);
- visibility = o_attrib->visibility == VISIBLE ? INVISIBLE : VISIBLE;
+ /* toggle visibility */
+ visibility = o_is_visible (w_current->toplevel, o_attrib)
+ ? INVISIBLE : VISIBLE;
/* actually modifies the attribute */
o_attrib->visibility = visibility;
@@ -1827,7 +1839,7 @@ static void multiattrib_init(Multiattrib *multiattrib)
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
multiattrib_column_set_data_visible,
- NULL, NULL);
+ multiattrib, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
/* - column 4: show name */
renderer = GTK_CELL_RENDERER (
commit 97c5273a7ec9792a852f5193455a4c19ba6b6035
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: export accessors for object visibility
o_is_visible and o_set_visibility are now in exported interface.
Affects-bug: lp-701431
Reviewed-by: Peter Clifton <pcjc2@xxxxxxxxx>
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 1dee3cb..fc58114 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -116,6 +116,8 @@ void o_set_color(TOPLEVEL *toplevel, OBJECT *object, int color);
PAGE *o_get_page (TOPLEVEL *toplevel, OBJECT *object);
void o_add_change_notify(TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data);
void o_remove_change_notify(TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data);
+gboolean o_is_visible (TOPLEVEL *toplevel, OBJECT *object);
+void o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility);
/* o_box_basic.c */
OBJECT *o_box_new(TOPLEVEL *toplevel, char type, int color, int x1, int y1, int x2, int y2);
diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 03ccefc..e3dad86 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -115,8 +115,6 @@ 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 */
OBJECT *o_box_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs