gint child_displacement_x;
gint child_displacement_y;
gboolean displace_focus;
- GtkBorder *border;
+ GtkBorder border;
gtk_style_context_get_style (context,
"child-displacement-y", &child_displacement_y,
"child-displacement-x", &child_displacement_x,
"displace-focus", &displace_focus,
NULL);
-
- gtk_style_context_get (context, state,
- "border-width", &border,
- NULL);
+ gtk_style_context_get_border (context, state, &border);
if (interior_focus)
{
- x += border->left + focus_pad;
- y += border->top + focus_pad;
- width -= (2 * focus_pad) + border->left + border->right;
- height -= (2 * focus_pad) + border->top + border->bottom;
+ x += border.left + focus_pad;
+ y += border.top + focus_pad;
+ width -= (2 * focus_pad) + border.left + border.right;
+ height -= (2 * focus_pad) + border.top + border.bottom;
}
else
{
gtk_render_focus (context, cr,
x, y, width, height);
-
- gtk_border_free (border);
}
gtk_style_context_restore (context);
{
GtkStyleContext *context;
GtkStateFlags state;
- GdkRGBA *color;
+ GdkRGBA color;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_get_background_color (context, state, &color);
- gtk_style_context_get (context, state,
- "background-color", &color,
- NULL);
-
- gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), color);
- gdk_rgba_free (color);
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), &color);
}
}
if (priv->tree_view && priv->cell_view)
{
GtkStyleContext *context;
- GdkRGBA *color;
-
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get (context, 0,
- "background-color", &color,
- NULL);
+ GtkStateFlags state;
+ GdkRGBA color;
- gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view),
- color);
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_get_background_color (context, state, &color);
- gdk_rgba_free (color);
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), &color);
}
child = gtk_bin_get_child (GTK_BIN (combo_box));
{
GtkStyleContext *context;
GtkStateFlags state;
- GdkRGBA *color;
+ GdkRGBA color;
- context = gtk_widget_get_style_context (widget);
+ context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_get_background_color (context, state, &color);
- gtk_style_context_get (context, state,
- "background-color", &color,
- NULL);
-
- gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), color);
- gdk_rgba_free (color);
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), &color);
priv->box = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (priv->box),
if (priv->text && (*priv->text != '\0'))
{
- GdkRGBA *bg_color, *fg_color;
+ GdkRGBA bg_color, fg_color;
get_layout_location (label, &x, &y);
if (gtk_widget_has_focus (widget))
state |= GTK_STATE_FLAG_FOCUSED;
- gtk_style_context_get (context, state,
- "background-color", &bg_color,
- "color", &fg_color,
- NULL);
+ gtk_style_context_get_color (context, state, &fg_color);
+ gtk_style_context_get_background_color (context, state, &bg_color);
- gdk_cairo_set_source_rgba (cr, bg_color);
+ gdk_cairo_set_source_rgba (cr, &bg_color);
cairo_paint (cr);
- gdk_cairo_set_source_rgba (cr, fg_color);
+ gdk_cairo_set_source_rgba (cr, &fg_color);
cairo_move_to (cr, x, y);
_gtk_pango_fill_layout (cr, priv->layout);
cairo_restore (cr);
cairo_region_destroy (clip);
-
- gdk_rgba_free (bg_color);
- gdk_rgba_free (fg_color);
}
else if (info)
{
if (active_link)
{
- GdkRGBA *bg_color;
+ GdkRGBA bg_color;
range[0] = active_link->start;
range[1] = active_link->end;
else
state = GTK_STATE_FLAG_PRELIGHT;
- gtk_style_context_get (context, state,
- "background-color", &bg_color,
- NULL);
+ gtk_style_context_get_background_color (context, state, &bg_color);
- gdk_cairo_set_source_rgba (cr, bg_color);
+ gdk_cairo_set_source_rgba (cr, &bg_color);
cairo_paint (cr);
gdk_cairo_set_source_color (cr, text_color);
gdk_color_free (link_color);
gdk_color_free (visited_link_color);
- gdk_rgba_free (bg_color);
cairo_restore (cr);
}
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
GtkStyleContext *context;
- GtkBorder *border;
+ GtkBorder border;
context = gtk_widget_get_style_context (widget);
-
- gtk_style_context_get (context, 0,
- "border-width", &border,
- NULL);
+ gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget),
+ &border);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- *minimum += border->left + border->right;
- *natural += border->left + border->right;
+ *minimum += border.left + border.right;
+ *natural += border.left + border.right;
}
else
{
- *minimum += border->top + border->bottom;
- *natural += border->top + border->bottom;
+ *minimum += border.top + border.bottom;
+ *natural += border.top + border.bottom;
}
- gtk_border_free (border);
}
}
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
GtkStyleContext *context;
- GtkBorder *border;
+ GtkBorder border;
context = gtk_widget_get_style_context (widget);
- gtk_style_context_get (context, 0,
- "border-width", &border,
- NULL);
-
- remaining_space.x += border->left;
- remaining_space.y += border->top;
- remaining_space.width -= border->left + border->right;
- remaining_space.height -= border->top + border->bottom;
+ gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget),
+ &border);
- gtk_border_free (border);
+ remaining_space.x += border.left;
+ remaining_space.y += border.top;
+ remaining_space.width -= border.left + border.right;
+ remaining_space.height -= border.top + border.bottom;
}
requested_sizes = g_array_new (FALSE, FALSE, sizeof (GtkRequestedSize));
{
GtkStylePrivate *priv;
GtkStateType state;
- GtkBorder *padding;
+ GtkBorder padding;
gint i;
priv = GTK_STYLE_GET_PRIVATE (style);
gtk_style_context_get (priv->context, 0,
"font", &style->font_desc,
- "padding", &padding,
NULL);
+ gtk_style_context_get_padding (priv->context, 0, &padding);
- if (padding)
- {
- style->xthickness = padding->left;
- style->ythickness = padding->top;
-
- gtk_border_free (padding);
- }
+ style->xthickness = padding.left;
+ style->ythickness = padding.top;
for (i = 0; i < 5; i++)
{