1 #ifndef __FRACTALEXPLORER_H__ 2 #define __FRACTALEXPLORER_H__ 3 4 5 /********************************************************************** 6 Magic numbers 7 *********************************************************************/ 8 9 #define PREVIEW_SIZE 256 10 #define SCALE_WIDTH 200 11 #define ENTRY_WIDTH 60 12 #define MAX_LOAD_LINE 256 13 #define GR_WIDTH 325 14 15 #define MAXNCOLORS 8192 16 #define MAXSTRLEN 256 17 18 #define PLUG_IN_PROC "plug-in-fractalexplorer" 19 #define PLUG_IN_BINARY "fractal-explorer" 20 #define PLUG_IN_ROLE "gimp-fractal-explorer" 21 22 #define FRACTAL_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting@mygale.org>\n" 23 #define fractalexplorer_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting@mygale.org>\n" 24 25 enum 26 { 27 SINUS, 28 COSINUS, 29 NONE 30 }; 31 32 enum 33 { 34 TYPE_MANDELBROT, 35 TYPE_JULIA, 36 TYPE_BARNSLEY_1, 37 TYPE_BARNSLEY_2, 38 TYPE_BARNSLEY_3, 39 TYPE_SPIDER, 40 TYPE_MAN_O_WAR, 41 TYPE_LAMBDA, 42 TYPE_SIERPINSKI, 43 NUM_TYPES 44 }; 45 46 /********************************************************************** 47 Types 48 *********************************************************************/ 49 50 typedef struct 51 { 52 gint fractaltype; 53 gdouble xmin; 54 gdouble xmax; 55 gdouble ymin; 56 gdouble ymax; 57 gdouble iter; 58 gdouble cx; 59 gdouble cy; 60 gint colormode; 61 gdouble redstretch; 62 gdouble greenstretch; 63 gdouble bluestretch; 64 gint redmode; 65 gint greenmode; 66 gint bluemode; 67 gboolean redinvert; 68 gboolean greeninvert; 69 gboolean blueinvert; 70 gboolean alwayspreview; 71 gint ncolors; 72 gboolean gradinvert; 73 gboolean useloglog; 74 } explorer_vals_t; 75 76 typedef struct 77 { 78 GtkWidget *preview; 79 guchar *wimage; 80 gint run; 81 } explorer_interface_t; 82 83 /* typedef gint colorvalue[3]; */ 84 typedef struct 85 { 86 guchar r, g, b; 87 } gucharRGB; 88 89 typedef gucharRGB clrmap[MAXNCOLORS]; 90 91 typedef guchar vlumap[MAXNCOLORS]; 92 93 typedef struct 94 { 95 GtkWidget *text; 96 GtkAdjustment *data; 97 } scaledata; 98 99 typedef struct _DialogElements DialogElements; 100 101 struct _DialogElements 102 { 103 GtkWidget *type[NUM_TYPES]; 104 GtkObject *xmin; 105 GtkObject *xmax; 106 GtkObject *ymin; 107 GtkObject *ymax; 108 GtkObject *iter; 109 GtkObject *cx; 110 GtkObject *cy; 111 112 GtkObject *ncol; 113 GtkWidget *useloglog; 114 115 GtkObject *red; 116 GtkObject *green; 117 GtkObject *blue; 118 119 GtkWidget *redmode[3]; 120 GtkWidget *redinvert; 121 122 GtkWidget *greenmode[3]; 123 GtkWidget *greeninvert; 124 125 GtkWidget *bluemode[3]; 126 GtkWidget *blueinvert; 127 128 GtkWidget *colormode[2]; 129 }; 130 131 132 typedef struct DFigObj 133 { 134 gchar *name; /* Trailing name of file */ 135 gchar *filename; /* Filename itself */ 136 gchar *draw_name; /* Name of the drawing */ 137 explorer_vals_t opts; /* Options enforced when fig saved */ 138 GtkWidget *list_item; 139 GtkWidget *label_widget; 140 GtkWidget *pixmap_widget; 141 gint obj_status; 142 } fractalexplorerOBJ; 143 144 145 typedef struct GigObj 146 { 147 gchar *name; /* Trailing name of file */ 148 gchar *filename; /* Filename itself */ 149 gchar *draw_name; /* Name of the drawing */ 150 gint typus; 151 GtkWidget *list_item; 152 GtkWidget *label_widget; 153 GtkWidget *pixmap_widget; 154 gint obj_status; 155 } gradientOBJ; 156 157 typedef struct _fractalexplorerListOptions 158 { 159 GtkWidget *query_box; 160 GtkWidget *name_entry; 161 GtkWidget *list_entry; 162 fractalexplorerOBJ *obj; 163 gint created; 164 } fractalexplorerListOptions; 165 166 /* States of the object */ 167 #define fractalexplorer_OK 0x0 168 #define fractalexplorer_MODIFIED 0x1 169 170 #define gradient_GRADIENTEDITOR 0x2 171 172 extern fractalexplorerOBJ *current_obj; 173 174 GtkWidget * add_objects_list (void); 175 176 /********************************************************************** 177 Global variables 178 *********************************************************************/ 179 180 extern gdouble xmin; 181 extern gdouble xmax; 182 extern gdouble ymin; 183 extern gdouble ymax; 184 extern gdouble xbild; 185 extern gdouble ybild; 186 extern gdouble xdiff; 187 extern gdouble ydiff; 188 extern gint sel_x1, 189 sel_y1, 190 sel_x2, 191 sel_y2; 192 extern gint preview_width, 193 preview_height; 194 extern gdouble *gg; 195 extern int line_no; 196 extern gchar *filename; 197 extern clrmap colormap; 198 extern gchar *fractalexplorer_path; 199 200 201 extern explorer_interface_t wint; 202 203 extern explorer_vals_t wvals; 204 extern GimpDrawable *drawable; 205 206 207 /********************************************************************** 208 Global functions 209 *********************************************************************/ 210 211 void explorer_render_row (const guchar *src_row, 212 guchar *dest_row, 213 gint row, 214 gint row_width, 215 gint bpp); 216 #endif 217