[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: g_keys.c
User: cnieves
Date: 07/02/23 14:24:34
Modified: . g_keys.c g_register.c i_callbacks.c
Log:
Added two new hotkeys to increase and decrease the snap grid size.
* include/prototype.h, lib/system-gschemrc.in, src/g_keys.c,
src/g_register.c, src/i_callbacks.c:
Added two new hotkeys to increase and decrease the snap grid size.
Feature Request #1443637. Thanks to KaiMartin for the suggestion.
Revision Changes Path
1.5 +2 -0 eda/geda/gaf/gschem/src/g_keys.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_keys.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_keys.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- g_keys.c 9 Sep 2006 02:56:42 -0000 1.4
+++ g_keys.c 23 Feb 2007 19:24:34 -0000 1.5
@@ -281,6 +281,8 @@
DEFINE_G_KEYS(options_grid)
DEFINE_G_KEYS(options_snap)
DEFINE_G_KEYS(options_snap_size)
+DEFINE_G_KEYS(options_scale_up_snap_size)
+DEFINE_G_KEYS(options_scale_down_snap_size)
DEFINE_G_KEYS(options_rubberband)
DEFINE_G_KEYS(options_show_log_window)
DEFINE_G_KEYS(options_show_coord_window)
1.51 +2 -0 eda/geda/gaf/gschem/src/g_register.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_register.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_register.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- g_register.c 10 Feb 2007 19:43:12 -0000 1.50
+++ g_register.c 23 Feb 2007 19:24:34 -0000 1.51
@@ -296,6 +296,8 @@
{ "attributes-visibility-toggle", 0, 0, 0, g_keys_attributes_visibility_toggle },
{ "options-text-size", 0, 0, 0, g_keys_options_text_size },
{ "options-snap-size", 0, 0, 0, g_keys_options_snap_size },
+ { "options-scale-up-snap-size", 0, 0, 0, g_keys_options_scale_up_snap_size },
+ { "options-scale-down-snap-size",0, 0, 0, g_keys_options_scale_down_snap_size },
{ "options-action-feedback", 0, 0, 0, g_keys_options_afeedback },
{ "options-grid", 0, 0, 0, g_keys_options_grid },
{ "options-snap", 0, 0, 0, g_keys_options_snap },
1.74 +38 -0 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.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- i_callbacks.c 22 Feb 2007 17:18:29 -0000 1.73
+++ i_callbacks.c 23 Feb 2007 19:24:34 -0000 1.74
@@ -3304,6 +3304,44 @@
snap_size_dialog(w_current);
}
+/*! \brief Multiply by two the snap grid size.
+ * \par Function Description
+ * Callback function for the scale-up snap grid size hotkey.
+ * Multiply by two the snap grid size.
+ */
+DEFINE_I_CALLBACK(options_scale_up_snap_size)
+{
+ TOPLEVEL *w_current = (TOPLEVEL *) data;
+
+ exit_if_null(w_current);
+
+ w_current->snap_size *= 2;
+ w_current->page_current->CHANGED=1; /* maybe remove those two lines */
+ o_undo_savestate(w_current, UNDO_ALL);
+
+ o_redraw_all(w_current);
+}
+
+/*! \brief Divide by two the snap grid size.
+ * \par Function Description
+ * Callback function for the scale-down snap grid size hotkey.
+ * Divide by two the snap grid size (if it's and even number).
+ */
+DEFINE_I_CALLBACK(options_scale_down_snap_size)
+{
+ TOPLEVEL *w_current = (TOPLEVEL *) data;
+
+ exit_if_null(w_current);
+
+ if (w_current->snap_size % 2 == 0)
+ w_current->snap_size /= 2;
+ w_current->page_current->CHANGED=1; /* maybe remove those two lines */
+ o_undo_savestate(w_current, UNDO_ALL);
+
+ o_redraw_all(w_current);
+
+}
+
/*! \todo Finish function documentation!!!
* \brief
* \par Function Description
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs