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
25 \brief Header info for the GUI building functions for Gerber Viewer
29 /** Sets the key acceleration of a menu item.
30 First tries to lookup the given STOCK_ID with gtk_stock_lookup.
31 If this succeeds and the retrieved GtkStockItem has an accelerator defined this accelerator is used.
32 Otherwise the defaults given below are used.
34 \warning There has to be a GtkStockItem variable 'stock' in scope where this macro is used.
36 #define SET_ACCELS_FROM_STOCK(STOCK_ID, GERBV_ACCEL_ID)\
37 if(gtk_stock_lookup (STOCK_ID, &stock) && stock.keyval != GDK_VoidSymbol && stock.keyval != 0)\
38 gtk_accel_map_add_entry (GERBV_ACCEL_ID ## _PATH, stock.keyval, stock.modifier);\
40 gtk_accel_map_add_entry (GERBV_ACCEL_ID ## _PATH, GERBV_ACCEL_ID ## _KEY, GERBV_ACCEL_ID ## _MOD)
42 #define SET_ACCELS(GERBV_ACCEL_ID)\
43 gtk_accel_map_add_entry (GERBV_ACCEL_ID ## _PATH, GERBV_ACCEL_ID ## _KEY, GERBV_ACCEL_ID ## _MOD)
45 /* If stock items/IDs are used the ACCEL_*_PATH macros have to match the labels of the stock items.
46 Otherwise the (persistent) accelerators are broken. One workaround would be to look the labels up. */
47 #define GERBV_ACCELS_RELPATH ".gnome2/accels/gerbv"
48 #define ACCEL_ROOT "<main>/"
49 #define ACCEL_FILE ACCEL_ROOT "file"
50 #define ACCEL_FILE_NEW_PATH ACCEL_FILE "/New"
51 #define ACCEL_FILE_NEW_KEY GDK_n
52 #define ACCEL_FILE_NEW_MOD (GdkModifierType) GDK_CONTROL_MASK
53 #define ACCEL_FILE_REVERT_PATH ACCEL_FILE "/Revert"
54 #define ACCEL_FILE_REVERT_KEY GDK_F5
55 #define ACCEL_FILE_REVERT_MOD (GdkModifierType) 0
56 #define ACCEL_FILE_OPEN_LAYER_PATH ACCEL_FILE "/Open layer(s)..."
57 #define ACCEL_FILE_OPEN_LAYER_KEY GDK_O
58 #define ACCEL_FILE_OPEN_LAYER_MOD (GdkModifierType) GDK_CONTROL_MASK
59 #define ACCEL_FILE_SAVE_LAYER_PATH ACCEL_FILE "/Save active layer"
60 #define ACCEL_FILE_SAVE_LAYER_KEY GDK_S
61 #define ACCEL_FILE_SAVE_LAYER_MOD (GdkModifierType) GDK_CONTROL_MASK
62 #define ACCEL_FILE_SAVE_LAYER_AS_PATH ACCEL_FILE "/Save active layer as..."
63 #define ACCEL_FILE_SAVE_LAYER_AS_KEY GDK_S
64 #define ACCEL_FILE_SAVE_LAYER_AS_MOD (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK
65 #define ACCEL_FILE_EXPORT ACCEL_FILE "/Export"
66 #define ACCEL_FILE_PRINT_PATH ACCEL_FILE "/Print..."
67 #define ACCEL_FILE_PRINT_KEY GDK_P
68 #define ACCEL_FILE_PRINT_MOD (GdkModifierType) GDK_CONTROL_MASK
69 #define ACCEL_FILE_QUIT_PATH ACCEL_FILE "/Quit"
70 #define ACCEL_FILE_QUIT_KEY GDK_Q
71 #define ACCEL_FILE_QUIT_MOD (GdkModifierType) GDK_CONTROL_MASK
73 #define ACCEL_EDIT ACCEL_ROOT "edit"
74 #define ACCEL_EDIT_PROPERTIES_PATH ACCEL_EDIT "/Display properties of selected object(s)"
75 #define ACCEL_EDIT_PROPERTIES_KEY GDK_Return
76 #define ACCEL_EDIT_PROPERTIES_MOD (GdkModifierType) GDK_MOD1_MASK
77 #define ACCEL_EDIT_DELETE_PATH ACCEL_EDIT "/Delete selected object(s)"
78 #define ACCEL_EDIT_DELETE_KEY GDK_Delete
79 #define ACCEL_EDIT_DELETE_MOD (GdkModifierType) 0
81 #define ACCEL_VIEW ACCEL_ROOT "view"
82 #define ACCEL_VIEW_FULLSCREEN_PATH ACCEL_VIEW "/Fullscreen"
83 #define ACCEL_VIEW_FULLSCREEN_KEY GDK_F11
84 #define ACCEL_VIEW_FULLSCREEN_MOD (GdkModifierType) 0
85 #define ACCEL_VIEW_TOOLBAR_PATH ACCEL_VIEW "/Show Toolbar"
86 #define ACCEL_VIEW_TOOLBAR_KEY GDK_F7
87 #define ACCEL_VIEW_TOOLBAR_MOD (GdkModifierType) 0
88 #define ACCEL_VIEW_SIDEPANE_PATH ACCEL_VIEW "/Show Sidepane"
89 #define ACCEL_VIEW_SIDEPANE_KEY GDK_F9
90 #define ACCEL_VIEW_SIDEPANE_MOD (GdkModifierType) 0
91 #define ACCEL_VIEW_VIS ACCEL_VIEW "/Toggle layer visibilty"
92 #define ACCEL_VIEW_VIS_LAYER1_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 1"
93 #define ACCEL_VIEW_VIS_LAYER1_KEY GDK_1
94 #define ACCEL_VIEW_VIS_LAYER1_MOD (GdkModifierType) GDK_CONTROL_MASK
95 #define ACCEL_VIEW_VIS_LAYER2_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 2"
96 #define ACCEL_VIEW_VIS_LAYER2_KEY GDK_2
97 #define ACCEL_VIEW_VIS_LAYER2_MOD (GdkModifierType) GDK_CONTROL_MASK
98 #define ACCEL_VIEW_VIS_LAYER3_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 3"
99 #define ACCEL_VIEW_VIS_LAYER3_KEY GDK_3
100 #define ACCEL_VIEW_VIS_LAYER3_MOD (GdkModifierType) GDK_CONTROL_MASK
101 #define ACCEL_VIEW_VIS_LAYER4_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 4"
102 #define ACCEL_VIEW_VIS_LAYER4_KEY GDK_4
103 #define ACCEL_VIEW_VIS_LAYER4_MOD (GdkModifierType) GDK_CONTROL_MASK
104 #define ACCEL_VIEW_VIS_LAYER5_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 5"
105 #define ACCEL_VIEW_VIS_LAYER5_KEY GDK_5
106 #define ACCEL_VIEW_VIS_LAYER5_MOD (GdkModifierType) GDK_CONTROL_MASK
107 #define ACCEL_VIEW_VIS_LAYER6_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 6"
108 #define ACCEL_VIEW_VIS_LAYER6_KEY GDK_6
109 #define ACCEL_VIEW_VIS_LAYER6_MOD (GdkModifierType) GDK_CONTROL_MASK
110 #define ACCEL_VIEW_VIS_LAYER7_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 7"
111 #define ACCEL_VIEW_VIS_LAYER7_KEY GDK_7
112 #define ACCEL_VIEW_VIS_LAYER7_MOD (GdkModifierType) GDK_CONTROL_MASK
113 #define ACCEL_VIEW_VIS_LAYER8_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 8"
114 #define ACCEL_VIEW_VIS_LAYER8_KEY GDK_8
115 #define ACCEL_VIEW_VIS_LAYER8_MOD (GdkModifierType) GDK_CONTROL_MASK
116 #define ACCEL_VIEW_VIS_LAYER9_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 9"
117 #define ACCEL_VIEW_VIS_LAYER9_KEY GDK_9
118 #define ACCEL_VIEW_VIS_LAYER9_MOD (GdkModifierType) GDK_CONTROL_MASK
119 #define ACCEL_VIEW_VIS_LAYER10_PATH ACCEL_VIEW_VIS "/Toggle visibility of layer 10"
120 #define ACCEL_VIEW_VIS_LAYER10_KEY GDK_0
121 #define ACCEL_VIEW_VIS_LAYER10_MOD (GdkModifierType) GDK_CONTROL_MASK
122 #define ACCEL_VIEW_ZOOM_IN_PATH ACCEL_VIEW "/Zoom In"
123 #define ACCEL_VIEW_ZOOM_IN_KEY GDK_z
124 #define ACCEL_VIEW_ZOOM_IN_MOD (GdkModifierType) 0
125 #define ACCEL_VIEW_ZOOM_OUT_PATH ACCEL_VIEW "/Zoom Out"
126 #define ACCEL_VIEW_ZOOM_OUT_KEY GDK_z
127 #define ACCEL_VIEW_ZOOM_OUT_MOD (GdkModifierType) GDK_SHIFT_MASK
128 #define ACCEL_VIEW_ZOOM_FIT_PATH ACCEL_VIEW "/Best Fit"
129 #define ACCEL_VIEW_ZOOM_FIT_KEY GDK_f
130 #define ACCEL_VIEW_ZOOM_FIT_MOD (GdkModifierType) 0
131 #define ACCEL_VIEW_RENDER ACCEL_VIEW "/Rendering"
132 #define ACCEL_VIEW_UNITS ACCEL_VIEW "/Units"
134 #define ACCEL_LAYER ACCEL_ROOT "layer"
135 #define ACCEL_LAYER_COLOR_PATH ACCEL_LAYER "/Change color"
136 #define ACCEL_LAYER_COLOR_KEY GDK_F6
137 #define ACCEL_LAYER_COLOR_MOD (GdkModifierType) 0
138 #define ACCEL_LAYER_UP_PATH ACCEL_LAYER "/Move up"
139 #define ACCEL_LAYER_UP_KEY GDK_Up
140 #define ACCEL_LAYER_UP_MOD (GdkModifierType) GDK_CONTROL_MASK
141 #define ACCEL_LAYER_DOWN_PATH ACCEL_LAYER "/Move down"
142 #define ACCEL_LAYER_DOWN_KEY GDK_Down
143 #define ACCEL_LAYER_DOWN_MOD (GdkModifierType) GDK_CONTROL_MASK
145 #define ACCEL_ANAL ACCEL_ROOT "analyze"
147 #define ACCEL_TOOLS ACCEL_ROOT "tools"
148 #define ACCEL_TOOLS_POINTER_PATH ACCEL_TOOLS "/Pointer Tool"
149 #define ACCEL_TOOLS_POINTER_KEY GDK_1
150 #define ACCEL_TOOLS_POINTER_MOD (GdkModifierType) 0
151 #define ACCEL_TOOLS_PAN_PATH ACCEL_TOOLS "/Pan Tool"
152 #define ACCEL_TOOLS_PAN_KEY GDK_2
153 #define ACCEL_TOOLS_PAN_MOD (GdkModifierType) 0
154 #define ACCEL_TOOLS_ZOOM_PATH ACCEL_TOOLS "/Zoom Tool"
155 #define ACCEL_TOOLS_ZOOM_KEY GDK_3
156 #define ACCEL_TOOLS_ZOOM_MOD (GdkModifierType) 0
157 #define ACCEL_TOOLS_MEASURE_PATH ACCEL_TOOLS "/Measure Tool"
158 #define ACCEL_TOOLS_MEASURE_KEY GDK_4
159 #define ACCEL_TOOLS_MEASURE_MOD (GdkModifierType) 0
161 #define ACCEL_HELP ACCEL_ROOT "help"
164 interface_create_gui (int req_width
, int req_height
);
167 interface_set_render_type (int);
169 void rename_main_window(char const* filename
, GtkWidget
* main_win
);
172 set_window_icon (GtkWidget
* this_window
);
175 interface_get_alert_dialog_response (gchar
*primaryText
,
176 gchar
*secondaryText
,
177 gboolean show_checkbox
,
178 gboolean
*ask_to_show_again
);
181 interface_show_alert_dialog (gchar
*primaryText
,
182 gchar
*secondaryText
,
183 gboolean show_checkbox
,
184 gboolean
*ask_to_show_again
);
187 interface_show_modify_orientation_dialog (gerbv_user_transformation_t
*transform
, gerbv_unit_t screenUnit
);
190 * Popup dialog for listing of files in zip archive.
191 * Input is list of files in zip archive.
192 * Output is list of files which has been selected.
194 GSList
*interface_show_select_zipped_files_dialog(GSList
*filenames
);