00001 00025 #ifndef __PREVIEW_INCLUDED__ 00026 #define __PREVIEW_INCLUDED__ 00027 00028 00029 GdkPixmap *pixmap = NULL; 00036 typedef struct preview_arc 00037 { 00038 GdkDrawable *drawable; 00040 GdkGC *gc; 00042 gboolean filled; 00044 gint x; 00046 gint y; 00048 gint width; 00050 gint height; 00052 gint angle1; 00055 gint angle2; 00058 } *preview_arc; 00059 00060 00064 typedef struct preview_line 00065 { 00066 GdkDrawable *drawable; 00068 GdkGC *gc; 00070 gint x1; 00072 gint y1; 00074 gint x2; 00076 gint y2; 00078 } *preview_line; 00079 00080 00084 typedef struct preview_polygon 00085 { 00086 GdkDrawable *drawable; 00088 GdkGC *gc; 00090 gboolean filled; 00092 GdkPoint *points; 00095 gint npoints; 00097 } *preview_polygon; 00098 00099 00103 typedef struct preview_rectangle 00104 { 00105 GdkDrawable *drawable; 00107 GdkGC *gc; 00109 gboolean filled; 00113 gint x; 00115 gint y; 00117 gint width; 00119 gint height; 00121 } *preview_rectangle; 00122 00123 00124 static void preview_close_cb (GtkWidget * widget, GtkWidget *preview_window); 00125 static gboolean preview_configure_event (GtkWidget *widget, GdkEventConfigure *event); 00126 void preview_delete_event (GtkWidget *widget, GdkEvent *event); 00127 int preview_set_fg_color (GdkGC *gc, const char *color_name); 00128 int preview_set_fill_mode (GdkGC *gc, GdkFill fill_mode); 00129 int preview_set_line_cap (GdkGC *gc, GdkCapStyle line_cap); 00130 int preview_set_line_style (GdkGC *gc, GdkLineStyle line_style); 00131 int preview_set_line_width (GdkGC *gc, gint line_width); 00132 int preview_use_gc (GdkDrawable *drawable, GdkGC *gc, const char * color_name, gint line_width, GdkCapStyle line_cap, GdkLineStyle line_style, GdkFill fill_mode); 00133 static void preview_draw_arc (GtkWidget *widget, preview_arc arc); 00134 static void preview_draw_background (GtkWidget *widget, gdouble x, gdouble y); 00135 static void preview_draw_line (GtkWidget *widget, preview_line line); 00136 static void preview_draw_pad (GtkWidget *widget ); 00137 static void preview_draw_pin (GtkWidget *widget ); 00138 static void preview_draw_polygon (GtkWidget *widget, preview_polygon polygon); 00139 static void preview_draw_rectangle (GtkWidget *widget, preview_rectangle rectangle); 00140 static gboolean preview_expose_event (GtkWidget *widget, GdkEventExpose *event); 00141 int preview_create_window (gchar *footprint_name, gint width, gint height); 00142 00143 00144 #endif /* __PREVIEW_INCLUDED__ */ 00145 00146 00147 /* EOF */