[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-383-g822d04b)
The branch, master has been updated
via 822d04bc29291979b91dd3222a27bbcb295e7b56 (commit)
from 0c461fb675babdea8339cc480f18847580303cba (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/o_basic.c | 9 +--
gschem/src/o_find.c | 77 +++++++---------
gschem/src/o_select.c | 4 +-
libgeda/include/o_types.h | 1 -
libgeda/src/a_basic.c | 3 +-
libgeda/src/f_print.c | 219 ++++++++++++++++++++++-----------------------
libgeda/src/o_basic.c | 6 --
libgeda/src/o_list.c | 2 +-
8 files changed, 145 insertions(+), 176 deletions(-)
=================
Commit Messages
=================
commit 822d04bc29291979b91dd3222a27bbcb295e7b56
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Dec 15 22:50:24 2008 +0000
Delete references to the non-existent object type OBJ_HEAD. (CODE!)
Ok, cleaned up some whitespace as well.. couldn't resist.
:100644 100644 a98687e... b8795ce... M gschem/src/o_basic.c
:100644 100644 9edf222... 6042d81... M gschem/src/o_find.c
:100644 100644 327f0a3... a5a677f... M gschem/src/o_select.c
:100644 100644 ead157e... 0ff2e4f... M libgeda/include/o_types.h
:100644 100644 003b76f... b862812... M libgeda/src/a_basic.c
:100644 100644 a797f82... adff30f... M libgeda/src/f_print.c
:100644 100644 27214ce... 973a822... M libgeda/src/o_basic.c
:100644 100644 0624996... bf90340... M libgeda/src/o_list.c
=========
Changes
=========
commit 822d04bc29291979b91dd3222a27bbcb295e7b56
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Dec 15 22:50:24 2008 +0000
Delete references to the non-existent object type OBJ_HEAD. (CODE!)
Ok, cleaned up some whitespace as well.. couldn't resist.
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index a98687e..b8795ce 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -100,8 +100,7 @@ void o_redraw (GSCHEM_TOPLEVEL *w_current, GList *object_list, gboolean draw_sel
iter = object_list;
while (iter != NULL) {
o_current = (OBJECT *)iter->data;
- if ((o_current->draw_func != NULL) &&
- (o_current->type != OBJ_HEAD)) {
+ if (o_current->draw_func != NULL) {
toplevel->DONT_REDRAW = redraw_state ||
o_current->dont_redraw ||
(!draw_selected && o_current->selected);
@@ -133,7 +132,7 @@ void o_redraw_single(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
if (toplevel->DONT_REDRAW) /* highly experimental */
return;
- if (o_current->draw_func != NULL && o_current->type != OBJ_HEAD) {
+ if (o_current->draw_func != NULL) {
(*o_current->draw_func)(w_current, o_current);
}
@@ -237,8 +236,7 @@ void o_erase_single(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
toplevel->override_color = toplevel->background_color;
if (o_current != NULL) {
- if (o_current->draw_func &&
- o_current->type != OBJ_HEAD) {
+ if (o_current->draw_func) {
(*o_current->draw_func)(w_current, o_current);
}
}
@@ -541,7 +539,6 @@ void o_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object)
void (*func) (GSCHEM_TOPLEVEL *, int, int, OBJECT*) = NULL;
switch (object->type) {
- case OBJ_HEAD: /* Do nothing for head nodes */ break;
case OBJ_LINE: func = o_line_draw_xor; break;
case OBJ_NET: func = o_net_draw_xor; break;
case OBJ_BUS: func = o_bus_draw_xor; break;
diff --git a/gschem/src/o_find.c b/gschem/src/o_find.c
index 9edf222..6042d81 100644
--- a/gschem/src/o_find.c
+++ b/gschem/src/o_find.c
@@ -63,24 +63,20 @@ gboolean o_find_object(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
w_x, w_y) &&
o_shortest_distance( o_current, w_x, w_y ) < w_slack ) {
if (o_current->sel_func != NULL &&
- o_current->type != OBJ_HEAD &&
- (o_current->visibility == VISIBLE ||
- (o_current->visibility == INVISIBLE &&
- toplevel->show_hidden_text))) {
- if (change_selection) {
- /* FIXME: should this switch be moved to o_select_object()? (Werner) */
- if (o_current->type == OBJ_NET && w_current->net_selection_mode) {
- o_select_connected_nets(w_current, o_current);
- }
- else {
- (*o_current->sel_func)(w_current, o_current,
- SINGLE, 0); /* 0 is count */
- }
- }
- object_found = TRUE;
- toplevel->page_current->object_lastplace = o_current;
- i_update_menus(w_current);
- return object_found;
+ (o_current->visibility == VISIBLE || toplevel->show_hidden_text)) {
+ if (change_selection) {
+ /* FIXME: should this switch be moved to o_select_object()? (Werner) */
+ if (o_current->type == OBJ_NET && w_current->net_selection_mode) {
+ o_select_connected_nets(w_current, o_current);
+ } else {
+ (*o_current->sel_func)(w_current, o_current,
+ SINGLE, 0); /* 0 is count */
+ }
+ }
+ object_found = TRUE;
+ toplevel->page_current->object_lastplace = o_current;
+ i_update_menus(w_current);
+ return object_found;
}
}
iter = g_list_next (iter);
@@ -100,26 +96,22 @@ gboolean o_find_object(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
o_current->w_right + w_slack, o_current->w_bottom + w_slack,
w_x, w_y) &&
o_shortest_distance( o_current, w_x, w_y ) < w_slack ) {
-
+
if (o_current->sel_func != NULL &&
- o_current->type != OBJ_HEAD &&
- (o_current->visibility == VISIBLE ||
- (o_current->visibility == INVISIBLE &&
- toplevel->show_hidden_text))) {
- if (change_selection) {
- /* FIXME: should this switch be moved to o_select_object()? (Werner) */
- if (o_current->type == OBJ_NET && w_current->net_selection_mode) {
- o_select_connected_nets(w_current, o_current);
- }
- else {
- (*o_current->sel_func)(w_current, o_current, SINGLE, 0); /* 0 is count */
- }
- }
- toplevel->page_current->object_lastplace = o_current;
- object_found = TRUE;
-
+ (o_current->visibility == VISIBLE || toplevel->show_hidden_text)) {
+ if (change_selection) {
+ /* FIXME: should this switch be moved to o_select_object()? (Werner) */
+ if (o_current->type == OBJ_NET && w_current->net_selection_mode) {
+ o_select_connected_nets(w_current, o_current);
+ } else {
+ (*o_current->sel_func)(w_current, o_current, SINGLE, 0); /* 0 is count */
+ }
+ }
+ toplevel->page_current->object_lastplace = o_current;
+ object_found = TRUE;
+
i_update_menus(w_current);
- return object_found;
+ return object_found;
}
}
iter = g_list_next (iter);
@@ -165,20 +157,17 @@ gboolean o_find_selected_object(GSCHEM_TOPLEVEL *w_current,
#if DEBUG
printf("o_find_selected_object:\n");
printf("Object bounds:\n\tL: %i\tR: %i\n\tT: %i\tB: %i.\n",
- o_current->w_left, o_current->w_right, o_current->w_top, o_current->w_bottom);
+ o_current->w_left, o_current->w_right, o_current->w_top, o_current->w_bottom);
printf("Screen pointer at: (%i,%i)\n", screen_x, screen_y);
#endif
if (o_current->sel_func != NULL &&
- o_current->type != OBJ_HEAD &&
- (o_current->visibility == VISIBLE ||
- (o_current->visibility == INVISIBLE &&
- toplevel->show_hidden_text))) {
- return TRUE;
+ (o_current->visibility == VISIBLE || toplevel->show_hidden_text)) {
+ return TRUE;
}
}
-
+
s_current = g_list_next(s_current);
- }
+ }
return (FALSE);
}
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index 327f0a3..a5a677f 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -341,9 +341,7 @@ void o_select_box_search(GSCHEM_TOPLEVEL *w_current)
while (iter != NULL) {
o_current = iter->data;
/* only select visible objects */
- if (o_current->type != OBJ_HEAD &&
- (o_current->visibility == VISIBLE ||
- (o_current->visibility == INVISIBLE && toplevel->show_hidden_text))) {
+ if (o_current->visibility == VISIBLE || toplevel->show_hidden_text) {
if ( o_current->w_left >= left &&
o_current->w_right <= right &&
diff --git a/libgeda/include/o_types.h b/libgeda/include/o_types.h
index ead157e..0ff2e4f 100644
--- a/libgeda/include/o_types.h
+++ b/libgeda/include/o_types.h
@@ -24,7 +24,6 @@
/* Object types are also available in scheme */
/* If there is any addition, add them also in g_register.c
(function g_register_libgeda_vars) */
-#define OBJ_HEAD -1
#define OBJ_LINE 'L'
#define OBJ_PATH 'H'
#define OBJ_BOX 'B'
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 003b76f..b862812 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -111,8 +111,7 @@ gchar *o_save_objects (GList *object_list, gboolean save_attribs)
while ( iter != NULL ) {
o_current = (OBJECT *)iter->data;
- if (o_current->type != OBJ_HEAD &&
- (save_attribs || o_current->attached_to == NULL)) {
+ if (save_attribs || o_current->attached_to == NULL) {
switch (o_current->type) {
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index a797f82..adff30f 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -252,109 +252,105 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, GList *obj_list,
while ( iter != NULL ) {
o_current = (OBJECT *)iter->data;
- if (o_current->type != OBJ_HEAD) {
+ switch (o_current->type) {
+ case(OBJ_LINE):
+ o_line_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
- switch (o_current->type) {
- case(OBJ_LINE):
- o_line_print(toplevel, fp, o_current,
+ case(OBJ_NET):
+ o_net_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
+
+ case(OBJ_BUS):
+ o_bus_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
+
+ case(OBJ_BOX):
+ o_box_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
+
+ case(OBJ_CIRCLE):
+ o_circle_print(toplevel, fp, o_current,
origin_x, origin_y);
- break;
-
- case(OBJ_NET):
- o_net_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
+ break;
- case(OBJ_BUS):
- o_bus_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
-
- case(OBJ_BOX):
- o_box_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
-
- case(OBJ_CIRCLE):
- o_circle_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
+ case(OBJ_COMPLEX):
+ case(OBJ_PLACEHOLDER): /* new object -- 1.20.2005 SDB */
+ fprintf(fp, "gsave\n");
- case(OBJ_COMPLEX):
- case(OBJ_PLACEHOLDER): /* new object -- 1.20.2005 SDB */
- fprintf(fp, "gsave\n");
+ f_print_objects(toplevel, fp,
+ o_current->complex->prim_objs,
+ origin_x, origin_y, scale,
+ unicode_count, unicode_table);
+ fprintf(fp, "grestore\n");
+ break;
- f_print_objects(toplevel, fp,
- o_current->complex->prim_objs,
- origin_x, origin_y, scale,
- unicode_count, unicode_table);
- fprintf(fp, "grestore\n");
- break;
+ case(OBJ_TEXT):
+ if (o_current->visibility == VISIBLE) {
+ int vectors = 0;
- case(OBJ_TEXT):
- if (o_current->visibility == VISIBLE) {
- int vectors = 0;
+ /* Look at flags and determine if vector text should
+ * be used for output.
+ */
+ if(toplevel->text_output == VECTOR_FONTS) {
+ vectors = 1;
+ } else if (toplevel->print_vector_threshold > 0 &&
+ o_text_num_lines (o_current->text->string) >
+ toplevel->print_vector_threshold) {
+ vectors = 1;
+ }
- /* Look at flags and determine if vector text should
- * be used for output.
- */
- if(toplevel->text_output == VECTOR_FONTS) {
- vectors = 1;
- } else if( (toplevel->print_vector_threshold > 0)
- && ( o_text_num_lines(o_current->text->string) >
- toplevel->print_vector_threshold)) {
- vectors = 1;
- }
-
- fprintf(fp, "gsave\n");
-
- if (vectors)
- {
- /* Output vectors */
- f_print_objects(toplevel,
- fp,
- o_current->text->
- prim_objs,
- origin_x, origin_y,
- scale, unicode_count, unicode_table);
- } else {
- /* Output text */
- o_text_print(toplevel, fp,
- o_current,
- origin_x, origin_y, unicode_count, unicode_table);
- }
+ fprintf(fp, "gsave\n");
- fprintf(fp, "grestore\n");
+ if (vectors)
+ {
+ /* Output vectors */
+ f_print_objects(toplevel,
+ fp,
+ o_current->text->
+ prim_objs,
+ origin_x, origin_y,
+ scale, unicode_count, unicode_table);
+ } else {
+ /* Output text */
+ o_text_print(toplevel, fp,
+ o_current,
+ origin_x, origin_y, unicode_count, unicode_table);
}
- break;
+ fprintf(fp, "grestore\n");
+ }
+ break;
- case(OBJ_PATH):
- o_path_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
- case(OBJ_PIN):
- o_pin_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
-
- case(OBJ_ARC):
- o_arc_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
+ case(OBJ_PATH):
+ o_path_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
- case(OBJ_PICTURE):
- o_picture_print(toplevel, fp, o_current,
- origin_x, origin_y);
- break;
+ case(OBJ_PIN):
+ o_pin_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
- default:
- fprintf(stderr, "Error type!\n");
- exit(-1);
- break;
- }
+ case(OBJ_ARC):
+ o_arc_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
+
+ case(OBJ_PICTURE):
+ o_picture_print(toplevel, fp, o_current,
+ origin_x, origin_y);
+ break;
+ default:
+ fprintf(stderr, "Error type!\n");
+ exit(-1);
+ break;
}
iter = g_list_next (iter);
}
@@ -660,47 +656,44 @@ static int f_print_get_unicode_chars (TOPLEVEL *toplevel, GList *obj_list,
while (iter != NULL) {
o_current = (OBJECT *)iter->data;
- if (o_current->type != OBJ_HEAD) {
-
- switch (o_current->type) {
+ switch (o_current->type) {
case (OBJ_COMPLEX):
- case (OBJ_PLACEHOLDER): /* new object -- 1.20.2005 SDB */
+ case (OBJ_PLACEHOLDER):
- count = f_print_get_unicode_chars(toplevel,
+ count = f_print_get_unicode_chars(toplevel,
o_current->complex->prim_objs,
count, table);
- break;
+ break;
case (OBJ_TEXT):
- if (o_current->visibility == VISIBLE) {
+ if (o_current->visibility == VISIBLE) {
aux = o_current->text->string;
while (aux && ((gunichar) (*aux) != 0)) {
current_char = g_utf8_get_char_validated(aux, -1);
if (current_char >= 127) {
- found = 0;
- i = 0;
- while (i < count) {
- if (table[i] == current_char)
- found = 1;
- i++;
- }
+ found = 0;
+ i = 0;
+ while (i < count) {
+ if (table[i] == current_char)
+ found = 1;
+ i++;
+ }
if (!found) {
- if (count < 128)
- table[count++] = current_char;
- else
- s_log_message(_("Too many UTF-8 characters, cannot print\n"));
- }
- }
+ if (count < 128)
+ table[count++] = current_char;
+ else
+ s_log_message(_("Too many UTF-8 characters, cannot print\n"));
+ }
+ }
aux = g_utf8_find_next_char(aux, NULL);
- }
- }
- break;
+ }
+ }
+ break;
default:
- break;
- }
+ break;
}
iter = g_list_next (iter);
}
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 27214ce..973a822 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -274,7 +274,6 @@ void o_translate_world (TOPLEVEL *toplevel, gint dx, gint dy, OBJECT *object)
void (*func) (TOPLEVEL*, int, int, OBJECT*) = NULL;
switch (object->type) {
- case OBJ_HEAD: /* Do nothing for head nodes */ break;
case OBJ_LINE: func = o_line_translate_world; break;
case OBJ_NET: func = o_net_translate_world; break;
case OBJ_BUS: func = o_bus_translate_world; break;
@@ -314,7 +313,6 @@ void o_rotate_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, i
void (*func) (TOPLEVEL*, int, int, int, OBJECT*) = NULL;
switch (object->type) {
- case OBJ_HEAD: /* Do nothing for head nodes */ break;
case OBJ_LINE: func = o_line_rotate_world; break;
case OBJ_NET: func = o_net_rotate_world; break;
case OBJ_BUS: func = o_bus_rotate_world; break;
@@ -353,7 +351,6 @@ void o_mirror_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, O
void (*func) (TOPLEVEL*, int, int, OBJECT*) = NULL;
switch (object->type) {
- case OBJ_HEAD: /* Do nothing for head nodes */ break;
case OBJ_LINE: func = o_line_mirror_world; break;
case OBJ_NET: func = o_net_mirror_world; break;
case OBJ_BUS: func = o_bus_mirror_world; break;
@@ -423,9 +420,6 @@ gdouble o_shortest_distance(OBJECT *object, gint x, gint y)
shortest_distance = o_complex_shortest_distance(object->complex, x, y);
break;
- case(OBJ_HEAD):
- break;
-
case(OBJ_PATH):
shortest_distance = o_path_shortest_distance(object, x, y);
break;
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 0624996..bf90340 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -174,7 +174,7 @@ GList *o_glist_copy_all (TOPLEVEL *toplevel,
if (selected_save)
o_selection_unselect(src_object);
- if (src_object->type != OBJ_TEXT && src_object->type != OBJ_HEAD) {
+ if (src_object->type != OBJ_TEXT) {
dst_object = o_object_copy (toplevel, src_object, flag);
dst_object->sid = global_sid++;
dest = g_list_prepend (dest, dst_object);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs