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;
203 double y0 = wi->allocation.y;
204 double rect_width = wi->allocation.width;
205 double rect_height = wi->allocation.height;
207 cairo_rectangle (cr, x0,y0,rect_width,rect_height);
208 cairo_set_source_rgb (cr, 0.22, 0.22, 0.22);
213 gdk_region_destroy (region);
222 cr = gdk_cairo_create(wi->window);
224 region = gdk_region_rectangle (&wi->allocation);
225 gdk_region_intersect (region, ev->region);
226 gdk_cairo_region (cr, region);
229 double x0 = wi->allocation.x+1;
230 double y0 = wi->allocation.y+1;
231 double rect_width = wi->allocation.width-2;
232 double rect_height = wi->allocation.height-2;
234 cairo_rectangle (cr, x0-1,y0-1,rect_width+2,rect_height+2);
235 cairo_set_source_rgb (cr, 0, 0, 0);
236 cairo_set_line_width(cr, 2.0);
239 cairo_pattern_t*pat = cairo_pattern_create_linear (x0, y0+rect_height/2,x0, y0);
240 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
242 cairo_pattern_add_color_stop_rgba (pat, 0, 0.1, 0.1, 0.2, 0.6);
243 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
245 cairo_set_source (cr, pat);
246 cairo_rectangle (cr, x0+2,y0+2,rect_width-4,rect_height-4);
249 cairo_rectangle (cr, x0+8,y0+31,rect_width-16,rect_height-75);
250 cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
251 cairo_set_line_width(cr, 2.0);
252 cairo_stroke_preserve(cr);
253 pat = cairo_pattern_create_linear (x0+8, y0+rect_height/2-37,x0, y0);
254 cairo_pattern_set_extend(pat, CAIRO_EXTEND_REFLECT);
255 cairo_pattern_add_color_stop_rgba (pat, 0, 0.2, 0.2, 0.3, 0.6);
256 cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 0.6);
257 cairo_set_source (cr, pat);
260 cairo_set_source_rgb(cr, 0.2, 0.2, 0.2);
261 cairo_set_line_width(cr, 2.0);
262 cairo_move_to(cr,x0+rect_width-3, y0+3);
263 cairo_line_to(cr, x0+rect_width-3, y0+rect_height-2);
264 cairo_line_to(cr, x0+2, y0+rect_height-2);
267 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
268 cairo_set_line_width(cr, 2.0);
269 cairo_move_to(cr,x0+3, y0+rect_height-1);
270 cairo_line_to(cr, x0+3, y0+3);
271 cairo_line_to(cr, x0+rect_width-3, y0+3);
274 cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
275 cairo_set_line_width(cr, 1.5);
276 cairo_arc (cr, x0+7, y0+7, 1.5, 0, 2*
M_PI);
277 cairo_move_to(cr,x0+rect_width-8, y0+7);
278 cairo_arc (cr, x0+rect_width-7, y0+7, 1.5, 0, 2*
M_PI);
279 cairo_move_to(cr,x0+rect_width-7, y0+rect_height-6);
280 cairo_arc (cr, x0+rect_width-7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
281 cairo_move_to(cr,x0+7, y0+rect_height-6);
282 cairo_arc (cr, x0+7, y0+rect_height-6, 1.5, 0, 2*
M_PI);
283 cairo_stroke_preserve(cr);
284 cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
287 cairo_pattern_destroy (pat);
289 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)