33 static void render (GtkWidget *wi, cairo_t* cr) {
34 double rect_width = wi->allocation.width;
35 double rect_height = wi->allocation.height;
36 double x0 = wi->allocation.x;
37 double y0 = wi->allocation.y;
39 cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 0.0f);
40 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
43 string path = string(GX_PIXMAPS_DIR) +
"/gx_splash.png";
44 cairo_surface_t *image = cairo_image_surface_create_from_png(path.c_str());
45 cairo_rectangle(cr, x0, y0, rect_width, rect_height);
46 cairo_set_source_surface(cr, image, 0, 0);
48 cairo_surface_destroy (image);
54 gint rect_width = wi->allocation.width;
55 gint rect_height = wi->allocation.height;
58 static GdkBitmap* ShapeBitmap = NULL;
59 static cairo_t* cr = NULL;
61 ShapeBitmap = gdk_pixmap_new(NULL, rect_width, rect_height, 1);
63 cr = gdk_cairo_create (ShapeBitmap);
64 if (cairo_status (cr) == CAIRO_STATUS_SUCCESS) {
68 gtk_widget_shape_combine_mask (wi, NULL, 0, 0);
70 gtk_widget_shape_combine_mask (wi, ShapeBitmap, 0, 0);
72 g_object_unref(ShapeBitmap);
76 gboolean
splash_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
79 cr = gdk_cairo_create (wi->window);
80 if (!cr)
return FALSE;
82 static bool ms =
true;
96 cr = gdk_cairo_create(wi->window);
98 region = gdk_region_rectangle (&wi->allocation);
99 gdk_region_intersect (region, ev->region);
100 gdk_cairo_region (cr, region);
103 double x0 = wi->allocation.x+2;
104 double y0 = wi->allocation.y+2;
105 double rect_width = wi->allocation.width-2;
106 double rect_height = wi->allocation.height-2;
108 cairo_rectangle (cr, x0,y0,rect_width,rect_height+1);
109 cairo_set_source_rgb (cr, 0, 0, 0);
112 cairo_pattern_t*pat =
113 cairo_pattern_create_linear (0, y0, 0, y0+rect_height);
115 cairo_pattern_add_color_stop_rgba (pat, 0, 0.2, 0.2, 0.3, 0.6);
116 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
117 cairo_set_source (cr, pat);
118 cairo_rectangle (cr, x0+1,y0+1,rect_width-2,rect_height-1);
121 cairo_pattern_destroy (pat);
123 gdk_region_destroy (region);
131 cairo_pattern_t *pat;
134 cr = gdk_cairo_create(wi->window);
136 region = gdk_region_rectangle (&wi->allocation);
137 gdk_region_intersect (region, ev->region);
138 gdk_cairo_region (cr, region);
141 double x0 = wi->allocation.x+5;
142 double y0 = wi->allocation.y+5;
143 double rect_width = wi->allocation.width-10;
144 double rect_height = wi->allocation.height-10;
150 cairo_move_to (cr, x0, y0 + radius);
151 cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
152 cairo_line_to (cr, x1 - radius, y0);
153 cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
154 cairo_line_to (cr, x1 , y1 - radius);
155 cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
156 cairo_line_to (cr, x0 + radius, y1);
157 cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
158 cairo_close_path (cr);
160 pat = cairo_pattern_create_linear (0, y0, 0, y1);
161 cairo_pattern_add_color_stop_rgba (pat, 1, 0., 0., 0., 0.8);
162 cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 0.4);
163 cairo_set_source (cr, pat);
164 cairo_fill_preserve (cr);
166 cairo_set_source_rgba (cr, 0, 0, 0, 0.8);
167 cairo_set_line_width (cr, 9.0);
170 cairo_move_to (cr, x0, y0 + radius);
171 cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
172 cairo_line_to (cr, x1 - radius, y0);
173 cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
174 cairo_line_to (cr, x1 , y1 - radius);
175 cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
176 cairo_line_to (cr, x0 + radius, y1);
177 cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
178 cairo_close_path (cr);
180 cairo_set_source_rgb (cr, 0.2, 0.2, 0.2);
181 cairo_set_line_width (cr, 1.0);
184 cairo_pattern_destroy (pat);
186 gdk_region_destroy (region);
195 cr = gdk_cairo_create(wi->window);
197 region = gdk_region_rectangle (&wi->allocation);
198 gdk_region_intersect (region, ev->region);
199 gdk_cairo_region (cr, region);
202 double x0 = wi->allocation.x+2;
203 double y0 = wi->allocation.y+2;
204 double rect_width = wi->allocation.width-4;
205 double rect_height = wi->allocation.height-4;
207 cairo_rectangle (cr, x0-1,y0-1,rect_width+2,rect_height+2);
208 cairo_set_source_rgb (cr, 0, 0, 0);
209 cairo_set_line_width(cr, 2.0);
212 cairo_pattern_t*pat = cairo_pattern_create_linear (x0, y0+50,x0, y0);
213 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
215 cairo_pattern_add_color_stop_rgba (pat, 0, 0.5, 0.02, 0.03, 0.6);
216 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.1, 0.6);
218 cairo_set_source (cr, pat);
219 cairo_rectangle (cr, x0+2,y0+2,rect_width-4,rect_height-4);
222 cairo_rectangle (cr, x0+8,y0+31,rect_width-16,rect_height-75);
223 cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
224 cairo_set_line_width(cr, 2.0);
225 cairo_stroke_preserve(cr);
226 pat = cairo_pattern_create_linear (x0, y0+50,x0, y0);
227 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
228 cairo_pattern_add_color_stop_rgba (pat, 0, 0.8, 0.8, 0.8, 0.6);
229 cairo_pattern_add_color_stop_rgba (pat, 1, 0.3, 0.3, 0.3, 0.6);
230 cairo_set_source (cr, pat);
233 cairo_set_source_rgb(cr, 0.2, 0.2, 0.2);
234 cairo_set_line_width(cr, 2.0);
235 cairo_move_to(cr,x0+rect_width-3, y0+3);
236 cairo_line_to(cr, x0+rect_width-3, y0+rect_height-2);
237 cairo_line_to(cr, x0+2, y0+rect_height-2);
240 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
241 cairo_set_line_width(cr, 2.0);
242 cairo_move_to(cr,x0+3, y0+rect_height-1);
243 cairo_line_to(cr, x0+3, y0+3);
244 cairo_line_to(cr, x0+rect_width-3, y0+3);
247 cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
248 cairo_set_line_width(cr, 1.5);
249 cairo_arc (cr, x0+7, y0+7, 1.5, 0, 2*
M_PI);
250 cairo_move_to(cr,x0+rect_width-8, y0+7);
251 cairo_arc (cr, x0+rect_width-7, y0+7, 1.5, 0, 2*
M_PI);
252 cairo_move_to(cr,x0+rect_width-7, y0+rect_height-6);
253 cairo_arc (cr, x0+rect_width-7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
254 cairo_move_to(cr,x0+7, y0+rect_height-6);
255 cairo_arc (cr, x0+7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
256 cairo_stroke_preserve(cr);
257 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
260 cairo_pattern_destroy (pat);
262 gdk_region_destroy (region);
271 cr = gdk_cairo_create(wi->window);
273 region = gdk_region_rectangle (&wi->allocation);
274 gdk_region_intersect (region, ev->region);
275 gdk_cairo_region (cr, region);
278 double x0 = wi->allocation.x+1;
279 double y0 = wi->allocation.y+1;
280 double rect_width = wi->allocation.width-2;
281 double rect_height = wi->allocation.height-2;
283 cairo_rectangle (cr, x0-1,y0-1,rect_width+2,rect_height+2);
284 cairo_set_source_rgb (cr, 0, 0, 0);
285 cairo_set_line_width(cr, 2.0);
288 cairo_pattern_t*pat = cairo_pattern_create_linear (x0, y0+rect_height/2,x0, y0);
289 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
291 cairo_pattern_add_color_stop_rgba (pat, 0, 0.1, 0.1, 0.2, 0.6);
292 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
294 cairo_set_source (cr, pat);
295 cairo_rectangle (cr, x0+2,y0+2,rect_width-4,rect_height-4);
298 cairo_rectangle (cr, x0+8,y0+31,rect_width-16,rect_height-75);
299 cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
300 cairo_set_line_width(cr, 2.0);
301 cairo_stroke_preserve(cr);
302 pat = cairo_pattern_create_linear (x0+8, y0+rect_height/2-37,x0, y0);
303 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
304 cairo_pattern_add_color_stop_rgba (pat, 0, 0.2, 0.2, 0.3, 0.6);
305 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
306 cairo_set_source (cr, pat);
309 cairo_set_source_rgb(cr, 0.2, 0.2, 0.2);
310 cairo_set_line_width(cr, 2.0);
311 cairo_move_to(cr,x0+rect_width-3, y0+3);
312 cairo_line_to(cr, x0+rect_width-3, y0+rect_height-2);
313 cairo_line_to(cr, x0+2, y0+rect_height-2);
316 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
317 cairo_set_line_width(cr, 2.0);
318 cairo_move_to(cr,x0+3, y0+rect_height-1);
319 cairo_line_to(cr, x0+3, y0+3);
320 cairo_line_to(cr, x0+rect_width-3, y0+3);
323 cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
324 cairo_set_line_width(cr, 1.5);
325 cairo_arc (cr, x0+7, y0+7, 1.5, 0, 2*
M_PI);
326 cairo_move_to(cr,x0+rect_width-8, y0+7);
327 cairo_arc (cr, x0+rect_width-7, y0+7, 1.5, 0, 2*
M_PI);
328 cairo_move_to(cr,x0+rect_width-7, y0+rect_height-6);
329 cairo_arc (cr, x0+rect_width-7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
330 cairo_move_to(cr,x0+7, y0+rect_height-6);
331 cairo_arc (cr, x0+7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
332 cairo_stroke_preserve(cr);
333 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
336 cairo_pattern_destroy (pat);
338 gdk_region_destroy (region);
void make_transparency(GtkWidget *wi)
gboolean conv_widget_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
gboolean error_box_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
gboolean splash_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
gboolean rectangle_skin_color_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
gboolean start_box_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)