gerbv  2.6A
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 {GERBV_MILS, GERBV_MMS, GERBV_INS} gerbv_gui_unit_t;
37 typedef enum {ZOOM_IN, ZOOM_OUT, ZOOM_FIT, ZOOM_IN_CMOUSE, ZOOM_OUT_CMOUSE, ZOOM_SET } gerbv_zoom_dir_t;
38 typedef enum {NORMAL, IN_MOVE, IN_ZOOM_OUTLINE, IN_MEASURE, ALT_PRESSED,
39  IN_SELECTION_DRAG, SCROLLBAR} gerbv_state_t;
40 typedef enum {POINTER, PAN, ZOOM, MEASURE} gerbv_tool_t;
41 
42 typedef struct {
43  GtkWidget *drawing_area;
44  GdkPixmap *pixmap;
45  GdkColor zoom_outline_color;
46  GdkColor dist_measure_color;
47  GdkColor selection_color;
48 
49  struct {
50  GtkWidget *log;
51  GtkWidget *topLevelWindow;
52  GtkWidget *messageTextView;
53  GtkWidget *statusMessageLeft;
54  GtkWidget *statusMessageRight;
55  GtkWidget *statusUnitComboBox;
56  GtkCheckMenuItem **menu_view_unit_group;
57  GtkWidget *layerTree;
58  gboolean treeIsUpdating;
59  GtkWidget *colorSelectionDialog;
60  gint colorSelectionIndex;
61  GtkWidget *hAdjustment;
62  GtkWidget *vAdjustment;
63  GtkWidget *hRuler;
64  GtkWidget *vRuler;
65  GtkWidget *sidepane_notebook;
66  GtkComboBox *sidepaneRenderComboBox;
67  GtkCheckMenuItem **menu_view_render_group;
68  GtkWidget *project;
69  GtkWidget *gerber;
70  GtkWidget *about_dialog;
71  GtkWidget *toolButtonPointer;
72  GtkWidget *toolButtonPan;
73  GtkWidget *toolButtonZoom;
74  GtkWidget *toolButtonMeasure;
75  gboolean updatingTools;
76  GtkWidget *layerTreePopupMenu;
77  GtkWidget *drawWindowPopupMenu;
78  GtkWidget *curLayerMenuItem;
79  GtkWidget *curAnalyzeMenuItem;
80  GtkWidget *curEditMenuItem;
81  GtkWidget *curFileMenuItem1;
82  GtkWidget *curFileMenuItem2;
83  GtkWidget *curFileMenuItem3;
84  GtkWidget *curFileMenuItem4;
85  GtkWidget *curFileMenuItem5;
86  GtkWidget *curFileMenuItem6;
87  GtkWidget *curFileMenuItem7;
88 
89  gdouble lastMeasuredX;
90  gdouble lastMeasuredY;
91  } win;
92 
93  gpointer windowSurface;
94  gpointer bufferSurface;
95  gpointer selectionRenderData;
96 
97  GtkTooltips *tooltips;
98  GtkWidget *popup_menu;
99  struct {
100  GtkWidget *msg;
101  char msgstr[MAX_STATUSMSGLEN];
102  char coordstr[MAX_COORDLEN];
103  char diststr[MAX_DISTLEN];
104  } statusbar;
105 
106  gboolean centered_outline_zoom;
107 
108  int selected_layer; /* Selected layer by Alt+keypad */
109  gerbv_selection_info_t selectionInfo;
110  gerbv_state_t state;
111  gerbv_tool_t tool;
112  gerbv_gui_unit_t unit;
113 
114  gint last_x;
115  gint last_y;
116  gint start_x; /* Zoom box start screen coordinates */
117  gint start_y;
118 
119  gint off_x; /* Offset current pixmap when panning */
120  gint off_y;
121 
122  gdouble measure_start_x; /* Measure start board coordinates */
123  gdouble measure_start_y;
124  gdouble measure_last_x; /* Measure end board coordinates */
125  gdouble measure_last_y;
126 
127  gdouble length_sum;
128 
129  int dump_parsed_image;
130 } gerbv_screen_t;
131 
132 struct log_struct {
133  gchar *domain;
134  GLogLevelFlags level;
135  gchar *message;
136 };
137 
138 extern gerbv_screen_t screen;
140 
141 void
142 main_save_as_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
143 
144 void
145 main_save_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
146 
147 void
148 main_open_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
149 #endif /* GERBV_H */
150