main.h

Go to the documentation of this file.
00001 /*
00002  * gEDA - GNU Electronic Design Automation
00003  * This file is a part of gerbv.
00004  *
00005  *   Copyright (C) 2000-2003 Stefan Petersen (spe@stacken.kth.se)
00006  *
00007  * $Id$
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
00022  */
00023 
00029 #ifndef MAIN_H
00030 #define MAIN_H
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 typedef enum {GERBV_MILS, GERBV_MMS, GERBV_INS} gerbv_gui_unit_t;
00037 typedef enum {ZOOM_IN, ZOOM_OUT, ZOOM_FIT, ZOOM_IN_CMOUSE, ZOOM_OUT_CMOUSE, ZOOM_SET } gerbv_zoom_dir_t;
00038 typedef enum {NORMAL, IN_MOVE, IN_ZOOM_OUTLINE, IN_MEASURE, ALT_PRESSED,
00039               IN_SELECTION_DRAG, SCROLLBAR} gerbv_state_t;
00040 typedef enum {POINTER, PAN, ZOOM, MEASURE} gerbv_tool_t;
00041 
00042 typedef struct {
00043     GtkWidget *drawing_area;
00044     GdkPixmap *pixmap;
00045     GdkColor  zoom_outline_color;
00046     GdkColor  dist_measure_color;
00047     GdkColor  selection_color;
00048 
00049     struct {
00050        GtkWidget *log;
00051        GtkWidget *topLevelWindow;
00052        GtkWidget *messageTextView;
00053        GtkWidget *statusMessageLeft;
00054        GtkWidget *statusMessageRight;
00055        GtkWidget *statusUnitComboBox;
00056        GtkWidget *layerTree;
00057        gboolean treeIsUpdating;
00058        GtkWidget *colorSelectionDialog;
00059        gint colorSelectionIndex;
00060        GtkWidget *hAdjustment;
00061        GtkWidget *vAdjustment;
00062        GtkWidget *hRuler;
00063        GtkWidget *vRuler;
00064        GtkWidget *sidepane_notebook;
00065        GtkWidget *project;
00066        GtkWidget *gerber;
00067        GtkWidget *about_dialog;
00068        GtkWidget *toolButtonPointer;
00069        GtkWidget *toolButtonPan;
00070        GtkWidget *toolButtonZoom;
00071        GtkWidget *toolButtonMeasure;
00072        gboolean updatingTools;
00073        GtkWidget *layerTreePopupMenu;
00074        GtkWidget *drawWindowPopupMenu;
00075        gdouble lastMeasuredX;
00076        gdouble lastMeasuredY;
00077     } win;
00078     
00079     gpointer windowSurface;
00080     gpointer bufferSurface;
00081     gpointer selectionRenderData;
00082 
00083     GtkTooltips *tooltips;
00084     GtkWidget *popup_menu;
00085     struct {
00086        GtkWidget *msg;
00087        char msgstr[MAX_STATUSMSGLEN];
00088        char coordstr[MAX_COORDLEN];
00089        char diststr[MAX_DISTLEN];
00090     } statusbar;
00091 
00092     gboolean centered_outline_zoom;
00093 
00094     int selected_layer;         /* Selected layer by Alt+keypad */
00095     gerbv_selection_info_t selectionInfo;
00096     gerbv_state_t state;
00097     gerbv_tool_t tool;
00098     gerbv_gui_unit_t unit;
00099            
00100     gint last_x;
00101     gint last_y;
00102     gint start_x;           /* Zoom box/measure start coordinates */
00103     gint start_y;
00104 
00105     gint off_x;                    /* Offset current pixmap when panning */
00106     gint off_y;
00107 
00108     int dump_parsed_image;
00109 } gerbv_screen_t;
00110 
00111 extern gerbv_screen_t screen;
00112 extern gerbv_project_t *mainProject;
00113 
00114 void 
00115 main_save_as_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
00116 
00117 void 
00118 main_save_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
00119 
00120 void 
00121 main_open_project_from_filename(gerbv_project_t *gerbvProject, gchar *filename);
00122 #endif /* GERBV_H */
00123 

Generated on Tue Aug 19 00:14:49 2008 for gerbv by  doxygen 1.5.6