Commit 3a10216d authored by Javier Jardón's avatar Javier Jardón

Use accessor functions to acces GtkContainer

parent 009acc26
......@@ -226,12 +226,12 @@ gtk_rotated_bin_realize (GtkWidget *widget)
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
......@@ -378,6 +378,7 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition child_requisition;
double s, c;
double w, h;
guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
......@@ -390,8 +391,9 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width = border_width * 2 + w;
requisition->height = border_width * 2 + h;
}
static void
......@@ -399,13 +401,13 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gint border_width;
guint border_width;
gint w, h;
gdouble s, c;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
......
......@@ -164,12 +164,12 @@ gtk_mirror_bin_realize (GtkWidget *widget)
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
......@@ -302,6 +302,7 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
......@@ -309,8 +310,9 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
if (bin->child && gtk_widget_get_visible (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width = border_width * 2 + child_requisition.width + 10;
requisition->height = border_width * 2 + child_requisition.height * 2 + 10;
}
static void
......@@ -318,11 +320,12 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint border_width;
gint w, h;
guint border_width;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
......
......@@ -478,7 +478,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
GtkBin *bin;
GtkAllocation child_allocation;
gint width, height;
gint border_width;
guint border_width;
gint padding_horizontal, padding_vertical;
GtkAlignmentPrivate *priv;
......@@ -496,7 +496,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
gint child_nat_height;
gint child_width, child_height;
border_width = GTK_CONTAINER (alignment)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (alignment));
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
padding_horizontal = priv->padding_left + priv->padding_right;
......@@ -567,11 +567,11 @@ gtk_alignment_get_size (GtkSizeRequest *widget,
{
GtkWidget *child;
GtkAlignmentPrivate *priv;
gint minimum, natural;
guint minimum, natural;
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
natural = minimum = GTK_CONTAINER (widget)->border_width * 2;
natural = minimum = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
if ((child = gtk_bin_get_child (GTK_BIN (widget))) && gtk_widget_get_visible (child))
{
......
......@@ -1140,6 +1140,7 @@ gtk_assistant_size_request (GtkWidget *widget,
GtkRequisition child_requisition;
gint header_padding, content_padding;
gint width, height, header_width, header_height;
guint border_width;
GList *list;
gtk_widget_style_get (widget,
......@@ -1188,8 +1189,9 @@ gtk_assistant_size_request (GtkWidget *widget,
width = MAX (width, child_requisition.width);
height += child_requisition.height + ACTION_AREA_SPACING;
width += GTK_CONTAINER (widget)->border_width * 2 + content_padding * 2;
height += GTK_CONTAINER (widget)->border_width * 2 + content_padding * 2;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
width += border_width * 2 + content_padding * 2;
height += border_width * 2 + content_padding * 2;
requisition->width = width;
requisition->height = height;
......@@ -1205,6 +1207,7 @@ gtk_assistant_size_allocate (GtkWidget *widget,
GtkRequisition header_requisition, action_requisition, sidebar_requisition;
GtkAllocation child_allocation, header_allocation;
gint header_padding, content_padding;
guint border_width;
gboolean rtl;
GList *pages;
......@@ -1217,13 +1220,14 @@ gtk_assistant_size_allocate (GtkWidget *widget,
NULL);
widget->allocation = *allocation;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
/* Header */
gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
header_allocation.x = GTK_CONTAINER (widget)->border_width + header_padding;
header_allocation.y = GTK_CONTAINER (widget)->border_width + header_padding;
header_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * header_padding;
header_allocation.x = border_width + header_padding;
header_allocation.y = border_width + header_padding;
header_allocation.width = allocation->width - 2 * border_width - 2 * header_padding;
header_allocation.height = header_requisition.height;
gtk_widget_size_allocate (priv->header_image, &header_allocation);
......@@ -1231,10 +1235,9 @@ gtk_assistant_size_allocate (GtkWidget *widget,
/* Action area */
gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
child_allocation.x = GTK_CONTAINER (widget)->border_width;
child_allocation.y = allocation->height -
GTK_CONTAINER (widget)->border_width - action_requisition.height;
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
child_allocation.x = border_width;
child_allocation.y = allocation->height - border_width - action_requisition.height;
child_allocation.width = allocation->width - 2 * border_width;
child_allocation.height = action_requisition.height;
gtk_widget_size_allocate (priv->action_area, &child_allocation);
......@@ -1243,25 +1246,23 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
if (rtl)
child_allocation.x = allocation->width -
GTK_CONTAINER (widget)->border_width - sidebar_requisition.width;
child_allocation.x = allocation->width - border_width - sidebar_requisition.width;
else
child_allocation.x = GTK_CONTAINER (widget)->border_width;
child_allocation.x = border_width;
child_allocation.y = GTK_CONTAINER (widget)->border_width +
priv->header_image->allocation.height + 2 * header_padding;
child_allocation.y = border_width + priv->header_image->allocation.height + 2 * header_padding;
child_allocation.width = sidebar_requisition.width;
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
child_allocation.height = allocation->height - 2 * border_width -
priv->header_image->allocation.height - 2 * header_padding - priv->action_area->allocation.height;
gtk_widget_size_allocate (priv->sidebar_image, &child_allocation);
/* Pages */
child_allocation.x = GTK_CONTAINER (widget)->border_width + content_padding;
child_allocation.y = GTK_CONTAINER (widget)->border_width +
child_allocation.x = border_width + content_padding;
child_allocation.y = border_width +
priv->header_image->allocation.height + 2 * header_padding + content_padding;
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * content_padding;
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
child_allocation.width = allocation->width - 2 * border_width - 2 * content_padding;
child_allocation.height = allocation->height - 2 * border_width -
priv->header_image->allocation.height - 2 * header_padding - ACTION_AREA_SPACING - priv->action_area->allocation.height - 2 * content_padding;
if (gtk_widget_get_visible (priv->sidebar_image))
......@@ -1452,7 +1453,7 @@ gtk_assistant_focus (GtkWidget *widget,
priv = GTK_ASSISTANT (widget)->priv;
/* we only have to care about 2 widgets, action area and the current page */
if (container->focus_child == priv->action_area)
if (gtk_container_get_focus_child (container) == priv->action_area)
{
if (!gtk_widget_child_focus (priv->action_area, direction) &&
(priv->current_page == NULL ||
......
......@@ -341,14 +341,14 @@ gboolean
gtk_button_box_get_child_secondary (GtkButtonBox *widget,
GtkWidget *child)
{
GtkBoxChild *child_info;
GList *list;
GtkBoxChild *child_info = NULL;
GList *list, *children;
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
child_info = NULL;
list = gtk_container_get_children (GTK_CONTAINER (widget));
list = children = gtk_container_get_children (GTK_CONTAINER (widget));
while (list)
{
child_info = list->data;
......@@ -358,9 +358,16 @@ gtk_button_box_get_child_secondary (GtkButtonBox *widget,
list = list->next;
}
g_return_val_if_fail (list != NULL, FALSE);
return child_info->is_secondary;
if (list == NULL)
{
g_list_free (children);
return FALSE;
}
else
{
g_list_free (children);
return child_info->is_secondary;
}
}
/**
......@@ -388,13 +395,14 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
GtkWidget *child,
gboolean is_secondary)
{
GList *list;
GList *list, *children;
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (child->parent == GTK_WIDGET (widget));
list = gtk_container_get_children (GTK_CONTAINER (widget));
list = children = gtk_container_get_children (GTK_CONTAINER (widget));
while (list)
{
GtkBoxChild *child_info = list->data;
......@@ -406,6 +414,7 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
list = list->next;
}
g_list_free (children);
gtk_widget_child_notify (child, "secondary");
......@@ -427,7 +436,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
GtkButtonBoxPriv *priv;
GtkButtonBox *bbox;
GtkBoxChild *child;
GList *children;
GList *children, *list;
gint nchildren;
gint nsecondaries;
gint needed_width;
......@@ -468,7 +477,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
nchildren = 0;
nsecondaries = 0;
children = gtk_container_get_children (GTK_CONTAINER (bbox));
list = children = gtk_container_get_children (GTK_CONTAINER (bbox));
needed_width = child_min_width;
needed_height = child_min_height;
ipad_w = ipad_x * 2;
......@@ -493,6 +502,8 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
}
}
g_list_free (list);
if (nvis_children)
*nvis_children = nchildren;
if (nvis_secondaries)
......@@ -531,6 +542,7 @@ gtk_button_box_size_request (GtkWidget *widget,
gint child_width;
gint child_height;
gint spacing;
guint border_width;
GtkButtonBoxStyle layout;
GtkOrientation orientation;
......@@ -590,8 +602,9 @@ gtk_button_box_size_request (GtkWidget *widget,
requisition->width = child_width;
}
requisition->width += GTK_CONTAINER (box)->border_width * 2;
requisition->height += GTK_CONTAINER (box)->border_width * 2;
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
requisition->width += border_width * 2;
requisition->height += border_width * 2;
}
static void
......@@ -602,7 +615,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
GtkBox *base_box;
GtkButtonBox *box;
GtkBoxChild *child;
GList *children;
GList *children, *list;
GtkAllocation child_allocation;
gint nvis_children;
gint n_secondaries;
......@@ -618,12 +631,14 @@ gtk_button_box_size_allocate (GtkWidget *widget,
gint childspacing = 0;
GtkButtonBoxStyle layout;
gint spacing;
guint border_width;
GtkOrientation orientation;
base_box = GTK_BOX (widget);
box = GTK_BUTTON_BOX (widget);
priv = box->priv;
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
spacing = gtk_box_get_spacing (base_box);
layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
......@@ -636,9 +651,9 @@ gtk_button_box_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
width = allocation->width - GTK_CONTAINER (box)->border_width*2;
width = allocation->width - border_width*2;
else
height = allocation->height - GTK_CONTAINER (box)->border_width*2;
height = allocation->height - border_width*2;
switch (layout)
{
......@@ -648,8 +663,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
{
childspacing = (width - (nvis_children * child_width))
/ (nvis_children + 1);
x = allocation->x + GTK_CONTAINER (box)->border_width
+ childspacing;
x = allocation->x + border_width + childspacing;
secondary_x = x + ((nvis_children - n_secondaries)
* (child_width + childspacing));
}
......@@ -657,8 +671,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
{
childspacing = (height - (nvis_children * child_height))
/ (nvis_children + 1);
y = allocation->y + GTK_CONTAINER (box)->border_width
+ childspacing;
y = allocation->y + border_width + childspacing;
secondary_y = y + ((nvis_children - n_secondaries)
* (child_height + childspacing));
}
......@@ -673,7 +686,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
{
childspacing = (width - (nvis_children * child_width))
/ (nvis_children - 1);
x = allocation->x + GTK_CONTAINER (box)->border_width;
x = allocation->x + border_width;
secondary_x = x + ((nvis_children - n_secondaries)
* (child_width + childspacing));
}
......@@ -691,7 +704,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
{
childspacing = (height - (nvis_children*child_height))
/ (nvis_children-1);
y = allocation->y + GTK_CONTAINER (box)->border_width;
y = allocation->y + border_width;
secondary_y = y + ((nvis_children - n_secondaries)
* (child_height + childspacing));
}
......@@ -711,20 +724,20 @@ gtk_button_box_size_allocate (GtkWidget *widget,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
childspacing = spacing;
x = allocation->x + GTK_CONTAINER (box)->border_width;
x = allocation->x + border_width;
secondary_x = allocation->x + allocation->width
- child_width * n_secondaries
- spacing * (n_secondaries - 1)
- GTK_CONTAINER (box)->border_width;
- border_width;
}
else
{
childspacing = spacing;
y = allocation->y + GTK_CONTAINER (box)->border_width;
y = allocation->y + border_width;
secondary_y = allocation->y + allocation->height
- child_height * n_secondaries
- spacing * (n_secondaries - 1)
- GTK_CONTAINER (box)->border_width;
- border_width;
}
break;
......@@ -737,8 +750,8 @@ gtk_button_box_size_allocate (GtkWidget *widget,
x = allocation->x + allocation->width
- child_width * (nvis_children - n_secondaries)
- spacing * (nvis_children - n_secondaries - 1)
- GTK_CONTAINER (box)->border_width;
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
- border_width;
secondary_x = allocation->x + border_width;
}
else
{
......@@ -746,8 +759,8 @@ gtk_button_box_size_allocate (GtkWidget *widget,
y = allocation->y + allocation->height
- child_height * (nvis_children - n_secondaries)
- spacing * (nvis_children - n_secondaries - 1)
- GTK_CONTAINER (box)->border_width;
secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
- border_width;
secondary_y = allocation->y + border_width;
}
break;
......@@ -762,7 +775,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
- (child_width * (nvis_children - n_secondaries)
+ spacing * (nvis_children - n_secondaries - 1))) / 2
+ (n_secondaries * child_width + n_secondaries * spacing) / 2;
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
secondary_x = allocation->x + border_width;
}
else
{
......@@ -772,7 +785,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
- (child_height * (nvis_children - n_secondaries)
+ spacing * (nvis_children - n_secondaries - 1))) / 2
+ (n_secondaries * child_height + n_secondaries * spacing) / 2;
secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
secondary_y = allocation->y + border_width;
}
break;
......@@ -793,7 +806,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
childspace = child_height + childspacing;
}
children = gtk_container_get_children (GTK_CONTAINER (box));
list = children = gtk_container_get_children (GTK_CONTAINER (box));
while (children)
{
......@@ -843,6 +856,8 @@ gtk_button_box_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (child->widget, &child_allocation);
}
}
g_list_free (list);
}
/**
......
......@@ -427,7 +427,7 @@ gtk_box_size_allocate (GtkWidget *widget,
if (nvis_children > 0)
{
gint border_width = GTK_CONTAINER (box)->border_width;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
GtkTextDirection direction = gtk_widget_get_direction (widget);
GtkAllocation child_allocation;
GtkBoxSpreading *spreading = g_newa (GtkBoxSpreading, nvis_children);
......@@ -882,7 +882,7 @@ gtk_box_get_size (GtkSizeRequest *widget,
box = GTK_BOX (widget);
private = box->priv;
border_width = GTK_CONTAINER (box)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
minimum = natural = 0;
......@@ -981,7 +981,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
gint nvis_children;
gint nexpand_children;
gint computed_minimum = 0, computed_natural = 0;
gint border_width = GTK_CONTAINER (box)->border_width;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
count_expand_children (box, &nvis_children, &nexpand_children);
......@@ -1184,8 +1184,10 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
gint nvis_children = 0;
gint required_size = 0, required_natural = 0, child_size, child_natural;
gint largest_child = 0, largest_natural = 0;
guint border_width;
avail_size -= GTK_CONTAINER (box)->border_width * 2;
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
avail_size -= border_width * 2;
for (children = private->children; children != NULL;
children = children->next, nvis_children++)
......@@ -1229,8 +1231,8 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
required_natural += (nvis_children - 1) * private->spacing;
}
required_size += GTK_CONTAINER (box)->border_width * 2;
required_natural += GTK_CONTAINER (box)->border_width * 2;
required_size += border_width * 2;
required_natural += border_width * 2;
if (minimum_size)
*minimum_size = required_size;
......
......@@ -1273,7 +1273,7 @@ gtk_button_realize (GtkWidget *widget)
button = GTK_BUTTON (widget);
gtk_widget_set_realized (widget, TRUE);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
......@@ -1435,7 +1435,7 @@ gtk_button_size_allocate (GtkWidget *widget,
GtkButton *button = GTK_BUTTON (widget);
GtkAllocation child_allocation;
gint border_width = GTK_CONTAINER (widget)->border_width;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
GtkBorder default_border;
......@@ -1530,7 +1530,7 @@ _gtk_button_paint (GtkButton *button,
if (gtk_widget_is_drawable (widget))
{
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
gtk_widget_style_get (widget,
......@@ -1883,6 +1883,7 @@ gtk_button_get_size (GtkSizeRequest *widget,
gint focus_width;
gint focus_pad;
gint minimum, natural;
guint border_width;
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
......@@ -1890,18 +1891,19 @@ gtk_button_get_size (GtkSizeRequest *widget,
"focus-padding", &focus_pad,
NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum = ((GTK_CONTAINER (widget)->border_width +
minimum = ((border_width +
GTK_WIDGET (widget)->style->xthickness) * 2 +
inner_border.left + inner_border.right);
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
minimum += default_border.left + default_border.right;
}
else
{
minimum = ((GTK_CONTAINER (widget)->border_width +
minimum = ((border_width +
GTK_WIDGET (widget)->style->ythickness) * 2 +
inner_border.top + inner_border.bottom);
......
......@@ -146,8 +146,8 @@ gtk_check_button_paint (GtkWidget *widget,
NULL);
gtk_check_button_draw_indicator (check_button, area);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (gtk_widget_has_focus (widget))
{
GtkWidget *child = GTK_BIN (widget)->child;
......@@ -196,9 +196,11 @@ gtk_check_button_size_request (GtkWidget *widget,
gint temp;
gint indicator_size;
gint indicator_spacing;
gint border_width = GTK_CONTAINER (widget)->border_width;
gint focus_width;
gint focus_pad;
guint border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
......@@ -266,7 +268,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
gint border_width = GTK_CONTAINER (widget)->border_width;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_get_child_requisition (GTK_BIN (button)->child, &child_requisition);
......@@ -354,6 +356,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
gint indicator_spacing;
gint focus_width;
gint focus_pad;
guint border_width;
gboolean interior_focus;
widget = GTK_WIDGET (check_button);
......@@ -371,7 +374,9 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
_gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
x = widget->allocation.x + indicator_spacing + border_width;
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
child = GTK_BIN (check_button)->child;
......@@ -402,10 +407,10 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
GdkRectangle restrict_area;
GdkRectangle new_area;
restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
restrict_area.x = widget->allocation.x + border_width;
restrict_area.y = widget->allocation.y + border_width;
restrict_area.width = widget->allocation.width - (2 * border_width);
restrict_area.height = widget->allocation.height - (2 * border_width);
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
......
......@@ -469,6 +469,7 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
if (gtk_widget_is_drawable (widget))
{
guint border_width;
guint offset;
guint toggle_size;
guint toggle_spacing;
......@@ -482,8 +483,8 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
NULL);
toggle_size = GTK_MENU_ITEM (check_menu_item)->toggle_size;
offset = GTK_CONTAINER (check_menu_item)->border_width +
widget->style->xthickness + 2;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
offset = border_width + widget->style->xthickness + 2;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
{
......
......@@ -2165,6 +2165,7 @@ gtk_combo_box_size_request (GtkWidget *widget,
gint focus_width, focus_pad;
gint font_size;
gint arrow_size;
guint border_width;
GtkRequisition bin_req;
PangoContext *context;
PangoFontMetrics *metrics;
......@@ -2204,10 +2205,10 @@ gtk_combo_box_size_request (GtkWidget *widget,
if (priv->cell_view)
{
GtkRequisition button_req, sep_req, arrow_req;
gint border_width, xthickness, ythickness;
gint xthickness, ythickness;
gtk_widget_size_request (priv->button, &button_req);
border_width = GTK_CONTAINER (combo_box)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
xthickness = priv->button->style->xthickness;
ythickness = priv->button->style->ythickness;
......@@ -2253,12 +2254,10 @@ gtk_combo_box_size_request (GtkWidget *widget,
gtk_widget_size_request (priv->cell_view_frame, &frame_req);
if (priv->has_frame)
{
requisition->width += 2 *
(GTK_CONTAINER (priv->cell_view_frame)->border_width +
GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
requisition->height += 2 *
(GTK_CONTAINER (priv->cell_view_frame)->border_width +
GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));