Use new text accessors.
[geda-gaf/berndj.git] / gschem / include / gschem_struct.h
blob65ea9d5527ab79c934e0f774c198292619859b14
1 #ifndef H_GSCHEM_STRUCT_H
2 #define H_GSCHEM_STRUCT_H
4 enum multinet_direction_t {
5 DIRECTION_H_THEN_V,
6 DIRECTION_V_THEN_H,
7 DIRECTION_NEXT
8 };
10 enum scm_prompt_columns {
11 SCM_PROMPT_CONTINUATION,
12 SCM_PROMPT_MESSAGE,
13 SCM_PROMPT_N_COLUMNS
16 enum zoom_dir {
17 ZOOM_OUT = 0,
18 ZOOM_IN = 1,
19 ZOOM_FULL = 2,
22 enum zoom_from {
23 DONTCARE = 0,
24 MENU = 1,
25 HOTKEY = 2,
28 enum pan_flags {
29 A_PAN_FULL = 0,
30 A_PAN_IGNORE_BORDERS = 1,
31 A_PAN_DONT_REDRAW = 2,
34 typedef struct st_gschem_toplevel GSCHEM_TOPLEVEL;
36 struct st_gschem_toplevel {
38 TOPLEVEL *toplevel;
40 /* ------------------- */
41 /* main window widgets */
42 /* ------------------- */
43 GtkWidget *main_window;
45 GtkWidget *drawing_area;
46 GtkWidget *menubar;
47 GtkWidget *popup_menu;
49 GtkWidget *h_scrollbar;
50 GtkWidget *v_scrollbar;
51 GtkObject *h_adjustment;
52 GtkObject *v_adjustment;
54 GtkWidget *left_label;
55 GtkWidget *middle_label;
56 GtkWidget *right_label;
57 GtkWidget *grid_label;
58 GtkWidget *status_label;
60 GtkWidget *scm_prompts;
62 GtkWidget *toolbar_select;
63 GtkWidget *toolbar_net;
64 GtkWidget *toolbar_bus;
66 gchar *keyaccel_string; /* visual feedback when pressing
67 keyboard accelerators */
69 /* ------------ */
70 /* Dialog boxes */
71 /* ------------ */
72 GtkWidget *sowindow; /* Script open */
73 GtkWidget *pfswindow; /* Picture File Selection window */
74 GtkWidget *cswindow; /* component select */
75 GtkWidget *iwindow; /* image write dialog box */
76 GtkWidget *pswindow; /* page select */
77 GtkWidget *tiwindow; /* text input */
78 GtkWidget *tewindow; /* text edit */
79 GtkWidget *sewindow; /* slot edit */
80 GtkWidget *aawindow; /* arc attribs */
81 GtkWidget *mawindow; /* multi attribute */
82 GtkWidget *aewindow; /* attribute edit */
83 GtkWidget *trwindow; /* translate */
84 GtkWidget *tswindow; /* text size */
85 GtkWidget *tshowwindow; /* text show window */
86 GtkWidget *thidewindow; /* text hide window */
87 GtkWidget *tfindwindow; /* text find window */
88 GtkWidget *abwindow; /* Help/About... dialog*/
89 GtkWidget *hkwindow; /* Help/Hotkeys... dialog*/
90 GtkWidget *clwindow; /* Color edit dialog */
91 int edit_color; /* Used by the color edit dialog */
92 GtkWidget *cowindow; /* Coordinate window */
93 GtkWidget *coord_world; /* World coordinate label */
94 GtkWidget *coord_screen; /* Screen coordinate window */
96 /* ----------------- */
97 /* Picture placement */
98 /* ----------------- */
99 GdkPixbuf *current_pixbuf; /* used by add picture dialog */
100 double pixbuf_wh_ratio; /* width/height ratio of the pixbuf */
101 char *pixbuf_filename;
104 /* ---------------- */
105 /* graphics context */
106 /* ---------------- */
107 GdkGC *gc;
108 GdkGC *xor_gc;
109 GdkGC *outline_xor_gc;
110 GdkGC *bounding_xor_gc;
111 GdkGC *bus_gc;
113 /* ---------------- */
114 /* Drawing surfaces */
115 /* ---------------- */
116 GdkWindow *window; /* drawing_area's X drawable */
117 GdkPixmap *backingstore; /* backingstore pixmap */
118 int win_width, win_height; /* Actual size of window (?) */
120 /* ------------- */
121 /* Drawing state */
122 /* ------------- */
123 int first_wx;
124 int first_wy;
125 int second_wx;
126 int second_wy;
127 int magnetic_wx, magnetic_wy; /* Position of the magnetic marker*/
128 int distance;
129 int inside_action; /* Are we doing an action? */
130 int rubber_visible; /* Are there any rubber lines on
131 the screen? */
132 int magnetic_visible; /* Is the magnetic marker visible */
133 int net_direction; /* bit field to guess the best net direction */
134 int which_grip; /* Which grip is being manipulated.
135 Its range of values depends on the
136 type of object being manipulated. */
137 OBJECT *which_object; /* Object being manipulated */
138 int subject_is_new;
140 /* --------------------- */
141 /* Gschem internal state */
142 /* --------------------- */
143 int num_untitled; /* keep track of untitled wins */
144 int event_state; /* Current event state */
145 int image_width, image_height; /* h, w of image write */
146 int grid; /* Grid on/off*/
147 int min_zoom; /* minimum zoom factor */
148 int max_zoom; /* maximum zoom factor */
149 int text_alignment; /* current alignment of text */
150 int inside_redraw; /* complex vs list redrawing */
151 int drawbounding_action_mode; /* outline vs bounding box */
152 int last_drawb_mode; /* last above mode */
153 int CONTROLKEY; /* control key pressed? */
154 int SHIFTKEY; /* shift key pressed? */
155 int ALTKEY; /* alt key pressed? */
156 int doing_pan; /* mouse pan status flag */
157 int buffer_number; /* current paste buffer in use */
158 void (*last_callback)(); /* Last i_call* cmd executed */
160 /* ------------------ */
161 /* rc/user parameters */
162 /* ------------------ */
163 int graphic_color;
164 int net_color;
165 int bus_color;
166 int pin_color;
167 int text_color;
169 /* not used anywhere yet, but will be */
170 int logic_bubble_color;
171 int zoom_box_color;
172 int grid_color;
173 int select_color;
174 int bb_color;
175 int lock_color;
176 int stroke_color; /* color of the stroke points */
178 int text_caps;
179 int text_size;
181 int zoom_with_pan;
183 int actionfeedback_mode; /* can be either OUTLINE or BOUNDINGBOX */
184 int text_feedback; /* is text is drawn or not in copy/move/place ops */
185 int text_display_zoomfactor; /* zoom factor at which text is displayed completely */
186 int net_endpoint_mode; /* can be either NONE, FILLEDBOX, EMPTYBOX, X */
187 int net_midpoint_mode; /* can be either NONE or FILLED or EMPTY */
188 int net_direction_mode; /* controls if the net direction mode is used */
189 int net_selection_mode; /* controls the behaviour when selecting a net */
190 int net_selection_state; /* current status of the net selecting mode */
191 int embed_complex; /* controls if complex objects are embedded */
192 int include_complex; /* controls if complex objects are included */
193 int scrollbars_flag; /* controls if scrollbars are displayed */
194 int log_window; /* controls if the log windows mapped on startup */
195 int log_window_type; /* controls if the log window is decorated or not */
196 int third_button; /* controls what the third mouse button does */
197 int middle_button; /* controls what the third mouse button does */
198 int scroll_wheel; /* controls what the mouse scroll wheel does */
199 int file_preview; /* controls if the preview area is enabled or not */
200 int enforce_hierarchy; /* controls how much freedom user has when traversing the hierarchy */
201 int text_origin_marker; /* controls if text origin marker is displayed or not */
202 int fast_mousepan; /* controls if text is completely drawn during mouse pan */
203 int raise_dialog_boxes; /*controls if expose events raise dialog boxes*/
205 /* controls if after doing a place the same component can be placed again */
206 int continue_component_place;
207 GList *component_select_attrlist; /* holds a list of attribute names that are displayed in the
208 component select dialog */
210 int undo_levels; /* number of undo levels stored on disk */
211 int undo_control; /* sets if undo is enabled or not */
212 enum undo_type_t undo_type; /* type of undo (disk/memory) */
213 int undo_panzoom; /* sets if pan / zoom info is saved in undo */
214 int draw_grips; /* sets if grips are enabled or not */
216 /* sets whether nets rubberband as you move them (or connecting comps) */
217 int netconn_rubberband;
219 int sort_component_library; /* sort the component library */
220 int warp_cursor; /* warp the cursor when zooming */
221 int toolbars; /* sets if the toolbar(s) are enabled or disabled */
222 int handleboxes; /* sets if the handleboxes are enabled or disabled */
223 int bus_ripper_size; /* sets size of the bus rippers */
224 int bus_ripper_type; /* sets type of the bus ripper (component or net) */
225 int bus_ripper_rotation; /* sets if the the bus ripper is symmetric or not */
226 int grid_dot_size; /* sets the grid dot size */
227 int grid_mode; /* sets the mode of the grid (either variable or fixed) */
228 int magneticnet_mode; /* enables/disables the magnetic net mode ON/OFF */
230 /* sets the minimum number of pixels necessary for the grid to be */
231 /* displayed */
232 int grid_fixed_threshold;
234 /* sets the offset (in world coordinates) that are added to netname */
235 /* attributes when they are attached to vertical or horizontal nets */
236 int add_attribute_offset;
238 int drag_can_move; /* Controls if drag can move objects or not */
239 int mousepan_gain; /* Controls the gain of the mouse pan */
240 int keyboardpan_gain; /* Controls the gain of the keyboard pan */
241 int select_slack_pixels; /* Number of pixels around an object we can still select it with */
242 int zoom_gain; /* Percentage increase in size for a zoom-in operation */
243 int scrollpan_steps; /* Number of scroll pan events required to traverse the viewed area */
245 char *print_command; /* The command to send postscript to when printing */
248 #endif