From 1a49d46192ff0e84e5727ba92829c56961119e5b Mon Sep 17 00:00:00 2001 From: Werner Hoch Date: Wed, 27 Feb 2008 20:12:26 +0100 Subject: [PATCH] added configuration option for magnetic net mode in system-gschemrc Added a configuration option magnetic-net-mode and the g_rc function Set the default value to enabled. --- gschem/include/i_vars.h | 1 + gschem/include/prototype.h | 1 + gschem/lib/system-gschemrc.in | 8 ++++++++ gschem/src/g_rc.c | 18 ++++++++++++++++++ gschem/src/g_register.c | 1 + gschem/src/i_vars.c | 2 ++ 6 files changed, 31 insertions(+) diff --git a/gschem/include/i_vars.h b/gschem/include/i_vars.h index 0ebf72a5c..35037b2d9 100644 --- a/gschem/include/i_vars.h +++ b/gschem/include/i_vars.h @@ -73,6 +73,7 @@ extern int default_undo_type; extern int default_undo_panzoom; extern int default_draw_grips; extern int default_netconn_rubberband; +extern int default_magnetic_net_mode; extern int default_sort_component_library; extern int default_warp_cursor; extern int default_toolbars; diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h index 99e2e4048..8e55574b2 100644 --- a/gschem/include/prototype.h +++ b/gschem/include/prototype.h @@ -256,6 +256,7 @@ 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_magnetic_net_mode(SCM mode); SCM g_rc_sort_component_library(SCM mode); SCM g_rc_add_menu(SCM menu_name, SCM menu_items); SCM g_rc_window_size(SCM width, SCM height); diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in index 16aca1816..28aaf3967 100644 --- a/gschem/lib/system-gschemrc.in +++ b/gschem/lib/system-gschemrc.in @@ -141,6 +141,14 @@ (netconn-rubberband "enabled") ;(netconn-rubberband "disabled") +; magnetic-net-mode string +; +; Controls the initial setting of the magnetic net mode. The magnetic +; net mode marks a possible connection that is close to the current +; cursor position +(magnetic-net-mode "enabled") +;(magnetic-net-mode "disabled") + ; bus-style string ; ; Set to thin if you want thin buses. diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c index ec426cd1d..17d52e065 100644 --- a/gschem/src/g_rc.c +++ b/gschem/src/g_rc.c @@ -1155,6 +1155,24 @@ SCM g_rc_netconn_rubberband(SCM mode) 2); } + +/*! \todo Finish function documentation!!! + * \brief + * \par Function Description + * + */ +SCM g_rc_magnetic_net_mode(SCM mode) +{ + static const vstbl_entry mode_table[] = { + {TRUE , "enabled" }, + {FALSE, "disabled"}, + }; + + RETURN_G_RC_MODE("magnetic-net-mode", + default_magnetic_net_mode, + 2); +} + /*! \todo Finish function documentation!!! * \brief * \par Function Description diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c index 1bb5f86c3..35209afd8 100644 --- a/gschem/src/g_register.c +++ b/gschem/src/g_register.c @@ -134,6 +134,7 @@ static struct gsubr_t gschem_funcs[] = { { "draw-grips", 1, 0, 0, g_rc_draw_grips }, { "netconn-rubberband", 1, 0, 0, g_rc_netconn_rubberband }, + { "magnetic-net-mode", 1, 0, 0, g_rc_magnetic_net_mode }, { "sort-component-library", 1, 0, 0, g_rc_sort_component_library }, { "add-menu", 2, 0, 0, g_rc_add_menu }, { "window-size", 2, 0, 0, g_rc_window_size }, diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c index 2f8f17a0d..90a39123b 100644 --- a/gschem/src/i_vars.c +++ b/gschem/src/i_vars.c @@ -102,6 +102,7 @@ int default_undo_type = UNDO_DISK; int default_undo_panzoom = FALSE; int default_draw_grips = TRUE; int default_netconn_rubberband = FALSE; +int default_magnetic_net_mode = TRUE; int default_sort_component_library = FALSE; int default_warp_cursor = TRUE; int default_toolbars = TRUE; @@ -230,6 +231,7 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current) w_current->draw_grips = default_draw_grips; w_current->netconn_rubberband = default_netconn_rubberband; + w_current->magneticnet_mode = default_magnetic_net_mode; w_current->sort_component_library = default_sort_component_library; w_current->warp_cursor = default_warp_cursor; w_current->toolbars = default_toolbars; -- 2.11.4.GIT