33 static void render (GtkWidget *wi, cairo_t* cr) {
34 GtkAllocation allocation;
35 gtk_widget_get_allocation(wi, &allocation);
36 double rect_width = allocation.width;
37 double rect_height = allocation.height;
38 double x0 = allocation.x;
39 double y0 = allocation.y;
41 cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 0.0f);
42 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
45 string path = string(GX_PIXMAPS_DIR) +
"/gx_splash.png";
46 cairo_surface_t *image = cairo_image_surface_create_from_png(path.c_str());
47 cairo_rectangle(cr, x0, y0, rect_width, rect_height);
48 cairo_set_source_surface(cr, image, 0, 0);
50 cairo_surface_destroy (image);
55 GtkAllocation allocation;
56 gtk_widget_get_allocation(wi, &allocation);
58 gint rect_width = allocation.width;
59 gint rect_height = allocation.height;
62 static GdkBitmap* ShapeBitmap = NULL;
63 static cairo_t* cr = NULL;
65 ShapeBitmap = gdk_pixmap_new(NULL, rect_width, rect_height, 1);
67 cr = gdk_cairo_create (ShapeBitmap);
68 if (cairo_status (cr) == CAIRO_STATUS_SUCCESS) {
72 gtk_widget_shape_combine_mask (wi, NULL, 0, 0);
74 gtk_widget_shape_combine_mask (wi, ShapeBitmap, 0, 0);
76 g_object_unref(ShapeBitmap);
80 gboolean
splash_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
83 cr = gdk_cairo_create (gtk_widget_get_window(wi));
84 if (!cr)
return FALSE;
86 static bool ms =
true;
100 cr = gdk_cairo_create(gtk_widget_get_window(wi));
101 GtkAllocation allocation;
102 gtk_widget_get_allocation(wi, &allocation);
104 region = gdk_region_rectangle (&allocation);
105 gdk_region_intersect (region, ev->region);
106 gdk_cairo_region (cr, region);
109 double x0 = allocation.x+2;
110 double y0 = allocation.y+2;
111 double rect_width = allocation.width-2;
112 double rect_height = allocation.height-2;
114 cairo_rectangle (cr, x0,y0,rect_width,rect_height+1);
115 cairo_set_source_rgb (cr, 0, 0, 0);
118 cairo_pattern_t*pat =
119 cairo_pattern_create_linear (0, y0, 0, y0+rect_height);
121 cairo_pattern_add_color_stop_rgba (pat, 0, 0.2, 0.2, 0.3, 0.6);
122 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
123 cairo_set_source (cr, pat);
124 cairo_rectangle (cr, x0+1,y0+1,rect_width-2,rect_height-1);
127 cairo_pattern_destroy (pat);
129 gdk_region_destroy (region);
137 cairo_pattern_t *pat;
140 cr = gdk_cairo_create(gtk_widget_get_window(wi));
141 GtkAllocation allocation;
142 gtk_widget_get_allocation(wi, &allocation);
144 region = gdk_region_rectangle (&allocation);
145 gdk_region_intersect (region, ev->region);
146 gdk_cairo_region (cr, region);
149 double x0 = allocation.x+5;
150 double y0 = allocation.y+5;
151 double rect_width = allocation.width-10;
152 double rect_height = allocation.height-10;
158 cairo_move_to (cr, x0, y0 + radius);
159 cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
160 cairo_line_to (cr, x1 - radius, y0);
161 cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
162 cairo_line_to (cr, x1 , y1 - radius);
163 cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
164 cairo_line_to (cr, x0 + radius, y1);
165 cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
166 cairo_close_path (cr);
168 pat = cairo_pattern_create_linear (0, y0, 0, y1);
169 cairo_pattern_add_color_stop_rgba (pat, 1, 0., 0., 0., 0.8);
170 cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 0.4);
171 cairo_set_source (cr, pat);
172 cairo_fill_preserve (cr);
174 cairo_set_source_rgba (cr, 0, 0, 0, 0.8);
175 cairo_set_line_width (cr, 9.0);
178 cairo_move_to (cr, x0, y0 + radius);
179 cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
180 cairo_line_to (cr, x1 - radius, y0);
181 cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
182 cairo_line_to (cr, x1 , y1 - radius);
183 cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
184 cairo_line_to (cr, x0 + radius, y1);
185 cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
186 cairo_close_path (cr);
188 cairo_set_source_rgb (cr, 0.2, 0.2, 0.2);
189 cairo_set_line_width (cr, 1.0);
192 cairo_pattern_destroy (pat);
194 gdk_region_destroy (region);
203 cr = gdk_cairo_create(gtk_widget_get_window(wi));
204 GtkAllocation allocation;
205 gtk_widget_get_allocation(wi, &allocation);
207 region = gdk_region_rectangle (&allocation);
208 gdk_region_intersect (region, ev->region);
209 gdk_cairo_region (cr, region);
212 double x0 = allocation.x;
213 double y0 = allocation.y;
214 double rect_width = allocation.width;
215 double rect_height = allocation.height;
217 cairo_rectangle (cr, x0,y0,rect_width,rect_height);
218 cairo_set_source_rgb (cr, 0.22, 0.22, 0.22);
223 gdk_region_destroy (region);
232 cr = gdk_cairo_create(gtk_widget_get_window(wi));
233 GtkAllocation allocation;
234 gtk_widget_get_allocation(wi, &allocation);
236 region = gdk_region_rectangle (&allocation);
237 gdk_region_intersect (region, ev->region);
238 gdk_cairo_region (cr, region);
241 double x0 = allocation.x+1;
242 double y0 = allocation.y+1;
243 double rect_width = allocation.width-2;
244 double rect_height = allocation.height-2;
246 cairo_rectangle (cr, x0-1,y0-1,rect_width+2,rect_height+2);
247 cairo_set_source_rgb (cr, 0, 0, 0);
248 cairo_set_line_width(cr, 2.0);
251 cairo_pattern_t*pat = cairo_pattern_create_linear (x0, y0+rect_height/2,x0, y0);
252 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
254 cairo_pattern_add_color_stop_rgba (pat, 0, 0.1, 0.1, 0.2, 0.6);
255 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
257 cairo_set_source (cr, pat);
258 cairo_rectangle (cr, x0+2,y0+2,rect_width-4,rect_height-4);
261 cairo_rectangle (cr, x0+8,y0+31,rect_width-16,rect_height-75);
262 cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
263 cairo_set_line_width(cr, 2.0);
264 cairo_stroke_preserve(cr);
265 pat = cairo_pattern_create_linear (x0+8, y0+rect_height/2-37,x0, y0);
266 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
267 cairo_pattern_add_color_stop_rgba (pat, 0, 0.2, 0.2, 0.3, 0.6);
268 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
269 cairo_set_source (cr, pat);
272 cairo_set_source_rgb(cr, 0.2, 0.2, 0.2);
273 cairo_set_line_width(cr, 2.0);
274 cairo_move_to(cr,x0+rect_width-3, y0+3);
275 cairo_line_to(cr, x0+rect_width-3, y0+rect_height-2);
276 cairo_line_to(cr, x0+2, y0+rect_height-2);
279 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
280 cairo_set_line_width(cr, 2.0);
281 cairo_move_to(cr,x0+3, y0+rect_height-1);
282 cairo_line_to(cr, x0+3, y0+3);
283 cairo_line_to(cr, x0+rect_width-3, y0+3);
286 cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
287 cairo_set_line_width(cr, 1.5);
288 cairo_arc (cr, x0+7, y0+7, 1.5, 0, 2*
M_PI);
289 cairo_move_to(cr,x0+rect_width-8, y0+7);
290 cairo_arc (cr, x0+rect_width-7, y0+7, 1.5, 0, 2*
M_PI);
291 cairo_move_to(cr,x0+rect_width-7, y0+rect_height-6);
292 cairo_arc (cr, x0+rect_width-7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
293 cairo_move_to(cr,x0+7, y0+rect_height-6);
294 cairo_arc (cr, x0+7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
295 cairo_stroke_preserve(cr);
296 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
299 cairo_pattern_destroy (pat);
301 gdk_region_destroy (region);