Lines Matching refs:button

32 	gint (*status_get_func)(ButtonData *button, const gchar *key, gpointer data);
33 void (*button_click_func)(ButtonData *button, const gchar *key, gpointer data);
34 void (*button_press_func)(ButtonData *button, const gchar *key, gpointer data);
35 void (*button_release_func)(ButtonData *button, const gchar *key, gpointer data);
54 ButtonData *button; in button_new() local
67 button = g_new0(ButtonData, 1); in button_new()
69 button->overlay = util_size_pixbuf(pb, TRUE); in button_new()
70 button->has_light = light; in button_new()
71 button->has_prelight = prelight; in button_new()
72 button->pushed = FALSE; in button_new()
73 button->lit = FALSE; in button_new()
74 button->prelit = FALSE; in button_new()
75 button->active = FALSE; in button_new()
76 button->x = x; in button_new()
77 button->y = y; in button_new()
79button->width = gdk_pixbuf_get_width(button->overlay) / (2 + (light * prelight) + prelight + (2 * … in button_new()
80 button->height = gdk_pixbuf_get_height(button->overlay); in button_new()
87 if (button->width == gdk_pixbuf_get_width(clip_pb) && in button_new()
88 button->height == gdk_pixbuf_get_height(clip_pb) ) in button_new()
90 button->clip_mask = TRUE; in button_new()
96 button->clip_mask = FALSE; in button_new()
101 button->clip_mask = FALSE; in button_new()
104button->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, button->clip_mask, 8, gdk_pixbuf_get_width(but… in button_new()
106 if (button->clip_mask && clip_pb) in button_new()
110 …for (i = 0; i < 2 + (2 * button->has_light) + button->has_prelight + (button->has_prelight * butto… in button_new()
113 button->pixbuf, i * button->width, 0, in button_new()
114 button->width, button->height, 3); in button_new()
127 return button; in button_new()
171 void button_free(ButtonData *button) in button_free() argument
173 if (!button) return; in button_free()
174 if (button->pixbuf) gdk_pixbuf_unref(button->pixbuf); in button_free()
175 if (button->overlay) gdk_pixbuf_unref(button->overlay); in button_free()
176 g_free(button); in button_free()
190 static gint button_calc_offset(ButtonData *button, gint prelight, gint pressed) in button_calc_offset() argument
195 if (button->has_prelight && prelight && !pressed) in button_calc_offset()
197 if (button->has_light) in button_calc_offset()
200 if (button->lit) r++; in button_calc_offset()
206 if (button->has_light && button->lit) r += 2; in button_calc_offset()
212 static void button_draw_real(ButtonData *button, gint prelight, gint pressed, gint force, GdkPixbuf… in button_draw_real() argument
217 if (!button) return; in button_draw_real()
219 old_l = button_calc_offset(button, button->prelit, button->pushed); in button_draw_real()
228 l = button_calc_offset(button, prelight, pressed); in button_draw_real()
233 if (button->clip_mask) in button_draw_real()
235 pixbuf_copy_area_alpha(button->pixbuf, l * button->width, 0, in button_draw_real()
236 pb, button->x, button->y, in button_draw_real()
237 button->width, button->height, 255); in button_draw_real()
241 pixbuf_copy_area(button->pixbuf, l * button->width, 0, in button_draw_real()
242 pb, button->x, button->y, in button_draw_real()
243 button->width, button->height, FALSE); in button_draw_real()
246 ui_display_render_area(ui, button->x, button->y, button->width, button->height, button->wd); in button_draw_real()
251 button->pushed = pressed; in button_draw_real()
252 button->prelit = prelight; in button_draw_real()
256 static void button_light_set(ButtonData *button, gint lit, GdkPixbuf *pb, UIData *ui) in button_light_set() argument
258 if (!button || !button->has_light) return; in button_light_set()
260 if (button->lit == lit) return; in button_light_set()
262 button->lit = lit; in button_light_set()
264 button_draw_real(button, FALSE, FALSE, TRUE, pb, ui); in button_light_set()
275 ButtonData *button = data; in button_draw() local
278 state = button->lit; in button_draw()
287 state = cd->status_get_func(button, key, cd->status_get_data); in button_draw()
291 if (force || state != button->lit) in button_draw()
293 if (button->has_light && state != button->lit) in button_draw()
295 button_light_set(button, state, pb, ui); in button_draw()
299 button_draw_real(button, button->prelit, button->pushed, force, pb, ui); in button_draw()
306 ButtonData *button = data; in button_reset() local
308 button_draw_real(button, FALSE, FALSE, FALSE, pb, ui); in button_reset()
311 static gint button_test_proximity(ButtonData *button, gint x, gint y) in button_test_proximity() argument
313 if (!button) return FALSE; in button_test_proximity()
315 if (x < button->x || x >= button->x + button->width || in button_test_proximity()
316 y < button->y || y >= button->y + button->height) return FALSE; in button_test_proximity()
318 …if (button->clip_mask && !pixbuf_pixel_is_visible(button->pixbuf, x - button->x, y - button->y)) r… in button_test_proximity()
325 ButtonData *button = data; in button_motion() local
326 if (!button) return; in button_motion()
328 if (button_test_proximity(button, x, y)) in button_motion()
330 if (button->active) in button_motion()
332 button_draw_real(button, FALSE, TRUE, FALSE, pb, ui); in button_motion()
336 button_draw_real(button, TRUE, FALSE, FALSE, pb, ui); in button_motion()
341 button_draw_real(button, FALSE, FALSE, FALSE, pb, ui); in button_motion()
347 ButtonData *button = data; in button_press() local
350 if (!button) return FALSE; in button_press()
352 if (button_test_proximity(button, x, y)) in button_press()
354 button->active = TRUE; in button_press()
356 button_draw_real(button, FALSE, TRUE, FALSE, pb, ui); in button_press()
361 cd->button_press_func(button, key, cd->button_press_data); in button_press()
372 ButtonData *button = data; in button_release() local
375 if (!button || !button->active) return; in button_release()
377 button->active = FALSE; in button_release()
384 cd->button_release_func(button, key, cd->button_release_data); in button_release()
387 if (cd && cd->button_click_func && button_test_proximity(button, x, y)) in button_release()
389 cd->button_click_func(button, key, cd->button_click_data); in button_release()
398 ButtonData *button = data; in button_key_event_cb() local
406 cd->button_press_func(button, key, cd->button_press_data); in button_key_event_cb()
410 cd->button_release_func(button, key, cd->button_release_data); in button_key_event_cb()
414 cd->button_click_func(button, key, cd->button_click_data); in button_key_event_cb()
425 ButtonData *button = data; in button_back_set() local
428 if (!button) return; in button_back_set()
430 …for (i = 0; i < 2 + (2 * button->has_light) + button->has_prelight + (button->has_prelight * butto… in button_back_set()
432 pixbuf_copy_area(pb, button->x, button->y, button->pixbuf, in button_back_set()
433 i * button->width, 0, button->width, button->height, FALSE); in button_back_set()
436 pixbuf_copy_area_alpha(button->overlay, 0, 0, in button_back_set()
437 button->pixbuf, 0, 0, gdk_pixbuf_get_width(button->overlay), button->height, 255); in button_back_set()
442 ButtonData *button = widget; in button_get_geometry() local
444 *x = button->x; in button_get_geometry()
445 *y = button->y; in button_get_geometry()
446 *w = button->width; in button_get_geometry()
447 *h = button->height; in button_get_geometry()
454 ButtonData *button = widget; in button_set_coord() local
456 button->x = x; in button_set_coord()
457 button->y = y; in button_set_coord()
463 ButtonData *button; in button_parse() local
481 button = button_new_from_file(filename, x, y, prelight, light, clipname); in button_parse()
483 if (button) in button_parse()
485 wd = button_register(skin, button, key, NULL); in button_parse()
506 WidgetData *button_register(SkinData *skin, ButtonData *button, const gchar *key, const gchar *text… in button_register() argument
510 wd = skin_register_widget(skin, key, text_id, type_id, button); in button_register()
511 button->wd = wd; in button_register()
520 ButtonData *button; in button_register_to_skin() local
522 button = button_new_from_data(data, x, y, prelight, light, clip_data); in button_register_to_skin()
523 return button_register(skin, button, key, text_id); in button_register_to_skin()
527 …gint (*status_get_func)(ButtonData *button, const gchar *key, gpointer data), gpointer status_get_… in button_register_key() argument
528 …void (*button_click_func)(ButtonData *button, const gchar *key, gpointer data), gpointer button_cl… in button_register_key() argument
529 …void (*button_press_func)(ButtonData *button, const gchar *key, gpointer data), gpointer button_pr… in button_register_key() argument
530 …void (*button_release_func)(ButtonData *button, const gchar *key, gpointer data), gpointer button_… in button_register_key() argument
560 ButtonData *button; in button_state_set_cb() local
563 button = wd->widget; in button_state_set_cb()
566 button_light_set(button, state, pb, ui); in button_state_set_cb()
577 ButtonData *button; in button_state_get() local
582 button = wd->widget; in button_state_get()
583 return button->lit; in button_state_get()