2 * gEDA - GNU Electronic Design Automation
3 * This file is a part of gerbv.
5 * Copyright (C) 2000-2003 Stefan Petersen (spe@stacken.kth.se)
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111 USA
24 #ifndef GERBV_SCREEN_H
25 #define GERBV_SCREEN_H
34 #include "gerb_image.h"
37 #define INITIAL_SCALE 200
38 #define MAX_ERRMSGLEN 25
39 #define MAX_COORDLEN 28
40 #define MAX_DISTLEN 90
41 #define MAX_STATUSMSGLEN (MAX_ERRMSGLEN+MAX_COORDLEN+MAX_DISTLEN)
43 /* Macros to convert between unscaled gerber coordinates and other units */
44 /* XXX NOTE: Currently unscaled units are assumed as inch, this is not
45 XXX necessarily true for all files */
46 #define COORD2MILS(c) ((c)*1000.0)
47 #define COORD2MMS(c) ((c)*25.4)
49 typedef enum {NORMAL
, MOVE
, ZOOM_OUTLINE
, MEASURE
, ALT_PRESSED
} gerbv_state_t
;
51 typedef enum {GERBV_MILS
, GERBV_MMS
, GERBV_INS
} gerbv_unit_t
;
58 gpointer privateRenderData
;
71 GtkWidget
*drawing_area
;
74 GdkFunction si_func
; /* Function used for superimposing layers */
75 GdkColor zoom_outline_color
;
76 GdkColor dist_measure_color
;
81 GtkWidget
*topLevelWindow
;
82 GtkWidget
*messageTextView
;
83 GtkWidget
*statusMessageLeft
;
84 GtkWidget
*statusMessageRight
;
85 GtkWidget
*statusUnitComboBox
;
87 gboolean treeIsUpdating
;
88 GtkWidget
*colorSelectionDialog
;
89 gint colorSelectionIndex
;
90 GtkWidget
*hAdjustment
;
91 GtkWidget
*vAdjustment
;
96 GtkWidget
*about_dialog
;
98 gpointer windowSurface
;
99 gpointer bufferSurface
;
101 // gint canvasHeight;
102 gerbv_fileinfo_t
*file
[MAX_FILES
];
107 char *execpath
; /* Path to executed version of gerbv */
108 char *project
; /* Current project to simplify save next time */
110 /* Bounding box for all loaded gerber images. Initialized by autoscale() */
111 // gerbv_bbox_t gerber_bbox;
113 GtkTooltips
*tooltips
;
114 GtkWidget
*popup_menu
;
117 char msgstr
[MAX_STATUSMSGLEN
];
118 char coordstr
[MAX_COORDLEN
];
119 char diststr
[MAX_DISTLEN
];
123 gboolean centered_outline_zoom
;
127 int selected_layer
; /* Selected layer by Alt+keypad */
131 gint start_x
; /* Zoom box/measure start coordinates */
134 // int trans_x; /* Translate offset */
136 // gerb_transf_t *transf; /*handles all tranformations:Mirroring, scaling and translation*/
138 gint off_x
; /* Offset current pixmap when panning */
140 // gerbv_bbox_t clip_bbox; /* Clipping bounding box */
142 int dump_parsed_image
;
145 typedef enum {ZOOM_IN
, ZOOM_OUT
, ZOOM_FIT
, ZOOM_IN_CMOUSE
, ZOOM_OUT_CMOUSE
, ZOOM_SET
} gerbv_zoom_dir_t
;
147 gerbv_zoom_dir_t z_dir
;
148 GdkEventButton
*z_event
;
152 extern gerbv_screen_t screen
;
154 #endif /* GERBV_SCREEN_H */