static void gtk_expander_paint (GtkExpander *expander) { GtkWidget *widget; GdkRectangle clip; GtkStateType state; widget = GTK_WIDGET (expander); get_expander_bounds (expander, &clip); state = widget->state; if (expander->priv->prelight) { state = GTK_STATE_PRELIGHT; gtk_expander_paint_prelight (expander); } gtk_paint_expander (widget->style, widget->window, state, &clip, widget, "expander", clip.x + clip.width / 2, clip.y + clip.height / 2, expander->priv->expander_style); }
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 void gm_cell_renderer_expander_render (GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, G_GNUC_UNUSED GtkCellRendererState flags) { GmCellRendererExpander *expander; GmCellRendererExpanderPriv *priv; GtkExpanderStyle expander_style; gint x_offset, y_offset; guint xpad, ypad; GtkAllocation allocation; expander = (GmCellRendererExpander*) cell; priv = GET_PRIV (expander); g_object_get (G_OBJECT (cell), "xpad", &xpad, "ypad", &ypad, NULL); gtk_widget_get_allocation (widget, &allocation); if (priv->animation_node) { GtkTreePath *path; GdkRectangle rect; /* Not sure if I like this ... */ path = gtk_tree_row_reference_get_path (priv->animation_node); gtk_tree_view_get_background_area (priv->animation_view, path, NULL, &rect); gtk_tree_path_free (path); if (background_area->y == rect.y) expander_style = priv->animation_style; else expander_style = priv->expander_style; } else expander_style = priv->expander_style; gm_cell_renderer_expander_get_size (cell, widget, cell_area, &x_offset, &y_offset, NULL, NULL); gtk_paint_expander (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, expose_area, widget, "treeview", cell_area->x + x_offset + xpad + priv->expander_size / 2, cell_area->y + y_offset + ypad + priv->expander_size / 2, expander_style); gtk_paint_hline (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, NULL, widget, NULL, 0, allocation.width, cell_area->y + cell_area->height); }
static VALUE style_paint_expander(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE expander_style) { gtk_paint_expander(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), RVAL2GENUM(expander_style, GTK_TYPE_EXPANDER_STYLE)); return self; }
static void gossip_cell_renderer_expander_render (GtkCellRenderer *cell, cairo_t *cr, GtkWidget *widget, const GdkRectangle *background_area, const GdkRectangle *cell_area, GtkCellRendererState flags) { GossipCellRendererExpander *expander; GossipCellRendererExpanderPriv *priv; GtkExpanderStyle expander_style; gint x_offset, y_offset; gint xpad, ypad; expander = (GossipCellRendererExpander*) cell; priv = GET_PRIV (expander); if (priv->animation_node) { GtkTreePath *path; GdkRectangle rect; /* Not sure if I like this ... */ path = gtk_tree_row_reference_get_path (priv->animation_node); gtk_tree_view_get_background_area (priv->animation_view, path, NULL, &rect); gtk_tree_path_free (path); if (background_area->y == rect.y) expander_style = priv->animation_style; else expander_style = priv->expander_style; } else expander_style = priv->expander_style; gossip_cell_renderer_expander_get_size (cell, widget, cell_area, &x_offset, &y_offset, NULL, NULL); gtk_cell_renderer_get_padding (cell, &xpad, &ypad); gtk_paint_expander (gtk_widget_get_style (widget), cr, GTK_STATE_NORMAL, widget, "treeview", cell_area->x + x_offset + xpad + priv->expander_size / 2, cell_area->y + y_offset + ypad + priv->expander_size / 2, expander_style); }
static void empathy_cell_renderer_expander_render (GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, GtkCellRendererState flags) { EmpathyCellRendererExpander *expander; EmpathyCellRendererExpanderPriv *priv; GtkExpanderStyle expander_style; gint x_offset, y_offset; expander = (EmpathyCellRendererExpander*) cell; priv = GET_PRIV (expander); if (priv->animation_node) { GtkTreePath *path; GdkRectangle rect; /* Not sure if I like this ... */ path = gtk_tree_row_reference_get_path (priv->animation_node); gtk_tree_view_get_background_area (priv->animation_view, path, NULL, &rect); gtk_tree_path_free (path); if (background_area->y == rect.y) expander_style = priv->animation_style; else expander_style = priv->expander_style; } else expander_style = priv->expander_style; empathy_cell_renderer_expander_get_size (cell, widget, cell_area, &x_offset, &y_offset, NULL, NULL); gtk_paint_expander (widget->style, window, GTK_STATE_NORMAL, expose_area, widget, "treeview", cell_area->x + x_offset + cell->xpad + priv->expander_size / 2, cell_area->y + y_offset + cell->ypad + priv->expander_size / 2, expander_style); }
static void popup_button_expose (GtkWidget *widget, GdkEventExpose *event, UmPhotoDialog *um) { GtkAllocation allocation; if (gtk_widget_get_state (widget) != GTK_STATE_PRELIGHT && !gtk_widget_is_focus (gtk_widget_get_parent (widget))) { return; } gtk_widget_get_allocation (widget, &allocation); gtk_paint_expander (gtk_widget_get_style (widget), gtk_widget_get_window (widget), gtk_widget_get_state (widget), NULL, widget, NULL, allocation.x + allocation.width, allocation.y + allocation.height, GTK_EXPANDER_EXPANDED); }