Commit 95a2a5c5 authored by Benjamin Otte's avatar Benjamin Otte

gtk: Remove GtkJunctionSides

parent f2f5941d
......@@ -5123,8 +5123,6 @@ gtk_style_context_new
gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_get
GtkJunctionSides
gtk_style_context_get_junction_sides
gtk_style_context_get_parent
gtk_style_context_get_path
gtk_style_context_get_property
......@@ -5148,7 +5146,6 @@ gtk_style_context_remove_provider_for_screen
gtk_style_context_reset_widgets
gtk_style_context_restore
gtk_style_context_save
gtk_style_context_set_junction_sides
gtk_style_context_set_parent
gtk_style_context_set_path
gtk_style_context_add_class
......
......@@ -894,15 +894,13 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
x + margin.left,
y + margin.top,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
gtk_css_node_get_junction_sides (priv->node));
height - margin.top - margin.bottom);
gtk_css_style_render_border (style,
cr,
x + margin.left,
y + margin.top,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
gtk_css_node_get_junction_sides (priv->node));
height - margin.top - margin.bottom);
contents_x = x + margin.left + border.left + padding.left;
contents_y = y + margin.top + border.top + padding.top;
......@@ -1036,13 +1034,11 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
gtk_css_style_snapshot_background (style,
snapshot,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
gtk_css_node_get_junction_sides (priv->node));
height - margin.top - margin.bottom);
gtk_css_style_snapshot_border (style,
snapshot,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
gtk_css_node_get_junction_sides (priv->node));
height - margin.top - margin.bottom);
gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
contents_x = x + margin.left + border.left + padding.left;
......
......@@ -1167,19 +1167,6 @@ gtk_css_node_get_state (GtkCssNode *cssnode)
return gtk_css_node_declaration_get_state (cssnode->decl);
}
void
gtk_css_node_set_junction_sides (GtkCssNode *cssnode,
GtkJunctionSides junction_sides)
{
gtk_css_node_declaration_set_junction_sides (&cssnode->decl, junction_sides);
}
GtkJunctionSides
gtk_css_node_get_junction_sides (GtkCssNode *cssnode)
{
return gtk_css_node_declaration_get_junction_sides (cssnode->decl);
}
static void
gtk_css_node_clear_classes (GtkCssNode *cssnode)
{
......
......@@ -24,7 +24,6 @@
struct _GtkCssNodeDeclaration {
guint refcount;
GtkJunctionSides junction_sides;
GType type;
const /* interned */ char *name;
const /* interned */ char *id;
......@@ -101,7 +100,6 @@ gtk_css_node_declaration_new (void)
static GtkCssNodeDeclaration empty = {
1, /* need to own a ref ourselves so the copy-on-write path kicks in when people change things */
0,
0,
NULL,
NULL,
0,
......@@ -129,25 +127,6 @@ gtk_css_node_declaration_unref (GtkCssNodeDeclaration *decl)
g_free (decl);
}
gboolean
gtk_css_node_declaration_set_junction_sides (GtkCssNodeDeclaration **decl,
GtkJunctionSides junction_sides)
{
if ((*decl)->junction_sides == junction_sides)
return FALSE;
gtk_css_node_declaration_make_writable (decl);
(*decl)->junction_sides = junction_sides;
return TRUE;
}
GtkJunctionSides
gtk_css_node_declaration_get_junction_sides (const GtkCssNodeDeclaration *decl)
{
return decl->junction_sides;
}
gboolean
gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl,
GType type)
......@@ -382,7 +361,6 @@ gtk_css_node_declaration_hash (gconstpointer elem)
hash += classes[i];
}
hash ^= ((guint) decl->junction_sides) << (sizeof (guint) * 8 - 5);
hash ^= decl->state;
return hash;
......@@ -423,9 +401,6 @@ gtk_css_node_declaration_equal (gconstpointer elem1,
return FALSE;
}
if (decl1->junction_sides != decl2->junction_sides)
return FALSE;
return TRUE;
}
......
......@@ -28,9 +28,6 @@ GtkCssNodeDeclaration * gtk_css_node_declaration_new (void);
GtkCssNodeDeclaration * gtk_css_node_declaration_ref (GtkCssNodeDeclaration *decl);
void gtk_css_node_declaration_unref (GtkCssNodeDeclaration *decl);
gboolean gtk_css_node_declaration_set_junction_sides (GtkCssNodeDeclaration **decl,
GtkJunctionSides junction_sides);
GtkJunctionSides gtk_css_node_declaration_get_junction_sides (const GtkCssNodeDeclaration *decl);
gboolean gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl,
GType type);
GType gtk_css_node_declaration_get_type (const GtkCssNodeDeclaration *decl);
......
......@@ -129,9 +129,6 @@ void gtk_css_node_set_id (GtkCssNode *
void gtk_css_node_set_state (GtkCssNode *cssnode,
GtkStateFlags state_flags);
GtkStateFlags gtk_css_node_get_state (GtkCssNode *cssnode);
void gtk_css_node_set_junction_sides (GtkCssNode *cssnode,
GtkJunctionSides junction_sides);
GtkJunctionSides gtk_css_node_get_junction_sides (GtkCssNode *cssnode);
void gtk_css_node_set_classes (GtkCssNode *cssnode,
const char **classes);
char ** gtk_css_node_get_classes (GtkCssNode *cssnode);
......
......@@ -1051,9 +1051,6 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE);
gtk_widget_show (scrolled);
context = gtk_widget_get_style_context (scrolled);
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->custom_paper_list));
priv->treeview = treeview;
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
......@@ -1080,7 +1077,6 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
context = gtk_widget_get_style_context (toolbar);
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE);
......
......@@ -809,32 +809,6 @@ typedef enum
GTK_STATE_FLAG_DROP_ACTIVE = 1 << 12
} GtkStateFlags;
/**
* GtkJunctionSides:
* @GTK_JUNCTION_NONE: No junctions.
* @GTK_JUNCTION_CORNER_TOPLEFT: Element connects on the top-left corner.
* @GTK_JUNCTION_CORNER_TOPRIGHT: Element connects on the top-right corner.
* @GTK_JUNCTION_CORNER_BOTTOMLEFT: Element connects on the bottom-left corner.
* @GTK_JUNCTION_CORNER_BOTTOMRIGHT: Element connects on the bottom-right corner.
* @GTK_JUNCTION_TOP: Element connects on the top side.
* @GTK_JUNCTION_BOTTOM: Element connects on the bottom side.
* @GTK_JUNCTION_LEFT: Element connects on the left side.
* @GTK_JUNCTION_RIGHT: Element connects on the right side.
*
* Describes how a rendered element connects to adjacent elements.
*/
typedef enum {
GTK_JUNCTION_NONE = 0,
GTK_JUNCTION_CORNER_TOPLEFT = 1 << 0,
GTK_JUNCTION_CORNER_TOPRIGHT = 1 << 1,
GTK_JUNCTION_CORNER_BOTTOMLEFT = 1 << 2,
GTK_JUNCTION_CORNER_BOTTOMRIGHT = 1 << 3,
GTK_JUNCTION_TOP = (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_TOPRIGHT),
GTK_JUNCTION_BOTTOM = (GTK_JUNCTION_CORNER_BOTTOMLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT),
GTK_JUNCTION_LEFT = (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMLEFT),
GTK_JUNCTION_RIGHT = (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)
} GtkJunctionSides;
/**
* GtkBorderStyle:
* @GTK_BORDER_STYLE_NONE: No visible border
......
......@@ -3787,7 +3787,6 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
context = gtk_widget_get_style_context (GTK_WIDGET (sidebar));
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SIDEBAR);
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_RIGHT | GTK_JUNCTION_LEFT);
/* list box */
sidebar->list_box = gtk_list_box_new ();
......
......@@ -920,8 +920,7 @@ gtk_popover_fill_border_path (GtkPopover *popover,
_gtk_rounded_box_init_rect (&box, x, y, w, h);
_gtk_rounded_box_apply_border_radius_for_style (&box,
gtk_style_context_lookup_style (context),
0);
gtk_style_context_lookup_style (context));
gsk_rounded_rect_path (&box, cr);
cairo_fill (cr);
}
......
......@@ -260,8 +260,7 @@ gtk_render_background (GtkStyleContext *context,
return;
gtk_css_style_render_background (gtk_style_context_lookup_style (context),
cr, x, y, width, height,
gtk_style_context_get_junction_sides (context));
cr, x, y, width, height);
}
/**
......@@ -331,8 +330,7 @@ gtk_render_frame (GtkStyleContext *context,
gtk_css_style_render_border (gtk_style_context_lookup_style (context),
cr,
x, y, width, height,
gtk_style_context_get_junction_sides (context));
x, y, width, height);
}
static void
......@@ -582,19 +580,15 @@ gtk_do_render_slider (GtkStyleContext *context,
GtkOrientation orientation)
{
GtkCssStyle *style;
GtkJunctionSides junction;
style = gtk_style_context_lookup_style (context);
junction = gtk_style_context_get_junction_sides (context);
gtk_css_style_render_background (style,
cr,
x, y, width, height,
junction);
x, y, width, height);
gtk_css_style_render_border (style,
cr,
x, y, width, height,
junction);
x, y, width, height);
}
/**
......@@ -644,11 +638,9 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
gdouble height,
GtkPositionType gap_side,
gdouble xy0_gap,
gdouble xy1_gap,
GtkJunctionSides junction)
gdouble xy1_gap)
{
gint border_width;
GtkCssValue *corner[4];
gdouble x0, y0, x1, y1, xc = 0.0, yc = 0.0, wc = 0.0, hc = 0.0;
GtkBorder border;
......@@ -656,10 +648,6 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
border.right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
corner[GSK_CORNER_TOP_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS);
corner[GSK_CORNER_TOP_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS);
corner[GSK_CORNER_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS);
corner[GSK_CORNER_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
border_width = MIN (MIN (border.top, border.bottom),
MIN (border.left, border.right));
......@@ -673,51 +661,27 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
yc = y;
wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
hc = border_width;
if (xy0_gap < _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_LEFT], width))
junction |= GTK_JUNCTION_CORNER_TOPLEFT;
if (xy1_gap > width - _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_RIGHT], width))
junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
break;
case GTK_POS_BOTTOM:
xc = x + xy0_gap + border_width;
yc = y + height - border_width;
wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
hc = border_width;
if (xy0_gap < _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_LEFT], width))
junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
if (xy1_gap > width - _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_RIGHT], width))
junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
break;
case GTK_POS_LEFT:
xc = x;
yc = y + xy0_gap + border_width;
wc = border_width;
hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
if (xy0_gap < _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_LEFT], height))
junction |= GTK_JUNCTION_CORNER_TOPLEFT;
if (xy1_gap > height - _gtk_css_corner_value_get_y (corner[GSK_CORNER_BOTTOM_LEFT], height))
junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
break;
case GTK_POS_RIGHT:
xc = x + width - border_width;
yc = y + xy0_gap + border_width;
wc = border_width;
hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
if (xy0_gap < _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_RIGHT], height))
junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
if (xy1_gap > height - _gtk_css_corner_value_get_y (corner[GSK_CORNER_BOTTOM_RIGHT], height))
junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
break;
}
......@@ -729,8 +693,7 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
cairo_clip (cr);
gtk_css_style_render_border (style, cr,
x, y, width, height,
junction);
x, y, width, height);
cairo_restore (cr);
}
......@@ -786,8 +749,7 @@ gtk_render_frame_gap (GtkStyleContext *context,
gtk_css_style_render_frame_gap (gtk_style_context_lookup_style (context),
cr,
x, y, width, height, gap_side,
xy0_gap, xy1_gap,
gtk_style_context_get_junction_sides (context));
xy0_gap, xy1_gap);
}
static void
......@@ -982,7 +944,7 @@ gtk_render_content_path (GtkStyleContext *context,
g_return_if_fail (cr != NULL);
_gtk_rounded_box_init_rect (&box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_style (&box, gtk_style_context_lookup_style (context), 0);
_gtk_rounded_box_apply_border_radius_for_style (&box, gtk_style_context_lookup_style (context));
gsk_rounded_rect_shrink (&box,
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100)
......
......@@ -527,8 +527,7 @@ static void
gtk_theming_background_init (GtkThemingBackground *bg,
GtkCssStyle *style,
double width,
double height,
GtkJunctionSides junction)
double height)
{
GtkBorder border, padding;
......@@ -552,7 +551,7 @@ gtk_theming_background_init (GtkThemingBackground *bg,
* right now we just shrink to the default.
*/
_gtk_rounded_box_init_rect (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], 0, 0, width, height);
_gtk_rounded_box_apply_border_radius_for_style (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], bg->style, junction);
_gtk_rounded_box_apply_border_radius_for_style (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], bg->style);
bg->boxes[GTK_CSS_AREA_PADDING_BOX] = bg->boxes[GTK_CSS_AREA_BORDER_BOX];
gsk_rounded_rect_shrink (&bg->boxes[GTK_CSS_AREA_PADDING_BOX],
......@@ -571,8 +570,7 @@ gtk_css_style_render_background (GtkCssStyle *style,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
GtkJunctionSides junction)
gdouble height)
{
GtkThemingBackground bg;
gint idx;
......@@ -593,7 +591,7 @@ gtk_css_style_render_background (GtkCssStyle *style,
_gtk_css_shadows_value_is_none (box_shadow))
return;
gtk_theming_background_init (&bg, style, width, height, junction);
gtk_theming_background_init (&bg, style, width, height);
cairo_save (cr);
cairo_translate (cr, x, y);
......@@ -650,8 +648,7 @@ void
gtk_css_style_snapshot_background (GtkCssStyle *style,
GtkSnapshot *snapshot,
gdouble width,
gdouble height,
GtkJunctionSides junction)
gdouble height)
{
GtkThemingBackground bg;
gint idx;
......@@ -671,7 +668,7 @@ gtk_css_style_snapshot_background (GtkCssStyle *style,
_gtk_css_shadows_value_is_none (box_shadow))
return;
gtk_theming_background_init (&bg, style, width, height, junction);
gtk_theming_background_init (&bg, style, width, height);
gtk_css_shadows_value_snapshot_outset (box_shadow,
snapshot,
......
......@@ -33,13 +33,11 @@ void gtk_css_style_render_background (GtkCssStyle
gdouble x,
gdouble y,
gdouble width,
gdouble height,
GtkJunctionSides junction);
gdouble height);
void gtk_css_style_snapshot_background (GtkCssStyle *style,
GtkSnapshot *snapshot,
gdouble width,
gdouble height,
GtkJunctionSides junction);
gdouble height);
......
......@@ -870,13 +870,12 @@ gtk_css_style_render_has_border (GtkCssStyle *style)
}
void
gtk_css_style_render_border (GtkCssStyle *style,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
GtkJunctionSides junction)
gtk_css_style_render_border (GtkCssStyle *style,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height)
{
GtkBorderImage border_image;
double border_width[4];
......@@ -914,18 +913,17 @@ gtk_css_style_render_border (GtkCssStyle *style,
colors[3] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
_gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_style (&border_box, style, junction);
_gtk_rounded_box_apply_border_radius_for_style (&border_box, style);
render_border (cr, &border_box, border_width, colors, border_style);
}
}
void
gtk_css_style_snapshot_border (GtkCssStyle *style,
GtkSnapshot *snapshot,
gdouble width,
gdouble height,
GtkJunctionSides junction)
gtk_css_style_snapshot_border (GtkCssStyle *style,
GtkSnapshot *snapshot,
gdouble width,
gdouble height)
{
GtkBorderImage border_image;
float border_width[4];
......@@ -973,7 +971,7 @@ gtk_css_style_snapshot_border (GtkCssStyle *style,
colors[3] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
_gtk_rounded_box_init_rect (&border_box, 0, 0, width, height);
_gtk_rounded_box_apply_border_radius_for_style (&border_box, style, junction);
_gtk_rounded_box_apply_border_radius_for_style (&border_box, style);
snapshot_border (snapshot, &border_box, border_width, colors, border_style);
}
......@@ -1070,7 +1068,7 @@ gtk_css_style_render_outline (GtkCssStyle *style,
colors[3] = colors[2] = colors[1] = colors[0];
_gtk_rounded_box_init_rect (&border_box, rect.x, rect.y, rect.width, rect.height);
_gtk_rounded_box_apply_outline_radius_for_style (&border_box, style, GTK_JUNCTION_NONE);
_gtk_rounded_box_apply_outline_radius_for_style (&border_box, style);
render_border (cr, &border_box, border_width, colors, border_style);
}
......@@ -1101,7 +1099,7 @@ gtk_css_style_snapshot_outline (GtkCssStyle *style,
colors[3] = colors[2] = colors[1] = colors[0];
_gtk_rounded_box_init_rect (&border_box, rect.x, rect.y, rect.width, rect.height);
_gtk_rounded_box_apply_outline_radius_for_style (&border_box, style, GTK_JUNCTION_NONE);
_gtk_rounded_box_apply_outline_radius_for_style (&border_box, style);
snapshot_border (snapshot, &border_box, border_width, colors, border_style);
}
......
......@@ -35,8 +35,7 @@ void gtk_css_style_render_border (GtkCssStyle
gdouble x,
gdouble y,
gdouble width,
gdouble height,
GtkJunctionSides junction);
gdouble height);
gboolean gtk_css_style_render_border_get_clip (GtkCssStyle *style,
gdouble x,
gdouble y,
......@@ -46,8 +45,7 @@ gboolean gtk_css_style_render_border_get_clip (GtkCssStyle
void gtk_css_style_snapshot_border (GtkCssStyle *style,
GtkSnapshot *snapshot,
gdouble width,
gdouble height,
GtkJunctionSides junction);
gdouble height);
gboolean gtk_css_style_render_has_outline (GtkCssStyle *style);
void gtk_css_style_render_outline (GtkCssStyle *style,
......
......@@ -86,31 +86,30 @@ gtk_rounded_box_clamp_border_radius (GskRoundedRect *box)
static void
_gtk_rounded_box_apply_border_radius (GskRoundedRect *box,
GtkCssValue **corner,
GtkJunctionSides junction)
GtkCssValue **corner)
{
if (corner[GSK_CORNER_TOP_LEFT] && (junction & GTK_JUNCTION_CORNER_TOPLEFT) == 0)
if (corner[GSK_CORNER_TOP_LEFT])
{
box->corner[GSK_CORNER_TOP_LEFT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_LEFT],
box->bounds.size.width);
box->corner[GSK_CORNER_TOP_LEFT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_LEFT],
box->bounds.size.height);
}
if (corner[GSK_CORNER_TOP_RIGHT] && (junction & GTK_JUNCTION_CORNER_TOPRIGHT) == 0)
if (corner[GSK_CORNER_TOP_RIGHT])
{
box->corner[GSK_CORNER_TOP_RIGHT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_RIGHT],
box->bounds.size.width);
box->corner[GSK_CORNER_TOP_RIGHT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_RIGHT],
box->bounds.size.height);
}
if (corner[GSK_CORNER_BOTTOM_RIGHT] && (junction & GTK_JUNCTION_CORNER_BOTTOMRIGHT) == 0)
if (corner[GSK_CORNER_BOTTOM_RIGHT])
{
box->corner[GSK_CORNER_BOTTOM_RIGHT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_RIGHT],
box->bounds.size.width);
box->corner[GSK_CORNER_BOTTOM_RIGHT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_BOTTOM_RIGHT],
box->bounds.size.height);
}
if (corner[GSK_CORNER_BOTTOM_LEFT] && (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT) == 0)
if (corner[GSK_CORNER_BOTTOM_LEFT])
{
box->corner[GSK_CORNER_BOTTOM_LEFT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_LEFT],
box->bounds.size.width);
......@@ -123,8 +122,7 @@ _gtk_rounded_box_apply_border_radius (GskRoundedRect *box,
void
_gtk_rounded_box_apply_border_radius_for_style (GskRoundedRect *box,
GtkCssStyle *style,
GtkJunctionSides junction)
GtkCssStyle *style)
{
GtkCssValue *corner[4];
......@@ -133,13 +131,12 @@ _gtk_rounded_box_apply_border_radius_for_style (GskRoundedRect *box,
corner[GSK_CORNER_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS);
corner[GSK_CORNER_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
_gtk_rounded_box_apply_border_radius (box, corner);
}
void
_gtk_rounded_box_apply_outline_radius_for_style (GskRoundedRect *box,
GtkCssStyle *style,
GtkJunctionSides junction)
GtkCssStyle *style)
{
GtkCssValue *corner[4];
......@@ -148,7 +145,7 @@ _gtk_rounded_box_apply_outline_radius_for_style (GskRoundedRect *box,
corner[GSK_CORNER_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
corner[GSK_CORNER_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
_gtk_rounded_box_apply_border_radius (box, corner);
}
typedef struct {
......
......@@ -35,12 +35,10 @@ void _gtk_rounded_box_init_rect (GskRoundedRect
double height);
void _gtk_rounded_box_apply_border_radius_for_style (GskRoundedRect *box,
GtkCssStyle *style,
GtkJunctionSides junction);
GtkCssStyle *style);
void _gtk_rounded_box_apply_outline_radius_for_style (GskRoundedRect *box,
GtkCssStyle *style,
GtkJunctionSides junction);
GtkCssStyle *style);
double _gtk_rounded_box_guess_length (const GskRoundedRect *box,
GtkCssSide side);
......
......@@ -890,8 +890,7 @@ gtk_snapshot_render_background (GtkSnapshot *snapshot,
gtk_snapshot_translate_2d (snapshot, x, y);
gtk_css_style_snapshot_background (gtk_style_context_lookup_style (context),
snapshot,
width, height,
gtk_style_context_get_junction_sides (context));
width, height);
gtk_snapshot_translate_2d (snapshot, -x, -y);
}
......@@ -924,8 +923,7 @@ gtk_snapshot_render_frame (GtkSnapshot *snapshot,
gtk_snapshot_translate_2d (snapshot, x, y);
gtk_css_style_snapshot_border (gtk_style_context_lookup_style (context),
snapshot,
width, height,
gtk_style_context_get_junction_sides (context));
width, height);
gtk_snapshot_translate_2d (snapshot, -x, -y);
}
......
......@@ -1708,51 +1708,6 @@ gtk_style_context_get_frame_clock (GtkStyleContext *context)
return context->priv->frame_clock;
}
/**
* gtk_style_context_set_junction_sides:
* @context: a #GtkStyleContext
* @sides: sides where rendered elements are visually connected to
* other elements
*
* Sets the sides where rendered elements (mostly through
* gtk_render_frame()) will visually connect with other visual elements.
*
* This is merely a hint that may or may not be honored
* by themes.
*
* Container widgets are expected to set junction hints as appropriate
* for their children, so it should not normally be necessary to call
* this function manually.
*
* Since: 3.0
**/
void
gtk_style_context_set_junction_sides (GtkStyleContext *context,
GtkJunctionSides sides)
{
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
gtk_css_node_set_junction_sides (context->priv->cssnode, sides);
}
/**
* gtk_style_context_get_junction_sides:
* @context: a #GtkStyleContext
*
* Returns the sides where rendered elements connect visually with others.
*
* Returns: the junction sides
*
* Since: 3.0
**/
GtkJunctionSides
gtk_style_context_get_junction_sides (GtkStyleContext *context)
{
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
return gtk_css_node_get_junction_sides (context->priv->cssnode);
}
gboolean
_gtk_style_context_resolve_color (GtkStyleContext *context,
GtkCssValue *color,
......
......@@ -1071,12 +1071,6 @@ void gtk_style_context_set_frame_clock (GtkStyleContext *context,
GDK_AVAILABLE_IN_3_8
GdkFrameClock *gtk_style_context_get_frame_clock (GtkStyleContext *context);
GDK_AVAILABLE_IN_ALL
void gtk_style_context_set_junction_sides (GtkStyleContext *context,
GtkJunctionSides sides);
GDK_AVAILABLE_IN_ALL
GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext *context);
GDK_AVAILABLE_IN_ALL
gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
const gchar *color_name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment