gschem

gschem_struct.h

Go to the documentation of this file.
00001 
00002 typedef enum {SNAP_OFF, SNAP_GRID, SNAP_RESNAP, SNAP_STATE_COUNT} SNAP_STATE;
00003 
00004 typedef struct st_gschem_toplevel GSCHEM_TOPLEVEL;
00005 typedef struct st_stretch STRETCH;
00006 
00007 struct st_gschem_toplevel {
00008 
00009   TOPLEVEL *toplevel;
00010 
00011   /* ------------------- */
00012   /* main window widgets */
00013   /* ------------------- */
00014   GtkWidget *main_window;
00015 
00016   GtkWidget *drawing_area;
00017   GtkWidget *menubar;
00018   GtkWidget *popup_menu;
00019 
00020   GtkWidget *h_scrollbar;
00021   GtkWidget *v_scrollbar;
00022   GtkAdjustment *h_adjustment;
00023   GtkAdjustment *v_adjustment;
00024 
00025   GtkWidget *macro_box;
00026   GtkWidget *macro_entry;
00027   GtkWidget *left_label;
00028   GtkWidget *middle_label;
00029   GtkWidget *right_label;
00030   GtkWidget *grid_label;
00031   GtkWidget *status_label;
00032 
00033   GtkWidget *toolbar_select;
00034   GtkWidget *toolbar_net;
00035   GtkWidget *toolbar_bus;
00036 
00037   gchar *keyaccel_string;               /* visual feedback when pressing
00038                                            keyboard accelerators */
00039   gboolean keyaccel_string_source_id;   /* event source ID used by above */
00040 
00041   /* ------------ */
00042   /* Dialog boxes */
00043   /* ------------ */
00044   GtkWidget *sowindow;                  /* Script open */
00045   GtkWidget *pfswindow;                 /* Picture File Selection window */
00046   GtkWidget *cswindow;                  /* component select */
00047   GtkWidget *iwindow;                   /* image write dialog box */
00048   GtkWidget *pswindow;                  /* page select */
00049   GtkWidget *tiwindow;                  /* text input */
00050   GtkWidget *tewindow;                  /* text edit */
00051   GtkWidget *sewindow;                  /* slot edit */
00052   GtkWidget *aawindow;                  /* arc attribs */
00053   GtkWidget *mawindow;                  /* multi attribute */
00054   GtkWidget *aewindow;                  /* attribute edit */
00055   GtkWidget *trwindow;                  /* translate */
00056   GtkWidget *tswindow;                  /* text size */
00057   GtkWidget *tshowwindow;               /* text show window */
00058   GtkWidget *thidewindow;               /* text hide window */
00059   GtkWidget *tfindwindow;               /* text find window */
00060   GtkWidget *hkwindow;                  /* Help/Hotkeys... dialog*/
00061   GtkWidget *clwindow;                  /* Color edit dialog */
00062   int edit_color;                         /* Used by the color edit dialog */
00063   GtkWidget *cowindow;                  /* Coordinate window */
00064   GtkWidget *coord_world;                 /* World coordinate label */
00065   GtkWidget *coord_screen;                /* Screen coordinate window */
00066 
00067   /* ----------------- */
00068   /* Picture placement */
00069   /* ----------------- */
00070   GdkPixbuf *current_pixbuf;            /* used by add picture dialog */
00071   double pixbuf_wh_ratio;               /* width/height ratio of the pixbuf */
00072   char *pixbuf_filename;
00073 
00074 
00075   /* ---------------- */
00076   /* graphics context */
00077   /* ---------------- */
00078   GdkGC *gc;
00079 
00080   /* ---------------- */
00081   /* Drawing surfaces */
00082   /* ---------------- */
00083   GdkWindow *window;                    /* drawing_area's X drawable */
00084   GdkPixmap *drawable;                  /* drawable to paint onto */
00085   cairo_t *cr;                          /* Cairo surface */
00086   PangoLayout *pl;                      /* Pango layout */
00087 
00088   int win_width, win_height;            /* Actual size of window (?) */
00089 
00090   /* ------------- */
00091   /* Drawing state */
00092   /* ------------- */
00093   int first_wx;
00094   int first_wy;
00095   int second_wx;
00096   int second_wy;
00097   int third_wx;
00098   int third_wy;
00099   int magnetic_wx, magnetic_wy;         /* Position of the magnetic marker*/
00100   int distance;
00101   int inside_action;                    /* Are we doing an action? */
00102   int rubber_visible;                   /* Are there any rubber lines on
00103                        the screen? */
00104   int net_direction;                    /* bit field to guess the best net direction */
00105   int which_grip;                       /* Which grip is being manipulated.
00106                                            Its range of values depends on the
00107                                            type of object being manipulated. */
00108   OBJECT *which_object;                 /* Object being manipulated */
00109 
00110   /* ------------------ */
00111   /* Rubberbanding nets */
00112   /* ------------------ */
00113   GList *stretch_list;
00114 
00115   /* --------------------- */
00116   /* Gschem internal state */
00117   /* --------------------- */
00118   int num_untitled;                     /* keep track of untitled wins */
00119   int event_state;                      /* Current event state */
00120   int image_width, image_height;        /* h, w of image write */
00121   int grid;                             /* what type of grid to show */
00122   int min_zoom;                         /* minimum zoom factor */
00123   int max_zoom;                         /* maximum zoom factor */
00124   int text_alignment;                   /* current alignment of text */
00125   int inside_redraw;                    /* complex vs list redrawing */
00126   int drawbounding_action_mode;         /* outline vs bounding box */
00127   int last_drawb_mode;                  /* last above mode */
00128   int CONTROLKEY;                       /* control key pressed? */
00129   int SHIFTKEY;                         /* shift key pressed? */
00130   int ALTKEY;                           /* alt key pressed? */
00131   int doing_pan;                        /* mouse pan status flag */
00132   int buffer_number;                    /* current paste buffer in use */
00133   void (*last_callback)();              /* Last i_call* cmd executed */
00134   GList *clipboard_buffer;              /* buffer for system clipboard integration */
00135 
00136   /* ------------------ */
00137   /* rc/user parameters */
00138   /* ------------------ */
00139   int text_caps;
00140   int text_size;
00141 
00142   int zoom_with_pan;
00143 
00144   int actionfeedback_mode;      /* can be either OUTLINE or BOUNDINGBOX */
00145   int text_feedback;      /* is text is drawn or not in copy/move/place ops */
00146   int text_display_zoomfactor;  /* zoom factor at which text is displayed completely */
00147   int net_endpoint_mode;  /* can be either NONE, FILLEDBOX, EMPTYBOX, X */
00148   int net_midpoint_mode;  /* can be either NONE or FILLED or EMPTY */
00149   int net_direction_mode; /* controls if the net direction mode is used */
00150   int net_selection_mode;  /* controls the behaviour when selecting a net */
00151   int net_selection_state;  /* current status of the net selecting mode */
00152   int embed_complex;      /* controls if complex objects are embedded */
00153   int include_complex;    /* controls if complex objects are included */
00154   int scrollbars_flag;    /* controls if scrollbars are displayed */
00155   int log_window;         /* controls if the log windows mapped on startup */
00156   int log_window_type;    /* controls if the log window is decorated or not */
00157   int third_button;       /* controls what the third mouse button does */
00158   int middle_button;      /* controls what the third mouse button does */
00159   int scroll_wheel;       /* controls what the mouse scroll wheel does */
00160   int file_preview;       /* controls if the preview area is enabled or not */
00161   int enforce_hierarchy;  /* controls how much freedom user has when traversing the hierarchy */
00162   int text_origin_marker; /* controls if text origin marker is displayed or not */
00163   int fast_mousepan;      /* controls if text is completely drawn during mouse pan */
00164   int raise_dialog_boxes; /*controls if expose events raise dialog boxes*/
00165 
00166   /* controls if after doing a place the same component can be placed again */
00167   int continue_component_place;
00168   GList *component_select_attrlist; /* holds a list of attribute names that are displayed in the 
00169                        component select dialog */
00170 
00171   int undo_levels;        /* number of undo levels stored on disk */
00172   int undo_control;       /* sets if undo is enabled or not */
00173   int undo_type;          /* type of undo (disk/memory) */
00174   int undo_panzoom;       /* sets if pan / zoom info is saved in undo */
00175   int draw_grips;         /* sets if grips are enabled or not */
00176 
00177   /* sets whether nets rubberband as you move them (or connecting comps) */
00178   int netconn_rubberband;
00179 
00180   int sort_component_library; /* sort the component library */
00181   int warp_cursor;        /* warp the cursor when zooming */
00182   int toolbars;           /* sets if the toolbar(s) are enabled or disabled */
00183   int handleboxes;        /* sets if the handleboxes are enabled or disabled */
00184   int bus_ripper_size;    /* sets size of the bus rippers */
00185   int bus_ripper_type;    /* sets type of the bus ripper (component or net) */
00186   int bus_ripper_rotation;  /* sets if the the bus ripper is symmetric or not */
00187   int magneticnet_mode; /* enables/disables the magnetic net mode ON/OFF */
00188 
00189   SNAP_STATE snap;                      /* Whether/how to snap to grid */
00190   int snap_size;                        /* Snap grid parameter */
00191 
00192   /* sets the mininum number of pixels necessary for the grid to be */
00193   /* displayed */
00194   int dots_grid_fixed_threshold;
00195   int dots_grid_dot_size; /* sets the grid dot size */
00196   int dots_grid_mode;     /* sets the mode of the dotted grid (either variable or fixed) */
00197 
00198   /* Minimum grid line pitch to display. Applies to major and minor lines. */
00199   int mesh_grid_display_threshold;
00200 
00201   /* sets the offset (in world coordinates) that are added to netname */
00202   /* attributes when they are attached to vertical or horizontal nets */
00203   int add_attribute_offset;
00204 
00205   int mousepan_gain;      /* Controls the gain of the mouse pan */
00206   int keyboardpan_gain;   /* Controls the gain of the keyboard pan */
00207   int select_slack_pixels; /* Number of pixels around an object we can still select it with */
00208   int zoom_gain;          /* Percentage increase in size for a zoom-in operation */
00209   int scrollpan_steps;    /* Number of scroll pan events required to traverse the viewed area */
00210 
00211   char *print_command;    /* The command to send postscript to when printing */
00212 
00213   SCM smob;               /* The Scheme representation of this window */
00214 };
00215 
00216 
00217 struct st_stretch
00218 {
00219   OBJECT *object;
00220   int whichone;
00221 };
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines