[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.1.1.20070708-76-g19aacff)
The branch, master has been updated
via 19aacfff985ee9b478c4c50dfeeb1a8af5957c3a (commit)
from 93199b2f50c31691722ed154fc42fd4c01a2dac5 (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/i_vars.h | 1 +
gschem/include/prototype.h | 1 +
gschem/lib/system-gschemrc.in | 13 +++++++++++++
gschem/src/a_zoom.c | 5 ++++-
gschem/src/g_rc.c | 15 +++++++++++++++
gschem/src/g_register.c | 1 +
gschem/src/i_callbacks.c | 35 ++++++++++++++++++++++++++++-------
gschem/src/i_vars.c | 2 ++
gschem/src/x_event.c | 19 +++++++++++++++----
libgeda/include/struct.h | 3 +++
libgeda/src/s_toplevel.c | 2 ++
11 files changed, 85 insertions(+), 12 deletions(-)
=================
Commit Messages
=================
commit 19aacfff985ee9b478c4c50dfeeb1a8af5957c3a
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date: Sat Aug 18 16:41:24 2007 -0400
Added undo-panzoom keyword to control if pan/zoom cmds are undoable
The default is to still store the pan/zoom info when panning or zooming,
but now the user has a choice.
:100644 100644 1c62831... f20926d... M gschem/include/i_vars.h
:100644 100644 0735756... 9fe43fd... M gschem/include/prototype.h
:100644 100644 7110f59... 67506d0... M gschem/lib/system-gschemrc.in
:100644 100644 44b5683... 21d244d... M gschem/src/a_zoom.c
:100644 100644 b8a5706... 4dafaa6... M gschem/src/g_rc.c
:100644 100644 05fb1cd... 781a3cb... M gschem/src/g_register.c
:100644 100644 b475810... b98a0a3... M gschem/src/i_callbacks.c
:100644 100644 c4c181a... 03be196... M gschem/src/i_vars.c
:100644 100644 fcf553e... 3202ec6... M gschem/src/x_event.c
:100644 100644 cbedca3... 80f3b6f... M libgeda/include/struct.h
:100644 100644 8acadd7... ad6493e... M libgeda/src/s_toplevel.c
=========
Changes
=========
commit 19aacfff985ee9b478c4c50dfeeb1a8af5957c3a
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date: Sat Aug 18 16:41:24 2007 -0400
Added undo-panzoom keyword to control if pan/zoom cmds are undoable
The default is to still store the pan/zoom info when panning or zooming,
but now the user has a choice.
diff --git a/gschem/include/i_vars.h b/gschem/include/i_vars.h
index 1c62831..f20926d 100644
--- a/gschem/include/i_vars.h
+++ b/gschem/include/i_vars.h
@@ -69,6 +69,7 @@ extern int default_continue_component_place;
extern int default_undo_levels;
extern int default_undo_control;
extern int default_undo_type;
+extern int default_undo_panzoom;
extern int default_draw_grips;
extern int default_netconn_rubberband;
extern int default_sort_component_library;
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 0735756..9fe43fd 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -249,6 +249,7 @@ SCM g_rc_continue_component_place(SCM mode);
SCM g_rc_undo_levels(SCM levels);
SCM g_rc_undo_control(SCM mode);
SCM g_rc_undo_type(SCM mode);
+SCM g_rc_undo_panzoom(SCM mode);
SCM g_rc_draw_grips(SCM mode);
SCM g_rc_netconn_rubberband(SCM mode);
SCM g_rc_sort_component_library(SCM mode);
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 7110f59..67506d0 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -75,6 +75,19 @@
(undo-type "disk")
;(undo-type "memory")
+; undo-panzoom string
+;
+; Controls if pan or zoom commands are saved in the undo list. If this
+; is enabled then a pan or zoom command will be considered a command and
+; can be undone. If this is false, then panning and zooming is not saved
+; in the undo list and cannot be undone. Note, the current viewport
+; information is saved for every command, so the display will change to the
+; viewport before a command is executed.
+;
+(undo-panzoom "enabled")
+;(undo-panzoom "disabled")
+
+
; autosave interval
;
; Controls if a backup copy is made every "interval" seconds.
diff --git a/gschem/src/a_zoom.c b/gschem/src/a_zoom.c
index 44b5683..21d244d 100644
--- a/gschem/src/a_zoom.c
+++ b/gschem/src/a_zoom.c
@@ -314,7 +314,10 @@ void a_zoom_box_end(TOPLEVEL *w_current, int x, int y)
XOR_DRAW_BOX(w_current, box_left, box_top, box_width, box_height);
a_zoom_box(w_current, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index b8a5706..4dafaa6 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -1093,6 +1093,21 @@ SCM g_rc_undo_type(SCM mode)
* \par Function Description
*
*/
+SCM g_rc_undo_panzoom(SCM mode)
+{
+ static const vstbl_entry mode_table[] = {
+ {TRUE , "enabled" },
+ {FALSE, "disabled"},
+ };
+
+ RETURN_G_RC_MODE("undo-panzoom", default_undo_panzoom, 2);
+}
+
+/*! \todo Finish function documentation!!!
+ * \brief
+ * \par Function Description
+ *
+ */
SCM g_rc_draw_grips(SCM mode)
{
static const vstbl_entry mode_table[] = {
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index 05fb1cd..781a3cb 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -126,6 +126,7 @@ static struct gsubr_t gschem_funcs[] = {
{ "undo-levels", 1, 0, 0, g_rc_undo_levels },
{ "undo-control", 1, 0, 0, g_rc_undo_control },
{ "undo-type", 1, 0, 0, g_rc_undo_type },
+ { "undo-panzoom", 1, 0, 0, g_rc_undo_panzoom },
{ "drag-can-move", 1, 0, 0, g_rc_drag_can_move },
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index b475810..b98a0a3 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -1374,7 +1374,10 @@ DEFINE_I_CALLBACK(view_zoom_full)
/* scroll bar stuff */
a_zoom(w_current, ZOOM_FULL, DONTCARE, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1392,7 +1395,10 @@ DEFINE_I_CALLBACK(view_zoom_extents)
/* scroll bar stuff */
a_zoom_extents(w_current, w_current->page_current->object_head, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1445,7 +1451,10 @@ DEFINE_I_CALLBACK(view_zoom_in)
exit_if_null(w_current);
a_zoom(w_current, ZOOM_IN, MENU, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1462,7 +1471,10 @@ DEFINE_I_CALLBACK(view_zoom_out)
exit_if_null(w_current);
a_zoom(w_current, ZOOM_OUT, MENU, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1480,7 +1492,10 @@ DEFINE_I_CALLBACK(view_zoom_in_hotkey)
exit_if_null(w_current);
a_zoom(w_current, ZOOM_IN, HOTKEY, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1497,7 +1512,10 @@ DEFINE_I_CALLBACK(view_zoom_out_hotkey)
exit_if_null(w_current);
a_zoom(w_current, ZOOM_OUT, HOTKEY, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
@@ -1606,7 +1624,10 @@ DEFINE_I_CALLBACK(view_pan_hotkey)
i_set_state(w_current, SELECT);
i_update_toolbar(w_current);
} */
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
}
/*! \todo Finish function documentation!!!
diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c
index c4c181a..03be196 100644
--- a/gschem/src/i_vars.c
+++ b/gschem/src/i_vars.c
@@ -97,6 +97,7 @@ int default_continue_component_place = TRUE;
int default_undo_levels = 20;
int default_undo_control = TRUE;
int default_undo_type = UNDO_DISK;
+int default_undo_panzoom = FALSE;
int default_draw_grips = TRUE;
int default_netconn_rubberband = FALSE;
int default_sort_component_library = FALSE;
@@ -221,6 +222,7 @@ void i_vars_set(TOPLEVEL *w_current)
w_current->undo_levels = default_undo_levels;
w_current->undo_control = default_undo_control;
w_current->undo_type = default_undo_type;
+ w_current->undo_panzoom = default_undo_panzoom;
w_current->draw_grips = default_draw_grips;
w_current->netconn_rubberband = default_netconn_rubberband;
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index fcf553e..3202ec6 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -920,7 +920,9 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
case(MID_MOUSEPAN_ENABLED):
w_current->doing_pan=FALSE;
o_redraw_all_fast(w_current);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
/* this needs to be REDONE */
/* if you mouse pan, you will be thrown out of the current mode. */
/* not good */
@@ -934,7 +936,10 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
if (w_current->doing_pan) { /* just for ending a mouse pan */
w_current->doing_pan=FALSE;
o_redraw_all_fast(w_current);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
/* this needs to be REDONE */
/* if you mouse pan, you will be thrown out of the current mode. */
/* not good */
@@ -1531,7 +1536,11 @@ gint x_event_scroll (GtkWidget *widget, GdkEventScroll *event,
/*! \todo Change "HOTKEY" TO new "MOUSE" specifier?
*/
a_zoom(w_current, ZOOM_IN, HOTKEY, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
+
} else if ( !w_current->CONTROLKEY ) {
/* if the control key is not held down, scroll up / down */
/* You must have scrollbars enabled if you want to use the scroll wheel to pan */
@@ -1556,7 +1565,9 @@ gint x_event_scroll (GtkWidget *widget, GdkEventScroll *event,
/*! \todo Change "HOTKEY" TO new "MOUSE" specifier?
*/
a_zoom(w_current, ZOOM_OUT, HOTKEY, 0);
- o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ if (w_current->undo_panzoom) {
+ o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
+ }
} else if ( !w_current->CONTROLKEY ) {
/* if the control key is not held down, scroll up / down */
/* You must have scrollbars enabled if you want to use the scroll wheel to pan */
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index cbedca3..80f3b6f 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -765,6 +765,9 @@ struct st_toplevel {
/* Type of undo (disk/memory) */
int undo_type;
+ /* Controls if pan / zoom info is saved in undo */
+ int undo_panzoom;
+
/* Controls if grips are enabled or not */
int draw_grips;
diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
index 8acadd7..ad6493e 100644
--- a/libgeda/src/s_toplevel.c
+++ b/libgeda/src/s_toplevel.c
@@ -370,6 +370,8 @@ TOPLEVEL *s_toplevel_new (void)
toplevel->undo_type = 0;
+ toplevel->undo_panzoom = 0;
+
toplevel->draw_grips = 0;
toplevel->netconn_rubberband = 0;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs