27 cairo_move_to (cr, x, (y + height)/2);
28 cairo_curve_to (cr, x ,y, x, y, (x + width)/2, y);
29 cairo_curve_to (cr, width, y, width, y, width, (y + height)/2);
30 cairo_curve_to (cr, width, height, width, height, (width + x)/2, height);
31 cairo_curve_to (cr, x, height, x, height, x, (y + height)/2);
32 cairo_close_path (cr);
38 cairo_pattern_t *pat = cairo_pattern_create_linear (2, 2, 2, height);
40 cairo_pattern_add_color_stop_rgba(pat, 0.5, 0.0, 0.0, 0.0, 0.0);
42 cairo_set_source(w->
crb, pat);
43 cairo_pattern_destroy (pat);
49 cairo_pattern_t *pat = cairo_pattern_create_linear (2, 2, 2, height);
50 cairo_pattern_add_color_stop_rgba(pat, 0.0, 0.0, 0.0, 0.0, 0.0);
52 cairo_pattern_add_color_stop_rgba(pat, 1.0, 0.0, 0.0, 0.0, 0.0);
53 cairo_set_source(w->
crb, pat);
54 cairo_pattern_destroy (pat);
58 int width = cairo_xlib_surface_get_width(w->
image);
59 int height = cairo_xlib_surface_get_height(w->
image);
60 double half_width = (width/height >=2) ? width*0.5 : width;
61 double x = (double)width_t/(
double)(half_width);
62 double y = (double)height_t/(
double)height;
63 double x1 = (double)height/(
double)height_t;
64 double y1 = (double)(half_width)/(double)width_t;
65 double off_set = offset*x1;
67 int findex = (int)(((width/height)-1) * buttonstate) * (width/height >=2);
68 cairo_scale(w->
crb, x,y);
69 cairo_set_source_surface (w->
crb, w->
image, -height*findex+off_set, off_set);
70 cairo_rectangle(w->
crb,0, 0, height, height);
72 cairo_scale(w->
crb, x1,y1);
76 int width = cairo_xlib_surface_get_width(w->
image);
77 int height = cairo_xlib_surface_get_height(w->
image);
78 double x = (double)width_t/(
double)height;
79 double y = (double)height/(
double)width_t;
81 int findex = (int)(((width/height)-1) * buttonstate);
82 cairo_scale(w->
crb, x,x);
83 cairo_set_source_surface (w->
crb, w->
image, -height*findex, 0);
84 cairo_rectangle(w->
crb,0, 0, height, height);
86 cairo_scale(w->
crb, y,y);
87 cairo_text_extents_t extents;
92 }
else if(w->
state==1) {
94 }
else if(w->
state==2) {
96 }
else if(w->
state==3) {
104 cairo_move_to (w->
crb, (width_t*0.5)-(extents.width/2), height_t-(extents.height/4));
107 cairo_text_extents(w->
crb,w->
label , &extents);
108 cairo_move_to (w->
crb, (width_t*0.5)-(extents.width/2), height_t-(extents.height/4));
111 cairo_new_path (w->
crb);
117 XWindowAttributes attrs;
118 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
119 int width = attrs.width-2;
120 int height = attrs.height-2;
121 if (attrs.map_state != IsViewable)
return;
122 if(strlen(w->
label)) {
139 cairo_set_line_width(w->
crb, 1.0);
141 cairo_fill_preserve(w->
crb);
143 }
else if(w->
state==1) {
145 cairo_fill_preserve(w->
crb);
146 cairo_set_line_width(w->
crb, 1.5);
148 }
else if(w->
state==2) {
150 cairo_fill_preserve(w->
crb);
151 cairo_set_line_width(w->
crb, 1.0);
153 }
else if(w->
state==3) {
155 cairo_fill_preserve(w->
crb);
156 cairo_set_line_width(w->
crb, 1.0);
159 cairo_stroke(w->
crb);
163 cairo_stroke(w->
crb);
165 cairo_stroke(w->
crb);
166 }
else if (w->
state==3) {
168 cairo_stroke(w->
crb);
178 for (src = dst = str; *src !=
'\0'; src++) {
194 XWindowAttributes attrs;
195 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
196 int width = attrs.width-2;
197 int height = attrs.height-2;
198 if (attrs.map_state != IsViewable)
return;
204 }
else if(w->
state==1) {
206 }
else if(w->
state==2) {
208 }
else if(w->
state==3) {
212 if(strlen(w->
label)) {
219 cairo_text_extents_t extents;
223 if (strstr(w->
label,
"_")) {
224 cairo_text_extents(w->
crb,
"--", &extents);
225 double underline = extents.width;
229 cairo_move_to (w->
crb, (width-extents.width)*0.5 +offset, (height+extents.height)*0.5 +offset);
231 cairo_set_line_width(w->
crb, 1.0);
232 cairo_move_to (w->
crb, (width-extents.width)*0.5 +offset + (pos * underline), (height+extents.height)*0.55 +offset);
233 cairo_line_to(w->
crb,(width-extents.width)*0.5 +offset + ((pos+1) * underline), (height+extents.height)*0.55 +offset);
234 cairo_stroke(w->
crb);
236 cairo_text_extents(w->
crb,w->
label , &extents);
237 cairo_move_to (w->
crb, (width-extents.width)*0.5 +offset, (height+extents.height)*0.5 +offset);
246 XWindowAttributes attrs;
247 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
248 int width = attrs.width-2;
249 int height = attrs.height-2;
250 if (attrs.map_state != IsViewable)
return;
255 cairo_text_extents_t extents;
258 }
else if(w->
state==1) {
260 }
else if(w->
state==2) {
262 }
else if(w->
state==3) {
273 cairo_text_extents(w->
crb,w->
label , &extents);
276 cairo_text_extents(w->
crb,w->
label , &extents);
279 cairo_move_to (w->
crb, (width-extents.width)*0.5 +offset, (height+extents.height)*0.5 +offset);
281 cairo_new_path (w->
crb);
288 XWindowAttributes attrs;
289 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
290 int width = attrs.width-2;
291 int height = attrs.height-2;
292 if (attrs.map_state != IsViewable)
return;
298 }
else if(w->
state==1) {
300 }
else if(w->
state==2) {
302 }
else if(w->
state==3) {
313 XWindowAttributes attrs;
314 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
315 int width = attrs.width-2;
316 int height = attrs.height-2;
317 if (attrs.map_state != IsViewable)
return;
332 cairo_set_line_width(w->
crb, 2.5);
333 cairo_move_to(w->
crb, wa+offset, h+offset);
334 cairo_line_to(w->
crb, wa1+offset, h1+offset);
335 cairo_line_to(w->
crb, wa2+offset, h+offset);
336 cairo_stroke(w->
crb);
339 cairo_new_path (w->
crb);
346 XWindowAttributes attrs;
347 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
348 int height = attrs.height-2;
349 if (attrs.map_state != IsViewable)
return;
360 int wa1 = height/2.2;
362 int wa2 = height/2.8;
364 cairo_set_line_width(w->
crb, 2.5);
365 cairo_move_to(w->
crb, wa+offset, h+offset);
366 cairo_line_to(w->
crb, wa1+offset, h1+offset);
367 cairo_line_to(w->
crb, wa2+offset, h+offset);
368 cairo_stroke(w->
crb);
371 cairo_new_path (w->
crb);
373 cairo_text_extents_t extents;
376 cairo_text_extents(w->
crb,w->
label , &extents);
377 cairo_move_to (w->
crb, height+5 , (height+extents.height)*0.5 );
379 cairo_new_path (w->
crb);
413 XButtonEvent *xbutton = (XButtonEvent*)button_;
416 if (xbutton->button == Button1) value = value ?
418 if (xbutton->button == Button4) value = w->
adj->
max_value;
419 if (xbutton->button == Button5) value = w->
adj->
min_value;