gerbv  2.10.1-dev~93f1b5
main.h
Go to the documentation of this file.
1 /*
2  * gEDA - GNU Electronic Design Automation
3  * This file is a part of gerbv.
4  *
5  * Copyright (C) 2000-2003 Stefan Petersen (spe@stacken.kth.se)
6  *
7  * $Id$
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
29 #ifndef MAIN_H
30 #define MAIN_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef enum {
37  GERBV_MILS,
38  GERBV_MMS,
39  GERBV_INS
40 } gerbv_gui_unit_t;
41 
42 typedef enum {
43  ZOOM_IN,
44  ZOOM_OUT,
45  ZOOM_FIT,
46  ZOOM_IN_CMOUSE,
47  ZOOM_OUT_CMOUSE,
48  ZOOM_SET
49 } gerbv_zoom_dir_t;
50 
51 typedef enum {
52  NORMAL,
53  IN_MOVE,
54  IN_ZOOM_OUTLINE,
55  IN_MEASURE,
56  ALT_PRESSED,
57  IN_SELECTION_DRAG,
58  SCROLLBAR
59 } gerbv_state_t;
60 
61 typedef enum {
62  POINTER,
63  PAN,
64  ZOOM,
65  MEASURE
66 } gerbv_tool_t;
67 
68 typedef struct {
69  GtkWidget* drawing_area;
70  GdkPixmap* pixmap;
71  GdkColor zoom_outline_color;
72  GdkColor dist_measure_color;
73  GdkColor selection_color;
74 
75  struct {
76  GtkWidget* log;
77  GtkWidget* topLevelWindow;
78  GtkWidget* messageTextView;
79  GtkWidget* statusMessageLeft;
80  GtkWidget* statusMessageRight;
81  GtkWidget* statusUnitComboBox;
82  GtkCheckMenuItem** menu_view_unit_group;
83  GtkWidget* layerTree;
84  gboolean treeIsUpdating;
85  GtkWidget* colorSelectionDialog;
86  gint colorSelectionIndex;
87  GtkWidget* hAdjustment;
88  GtkWidget* vAdjustment;
89  GtkWidget* hRuler;
90  GtkWidget* vRuler;
91  GtkWidget* sidepane_notebook;
92  GtkComboBox* sidepaneRenderComboBox;
93  GtkCheckMenuItem** menu_view_render_group;
94  GtkWidget* project;
95  GtkWidget* gerber;
96  GtkWidget* about_dialog;
97  GtkWidget* toolButtonPointer;
98  GtkWidget* toolButtonPan;
99  GtkWidget* toolButtonZoom;
100  GtkWidget* toolButtonMeasure;
101  gboolean updatingTools;
102  GtkWidget* layerTreePopupMenu;
103  GtkWidget* drawWindowPopupMenu;
104  GtkWidget* curLayerMenuItem;
105  GtkWidget* curAnalyzeMenuItem;
106  GtkWidget* curEditMenuItem;
107  GtkWidget * curEditAlingMenuItem, *curEditAlingItem[2];
108  GtkWidget* curFileMenuItem[7];
109  } win;
110 
111  gpointer windowSurface;
112  gpointer bufferSurface;
113  gpointer selectionRenderData;
114 
115  GtkTooltips* tooltips;
116  GtkWidget* popup_menu;
117 
118  struct {
119  GtkWidget* msg;
120  char msgstr[MAX_STATUSMSGLEN];
121  char coordstr[MAX_COORDLEN];
122  char diststr[MAX_DISTLEN];
123  } statusbar;
124 
125  gboolean centered_outline_zoom;
126 
127  int selected_layer; /* Selected layer by Alt+keypad */
128  gerbv_selection_info_t selectionInfo;
129  gerbv_state_t state;
130  gerbv_tool_t tool;
131  gerbv_gui_unit_t unit;
132  gboolean unit_is_from_cmdline;
133  gboolean background_is_from_cmdline;
134  gboolean background_is_from_project;
135  GSettings* settings;
136 
137  gint last_x;
138  gint last_y;
139  gint start_x; /* Zoom box start screen coordinates */
140  gint start_y;
141 
142  gint off_x; /* Offset current pixmap when panning */
143  gint off_y;
144 
145  gdouble measure_start_x; /* Measure start board coordinates */
146  gdouble measure_start_y;
147  gdouble measure_stop_x; /* Measure end board coordinates */
148  gdouble measure_stop_y;
149 
150  gdouble measure_last_x;
151  gdouble measure_last_y;
152 
153  gdouble length_sum;
154 
155  int dump_parsed_image;
156 } gerbv_screen_t;
157 
158 struct log_struct {
159  gchar* domain;
160  GLogLevelFlags level;
161  gchar* message;
162 };
163 
164 extern gerbv_screen_t screen;
166 
167 void main_save_as_project_from_filename(gerbv_project_t* gerbvProject, gchar* filename);
168 
169 void main_save_project_from_filename(gerbv_project_t* gerbvProject, gchar* filename);
170 
171 void main_open_project_from_filename(gerbv_project_t* gerbvProject, gchar* filename);
172 #endif /* GERBV_H */
gerbv_project_t * mainProject
Global state variable to keep track of what's happening on the screen.
Definition: main.c:169