[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-50-g29600e2)
The branch, master has been updated
via 29600e269da20822ec0443024c63cb5e0ae34ea2 (commit)
via 1dc71988f58df1bbe828aebacc5d81d7bd21b954 (commit)
via 3e08939b12e6298029a9387299dcdf7a9d6db6a6 (commit)
via 03056b53bfe6865d77c585bb7d190ce4f2aa0cd6 (commit)
from a3ee37bbb4a87379a129d6993e175136416721da (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/include/prototype.h | 2 +
gschem/src/i_callbacks.c | 27 ++++++++++---------------
gschem/src/o_basic.c | 24 ++++++++++++++--------
gschem/src/o_buffer.c | 1 +
gschem/src/o_move.c | 46 ++++++++++++++++++++++++++++++++-----------
libgeda/src/o_list.c | 15 ++++++++++---
6 files changed, 74 insertions(+), 41 deletions(-)
=================
Commit Messages
=================
commit 29600e269da20822ec0443024c63cb5e0ae34ea2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:44:55 2008 +0100
Add redraw for items being placed from paste-buffer in o_redraw_all()
Added missing "w_current->inside_action = 1;" to o_buffer_paste_start(),
noticed when the new redraw added didn't work on its own.
Fixes ghosts left when zooming whilst pasting from a buffer.
:100644 100644 43c6cfa... 871e839... M gschem/src/o_basic.c
:100644 100644 c8fda91... 3c73532... M gschem/src/o_buffer.c
commit 1dc71988f58df1bbe828aebacc5d81d7bd21b954
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:40:13 2008 +0100
Always "undo" when cancelling from a move action
The undo state is always saved in o_move_start(), so when cancelling
from a move action we should always undo.
Adds helper function o_move_cancel() to avoid code duplication
of the various operations when cancelling a move action.
:100644 100644 6473c35... 743e725... M gschem/include/prototype.h
:100644 100644 66ae525... 5547090... M gschem/src/i_callbacks.c
:100644 100644 034bcc4... 43c6cfa... M gschem/src/o_basic.c
:100644 100644 525acb1... 3af0d6e... M gschem/src/o_move.c
commit 3e08939b12e6298029a9387299dcdf7a9d6db6a6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:40:11 2008 +0100
o_glist_copy_all_to_glist(): Only deselect / reselect selected objects
Objects are deselected prior to being copied, then re-selected. Check
if the object being copied is selected before we try this, as we may
want to copy unselected objects.
:100644 100644 9bdce9d... f2f0c82... M libgeda/src/o_list.c
commit 03056b53bfe6865d77c585bb7d190ce4f2aa0cd6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:29:33 2008 +0100
Add o_move_rubbermove_xor()
Make use of o_move_rubbermove_xor() throught the code to avoid
duplication of o_drawbounding() calls.
:100644 100644 c7850b3... 6473c35... M gschem/include/prototype.h
:100644 100644 b727d00... 034bcc4... M gschem/src/o_basic.c
:100644 100644 13470d7... 525acb1... M gschem/src/o_move.c
=========
Changes
=========
commit 29600e269da20822ec0443024c63cb5e0ae34ea2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:44:55 2008 +0100
Add redraw for items being placed from paste-buffer in o_redraw_all()
Added missing "w_current->inside_action = 1;" to o_buffer_paste_start(),
noticed when the new redraw added didn't work on its own.
Fixes ghosts left when zooming whilst pasting from a buffer.
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 43c6cfa..871e839 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -77,6 +77,11 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
case(ENDTEXT):
o_text_rubberattrib_xor (w_current, TRUE);
break;
+
+ case(ENDPASTE):
+ o_buffer_paste_rubberpaste_xor (w_current, w_current->buffer_number, TRUE);
+ break;
+
case(STARTDRAWNET):
case(DRAWNET):
case(NETCONT):
diff --git a/gschem/src/o_buffer.c b/gschem/src/o_buffer.c
index c8fda91..3c73532 100644
--- a/gschem/src/o_buffer.c
+++ b/gschem/src/o_buffer.c
@@ -132,6 +132,7 @@ void o_buffer_paste_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
toplevel->ADDING_SEL = 0;
w_current->event_state = ENDPASTE;
+ w_current->inside_action = 1;
o_buffer_paste_rubberpaste_xor (w_current, buf_num, TRUE);
}
commit 1dc71988f58df1bbe828aebacc5d81d7bd21b954
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:40:13 2008 +0100
Always "undo" when cancelling from a move action
The undo state is always saved in o_move_start(), so when cancelling
from a move action we should always undo.
Adds helper function o_move_cancel() to avoid code duplication
of the various operations when cancelling a move action.
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 6473c35..743e725 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -638,6 +638,7 @@ void o_autosave_backups(GSCHEM_TOPLEVEL *w_current);
void o_move_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
void o_move_end_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *list, int type, int diff_x, int diff_y, GList **other_objects, GList **connected_objects);
void o_move_end(GSCHEM_TOPLEVEL *w_current);
+void o_move_cancel(GSCHEM_TOPLEVEL *w_current);
void o_move_rubbermove(GSCHEM_TOPLEVEL *w_current, int x, int y);
void o_move_rubbermove_xor(GSCHEM_TOPLEVEL *w_current, int drawing);
int o_move_return_whichone(OBJECT *object, int x, int y);
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 66ae525..5547090 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3541,10 +3541,12 @@ DEFINE_I_CALLBACK(cancel)
g_object_set_property (G_OBJECT(w_current->cswindow), "hidden", &value);
}
- if ( (w_current->inside_action) &&
- (w_current->rotated_inside != 0)) {
- o_undo_callback(w_current, UNDO_ACTION);
- w_current->rotated_inside = 0;
+ /* If we're cancelling from a move action, re-wind the
+ * page contents back to their state before we started */
+ if (w_current->inside_action &&
+ (w_current->event_state == MOVE ||
+ w_current->event_state == ENDMOVE)) {
+ o_move_cancel (w_current);
}
/* leave this on for now... but it might have to change */
@@ -3565,18 +3567,11 @@ DEFINE_I_CALLBACK(cancel)
* structure and also clean up the attrib_place_list.
* remember these don't remove the head structure */
- /* 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->toplevel,
- w_current->toplevel->page_current->complex_place_list);
- w_current->toplevel->page_current->complex_place_list = NULL;
- }
- else {
- g_list_free(w_current->toplevel->page_current->complex_place_list);
- }
+ /* Free the complex place list and its contents. If we were in a
+ * move action, the list (refering to objects on the page) would
+ * already have been cleared in o_move_cancel(), so this is OK. */
+ s_delete_object_glist(w_current->toplevel,
+ w_current->toplevel->page_current->complex_place_list);
w_current->toplevel->page_current->complex_place_list = NULL;
s_delete_object_glist(w_current->toplevel,
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 034bcc4..43c6cfa 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -528,15 +528,18 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
* so lets be sure to clean up the complex_place_list
* structure and also clean up the attrib_place_list. */
- /* If it is a move command, then free the complex place list WITHOUT
- freeing the individual objects. */
+ /* If we're cancelling from a move action, re-wind the
+ * page contents back to their state before we started. */
if ((w_current->event_state == MOVE) ||
(w_current->event_state == ENDMOVE)) {
- g_list_free (toplevel->page_current->complex_place_list);
- } else {
- s_delete_object_glist(toplevel,
- toplevel->page_current->complex_place_list);
+ o_move_cancel (w_current);
}
+
+ /* Free the complex place list and its contents. If we were in a
+ * move action, the list (refering to objects on the page) would
+ * already have been cleared in o_move_cancel(), so this is OK. */
+ s_delete_object_glist(toplevel,
+ toplevel->page_current->complex_place_list);
toplevel->page_current->complex_place_list = NULL;
s_delete_object_glist (toplevel,
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 525acb1..3af0d6e 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -252,6 +252,20 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
* \par Function Description
*
*/
+void o_move_cancel (GSCHEM_TOPLEVEL *w_current)
+{
+ g_list_free(w_current->toplevel->page_current->complex_place_list);
+ w_current->toplevel->page_current->complex_place_list = NULL;
+ o_undo_callback(w_current, UNDO_ACTION);
+ w_current->rotated_inside = 0;
+}
+
+
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
void o_move_rubbermove(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
{
o_move_rubbermove_xor (w_current, FALSE);
commit 3e08939b12e6298029a9387299dcdf7a9d6db6a6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:40:11 2008 +0100
o_glist_copy_all_to_glist(): Only deselect / reselect selected objects
Objects are deselected prior to being copied, then re-selected. Check
if the object being copied is selected before we try this, as we may
want to copy unselected objects.
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 9bdce9d..f2f0c82 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -238,6 +238,7 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
GList *src, *dest;
OBJECT *src_object, *dst_object;
int adding_sel_save;
+ int selected_save;
src = src_list;
/* Reverse any existing items, as we will prepend, then reverse at the end */
@@ -255,7 +256,9 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
src_object = (OBJECT *) src->data;
/* unselect the object before the copy */
- o_selection_unselect(src_object);
+ selected_save = src_object->selected;
+ if (selected_save)
+ o_selection_unselect(src_object);
if (src_object->type != OBJ_TEXT && src_object->type != OBJ_HEAD) {
dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
@@ -272,7 +275,8 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
}
/* reselect it */
- o_selection_select(src_object, SELECT_COLOR);
+ if (selected_save)
+ o_selection_select(src_object, SELECT_COLOR);
src = g_list_next(src);
}
@@ -284,7 +288,9 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
src_object = (OBJECT *) src->data;
/* unselect the object before the copy */
- o_selection_unselect(src_object);
+ selected_save = src_object->selected;
+ if (selected_save)
+ o_selection_unselect(src_object);
if (src_object->type == OBJ_TEXT) {
dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
@@ -309,7 +315,8 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
}
/* reselect it */
- o_selection_select(src_object, SELECT_COLOR);
+ if (selected_save)
+ o_selection_select(src_object, SELECT_COLOR);
src = g_list_next(src);
}
commit 03056b53bfe6865d77c585bb7d190ce4f2aa0cd6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Mon Jul 28 00:29:33 2008 +0100
Add o_move_rubbermove_xor()
Make use of o_move_rubbermove_xor() throught the code to avoid
duplication of o_drawbounding() calls.
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index c7850b3..6473c35 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -639,6 +639,7 @@ void o_move_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
void o_move_end_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT *list, int type, int diff_x, int diff_y, GList **other_objects, GList **connected_objects);
void o_move_end(GSCHEM_TOPLEVEL *w_current);
void o_move_rubbermove(GSCHEM_TOPLEVEL *w_current, int x, int y);
+void o_move_rubbermove_xor(GSCHEM_TOPLEVEL *w_current, int drawing);
int o_move_return_whichone(OBJECT *object, int x, int y);
void o_move_check_endpoint(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
void o_move_prep_rubberband(GSCHEM_TOPLEVEL *w_current);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index b727d00..034bcc4 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -62,9 +62,7 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
switch(w_current->event_state) {
case(MOVE):
case(ENDMOVE):
- o_drawbounding(w_current,
- geda_list_get_glist( toplevel->page_current->selection_list ),
- x_get_darkcolor(w_current->bb_color), TRUE);
+ o_move_rubbermove_xor (w_current, TRUE);
break;
case(ENDCOPY):
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 13470d7..525acb1 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -52,17 +52,14 @@ void o_move_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
o_erase_selected(w_current);
- o_drawbounding(w_current,
- geda_list_get_glist( toplevel->page_current->selection_list ),
- x_get_darkcolor(w_current->bb_color), TRUE);
-
if (w_current->netconn_rubberband) {
o_move_prep_rubberband(w_current);
- o_move_stretch_rubberband(w_current);
}
o_select_move_to_place_list(w_current);
w_current->inside_action = 1;
+
+ o_move_rubbermove_xor (w_current, TRUE);
}
}
@@ -148,6 +145,8 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
diff_x = w_current->second_wx - w_current->first_wx;
diff_y = w_current->second_wy - w_current->first_wy;
+ o_move_rubbermove_xor (w_current, FALSE);
+
if (w_current->netconn_rubberband)
{
o_move_end_rubberband(w_current, diff_x, diff_y,
@@ -155,10 +154,6 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
&rubbernet_connected_objects);
}
- o_drawbounding(w_current,
- geda_list_get_glist( toplevel->page_current->selection_list ),
- x_get_darkcolor(w_current->bb_color), FALSE);
-
s_current = geda_list_get_glist( toplevel->page_current->selection_list );
while (s_current != NULL) {
@@ -259,11 +254,24 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
*/
void o_move_rubbermove(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
{
- if (w_current->netconn_rubberband)
- o_move_stretch_rubberband(w_current);
+ o_move_rubbermove_xor (w_current, FALSE);
+ w_current->second_wx = w_x;
+ w_current->second_wy = w_y;
+ o_move_rubbermove_xor (w_current, TRUE);
+}
- o_complex_rubbercomplex(w_current, w_x, w_y);
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
+void o_move_rubbermove_xor (GSCHEM_TOPLEVEL *w_current, int drawing)
+{
+ TOPLEVEL *toplevel = w_current->toplevel;
+ o_drawbounding (w_current,
+ geda_list_get_glist (toplevel->page_current->selection_list),
+ x_get_darkcolor (w_current->bb_color), drawing);
if (w_current->netconn_rubberband)
o_move_stretch_rubberband(w_current);
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs