[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: g_hook.c
User: cnieves
Date: 06/10/21 18:20:51
Modified: . Tag: glist_dev g_hook.c i_basic.c i_callbacks.c
o_attrib.c o_basic.c o_buffer.c o_bus.c o_complex.c
o_copy.c o_delete.c o_find.c o_grips.c o_misc.c
o_move.c o_net.c o_picture.c o_select.c o_slot.c
o_text.c x_attribedit.c x_compselect.c x_dialog.c
x_event.c x_image.c x_multiattrib.c x_print.c
Log:
Convert the SELECTION list into a GList. Added new functions
o_recalc_object_glist and get_object_glist_bounds to handle glists.
Revision Changes Path
No revision
No revision
1.10.2.1 +2 -1 eda/geda/gaf/gschem/src/g_hook.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_hook.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_hook.c,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -b -r1.10 -r1.10.2.1
--- g_hook.c 30 Sep 2006 16:01:36 -0000 1.10
+++ g_hook.c 21 Oct 2006 22:20:43 -0000 1.10.2.1
@@ -520,7 +520,8 @@
clib = (gchar*)clibs->data;
new_object = page->object_tail = o_complex_add(w_current,
- page->object_tail, 'C',
+ page->object_tail, NULL,
+ 'C',
WHITE,
x, y,
angle, mirror,
1.13.2.1 +5 -2 eda/geda/gaf/gschem/src/i_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: i_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_basic.c,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -b -r1.13 -r1.13.2.1
--- i_basic.c 15 Jul 2006 18:51:41 -0000 1.13
+++ i_basic.c 21 Oct 2006 22:20:44 -0000 1.13.2.1
@@ -425,7 +425,10 @@
* should be based on what is in the selection list
*/
- if (o_selection_return_num(w_current->page_current->selection2_head)) {
+ g_assert(w_current != NULL);
+ g_assert(w_current->page_current != NULL);
+
+ if (w_current->page_current->selection_list != NULL) {
/* since one or more things are selected, we set these TRUE */
/* These strings should NOT be internationalized */
x_menus_sensitivity(w_current, "Edit/Edit...", TRUE);
1.69.2.1 +77 -57 eda/geda/gaf/gschem/src/i_callbacks.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: i_callbacks.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_callbacks.c,v
retrieving revision 1.69
retrieving revision 1.69.2.1
diff -u -b -r1.69 -r1.69.2.1
--- i_callbacks.c 20 Oct 2006 22:59:05 -0000 1.69
+++ i_callbacks.c 21 Oct 2006 22:20:44 -0000 1.69.2.1
@@ -799,7 +799,7 @@
exit_if_null(w_current);
i_update_middle_button(w_current, i_callback_edit_edit, _("Edit"));
- o_edit(w_current, w_current->page_current->selection2_head->next);
+ o_edit(w_current, w_current->page_current->selection_list);
}
/*! \todo Finish function documentation!!!
@@ -884,18 +884,19 @@
DEFINE_I_CALLBACK(edit_rotate_90_hotkey)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
- SELECTION *s_current;
+ GList *object_list;
exit_if_null(w_current);
o_redraw_cleanstates(w_current);
- if (w_current->page_current->selection2_head) {
- s_current = w_current->page_current->selection2_head->next;
+ object_list = w_current->page_current->selection_list;
+
+ if (object_list) {
i_update_middle_button(w_current,
i_callback_edit_rotate_90_hotkey, _("Rotate"));
/* Allow o_rotate_90 to redraw the objects */
w_current->DONT_REDRAW = 0;
- o_rotate_90(w_current, s_current, mouse_x, mouse_y);
+ o_rotate_90(w_current, object_list, mouse_x, mouse_y);
}
w_current->event_state = SELECT;
@@ -926,19 +927,20 @@
DEFINE_I_CALLBACK(edit_mirror_hotkey)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
- OBJECT *object;
+ GList *object_list;
exit_if_null(w_current);
o_redraw_cleanstates(w_current);
- object = o_select_return_first_object(w_current);
- if (object) {
+ object_list = w_current->page_current->selection_list;
+
+ if (object_list) {
i_update_middle_button(w_current,
i_callback_edit_mirror_hotkey, _("Mirror"));
o_mirror(w_current,
- w_current->page_current->selection2_head->next,
+ object_list,
mouse_x, mouse_y);
}
@@ -1025,6 +1027,7 @@
DEFINE_I_CALLBACK(edit_embed)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
+ OBJECT *o_current;
exit_if_null(w_current);
@@ -1032,14 +1035,15 @@
/* anything selected ? */
if (o_select_selected(w_current)) {
/* yes, embed each selected component */
- SELECTION *s_current =
- w_current->page_current->selection2_head->next;
+ GList *s_current =
+ w_current->page_current->selection_list;
while (s_current != NULL) {
- g_assert (s_current->selected_object != NULL);
- if ( (s_current->selected_object->type == OBJ_COMPLEX) ||
- (s_current->selected_object->type == OBJ_PICTURE) ) {
- o_embed (w_current, s_current->selected_object);
+ o_current = (OBJECT *) s_current->data;
+ g_assert (o_current != NULL);
+ if ( (o_current->type == OBJ_COMPLEX) ||
+ (o_current->type == OBJ_PICTURE) ) {
+ o_embed (w_current, o_current);
}
s_current = s_current->next;
}
@@ -1061,6 +1065,7 @@
DEFINE_I_CALLBACK(edit_unembed)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
+ OBJECT *o_current;
exit_if_null(w_current);
@@ -1068,14 +1073,15 @@
/* anything selected ? */
if (o_select_selected(w_current)) {
/* yes, unembed each selected component */
- SELECTION *s_current =
- w_current->page_current->selection2_head->next;
+ GList *s_current =
+ w_current->page_current->selection_list;
while (s_current != NULL) {
- g_assert (s_current->selected_object != NULL);
- if ( (s_current->selected_object->type == OBJ_COMPLEX) ||
- (s_current->selected_object->type == OBJ_PICTURE) ) {
- o_unembed (w_current, s_current->selected_object);
+ o_current = (OBJECT *) s_current->data;
+ g_assert (o_current != NULL);
+ if ( (o_current->type == OBJ_COMPLEX) ||
+ (o_current->type == OBJ_PICTURE) ) {
+ o_unembed (w_current, o_current);
}
s_current = s_current->next;
}
@@ -1097,6 +1103,7 @@
DEFINE_I_CALLBACK(edit_update)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
+ OBJECT *o_current;
exit_if_null(w_current);
@@ -1104,14 +1111,14 @@
/* anything selected ? */
if (o_select_selected(w_current)) {
/* yes, update each selected component */
- SELECTION *s_current =
- w_current->page_current->selection2_head->next;
+ GList *s_current =
+ w_current->page_current->selection_list;
while (s_current != NULL) {
- g_assert (s_current->selected_object != NULL);
- if (s_current->selected_object->type == OBJ_COMPLEX) {
- o_update_component (w_current,
- s_current->selected_object);
+ o_current = (OBJECT *) s_current->data;
+ g_assert (o_current != NULL);
+ if (o_current->type == OBJ_COMPLEX) {
+ o_update_component (w_current, o_current);
}
s_current = s_current->next;
}
@@ -1259,13 +1266,13 @@
/* anything selected ? */
if (o_select_selected(w_current)) {
- SELECTION *s_current =
- w_current->page_current->selection2_head->next;
+ GList *s_current =
+ w_current->page_current->selection_list;
GList *objects = NULL;
/* yes, build a list of relevant objects */
while (s_current != NULL) {
- OBJECT *o_current = s_current->selected_object;
+ OBJECT *o_current = (OBJECT *) s_current->data;
if (o_current->type == OBJ_LINE ||
o_current->type == OBJ_BOX ||
@@ -1302,13 +1309,13 @@
/* anything selected ? */
if (o_select_selected(w_current)) {
- SELECTION *s_current =
- w_current->page_current->selection2_head->next;
+ GList *s_current =
+ w_current->page_current->selection_list;
GList *objects = NULL;
/* yes, build a list of relevant objects */
while (s_current != NULL) {
- OBJECT *o_current = s_current->selected_object;
+ OBJECT *o_current = (OBJECT *) s_current->data;
if (o_current->type == OBJ_BOX ||
o_current->type == OBJ_CIRCLE) {
@@ -1854,7 +1861,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_copy1, _("Copy 1"));
@@ -1872,7 +1879,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_copy2, _("Copy 2"));
@@ -1890,7 +1897,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_copy3, _("Copy 3"));
@@ -1908,7 +1915,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_copy4, _("Copy 4"));
@@ -1926,7 +1933,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_copy5, _("Copy 5"));
@@ -1944,7 +1951,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_cut1, _("Cut 1"));
@@ -1962,7 +1969,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_cut2, _("Cut 2"));
@@ -1980,7 +1987,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_cut3, _("Cut 3"));
@@ -1998,7 +2005,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_cut4, _("Cut 4"));
@@ -2016,7 +2023,7 @@
exit_if_null(w_current);
- if (w_current->page_current->selection2_head->next == NULL)
+ if (w_current->page_current->selection_list == NULL)
return;
i_update_middle_button(w_current, i_callback_buffer_cut5, _("Cut 5"));
@@ -3056,7 +3063,7 @@
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
OBJECT *first_object;
- SELECTION *s_current;
+ GList *s_current;
exit_if_null(w_current);
@@ -3072,12 +3079,12 @@
_("Attach"));
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
if (!s_current) {
return;
}
- first_object = s_current->selected_object;
+ first_object = (OBJECT *) s_current->data;
if (!first_object) {
return;
}
@@ -3085,10 +3092,10 @@
/* skip over first object */
s_current = s_current->next;
while (s_current != NULL) {
- if (s_current->selected_object) {
+ if (s_current->data) {
o_attrib_attach(w_current,
w_current->page_current->object_head,
- s_current->selected_object,
+ (OBJECT *)s_current->data,
first_object);
w_current->page_current->CHANGED=1;
}
@@ -3105,7 +3112,7 @@
DEFINE_I_CALLBACK(attributes_detach)
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
- SELECTION *s_current;
+ GList *s_current;
OBJECT *o_current;
exit_if_null(w_current);
@@ -3121,9 +3128,9 @@
_("Detach"));
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- o_current = s_current->selected_object;
+ o_current = (OBJECT *) s_current->data;
if (o_current) {
if (o_current->attribs) {
o_attrib_free_all(w_current,
@@ -3163,7 +3170,7 @@
if (object != NULL) {
o_attrib_toggle_show_name_value(w_current,
w_current->page_current->
- selection2_head->next,
+ selection_list,
SHOW_NAME);
}
}
@@ -3194,7 +3201,7 @@
if (object != NULL) {
o_attrib_toggle_show_name_value(w_current,
w_current->page_current->
- selection2_head->next,
+ selection_list,
SHOW_VALUE);
}
}
@@ -3225,7 +3232,7 @@
if (object != NULL) {
o_attrib_toggle_show_name_value(w_current,
w_current->page_current->
- selection2_head->next,
+ selection_list,
SHOW_NAME_VALUE);
}
}
@@ -3257,7 +3264,7 @@
if (object != NULL) {
o_attrib_toggle_visibility(w_current,
w_current->page_current->
- selection2_head->next);
+ selection_list);
}
}
@@ -3495,8 +3502,21 @@
* so lets be sure to clean up the complex_place_head
* structure and also clean up the attrib_place_head.
* remember these don't remove the head structure */
- o_list_delete_rest(w_current,
- w_current->page_current->complex_place_head);
+
+ /* If it is a move command, then free the complex place list WITHOUT
+ freeing the individual objects. */
+ if ( (w_current->inside_action) &&
+ ((w_current->event_state == ENDCOPY) ||
+ (w_current->event_state == ENDMCOPY)) ) {
+ s_delete_object_glist(w_current,
+ w_current->page_current->complex_place_list);
+ w_current->page_current->complex_place_list = NULL;
+ }
+ else {
+ g_list_free(w_current->page_current->complex_place_list);
+ }
+ w_current->page_current->complex_place_list = NULL;
+
o_list_delete_rest(w_current,
w_current->page_current->attrib_place_head);
1.25.2.1 +19 -16 eda/geda/gaf/gschem/src/o_attrib.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_attrib.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_attrib.c,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -b -r1.25 -r1.25.2.1
--- o_attrib.c 6 Aug 2006 16:07:54 -0000 1.25
+++ o_attrib.c 21 Oct 2006 22:20:45 -0000 1.25.2.1
@@ -51,10 +51,11 @@
*
* \todo get a better name
*/
-void o_attrib_add_selected(TOPLEVEL *w_current, SELECTION* selection_list,
+void o_attrib_add_selected(TOPLEVEL *w_current, GList** selection_list_ptr,
OBJECT *selected)
{
ATTRIB *a_current;
+ GList *selection_list = *selection_list_ptr;
if (!selection_list) return;
@@ -69,7 +70,7 @@
/* make sure object isn't selected already */
if (a_current->object->saved_color == -1) {
- o_selection_add(selection_list,
+ *selection_list_ptr = o_selection_add(selection_list,
/* w_current->page_current->
selection2_head,*/
a_current->object);
@@ -90,9 +91,9 @@
* \par Function Description
*
*/
-void o_attrib_toggle_visibility(TOPLEVEL *w_current, SELECTION *list)
+void o_attrib_toggle_visibility(TOPLEVEL *w_current, GList *list)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object = NULL;
if (list == NULL) {
@@ -102,7 +103,7 @@
s_current = list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object == NULL) {
fprintf(stderr, _("Got NULL in o_attrib_toggle_visibility\n"));
exit(-1);
@@ -154,9 +155,9 @@
*
*/
void o_attrib_toggle_show_name_value(TOPLEVEL *w_current,
- SELECTION *list, int new_show_name_value)
+ GList *list, int new_show_name_value)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object = NULL;
if (list == NULL) {
@@ -166,7 +167,7 @@
s_current = list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object == NULL) {
fprintf(stderr, _("Got NULL in o_attrib_toggle_show_name_value\n"));
@@ -334,7 +335,7 @@
/* here is where you attach the stuff */
/* if an object is selected, else just place it */
/* selection_head should never be null since it has a head struct */
- object = o_select_return_first_object(w_current);
+ object = (OBJECT *) g_list_first (w_current->page_current->selection_list)->data;
if (object != NULL) {
/* should attribute be selected? probably */
/* this is probably okay, NEWSEL, since tail is a single obj */
@@ -344,7 +345,8 @@
object);
}
- o_selection_add(w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
w_current->page_current->object_tail);
o_undo_savestate(w_current, UNDO_ALL);
}
@@ -471,7 +473,8 @@
o_current);
}
- o_selection_add(w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
w_current->page_current->object_tail);
o_text_erase(w_current, w_current->page_current->object_tail);
1.21.2.3 +88 -95 eda/geda/gaf/gschem/src/o_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_basic.c,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -b -r1.21.2.2 -r1.21.2.3
--- o_basic.c 21 Oct 2006 21:14:42 -0000 1.21.2.2
+++ o_basic.c 21 Oct 2006 22:20:45 -0000 1.21.2.3
@@ -62,7 +62,7 @@
case(ENDCOPY):
case(ENDMCOPY):
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), FALSE);
break;
@@ -70,8 +70,8 @@
case(DRAWCOMP):
case(ENDCOMP):
o_drawbounding(w_current,
- w_current->page_current->complex_place_head->next,
NULL,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), FALSE);
break;
@@ -108,7 +108,7 @@
o_recalc_object_list(w_current, w_current->page_current->object_head);
/* Uncomment this when using the complex_place_list for moving and copying */
- /* o_recalc_glist(w_current, w_current->page_current->complex_place_list); */
+ /* o_recalc_object_glist(w_current, w_current->page_current->complex_place_list); */
draw_selected = !(w_current->inside_action &&
((w_current->event_state == MOVE) ||
@@ -156,8 +156,8 @@
{
if (!w_current->SHIFTKEY) {
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current, w_current->page_current->
- selection2_head);
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
}
}
@@ -195,15 +195,15 @@
*/
void o_draw_selected(TOPLEVEL *w_current)
{
- SELECTION* s_current;
+ GList* s_current;
OBJECT* o_current;
if (w_current->inside_redraw) {
return;
}
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- o_current=s_current->selected_object;
+ o_current = (OBJECT *) s_current->data;
if (o_current) {
o_redraw_single(w_current, o_current);
@@ -221,15 +221,15 @@
*/
void o_erase_selected(TOPLEVEL *w_current)
{
- SELECTION* s_current;
+ GList* s_current;
OBJECT* o_current;
if (w_current->inside_redraw) {
return;
}
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- o_current=s_current->selected_object;
+ o_current = (OBJECT *) s_current->data;
if (o_current) {
o_cue_erase_single(w_current, o_current);
@@ -275,7 +275,7 @@
*/
/* both outline and boundingbox work! */
/* name is blah */
-void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, SELECTION *s_list,
+void o_drawbounding(TOPLEVEL *w_current, OBJECT *o_list, GList *o_glist,
GdkColor *color, int firsttime)
{
int diff_x, diff_y;
@@ -285,7 +285,7 @@
/* you have to make these static... for the once mode */
static int rleft, rtop, rbottom, rright;
- if (!o_list && !s_list) {
+ if (!o_list && !o_glist) {
return;
}
@@ -306,11 +306,8 @@
diff_x,
diff_y,
o_list);
- } else if (s_list) {
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current, diff_x, diff_y, o_glist);
}
gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
@@ -321,14 +318,13 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
&rbottom);
}
-
gdk_draw_rectangle(w_current->window,
w_current->bounding_xor_gc, FALSE,
rleft + diff_x,
@@ -350,8 +346,8 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
@@ -375,12 +371,11 @@
diff_x,
diff_y,
o_list);
- } else if (s_list) {
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
}
+
}
w_current->last_drawb_mode = w_current->actionfeedback_mode;
@@ -408,12 +403,11 @@
diff_x,
diff_y,
o_list);
- } else if (s_list) {
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
}
+
} else {
if (o_list) {
get_object_list_bounds(w_current, o_list,
@@ -421,8 +415,8 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
@@ -456,12 +450,11 @@
diff_x,
diff_y,
o_list);
- } else if (s_list) {
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
}
+
} else {
if (o_list) {
get_object_list_bounds(w_current, o_list,
@@ -469,13 +462,14 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
&rbottom);
}
+
gdk_gc_set_foreground(w_current->bounding_xor_gc,
color);
gdk_draw_rectangle(w_current->window,
@@ -514,16 +508,13 @@
diff_x,
diff_y,
o_list);
- } else if (s_list) {
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
- o_complex_translate_display_selection(w_current,
- diff_x,
- diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
}
+
} else {
/*! \todo why are we doing this here...?
* probably a reason */
@@ -533,13 +524,14 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
&rbottom);
}
+
}
if (w_current->netconn_rubberband) {
o_move_stretch_rubberband(w_current);
@@ -566,13 +558,14 @@
&rtop ,
&rright ,
&rbottom);
- } else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ } else if (o_glist) {
+ get_object_glist_bounds(w_current, o_glist,
&rleft ,
&rtop ,
&rright ,
&rbottom);
}
+
/*printf("once\n");*/
}
@@ -597,9 +590,9 @@
*/
if (o_list) {
o_complex_translate2(w_current, diff_x, diff_y, o_list);
- } else if (s_list) {
- o_complex_translate_selection(w_current, diff_x, diff_y,
- s_list);
+ } else if (o_glist) {
+ o_complex_translate_display_object_glist(w_current,
+ diff_x, diff_y, o_glist);
}
}
@@ -608,12 +601,12 @@
* \par Function Description
*
*/
-void o_erasebounding(TOPLEVEL *w_current, OBJECT *o_list, SELECTION *s_list)
+void o_erasebounding(TOPLEVEL *w_current, OBJECT *o_list, GList *s_list)
{
int diff_x, diff_y;
int rleft, rtop, rright, rbottom;
- if (o_list == NULL) {
+ if ( (o_list == NULL) && (s_list == NULL)) {
/* this is an error condition */
w_current->event_state = SELECT;
w_current->inside_action = 0;
@@ -631,7 +624,7 @@
&rright ,
&rbottom);
} else if (s_list) {
- get_complex_bounds_selection(w_current, s_list,
+ get_object_glist_bounds(w_current, s_list,
&rleft ,
&rtop ,
&rright ,
@@ -766,8 +759,8 @@
* so lets be sure to clean up the complex_place_head
* structure and also clean up the attrib_place_head.
* remember these don't remove the head structure */
- o_list_delete_rest(w_current,
- w_current->page_current->complex_place_head);
+ s_delete_object_glist (w_current,
+ w_current->page_current->complex_place_list);
o_list_delete_rest(w_current,
w_current->page_current->attrib_place_head);
1.8.2.1 +11 -13 eda/geda/gaf/gschem/src/o_buffer.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_buffer.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_buffer.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -b -r1.8 -r1.8.2.1
--- o_buffer.c 21 Oct 2006 13:56:24 -0000 1.8
+++ o_buffer.c 21 Oct 2006 22:20:46 -0000 1.8.2.1
@@ -35,14 +35,14 @@
*/
void o_buffer_copy(TOPLEVEL *w_current, int buf_num)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
if (buf_num < 0 || buf_num > MAX_BUFFERS) {
fprintf(stderr, _("Got an invalid buffer_number [o_buffer_copy]\n"));
return;
}
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
if (object_buffer[buf_num] == NULL) {
object_buffer[buf_num] = s_basic_init_object("buffer0_head");
@@ -73,14 +73,14 @@
*/
void o_buffer_cut(TOPLEVEL *w_current, int buf_num)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
if (buf_num < 0 || buf_num > MAX_BUFFERS) {
fprintf(stderr, _("Got an invalid buffer_number [o_buffer_cut]\n"));
return;
}
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
if (object_buffer[buf_num] == NULL) {
object_buffer[buf_num] = s_basic_init_object("buffer0_head");
@@ -165,7 +165,7 @@
int w_diff_x, w_diff_y;
OBJECT *o_current;
OBJECT *o_saved;
- SELECTION *temp_list;
+ GList *temp_list;
PAGE *p_current;
GList *connected_objects = NULL;
@@ -205,11 +205,11 @@
p_current->object_tail = return_tail(p_current->object_head);
o_current = o_saved->next;
- temp_list = o_selection_new_head();
+ temp_list = NULL;
/* now add new objects to the selection list */
while (o_current != NULL) {
- o_selection_add(temp_list, o_current);
+ temp_list = o_selection_add(temp_list, o_current);
s_conn_update_object(w_current, o_current);
if (o_current->type == OBJ_COMPLEX || o_current->type == OBJ_PLACEHOLDER) {
connected_objects = s_conn_return_complex_others(
@@ -229,12 +229,10 @@
connected_objects = NULL;
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
- o_selection_destroy_head(w_current->page_current->selection2_head);
- w_current->page_current->selection2_head = temp_list;
- w_current->page_current->selection2_tail = o_selection_return_tail(
- temp_list);
+
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
+ w_current->page_current->selection_list = temp_list;
w_current->page_current->CHANGED = 1;
o_redraw(w_current, o_saved->next, TRUE); /* only redraw new objects */
1.21.2.1 +1 -1 eda/geda/gaf/gschem/src/o_bus.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_bus.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_bus.c,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -u -b -r1.21 -r1.21.2.1
--- o_bus.c 21 Oct 2006 13:56:24 -0000 1.21
+++ o_bus.c 21 Oct 2006 22:20:47 -0000 1.21.2.1
@@ -270,7 +270,7 @@
#if 0 /* not ready for prime time use */
/* new bus extenstion stuff */
- o_current = w_current->page_current->selection_head->next;
+ o_current = w_current->page_current->selection_list;
if (o_current != NULL && w_current->event_state == STARTDRAWNET) {
if (o_current->type == OBJ_BUS) {
if (o_current->line) {
1.28.2.2 +93 -99 eda/geda/gaf/gschem/src/o_complex.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_complex.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_complex.c,v
retrieving revision 1.28.2.1
retrieving revision 1.28.2.2
diff -u -b -r1.28.2.1 -r1.28.2.2
--- o_complex.c 21 Oct 2006 20:35:58 -0000 1.28.2.1
+++ o_complex.c 21 Oct 2006 22:20:47 -0000 1.28.2.2
@@ -42,6 +42,10 @@
{
int left, right, top, bottom;
+ g_return_if_fail (o_current != NULL);
+ g_return_if_fail (o_current->complex != NULL);
+ g_return_if_fail (o_current->complex->prim_objs != NULL);
+
if (!w_current->DONT_REDRAW) {
o_redraw(w_current, o_current->complex->prim_objs, TRUE);
}
@@ -154,10 +158,8 @@
w_current->DONT_DRAW_CONN = 1;
w_current->ADDING_SEL = 1; /* reuse this flag, rename later hack */
- w_current->page_current->complex_place_tail =
- (OBJECT *) o_complex_add(
- w_current,
- w_current->page_current->complex_place_head,
+ o_complex_add(w_current, NULL,
+ &(w_current->page_current->complex_place_list),
OBJ_COMPLEX, WHITE, x, y, 0, 0,
w_current->internal_clib,
w_current->internal_basename, 1, TRUE);
@@ -172,8 +174,8 @@
}
o_drawbounding(w_current,
- w_current->page_current->complex_place_head->next,
NULL,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), TRUE);
}
@@ -185,19 +187,21 @@
void o_complex_place_rotate(TOPLEVEL *w_current)
{
OBJECT *o_current;
+ GList *ptr;
int screen_x_local = -1;
int screen_y_local = -1;
int new_angle;
- o_current = w_current->page_current->complex_place_head->next;
- while(o_current) {
+ ptr = w_current->page_current->complex_place_list;
+ while(ptr) {
+ o_current = (OBJECT *) ptr->data;
switch(o_current->type) {
case(OBJ_COMPLEX):
screen_x_local = o_current->complex->screen_x;
screen_y_local = o_current->complex->screen_y;
break;
}
- o_current = o_current->next;
+ ptr = ptr->next;
}
if (screen_x_local == -1) {
@@ -205,8 +209,9 @@
return;
}
- o_current = w_current->page_current->complex_place_head->next;
- while(o_current) {
+ ptr = w_current->page_current->complex_place_list;
+ while(ptr) {
+ o_current = (OBJECT *) ptr->data;
switch(o_current->type) {
case(OBJ_TEXT):
@@ -222,7 +227,7 @@
break;
}
- o_current = o_current->next;
+ ptr = ptr->next;
}
}
@@ -298,18 +303,18 @@
printf("inside draw outline here\n");
#endif
/* erase outline */
- o_complex_translate_display(
- w_current,
+
+ o_complex_translate_display_object_glist(w_current,
diff_x, diff_y,
w_current->page_current->
- complex_place_head->next);
+ complex_place_list);
} else {
#if 0
printf("inside draw bounding here\n");
#endif
- get_object_list_bounds(w_current,
+ get_object_glist_bounds(w_current,
w_current->page_current->
- complex_place_head->next,
+ complex_place_list,
&rleft, &rtop, &rright, &rbottom);
gdk_gc_set_foreground(
w_current->gc,
@@ -326,16 +331,15 @@
w_current->page_current->CHANGED = 1;
o_undo_savestate(w_current, UNDO_ALL);
i_update_menus(w_current);
- o_list_delete_rest(w_current, w_current->page_current->
- complex_place_head);
+ s_delete_object_glist(w_current, w_current->page_current->
+ complex_place_list);
return;
}
o_temp = w_current->page_current->object_tail;
w_current->page_current->object_tail =
- o_complex_add(
- w_current,
- w_current->page_current->object_tail,
+ o_complex_add(w_current,
+ w_current->page_current->object_tail, NULL,
OBJ_COMPLEX, WHITE, x, y, w_current->complex_rotate, 0,
w_current->internal_clib,
w_current->internal_basename, 1, TRUE);
@@ -360,7 +364,6 @@
}
/* 1 should be define fix everywhere hack */
-
o_current = w_current->page_current->object_tail;
if (scm_hook_empty_p(add_component_hook) == SCM_BOOL_F &&
@@ -402,16 +405,15 @@
printf("inside draw outline here\n");
#endif
/* erase outline */
- o_complex_translate_display(
- w_current,
+ o_complex_translate_display_object_glist(w_current,
diff_x, diff_y,
- w_current->page_current->complex_place_head->next);
+ w_current->page_current->complex_place_list);
} else {
#if 0
printf("inside draw bounding here\n");
#endif
- get_object_list_bounds(w_current,
- w_current->page_current->complex_place_head->next,
+ get_object_glist_bounds(w_current,
+ w_current->page_current->complex_place_list,
&rleft, &rtop,
&rright, &rbottom);
gdk_gc_set_foreground(
@@ -426,19 +428,20 @@
/*! \todo redraw has to happen at the end of all this hack or
* maybe not? */
- o_list_delete_rest(w_current,
- w_current->page_current->complex_place_head);
+ g_list_free(w_current->page_current->complex_place_list);
+ w_current->page_current->complex_place_list = NULL;
/* This doesn't allow anything else to be in the selection
* list when you add a component */
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
- o_selection_add(w_current->page_current->selection2_head,
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
w_current->page_current->object_tail);
/* the o_redraw_selected is in x_events.c after this call
* returns */
- o_attrib_add_selected(w_current, w_current->page_current->selection2_head,
+ o_attrib_add_selected(w_current, &(w_current->page_current->selection_list),
w_current->page_current->object_tail);
s_conn_update_complex(w_current, o_current->complex->prim_objs);
@@ -462,8 +465,8 @@
void o_complex_rubbercomplex(TOPLEVEL *w_current)
{
o_drawbounding(w_current,
- w_current->page_current->complex_place_head->next,
NULL,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), FALSE);
}
@@ -472,12 +475,11 @@
* \par Function Description
*
*/
-void o_complex_translate_display(TOPLEVEL *w_current,
- int x1, int y1, OBJECT *complex)
+void
+o_complex_translate_display_single_object(TOPLEVEL *w_current,
+ int x1, int y1, OBJECT *o_current)
{
- OBJECT *o_current = complex;
-
- while (o_current != NULL) {
+ if (o_current != NULL) {
switch(o_current->type) {
case(OBJ_LINE):
o_line_draw_xor(w_current, x1, y1, o_current);
@@ -521,6 +523,41 @@
o_arc_draw_xor(w_current, x1, y1, o_current);
break;
}
+ }
+}
+
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
+void
+o_complex_translate_display_object_glist(TOPLEVEL *w_current,
+ int x1, int y1, GList *object_list)
+{
+ GList *ptr = object_list;
+
+ while (ptr != NULL) {
+ o_complex_translate_display_single_object (w_current, x1, y1,
+ (OBJECT *)ptr->data);
+ ptr = ptr->next;
+ }
+}
+
+
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
+void
+o_complex_translate_display(TOPLEVEL *w_current,
+ int x1, int y1, OBJECT *complex)
+{
+ OBJECT *o_current = complex;
+
+ while (o_current != NULL) {
+ o_complex_translate_display_single_object (w_current, x1, y1, o_current);
o_current = o_current->next;
}
}
@@ -531,63 +568,20 @@
*
*/
void o_complex_translate_display_selection(TOPLEVEL *w_current,
- int x1, int y1, SELECTION *head)
+ int x1, int y1, GList *head)
{
- SELECTION *s_current = head;
+ GList *s_current = head;
OBJECT *o_current;
while (s_current != NULL) {
- o_current = s_current->selected_object;
+ o_current = (OBJECT *) s_current->data;
if (!o_current) {
fprintf(stderr, _("Got NULL in o_complex_translate_display_selection\n"));
exit(-1);
}
-
- switch(o_current->type) {
- case(OBJ_LINE):
- o_line_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_NET):
- o_net_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_BUS):
- o_bus_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_BOX):
- o_box_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_PICTURE):
- o_picture_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_CIRCLE):
- o_circle_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_COMPLEX):
- case(OBJ_PLACEHOLDER):
- o_complex_draw_xor(w_current, x1, y1,
- o_current->complex->prim_objs);
- break;
-
- case(OBJ_TEXT):
- o_text_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_PIN):
- o_pin_draw_xor(w_current, x1, y1, o_current);
- break;
-
- case(OBJ_ARC):
- o_arc_draw_xor(w_current, x1, y1, o_current);
- break;
- }
+ o_complex_translate_display_single_object (w_current, x1, y1, o_current);
s_current = s_current->next;
}
}
@@ -698,7 +692,7 @@
*
*/
void o_complex_translate_selection(TOPLEVEL *w_current, int dx, int dy,
- SELECTION *head)
+ GList *head)
{
if (head == NULL) {
printf(_("Got NULL in o_complex_translate_selection!\n"));
@@ -904,7 +898,7 @@
new_obj = o_complex_add(w_current,
- list, object->type,
+ list, NULL, object->type,
color,
x, y,
object->complex->angle,
1.26.2.1 +29 -29 eda/geda/gaf/gschem/src/o_copy.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_copy.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_copy.c,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -b -r1.26 -r1.26.2.1
--- o_copy.c 6 Aug 2006 16:45:29 -0000 1.26
+++ o_copy.c 21 Oct 2006 22:20:47 -0000 1.26.2.1
@@ -37,7 +37,7 @@
*/
void o_copy_start(TOPLEVEL *w_current, int x, int y)
{
- if (w_current->page_current->selection2_head->next != NULL) {
+ if (w_current->page_current->selection_list != NULL) {
/* This is commented out since it breaks the copy of objects. See below. */
#if 0
@@ -53,7 +53,7 @@
w_current->last_x = w_current->start_x = fix_x(w_current, x);
w_current->last_y = w_current->start_y = fix_y(w_current, y);
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), TRUE);
w_current->inside_action = 1;
}
@@ -66,8 +66,8 @@
*/
void o_copy_end(TOPLEVEL *w_current)
{
- SELECTION *temp_list = NULL;
- SELECTION *s_current = NULL;
+ GList *temp_list = NULL;
+ GList *s_current = NULL;
GList *new_objects = NULL;
GList *connected_objects=NULL;
OBJECT *new_object = NULL;
@@ -108,18 +108,19 @@
diff_y = ly - sy;
/* skip over head node */
- s_current = w_current->page_current->selection2_head->next;
- temp_list = o_selection_new_head();
+ s_current = w_current->page_current->selection_list;
+ temp_list = NULL;
new_objects_head = s_basic_init_object("object_head");
while(s_current != NULL) {
- if (s_current->selected_object == NULL) {
+ object = (OBJECT *) s_current->data;
+
+ if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object in o_copy_end!\n"));
exit(-1);
}
- object = s_current->selected_object;
switch(object->type) {
case(OBJ_NET):
@@ -143,7 +144,7 @@
diff_x, diff_y,
new_object);
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_net_draw(w_current, new_object);
@@ -174,7 +175,7 @@
diff_x, diff_y,
new_object);
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_pin_draw(w_current, new_object);
@@ -204,7 +205,7 @@
diff_x, diff_y,
new_object);
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_bus_draw(w_current, new_object);
@@ -244,7 +245,7 @@
diff_y,
new_object);
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
/* NEWSEL: this needs to be fixed too */
/* this may not be needed anymore? */
@@ -275,7 +276,7 @@
new_object);
w_current->ADDING_SEL=0;
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_line_draw(w_current, new_object);
break;
@@ -297,7 +298,7 @@
new_object);
w_current->ADDING_SEL=0;
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_box_draw(w_current, new_object);
@@ -320,7 +321,7 @@
new_object);
w_current->ADDING_SEL=0;
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_picture_draw(w_current, new_object);
@@ -344,7 +345,7 @@
new_object);
w_current->ADDING_SEL=0;
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_circle_draw(w_current, new_object);
break;
@@ -367,7 +368,7 @@
new_object);
w_current->ADDING_SEL=0;
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = object->saved_color;
o_arc_draw(w_current, new_object);
break;
@@ -381,15 +382,16 @@
}
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while(s_current != NULL) {
- if (s_current->selected_object == NULL) {
+ object = (OBJECT *) s_current->data;
+
+ if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object in o_copy_end!\n"));
exit(-1);
}
- object = s_current->selected_object;
switch(object->type) {
case(OBJ_TEXT):
@@ -440,7 +442,7 @@
color = object->saved_color;
}
- o_selection_add(temp_list, new_object);
+ temp_list = o_selection_add(temp_list, new_object);
new_object->saved_color = color;
/* signify that object is no longer an attribute */
@@ -506,19 +508,17 @@
/* erase the bounding box */
if (w_current->actionfeedback_mode == BOUNDINGBOX) {
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), TRUE);
}
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
- o_selection_destroy_head(w_current->page_current->selection2_head);
- w_current->page_current->selection2_head = temp_list;
- w_current->page_current->selection2_tail = o_selection_return_tail(
- temp_list);
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
+ w_current->page_current->selection_list = NULL;
+ w_current->page_current->selection_list = temp_list;
#if DEBUG
- o_selection_print_all(w_current->page_current->selection2_head);
+ o_selection_print_all(w_current->page_current->selection_list);
#endif
w_current->page_current->CHANGED = 1;
1.22.2.1 +5 -5 eda/geda/gaf/gschem/src/o_delete.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_delete.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_delete.c,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -u -b -r1.22 -r1.22.2.1
--- o_delete.c 6 Aug 2006 16:45:29 -0000 1.22
+++ o_delete.c 21 Oct 2006 22:20:47 -0000 1.22.2.1
@@ -232,7 +232,7 @@
*/
void o_delete(TOPLEVEL *w_current)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object = NULL;
object = o_select_return_first_object(w_current);
@@ -245,11 +245,11 @@
/* skip over head node */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object == NULL) {
fprintf(stderr,
_("ERROR: NULL object in o_delete_end!\n"));
@@ -303,8 +303,8 @@
w_current->inside_action = 0;
- o_selection_destroy_all(w_current->page_current->selection2_head);
- w_current->page_current->selection2_head = o_selection_new_head();
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
w_current->page_current->CHANGED=1;
/* no longer needed */
1.4.2.1 +7 -11 eda/geda/gaf/gschem/src/o_find.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_find.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_find.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- o_find.c 14 Jul 2006 02:23:55 -0000 1.4
+++ o_find.c 21 Oct 2006 22:20:47 -0000 1.4.2.1
@@ -69,7 +69,6 @@
return object_found;
}
}
-
o_current = o_current->next;
}
@@ -113,11 +112,11 @@
if (change_selection && (!w_current->SHIFTKEY)) {
#if DEBUG
- o_selection_print_all( w_current->page_current->selection2_head);
+ o_selection_print_all( w_current->page_current->selection_list);
#endif
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
}
i_update_menus(w_current);
@@ -134,15 +133,12 @@
int screen_x, int screen_y)
{
OBJECT *o_current=NULL;
- SELECTION *s_current;
-
- g_assert (w_current->page_current->selection2_head != NULL);
+ GList *s_current;
- /* Skip the head node */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
/* do first search */
while (s_current != NULL) {
- o_current = s_current->selected_object;
+ o_current = (OBJECT *) s_current->data;
if (inside_region(o_current->left, o_current->top,
o_current->right, o_current->bottom,
screen_x, screen_y)) {
1.12.2.1 +5 -6 eda/geda/gaf/gschem/src/o_grips.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_grips.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_grips.c,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -b -r1.12 -r1.12.2.1
--- o_grips.c 21 Oct 2006 13:56:25 -0000 1.12
+++ o_grips.c 21 Oct 2006 22:20:47 -0000 1.12.2.1
@@ -86,7 +86,7 @@
{
OBJECT *object=NULL;
OBJECT *found=NULL;
- SELECTION *s_current;
+ GList *s_current;
int size, x2size;
if (!whichone) {
@@ -99,12 +99,11 @@
x2size = size * 2;
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
- while (s_current) {
- if (s_current->selected_object) {
- object = s_current->selected_object;
+ s_current = w_current->page_current->selection_list;
+ while (s_current != NULL) {
+ object = (OBJECT *) s_current->data;
+ if (object) {
switch(object->type) {
-
case(OBJ_ARC):
/* check the grips of the arc object */
found = o_grips_search_arc(w_current, object,
1.35.2.1 +20 -49 eda/geda/gaf/gschem/src/o_misc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_misc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_misc.c,v
retrieving revision 1.35
retrieving revision 1.35.2.1
diff -u -b -r1.35 -r1.35.2.1
--- o_misc.c 25 Aug 2006 01:00:09 -0000 1.35
+++ o_misc.c 21 Oct 2006 22:20:47 -0000 1.35.2.1
@@ -62,14 +62,10 @@
* \par Function Description
*
*/
-void o_edit(TOPLEVEL *w_current, SELECTION *list)
+void o_edit(TOPLEVEL *w_current, GList *list)
{
char *equal_ptr;
OBJECT *o_current;
-#if 0 /* was HAS_LIBGTKEXTRA, no longer user */
- SELECTION *s_current;
- int object_count=0;
-#endif
int num_lines = 0;
if (list == NULL) {
@@ -78,38 +74,12 @@
return;
}
- o_current = list->selected_object;
+ o_current = (OBJECT *) list->data;
if (o_current == NULL) {
fprintf(stderr, _("Got an unexpected NULL in o_edit\n"));
exit(-1);
}
-#if 0 /* was HAS_LIBGTKEXTRA, no longer used */
- /* count up how many non-text objects exist in the selection */
- /* list. Why? Because if there are multiple objects, invoke the */
- /* multi_multi_edit dialog box */
- s_current = list;
- while (s_current != NULL) {
- if (s_current->selected_object) {
- if (s_current->selected_object->type != OBJ_TEXT) {
- object_count++;
- }
- }
- s_current=s_current->next;
- }
-
- /* now decide what we want to do, either single edit or */
- /* multi multi edit */
- if (object_count == 1 && o_current->type != OBJ_TEXT) {
- x_multiattrib_open (w_current, o_current);
- return;
- } else if ( object_count > 1 ) {
- x_multiattrib_open (w_current, o_current);
- return;
- }
-#endif
-
-
/* for now deal with only the first item */
switch(o_current->type) {
@@ -170,13 +140,13 @@
void o_lock(TOPLEVEL *w_current)
{
OBJECT *object = NULL;
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object) {
/* check to see if locked_color is already being used */
if (object->locked_color == -1) {
@@ -209,12 +179,12 @@
void o_unlock(TOPLEVEL *w_current)
{
OBJECT *object = NULL;
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object) {
/* only unlock if sel_func is not set to something */
if (object->sel_func == NULL) {
@@ -247,11 +217,11 @@
* \param [in] centerx Center x coordinate of rotation.
* \param [in] centery Center y coordinate of rotation.
*/
-void o_rotate_90(TOPLEVEL *w_current, SELECTION *list,
+void o_rotate_90(TOPLEVEL *w_current, GList *list,
int centerx, int centery)
{
OBJECT *object;
- SELECTION *s_current;
+ GList *s_current;
int new_angle;
GList *other_objects=NULL;
GList *connected_objects=NULL;
@@ -267,7 +237,7 @@
s_current = list;
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (!object) {
fprintf(stderr, _("ERROR: NULL object in o_rotate_90!\n"));
@@ -516,7 +486,7 @@
an object and all its attributes (text) */
s_current = list;
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (!object) {
fprintf(stderr, _("ERROR: NULL object in o_rotate_90!\n"));
@@ -678,10 +648,10 @@
* \par Function Description
*
*/
-void o_mirror(TOPLEVEL *w_current, SELECTION *list, int centerx, int centery)
+void o_mirror(TOPLEVEL *w_current, GList *list, int centerx, int centery)
{
OBJECT *object;
- SELECTION *s_current;
+ GList *s_current;
OBJECT *o_current = NULL;
GList *other_objects=NULL;
GList *connected_objects=NULL;
@@ -696,7 +666,7 @@
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (!object) {
fprintf(stderr, _("ERROR: NULL object in o_mirror!\n"));
@@ -874,7 +844,7 @@
an object and all its attributes (text) */
s_current = list;
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (!object) {
fprintf(stderr, _("ERROR: NULL object in o_rotate_90!\n"));
@@ -1095,7 +1065,8 @@
if (strstr(o_current->text->string,stext)) {
/* printf(_("Found %s\n"), stext);
if (!o_current->selected&&(!descend)) {
- o_selection_add(w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
o_current);
} */
if (!skiplast) {
@@ -1626,7 +1597,7 @@
/* build a temporary list and add a complex to this list */
tmp_list = s_basic_init_object ("update component");
new_complex = o_complex_add (w_current,
- tmp_list,
+ tmp_list, NULL,
OBJ_COMPLEX,
WHITE,
o_current->complex->x,
1.29.2.2 +17 -14 eda/geda/gaf/gschem/src/o_move.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_move.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_move.c,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -b -r1.29.2.1 -r1.29.2.2
--- o_move.c 21 Oct 2006 20:35:58 -0000 1.29.2.1
+++ o_move.c 21 Oct 2006 22:20:48 -0000 1.29.2.2
@@ -36,7 +36,7 @@
*/
void o_move_start(TOPLEVEL * w_current, int x, int y)
{
- if (w_current->page_current->selection2_head->next != NULL) {
+ if (w_current->page_current->selection_list != NULL) {
/* Save the current state. When rotating the selection when moving,
we have to come back to here */
@@ -50,7 +50,7 @@
o_erase_selected(w_current);
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), TRUE);
if (w_current->netconn_rubberband) {
@@ -58,6 +58,7 @@
o_move_stretch_rubberband(w_current);
}
+ o_select_move_to_place_list(w_current);
w_current->inside_action = 1;
}
}
@@ -165,7 +166,7 @@
*/
void o_move_end(TOPLEVEL * w_current)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object;
int diff_x, diff_y;
int screen_diff_x, screen_diff_y;
@@ -207,22 +208,23 @@
if (w_current->actionfeedback_mode == OUTLINE) {
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), TRUE);
}
/* skip over head node */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- if (s_current->selected_object == NULL) {
+ object = (OBJECT *) s_current->data;
+
+ if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object in o_move_end!\n"));
exit(-1);
}
- object = s_current->selected_object;
switch (object->type) {
case (OBJ_NET):
case (OBJ_PIN):
@@ -284,7 +286,7 @@
/* erase the bounding box */
if (w_current->actionfeedback_mode == BOUNDINGBOX) {
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), FALSE);
}
@@ -313,6 +315,8 @@
g_list_free(rubbernet_other_objects);
g_list_free(rubbernet_connected_objects);
+ g_list_free(w_current->page_current->complex_place_list);
+ w_current->page_current->complex_place_list = NULL;
}
/*! \todo Finish function documentation!!!
@@ -418,7 +422,7 @@
*/
void o_move_prep_rubberband(TOPLEVEL * w_current)
{
- SELECTION *s_current;
+ GList *s_current;
OBJECT *object;
OBJECT *o_current;
@@ -433,10 +437,9 @@
printf("\n\n\n");
#endif
- /* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object) {
switch (object->type) {
case (OBJ_NET):
1.29.2.1 +2 -1 eda/geda/gaf/gschem/src/o_net.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_net.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_net.c,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -b -r1.29 -r1.29.2.1
--- o_net.c 21 Oct 2006 13:56:26 -0000 1.29
+++ o_net.c 21 Oct 2006 22:20:48 -0000 1.29.2.1
@@ -317,7 +317,7 @@
#if 0 /* not ready for prime time use */
/* new net extenstion stuff */
- o_current = w_current->page_current->selection_head->next;
+ o_current = (OBJECT *) w_current->page_current->selection_list->data;
if (o_current != NULL && w_current->event_state == STARTDRAWNET) {
if (o_current->type == OBJ_NET) {
if (o_current->line) {
@@ -1133,6 +1133,7 @@
(OBJECT *) o_complex_add(
w_current,
w_current->page_current->object_tail,
+ NULL,
OBJ_COMPLEX, WHITE,
rippers[i].x[0], rippers[i].y[0],
complex_angle, 0,
1.6.2.1 +3 -3 eda/geda/gaf/gschem/src/o_picture.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_picture.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_picture.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -b -r1.6 -r1.6.2.1
--- o_picture.c 21 Oct 2006 13:56:26 -0000 1.6
+++ o_picture.c 21 Oct 2006 22:20:48 -0000 1.6.2.1
@@ -737,7 +737,7 @@
const gchar *selected_filename;
GdkPixbuf *pixbuf;
GError *error;
- SELECTION *list;
+ GList *list;
selected_filename = (char *) g_strdup(gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selector)));
#if DEBUG
@@ -775,11 +775,11 @@
w_current->inside_action = 0;
- list = w_current->page_current->selection2_head->next;
+ list = w_current->page_current->selection_list;
while (list != NULL) {
OBJECT *object;
- object = list->selected_object;
+ object = (OBJECT *) list->data;
if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object!\n"));
exit(-1);
1.5.2.1 +55 -34 eda/geda/gaf/gschem/src/o_select.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_select.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_select.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -b -r1.5 -r1.5.2.1
--- o_select.c 21 Oct 2006 13:56:26 -0000 1.5
+++ o_select.c 21 Oct 2006 22:20:48 -0000 1.5.2.1
@@ -162,8 +162,8 @@
/* result: remove all objects from selection */
if (count == 0 && !CONTROLKEY) {
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
}
break;
@@ -171,7 +171,8 @@
/* object not select, add it to the selection list */
o_select_run_hooks(w_current, o_current, 1);
- o_selection_add(w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
o_current);
break;
@@ -187,8 +188,7 @@
/* result: remove object from selection */
if (type != MULTIPLE) {
o_select_run_hooks(w_current, o_current, 0);
- o_selection_remove(
- w_current->page_current->selection2_head,
+ o_selection_remove(&(w_current->page_current->selection_list),
o_current);
}
@@ -203,12 +203,12 @@
/* 2nd result: add object to selection */
if (type == MULTIPLE && count == 0 && !CONTROLKEY) {
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
o_select_run_hooks(w_current, o_current, 1);
- o_selection_add(
- w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
o_current);
}
@@ -218,19 +218,18 @@
/* 2nd result: add object to selection list */
if (type == SINGLE && !CONTROLKEY) {
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
o_select_run_hooks (w_current, o_current, 1);
- o_selection_add(
- w_current->page_current->selection2_head,
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
o_current);
}
if (CONTROLKEY) {
o_select_run_hooks(w_current, o_current, 0);
- o_selection_remove(
- w_current->page_current->selection2_head,
+ o_selection_remove(&(w_current->page_current->selection_list),
o_current);
}
@@ -240,7 +239,7 @@
}
/* do the attributes */
- o_attrib_add_selected(w_current, w_current->page_current->selection2_head,
+ o_attrib_add_selected(w_current, &(w_current->page_current->selection_list),
o_current);
/* finally redraw object */
@@ -436,8 +435,8 @@
/* key was pressed */
if (count == 0 && !SHIFTKEY) {
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
}
i_update_menus(w_current);
}
@@ -446,8 +445,10 @@
/* This function always looks at the current page selection list */
OBJECT *o_select_return_first_object(TOPLEVEL *w_current)
{
- return(o_selection_return_first_object(w_current->page_current->
- selection2_head));
+ if (! (w_current && w_current->page_current && w_current->page_current->selection_list))
+ return NULL;
+ else
+ return((OBJECT *) g_list_first(w_current->page_current->selection_list)->data);
}
/*! \todo Finish function documentation!!!
@@ -459,16 +460,9 @@
*/
int o_select_selected(TOPLEVEL *w_current)
{
- SELECTION *head;
-
- head = w_current->page_current->selection2_head;
- if (head) {
- if (head->next) {
- if (head->next->selected_object) {
+ if (w_current->page_current->selection_list) {
return(TRUE);
}
- }
- }
return(FALSE);
}
@@ -480,6 +474,33 @@
void o_select_unselect_all(TOPLEVEL *w_current)
{
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
+ o_selection_unselect_list (w_current,
+ &(w_current->page_current->selection_list));
+}
+
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
+void
+o_select_move_to_place_list(TOPLEVEL *w_current)
+{
+ GList *selection;
+ OBJECT *o_current;
+
+ selection= w_current->page_current->selection_list;
+
+ if (!selection) {
+ return;
+ }
+
+ while (selection) {
+ o_current = (OBJECT *) selection->data;
+ if (o_current) {
+ w_current->page_current->complex_place_list = g_list_append(w_current->page_current->complex_place_list,
+ o_current);
+ }
+ selection = selection->next;
+ }
}
1.19.2.1 +1 -1 eda/geda/gaf/gschem/src/o_slot.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_slot.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_slot.c,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -b -r1.19 -r1.19.2.1
--- o_slot.c 15 Jul 2006 18:51:41 -0000 1.19
+++ o_slot.c 21 Oct 2006 22:20:48 -0000 1.19.2.1
@@ -225,7 +225,7 @@
o_erase_selected(w_current);
o_attrib_slot_copy(w_current, object,
- w_current->page_current->selection_head->next);
+ w_current->page_current->selection_list);
o_redraw_single(w_current,object);
#endif
1.21.2.2 +9 -8 eda/geda/gaf/gschem/src/o_text.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_text.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_text.c,v
retrieving revision 1.21.2.1
retrieving revision 1.21.2.2
diff -u -b -r1.21.2.1 -r1.21.2.2
--- o_text.c 21 Oct 2006 20:35:59 -0000 1.21.2.1
+++ o_text.c 21 Oct 2006 22:20:48 -0000 1.21.2.2
@@ -586,9 +586,10 @@
w_current->page_current->CHANGED=1;
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->selection2_head);
- o_selection_add(w_current->page_current->selection2_head,
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
+ w_current->page_current->selection_list =
+ o_selection_add(w_current->page_current->selection_list,
w_current->page_current->object_tail);
@@ -641,15 +642,15 @@
int text_alignment)
{
OBJECT *object;
- SELECTION *s_current;
+ GList *s_current;
int numselect;
/* skip over head */
- s_current = w_current->page_current->selection2_head->next;
- numselect = o_selection_return_num(w_current->page_current->selection2_head);
+ s_current = w_current->page_current->selection_list;
+ numselect = g_list_length(w_current->page_current->selection_list);
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object) {
if (object->type == OBJ_TEXT) {
1.5.2.1 +9 -9 eda/geda/gaf/gschem/src/x_attribedit.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_attribedit.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_attribedit.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -b -r1.5 -r1.5.2.1
--- x_attribedit.c 21 Oct 2006 01:46:29 -0000 1.5
+++ x_attribedit.c 21 Oct 2006 22:20:49 -0000 1.5.2.1
@@ -93,7 +93,7 @@
GtkWidget *overwritebutton;
OBJECT *attribptr;
OBJECT *object;
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
ATTRIB *a_current = NULL, *a_sav;
int vis, show;
int invocation_flag;
@@ -146,19 +146,19 @@
int world_x, world_y;
OBJECT *new = NULL;
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *)s_current->data;
if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object!\n"));
exit(-1);
}
- if (!s_current->selected_object->attached_to) {
+ if (!object->attached_to) {
nsel++;
}
s_current = s_current->next;
}
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
if (nsel > 1) {
addtoallbutton =
@@ -196,7 +196,7 @@
while (s_current != NULL) {
gboolean replaced;
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object && !object->attached_to && object->type != OBJ_TEXT ) {
addmask = 4;
if (object->type == OBJ_COMPLEX || object->type == OBJ_PLACEHOLDER) {
@@ -338,7 +338,7 @@
GtkWidget *overwritebutton;
/* gschem specific */
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
GList *combo_items = NULL;
char* string = NULL;
int nsel=0, i, len;
@@ -351,9 +351,9 @@
return;
/* gschem specific */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
- if (!s_current->selected_object->attached_to) {
+ if (!((OBJECT *) s_current->data)->attached_to) {
nsel++;
}
s_current = s_current->next;
1.8.2.1 +6 -5 eda/geda/gaf/gschem/src/x_compselect.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_compselect.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_compselect.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -b -r1.8 -r1.8.2.1
--- x_compselect.c 13 Oct 2006 14:43:28 -0000 1.8
+++ x_compselect.c 21 Oct 2006 22:20:49 -0000 1.8.2.1
@@ -131,13 +131,14 @@
diff_x = toplevel->last_x - toplevel->start_x;
diff_y = toplevel->last_y - toplevel->start_y;
- o_complex_translate_display(toplevel,
+ o_complex_translate_display_object_glist(toplevel,
diff_x, diff_y,
- toplevel->page_current->complex_place_head);
+ toplevel->page_current->complex_place_list);
}
- o_list_delete_rest(toplevel,
- toplevel->page_current->complex_place_head);
+ g_list_free(toplevel->page_current->complex_place_list);
+ toplevel->page_current->complex_place_list = NULL;
+
o_complex_set_filename(toplevel, toplevel->current_clib,
toplevel->current_basename);
1.62.2.1 +8 -10 eda/geda/gaf/gschem/src/x_dialog.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_dialog.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_dialog.c,v
retrieving revision 1.62
retrieving revision 1.62.2.1
diff -u -b -r1.62 -r1.62.2.1
--- x_dialog.c 21 Oct 2006 01:46:29 -0000 1.62
+++ x_dialog.c 21 Oct 2006 22:20:49 -0000 1.62.2.1
@@ -473,7 +473,7 @@
GtkTextBuffer *textbuffer;
GtkTextIter start, end;
- num_selected = o_selection_return_num(w_current->page_current->selection2_head);
+ num_selected = g_list_length(w_current->page_current->selection_list);
/* text string entry will only show up if one object is selected */
if (num_selected == 1) {
@@ -544,7 +544,7 @@
int num_selected;
int select_index=0;
- num_selected = o_selection_return_num(w_current->page_current->selection2_head);
+ num_selected = g_list_length(w_current->page_current->selection_list);
if (!w_current->tewindow) {
w_current->tewindow = x_create_dialog_box(&vbox, &action_area);
@@ -2672,18 +2672,17 @@
/* first lets see if we have a selected object, if so select its color */
int select_col = -1;
int item_index = 0;
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object = NULL;
menu = gtk_menu_new ();
group = NULL;
- /* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
if (s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object == NULL) {
fprintf(stderr, "no object selected - WHEE!\n");
}else{
@@ -2782,15 +2781,14 @@
*/
void color_edit_dialog_apply(GtkWidget *w, TOPLEVEL *w_current)
{
- SELECTION *s_current = NULL;
+ GList *s_current = NULL;
OBJECT *object = NULL;
- /* skip over head */
- s_current = w_current->page_current->selection2_head->next;
+ s_current = w_current->page_current->selection_list;
while(s_current != NULL) {
- object = s_current->selected_object;
+ object = (OBJECT *) s_current->data;
if (object == NULL) {
fprintf(stderr, _("ERROR: NULL object in color_edit_dialog_apply!\n"));
exit(-1);
1.41.2.1 +29 -39 eda/geda/gaf/gschem/src/x_event.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_event.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_event.c,v
retrieving revision 1.41
retrieving revision 1.41.2.1
diff -u -b -r1.41 -r1.41.2.1
--- x_event.c 4 Oct 2006 19:10:30 -0000 1.41
+++ x_event.c 21 Oct 2006 22:20:50 -0000 1.41.2.1
@@ -88,15 +88,14 @@
case(ENDCOPY):
case(ENDMCOPY):
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), FALSE);
break;
case(DRAWCOMP):
case(ENDCOMP):
case(ENDPASTE):
- o_drawbounding(w_current,
- w_current->page_current->complex_place_head->next,
- NULL,
+ o_drawbounding(w_current, NULL,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), FALSE);
break;
@@ -161,7 +160,7 @@
printf("event state: %d \n", event->state);
printf("w_current state: %d \n", w_current->event_state);
printf("Selection is:\n");
- o_selection_print_all( w_current->page_current->selection2_head);
+ o_selection_print_all( w_current->page_current->selection_list);
printf("\n");
#endif
@@ -169,8 +168,8 @@
(w_current->event_state == STARTSELECT ||
w_current->event_state == SELECT)) {
o_find_object(w_current, (int) event->x, (int) event->y, TRUE);
- if (w_current->page_current->selection2_head->next) {
- o_edit(w_current, w_current->page_current->selection2_head->next);
+ if (w_current->page_current->selection_list) {
+ o_edit(w_current, w_current->page_current->selection_list);
return(0);
}
}
@@ -433,7 +432,7 @@
w_current->DONT_REDRAW = 0;
o_rotate_90(
w_current,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
(int) event->x, (int) event->y);
w_current->DONT_REDRAW = prev_state;
@@ -444,7 +443,7 @@
case(ENDMIRROR):
o_mirror(w_current,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->selection_list,
(int) event->x, (int) event->y);
w_current->inside_action = 0;
@@ -759,7 +758,6 @@
break;
case(STARTSELECT):
-
/* first look for grips */
if (!o_grips_start(
w_current, (int) event->x, (int) event->y)) {
@@ -782,9 +780,9 @@
if (w_current->inside_action) {
if (w_current->event_state == ENDCOMP) {
o_drawbounding(w_current,
- w_current->page_current->
- complex_place_head->next,
- NULL, x_get_darkcolor(w_current->bb_color), TRUE);
+ NULL,
+ w_current->page_current->complex_place_list,
+ x_get_darkcolor(w_current->bb_color), TRUE);
w_current->complex_rotate =
(w_current->complex_rotate + 90) % 360;
@@ -792,15 +790,16 @@
o_complex_place_rotate(w_current);
o_drawbounding(w_current,
- w_current->page_current->
- complex_place_head->next,
- NULL, x_get_darkcolor(w_current->bb_color), TRUE);
+ NULL,
+ w_current->page_current->complex_place_list,
+ x_get_darkcolor(w_current->bb_color), TRUE);
return(0);
} else if (w_current->event_state == ENDTEXT) {
o_drawbounding(w_current,
w_current->page_current->
attrib_place_head->next,
- NULL, x_get_darkcolor(w_current->bb_color), TRUE);
+ NULL,
+ x_get_darkcolor(w_current->bb_color), TRUE);
w_current->complex_rotate =
(w_current->complex_rotate + 90) % 360;
@@ -810,18 +809,18 @@
o_drawbounding(w_current,
w_current->page_current->
attrib_place_head->next,
- NULL, x_get_darkcolor(w_current->bb_color), TRUE);
+ NULL,
+ x_get_darkcolor(w_current->bb_color), TRUE);
return(0);
}
else if ((w_current->event_state == ENDMOVE) ||
(w_current->event_state == ENDCOPY) ||
(w_current->event_state == ENDMCOPY) ) {
- g_assert (w_current->page_current->selection2_head != NULL);
prev_state = w_current->event_state;
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), TRUE);
/* Don't allow o_rotate_90 to erase the selection, neither to
@@ -830,7 +829,7 @@
redraw_state = w_current->DONT_REDRAW;
w_current->DONT_REDRAW = 1;
- o_rotate_90(w_current, w_current->page_current->selection2_head->next,
+ o_rotate_90(w_current, w_current->page_current->complex_place_list,
fix_x(w_current, w_current->start_x),
fix_y(w_current, w_current->start_y));
w_current->DONT_REDRAW = redraw_state;
@@ -838,7 +837,7 @@
w_current->event_state = prev_state;
o_drawbounding(w_current, NULL,
- w_current->page_current->selection2_head->next,
+ w_current->page_current->complex_place_list,
x_get_darkcolor(w_current->bb_color), TRUE);
return(0);
@@ -1072,17 +1071,10 @@
o_move_stretch_rubberband(w_current);
}
- o_drawbounding(
- w_current, NULL,
- w_current->page_current->selection2_head->next,
- x_get_darkcolor(w_current->bb_color), FALSE);
+ o_complex_rubbercomplex(w_current);
w_current->last_x = fix_x(w_current, (int) event->x);
w_current->last_y = fix_y(w_current, (int) event->y);
- o_drawbounding(
- w_current, NULL,
- w_current->page_current->selection2_head->next,
- x_get_darkcolor(w_current->bb_color), FALSE);
-
+ o_complex_rubbercomplex(w_current);
if (w_current->netconn_rubberband) {
o_move_stretch_rubberband(w_current);
}
@@ -1095,15 +1087,13 @@
case(ENDMCOPY):
case(MCOPY):
if (w_current->inside_action) {
- o_drawbounding(
- w_current, NULL,
- w_current->page_current->selection2_head->next,
+ o_drawbounding(w_current, NULL,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), FALSE);
w_current->last_x = fix_x(w_current, (int) event->x);
w_current->last_y = fix_y(w_current, (int) event->y);
- o_drawbounding(
- w_current, NULL,
- w_current->page_current->selection2_head->next,
+ o_drawbounding(w_current, NULL,
+ w_current->page_current->selection_list,
x_get_darkcolor(w_current->bb_color), FALSE);
}
break;
1.26.2.2 +2 -3 eda/geda/gaf/gschem/src/x_image.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_image.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_image.c,v
retrieving revision 1.26.2.1
retrieving revision 1.26.2.2
diff -u -b -r1.26.2.1 -r1.26.2.2
--- x_image.c 21 Oct 2006 20:35:59 -0000 1.26.2.1
+++ x_image.c 21 Oct 2006 22:20:50 -0000 1.26.2.2
@@ -271,9 +271,8 @@
/* de select everything first */
o_select_run_hooks(w_current, NULL, 2);
- o_selection_remove_most(w_current,
- w_current->page_current->
- selection2_head);
+ o_selection_unselect_list(w_current,
+ &(w_current->page_current->selection_list));
#ifdef HAS_LIBGD
1.3.2.1 +1 -1 eda/geda/gaf/gschem/src/x_multiattrib.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_multiattrib.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_multiattrib.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -b -r1.3 -r1.3.2.1
--- x_multiattrib.c 19 Oct 2006 15:42:44 -0000 1.3
+++ x_multiattrib.c 21 Oct 2006 22:20:50 -0000 1.3.2.1
@@ -457,7 +457,7 @@
OBJECT *o_attrib)
{
/* actually deletes the attribute */
- o_selection_remove (toplevel->page_current->selection2_head, o_attrib);
+ o_selection_remove (&(toplevel->page_current->selection_list), o_attrib);
o_delete_text (toplevel, o_attrib);
toplevel->page_current->CHANGED=1;
o_undo_savestate (toplevel, UNDO_ALL);
1.25.2.1 +2 -2 eda/geda/gaf/gschem/src/x_print.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_print.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_print.c,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -b -r1.25 -r1.25.2.1
--- x_print.c 21 Oct 2006 01:46:29 -0000 1.25
+++ x_print.c 21 Oct 2006 22:20:50 -0000 1.25.2.1
@@ -730,8 +730,8 @@
/* de select everything first */
o_select_run_hooks (w_current, NULL, 2);
- o_selection_remove_most (w_current,
- w_current->page_current->selection2_head);
+ g_list_free(w_current->page_current->selection_list);
+ w_current->page_current->selection_list = NULL;
if (usefile && filename[0])
/* Print to file */
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs