static void run_functions (Test *test) { GtkStyle *style = styles[test->style]; if (test->function & FUNCTION_ARROW) gtk_paint_arrow (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, test->arrow_type, test->fill, 0, 0, 10, 10); if (test->function & FUNCTION_BOX) gtk_paint_box (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_SHADOW) gtk_paint_shadow (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_BOX_GAP) gtk_paint_box_gap (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side, 0, 100); if (test->function & FUNCTION_SHADOW_GAP) gtk_paint_shadow_gap (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side, 0, 100); if (test->function & FUNCTION_CHECK) gtk_paint_check (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_EXPANDER) gtk_paint_expander (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 10, 10, test->expander_style); if (test->function & FUNCTION_EXTENSION) gtk_paint_extension (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side); if (test->function & FUNCTION_FLAT_BOX) gtk_paint_flat_box (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_FOCUS) gtk_paint_focus (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_HANDLE) gtk_paint_handle (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->orientation); if (test->function & FUNCTION_OPTION) gtk_paint_option (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_RESIZE_GRIP) gtk_paint_resize_grip (style, window->window, test->state, NULL, widgets[test->widget], test->detail, test->edge, 0, 0, 10, 10); if (test->function & FUNCTION_SLIDER) gtk_paint_slider (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->orientation); if (test->function & FUNCTION_TAB) gtk_paint_tab (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10); if (test->function & FUNCTION_HLINE) gtk_paint_hline (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 1, 10, 4); if (test->function & FUNCTION_VLINE) gtk_paint_vline (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 1, 10, 4); }
static VALUE style_paint_option(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_option(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; }
void WidgetRenderingContext::gtkPaintOption(const IntRect& rect, GtkWidget* widget, GtkStateType stateType, GtkShadowType shadowType, const gchar* detail) { GdkRectangle paintRect = { m_paintRect.x + rect.x(), m_paintRect.y + rect.y(), rect.width(), rect.height() }; gtk_paint_option(gtk_widget_get_style(widget), m_target, stateType, shadowType, &paintRect, widget, detail, paintRect.x, paintRect.y, paintRect.width, paintRect.height); }
static gint moz_gtk_toggle_paint(GdkDrawable* drawable, GdkRectangle* rect, GdkRectangle* cliprect, GtkWidgetState* state, gboolean selected, gboolean inconsistent, gboolean isradio, GtkTextDirection direction) { GtkStateType state_type = ConvertGtkState(state); GtkShadowType shadow_type = (selected)?GTK_SHADOW_IN:GTK_SHADOW_OUT; gint indicator_size, indicator_spacing; gint x, y, width, height; gint focus_x, focus_y, focus_width, focus_height; GtkWidget *w; GtkStyle *style; if (isradio) { moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing); w = gParts->radiobuttonWidget; } else { moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing); w = gParts->checkboxWidget; } // "GetMinimumWidgetSize was ignored" // FIXME: This assert causes a build failure in WebKitGTK+ debug // builds, because it uses 'false' in its definition. We may want // to force this file to be built with g++, by renaming it. // ASSERT(rect->width == indicator_size); /* * vertically center in the box, since XUL sometimes ignores our * GetMinimumWidgetSize in the vertical dimension */ x = rect->x; y = rect->y + (rect->height - indicator_size) / 2; width = indicator_size; height = indicator_size; focus_x = x - indicator_spacing; focus_y = y - indicator_spacing; focus_width = width + 2 * indicator_spacing; focus_height = height + 2 * indicator_spacing; style = gtk_widget_get_style(w); TSOffsetStyleGCs(style, x, y); gtk_widget_set_sensitive(w, !state->disabled); gtk_widget_set_direction(w, direction); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), selected); if (isradio) { gtk_paint_option(style, drawable, state_type, shadow_type, cliprect, gParts->radiobuttonWidget, "radiobutton", x, y, width, height); if (state->focused) { gtk_paint_focus(style, drawable, GTK_STATE_ACTIVE, cliprect, gParts->radiobuttonWidget, "radiobutton", focus_x, focus_y, focus_width, focus_height); } } else { /* * 'indeterminate' type on checkboxes. In GTK, the shadow type * must also be changed for the state to be drawn. */ if (inconsistent) { gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gParts->checkboxWidget), TRUE); shadow_type = GTK_SHADOW_ETCHED_IN; } else { gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(gParts->checkboxWidget), FALSE); } gtk_paint_check(style, drawable, state_type, shadow_type, cliprect, gParts->checkboxWidget, "checkbutton", x, y, width, height); if (state->focused) { gtk_paint_focus(style, drawable, GTK_STATE_ACTIVE, cliprect, gParts->checkboxWidget, "checkbutton", focus_x, focus_y, focus_width, focus_height); } } return MOZ_GTK_SUCCESS; }