missing NULL terminator in set_config_x
[geda-gaf.git] / gschem / include / gschem_options.h
blobb00ab93ef21eb96a288db10670aa8237c84004df
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 2013 Ales Hvezda
4 * Copyright (C) 2013-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*!
21 * \file gschem_options.h
23 * \brief
26 /*! \brief The initial mode for magnetic nets
28 * TRUE = enabled
29 * FALSE = disabled
31 * Loading a configuration will overwrite this value
33 #define DEFAULT_MAGNETIC_NET_MODE (TRUE)
36 /*! \brief The initial mode for rubber band nets
38 * TRUE = enabled
39 * FALSE = disabled
41 * Loading a configuration will overwrite this value
43 #define DEFAULT_NET_RUBBER_BAND_MODE (FALSE)
46 /*! \brief The initial grid mode
48 * This value will get replaced by user settings.
50 #define DEFAULT_GRID_MODE (GRID_MODE_MESH)
53 /*! \brief The initial show origin
55 * This value will get replaced by user settings.
57 #define DEFAULT_SHOW_ORIGIN (TRUE)
60 /*! \brief The initial snap size
62 * This value will get replaced by user settings.
64 #define DEFAULT_SNAP_SIZE (100)
67 /*! \brief The maximum snap size, inclusive
69 * An even power of two multiplied by 100 ensures the snap size does not get
70 * off track when the user scales to the limit.
72 #define MAXIMUM_SNAP_SIZE (102400)
75 /*! \brief The minimum snap size, inclusive
77 * A value of 5 might be better for the minimum. Using the spin widget can
78 * allow the snap size to get off track.
80 #define MINIMUM_SNAP_SIZE (1)
83 #define GSCHEM_TYPE_OPTIONS (gschem_options_get_type ())
84 #define GSCHEM_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSCHEM_TYPE_OPTIONS, GschemOptions))
85 #define GSCHEM_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSCHEM_TYPE_OPTIONS, GschemOptionsClass))
86 #define IS_GSCHEM_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSCHEM_TYPE_OPTIONS))
87 #define GSCHEM_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSCHEM_TYPE_OPTIONS, GschemOptionsClass))
89 typedef struct _GschemOptionsClass GschemOptionsClass;
90 typedef struct _GschemOptions GschemOptions;
92 struct _GschemOptionsClass {
93 GObjectClass parent_class;
96 struct _GschemOptions {
97 GObject parent;
99 GschemToplevel *w_current;
101 int grid_mode;
102 gboolean show_origin;
103 gboolean magnetic_net_mode;
104 gboolean net_rubber_band_mode;
105 SNAP_STATE snap_mode;
106 int snap_size;
109 void
110 gschem_options_cycle_grid_mode (GschemOptions *options);
112 void
113 gschem_options_cycle_show_origin (GschemOptions *options);
115 void
116 gschem_options_cycle_magnetic_net_mode (GschemOptions *options);
118 void
119 gschem_options_cycle_net_rubber_band_mode (GschemOptions *options);
121 void
122 gschem_options_cycle_snap_mode (GschemOptions *options);
124 GRID_MODE
125 gschem_options_get_grid_mode (GschemOptions *options);
127 gboolean
128 gschem_options_get_show_origin (GschemOptions *options);
130 gboolean
131 gschem_options_get_magnetic_net_mode (GschemOptions *options);
133 gboolean
134 gschem_options_get_net_rubber_band_mode (GschemOptions *options);
136 SNAP_STATE
137 gschem_options_get_snap_mode (GschemOptions *options);
140 gschem_options_get_snap_size (GschemOptions *options);
142 GType
143 gschem_options_get_type ();
145 GschemOptions*
146 gschem_options_new (GschemToplevel *w_current);
148 void
149 gschem_options_scale_snap_down (GschemOptions *options);
151 void
152 gschem_options_scale_snap_up (GschemOptions *options);
154 void
155 gschem_options_set_grid_mode (GschemOptions *options, GRID_MODE grid_mode);
157 void
158 gschem_options_set_show_origin (GschemOptions *options, gboolean show_origin);
160 void
161 gschem_options_set_magnetic_net_mode (GschemOptions *options, gboolean enabled);
163 void
164 gschem_options_set_net_rubber_band_mode (GschemOptions *options, gboolean enabled);
166 void
167 gschem_options_set_snap_mode (GschemOptions *options, SNAP_STATE snap_mode);
169 void
170 gschem_options_set_snap_size (GschemOptions *options, int snap_size);