Compare commits
22 Commits
amolenaar/
...
css-variab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5d0f32d8c | ||
|
|
e825fd901f | ||
|
|
e3543f37d3 | ||
|
|
e9bf0322ac | ||
|
|
6d5cb0a083 | ||
|
|
8b5aab459a | ||
|
|
8da3cc10fd | ||
|
|
f48a4e84af | ||
|
|
09c76208a2 | ||
|
|
62b1d21556 | ||
|
|
8fba58eaa9 | ||
|
|
b4890edd64 | ||
|
|
93b9388180 | ||
|
|
76b2609ad5 | ||
|
|
a37a0711ad | ||
|
|
23dbb7122c | ||
|
|
e04ab263f9 | ||
|
|
5e6e808a55 | ||
|
|
6eaf6e2f7d | ||
|
|
e4a4a0f6dd | ||
|
|
f301ea7936 | ||
|
|
a3e9ecd199 |
7
NEWS
7
NEWS
@@ -6,7 +6,6 @@ Overview of Changes in 4.15.1, xx-xx-xxxx
|
||||
|
||||
* CSS:
|
||||
- Support the :root selector
|
||||
- Support variables and custom properties
|
||||
|
||||
* Icontheme:
|
||||
- Make symbolic svg loading more efficient
|
||||
@@ -15,22 +14,19 @@ Overview of Changes in 4.15.1, xx-xx-xxxx
|
||||
* Accessibility:
|
||||
- Make the gtk-demo sidebar search more accessible
|
||||
- Stop emitting focus events
|
||||
- Realize child contexts when necessary
|
||||
|
||||
* GDK:
|
||||
- Support XDG_ACTIVATION_TOKEN
|
||||
- dmabuf: Be more defensive when importing unknown formats to GL
|
||||
- dmabuf: Use narrow range for YUV
|
||||
- vulkan: Recreate swapchains when necessary or beneficial
|
||||
|
||||
* GSK:
|
||||
- Improve logging for GDK_DEBUG=offload
|
||||
- Improve logging for GSK_DEBUG=renderer
|
||||
- gpu: Warn about inefficient texture import
|
||||
- gpu: Handle tiny offscreens correctly
|
||||
- gpu: Handle tiny offscreens correctly
|
||||
- vulkan: Add profiler marks in various places
|
||||
- vulkan: Fix a problem with imported dmabufs showing up black
|
||||
- cairo: Speed up mask nodes, since we use them for symbolic icons
|
||||
|
||||
* Wayland:
|
||||
- Use wl_compositor version 6
|
||||
@@ -50,7 +46,6 @@ Overview of Changes in 4.15.1, xx-xx-xxxx
|
||||
|
||||
* Translation updates:
|
||||
Korean
|
||||
Portuguese
|
||||
Turkish
|
||||
|
||||
|
||||
|
||||
@@ -41,10 +41,8 @@ G_BEGIN_DECLS
|
||||
|
||||
#ifdef GDK_ARRAY_NULL_TERMINATED
|
||||
#define GDK_ARRAY_REAL_SIZE(_size) ((_size) + 1)
|
||||
#define GDK_ARRAY_MAX_SIZE (G_MAXSIZE / sizeof (_T_) - 1)
|
||||
#else
|
||||
#define GDK_ARRAY_REAL_SIZE(_size) (_size)
|
||||
#define GDK_ARRAY_MAX_SIZE (G_MAXSIZE / sizeof (_T_))
|
||||
#endif
|
||||
|
||||
/* make this readable */
|
||||
@@ -179,23 +177,18 @@ G_GNUC_UNUSED static inline void
|
||||
gdk_array(reserve) (GdkArray *self,
|
||||
gsize n)
|
||||
{
|
||||
gsize new_capacity, size, capacity;
|
||||
gsize new_size, size;
|
||||
|
||||
if (G_UNLIKELY (n > GDK_ARRAY_MAX_SIZE))
|
||||
g_error ("requesting array size of %zu, but maximum size is %zu", n, GDK_ARRAY_MAX_SIZE);
|
||||
|
||||
capacity = gdk_array(get_capacity) (self);
|
||||
if (n <= capacity)
|
||||
return;
|
||||
if (n <= gdk_array(get_capacity) (self))
|
||||
return;
|
||||
|
||||
size = gdk_array(get_size) (self);
|
||||
/* capacity * 2 can overflow, that's why we MAX() */
|
||||
new_capacity = MAX (GDK_ARRAY_REAL_SIZE (n), capacity * 2);
|
||||
new_size = ((gsize) 1) << g_bit_storage (MAX (GDK_ARRAY_REAL_SIZE (n), 16) - 1);
|
||||
|
||||
#ifdef GDK_ARRAY_PREALLOC
|
||||
if (self->start == self->preallocated)
|
||||
{
|
||||
self->start = g_new (_T_, new_capacity);
|
||||
self->start = g_new (_T_, new_size);
|
||||
memcpy (self->start, self->preallocated, sizeof (_T_) * GDK_ARRAY_REAL_SIZE (size));
|
||||
}
|
||||
else
|
||||
@@ -203,15 +196,15 @@ gdk_array(reserve) (GdkArray *self,
|
||||
#ifdef GDK_ARRAY_NULL_TERMINATED
|
||||
if (self->start == NULL)
|
||||
{
|
||||
self->start = g_new (_T_, new_capacity);
|
||||
self->start = g_new (_T_, new_size);
|
||||
*self->start = *(_T_[1]) { 0 };
|
||||
}
|
||||
else
|
||||
#endif
|
||||
self->start = g_renew (_T_, self->start, new_capacity);
|
||||
self->start = g_renew (_T_, self->start, new_size);
|
||||
|
||||
self->end = self->start + size;
|
||||
self->end_allocation = self->start + new_capacity;
|
||||
self->end_allocation = self->start + new_size;
|
||||
#ifdef GDK_ARRAY_NULL_TERMINATED
|
||||
self->end_allocation--;
|
||||
#endif
|
||||
@@ -319,7 +312,6 @@ gdk_array(get) (const GdkArray *self,
|
||||
#undef gdk_array_paste
|
||||
#undef gdk_array
|
||||
#undef GDK_ARRAY_REAL_SIZE
|
||||
#undef GDK_ARRAY_MAX_SIZE
|
||||
|
||||
#undef GDK_ARRAY_BY_VALUE
|
||||
#undef GDK_ARRAY_ELEMENT_TYPE
|
||||
|
||||
@@ -607,8 +607,7 @@ physical_device_check_features (VkPhysicalDevice device)
|
||||
features |= GDK_VULKAN_FEATURE_YCBCR;
|
||||
|
||||
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME) &&
|
||||
physical_device_supports_extension (device, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME) &&
|
||||
physical_device_supports_extension (device, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME))
|
||||
physical_device_supports_extension (device, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME))
|
||||
features |= GDK_VULKAN_FEATURE_DMABUF;
|
||||
|
||||
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME))
|
||||
@@ -1518,7 +1517,6 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
||||
|
||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
|
||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
|
||||
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME);
|
||||
|
||||
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME);
|
||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME);
|
||||
|
||||
@@ -165,29 +165,25 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
double *scale)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
int desired_scale_factor;
|
||||
|
||||
desired_scale_factor = (int) ceil (desired_scale);
|
||||
|
||||
if (gdk_cursor_get_name (cursor))
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
int scale_factor;
|
||||
|
||||
if (g_str_equal (gdk_cursor_get_name (cursor), "none"))
|
||||
{
|
||||
*hotspot_x = *hotspot_y = 0;
|
||||
*width = *height = 0;
|
||||
*scale = 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scale_factor = (int) ceil (desired_scale);
|
||||
goto none;
|
||||
|
||||
c = gdk_wayland_cursor_load_for_name (display,
|
||||
display->cursor_theme,
|
||||
scale_factor,
|
||||
_gdk_wayland_display_get_cursor_theme (display),
|
||||
desired_scale_factor,
|
||||
gdk_cursor_get_name (cursor));
|
||||
if (c && c->image_count > 0)
|
||||
{
|
||||
struct wl_cursor_image *image;
|
||||
int cursor_scale;
|
||||
|
||||
if (image_index >= c->image_count)
|
||||
{
|
||||
@@ -199,23 +195,23 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
|
||||
image = c->images[image_index];
|
||||
|
||||
*width = display->cursor_theme_size;
|
||||
*height = display->cursor_theme_size;
|
||||
*scale = image->width / (double) *width;
|
||||
*hotspot_x = image->hotspot_x / scale_factor;
|
||||
*hotspot_y = image->hotspot_y / scale_factor;
|
||||
|
||||
if (*scale != scale_factor && !use_viewporter)
|
||||
cursor_scale = desired_scale_factor;
|
||||
if ((image->width % cursor_scale != 0) ||
|
||||
(image->height % cursor_scale != 0))
|
||||
{
|
||||
g_warning (G_STRLOC " cursor image size (%d) not an integer "
|
||||
"multiple of theme size (%d)", image->width, *width);
|
||||
*width = image->width;
|
||||
*height = image->height;
|
||||
*hotspot_x = image->hotspot_x;
|
||||
*hotspot_y = image->hotspot_y;
|
||||
*scale = 1;
|
||||
g_warning (G_STRLOC " cursor image size (%dx%d) not an integer "
|
||||
"multiple of scale (%d)", image->width, image->height,
|
||||
cursor_scale);
|
||||
cursor_scale = 1;
|
||||
}
|
||||
|
||||
*hotspot_x = image->hotspot_x / cursor_scale;
|
||||
*hotspot_y = image->hotspot_y / cursor_scale;
|
||||
|
||||
*width = image->width / cursor_scale;
|
||||
*height = image->height / cursor_scale;
|
||||
*scale = cursor_scale;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
}
|
||||
@@ -261,7 +257,7 @@ from_texture:
|
||||
else
|
||||
{
|
||||
if (!use_viewporter)
|
||||
*scale = ceil (desired_scale);
|
||||
*scale = desired_scale_factor;
|
||||
else
|
||||
*scale = desired_scale;
|
||||
|
||||
@@ -298,23 +294,28 @@ from_texture:
|
||||
}
|
||||
|
||||
if (gdk_cursor_get_fallback (cursor))
|
||||
{
|
||||
return _gdk_wayland_cursor_get_buffer (display,
|
||||
gdk_cursor_get_fallback (cursor),
|
||||
desired_scale,
|
||||
use_viewporter,
|
||||
image_index,
|
||||
hotspot_x, hotspot_y,
|
||||
width, height,
|
||||
scale);
|
||||
}
|
||||
return _gdk_wayland_cursor_get_buffer (display,
|
||||
gdk_cursor_get_fallback (cursor),
|
||||
desired_scale,
|
||||
use_viewporter,
|
||||
image_index,
|
||||
hotspot_x, hotspot_y,
|
||||
width, height,
|
||||
scale);
|
||||
else
|
||||
{
|
||||
texture = gdk_texture_new_from_resource ("/org/gtk/libgdk/cursor/default");
|
||||
goto from_texture;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
none:
|
||||
*hotspot_x = 0;
|
||||
*hotspot_y = 0;
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
*scale = 1;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
guint
|
||||
|
||||
@@ -1776,6 +1776,11 @@ _gdk_x11_display_is_root_window (GdkDisplay *display,
|
||||
return GDK_SCREEN_XROOTWIN (display_x11->screen) == xroot_window;
|
||||
}
|
||||
|
||||
struct XPointerUngrabInfo {
|
||||
GdkDisplay *display;
|
||||
guint32 time;
|
||||
};
|
||||
|
||||
static void
|
||||
device_grab_update_callback (GdkDisplay *display,
|
||||
gpointer data,
|
||||
|
||||
@@ -6397,10 +6397,6 @@ gsk_mask_node_draw (GskRenderNode *node,
|
||||
graphene_matrix_t color_matrix;
|
||||
graphene_vec4_t color_offset;
|
||||
|
||||
/* clip so the push_group() creates a smaller surface */
|
||||
gsk_cairo_rectangle (cr, &node->bounds);
|
||||
cairo_clip (cr);
|
||||
|
||||
if (has_empty_clip (cr))
|
||||
return;
|
||||
|
||||
|
||||
@@ -530,15 +530,6 @@ handle_accessible_method (GDBusConnection *connection,
|
||||
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{ss}"));
|
||||
g_variant_builder_add (&builder, "{ss}", "toolkit", "GTK");
|
||||
|
||||
if (gtk_at_context_has_accessible_property (GTK_AT_CONTEXT (self), GTK_ACCESSIBLE_PROPERTY_LEVEL))
|
||||
{
|
||||
GtkAccessibleValue *value = gtk_at_context_get_accessible_property (GTK_AT_CONTEXT (self),
|
||||
GTK_ACCESSIBLE_PROPERTY_LEVEL);
|
||||
char *level = g_strdup_printf ("%d", gtk_int_accessible_value_get (value));
|
||||
g_variant_builder_add (&builder, "{ss}", "level", level);
|
||||
g_free (level);
|
||||
}
|
||||
|
||||
if (gtk_at_context_has_accessible_property (GTK_AT_CONTEXT (self), GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER))
|
||||
{
|
||||
GtkAccessibleValue *value;
|
||||
@@ -1266,13 +1257,10 @@ gtk_at_spi_context_child_change (GtkATContext *ctx,
|
||||
}
|
||||
|
||||
if (change & GTK_ACCESSIBLE_CHILD_CHANGE_ADDED)
|
||||
{
|
||||
gtk_at_context_realize (child_context);
|
||||
emit_children_changed (self,
|
||||
GTK_AT_SPI_CONTEXT (child_context),
|
||||
idx,
|
||||
GTK_ACCESSIBLE_CHILD_STATE_ADDED);
|
||||
}
|
||||
else if (change & GTK_ACCESSIBLE_CHILD_CHANGE_REMOVED)
|
||||
emit_children_changed (self,
|
||||
GTK_AT_SPI_CONTEXT (child_context),
|
||||
|
||||
@@ -49,7 +49,7 @@ struct _GtkCssParserBlock
|
||||
#define GDK_ARRAY_NAME gtk_css_parser_blocks
|
||||
#define GDK_ARRAY_TYPE_NAME GtkCssParserBlocks
|
||||
#define GDK_ARRAY_ELEMENT_TYPE GtkCssParserBlock
|
||||
#define GDK_ARRAY_PREALLOC 12
|
||||
#define GDK_ARRAY_PREALLOC 32
|
||||
#define GDK_ARRAY_NO_MEMSET 1
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
|
||||
@@ -786,7 +786,7 @@ gtk_style_context_resolve_color (GtkStyleContext *context,
|
||||
return FALSE;
|
||||
|
||||
*result = *gtk_css_color_value_get_rgba (val);
|
||||
gtk_css_value_unref (val);
|
||||
_gtk_css_value_unref (val);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2188,8 +2188,7 @@ gtk_column_view_set_header_factory (GtkColumnView *self,
|
||||
/**
|
||||
* gtk_column_view_scroll_to:
|
||||
* @self: The columnview to scroll in
|
||||
* @pos: position of the item. Must be less than the number of
|
||||
* items in the view.
|
||||
* @pos: position of the item
|
||||
* @column: (nullable) (transfer none): The column to scroll to
|
||||
* or %NULL to not scroll columns.
|
||||
* @flags: actions to perform
|
||||
@@ -2212,7 +2211,6 @@ gtk_column_view_scroll_to (GtkColumnView *self,
|
||||
GtkScrollInfo *scroll)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_COLUMN_VIEW (self));
|
||||
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self->listview)));
|
||||
g_return_if_fail (column == NULL || GTK_IS_COLUMN_VIEW_COLUMN (column));
|
||||
if (column)
|
||||
{
|
||||
|
||||
@@ -44,8 +44,7 @@ G_DEFINE_TYPE (GtkCssAnimatedStyle, gtk_css_animated_style, GTK_TYPE_CSS_STYLE)
|
||||
|
||||
#define DEFINE_VALUES(ENUM, TYPE, NAME) \
|
||||
static inline void \
|
||||
gtk_css_ ## NAME ## _values_recompute (GtkCssAnimatedStyle *animated, \
|
||||
GtkCssComputeContext *context) \
|
||||
gtk_css_ ## NAME ## _values_recompute (GtkCssAnimatedStyle *animated) \
|
||||
{ \
|
||||
GtkCssStyle *style = (GtkCssStyle *)animated; \
|
||||
GtkCssValue **values = (GtkCssValue **)((guint8*)(animated->style->NAME) + sizeof (GtkCssValues)); \
|
||||
@@ -63,9 +62,12 @@ gtk_css_ ## NAME ## _values_recompute (GtkCssAnimatedStyle *animated, \
|
||||
if (original == NULL) \
|
||||
continue; \
|
||||
\
|
||||
computed = gtk_css_value_compute (original, \
|
||||
id, \
|
||||
context); \
|
||||
computed = _gtk_css_value_compute (original, \
|
||||
id, \
|
||||
animated->provider, \
|
||||
style, \
|
||||
animated->parent_style, \
|
||||
NULL); \
|
||||
if (computed == NULL) \
|
||||
continue; \
|
||||
\
|
||||
@@ -609,7 +611,6 @@ gtk_css_animated_style_set_animated_custom_value (GtkCssAnimatedStyle *animated,
|
||||
GtkCssVariableValue *value)
|
||||
{
|
||||
GtkCssStyle *style = (GtkCssStyle *)animated;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
gtk_internal_return_if_fail (GTK_IS_CSS_ANIMATED_STYLE (style));
|
||||
gtk_internal_return_if_fail (value != NULL);
|
||||
@@ -629,22 +630,17 @@ gtk_css_animated_style_set_animated_custom_value (GtkCssAnimatedStyle *animated,
|
||||
|
||||
gtk_css_variable_set_add (style->variables, id, value);
|
||||
|
||||
context.provider = animated->provider;
|
||||
context.style = animated->style;
|
||||
context.parent_style = animated->parent_style;
|
||||
context.provider = animated->provider;
|
||||
|
||||
gtk_css_core_values_recompute (animated, &context);
|
||||
gtk_css_background_values_recompute (animated, &context);
|
||||
gtk_css_border_values_recompute (animated, &context);
|
||||
gtk_css_icon_values_recompute (animated, &context);
|
||||
gtk_css_outline_values_recompute (animated, &context);
|
||||
gtk_css_font_values_recompute (animated, &context);
|
||||
gtk_css_font_variant_values_recompute (animated, &context);
|
||||
gtk_css_animation_values_recompute (animated, &context);
|
||||
gtk_css_transition_values_recompute (animated, &context);
|
||||
gtk_css_size_values_recompute (animated, &context);
|
||||
gtk_css_other_values_recompute (animated, &context);
|
||||
gtk_css_core_values_recompute (animated);
|
||||
gtk_css_background_values_recompute (animated);
|
||||
gtk_css_border_values_recompute (animated);
|
||||
gtk_css_icon_values_recompute (animated);
|
||||
gtk_css_outline_values_recompute (animated);
|
||||
gtk_css_font_values_recompute (animated);
|
||||
gtk_css_font_variant_values_recompute (animated);
|
||||
gtk_css_animation_values_recompute (animated);
|
||||
gtk_css_transition_values_recompute (animated);
|
||||
gtk_css_size_values_recompute (animated);
|
||||
gtk_css_other_values_recompute (animated);
|
||||
}
|
||||
|
||||
GtkCssVariableValue *
|
||||
@@ -819,7 +815,7 @@ gtk_css_animated_style_create_css_transitions (GPtrArray *animations,
|
||||
start = gtk_css_animated_style_get_intrinsic_value ((GtkCssAnimatedStyle *)source, i);
|
||||
end = gtk_css_style_get_value (base_style, i);
|
||||
|
||||
if (gtk_css_value_equal (start, end))
|
||||
if (_gtk_css_value_equal (start, end))
|
||||
{
|
||||
animation = gtk_css_animated_style_find_transition ((GtkCssAnimatedStyle *)source, i);
|
||||
if (animation)
|
||||
@@ -835,8 +831,8 @@ gtk_css_animated_style_create_css_transitions (GPtrArray *animations,
|
||||
}
|
||||
}
|
||||
|
||||
if (gtk_css_value_equal (gtk_css_style_get_value (source, i),
|
||||
gtk_css_style_get_value (base_style, i)))
|
||||
if (_gtk_css_value_equal (gtk_css_style_get_value (source, i),
|
||||
gtk_css_style_get_value (base_style, i)))
|
||||
continue;
|
||||
|
||||
animation = _gtk_css_transition_new (i,
|
||||
|
||||
@@ -171,7 +171,7 @@ gtk_css_animation_free (GtkStyleAnimation *animation)
|
||||
|
||||
g_free (self->name);
|
||||
_gtk_css_keyframes_unref (self->keyframes);
|
||||
gtk_css_value_unref (self->ease);
|
||||
_gtk_css_value_unref (self->ease);
|
||||
|
||||
g_free (self);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ _gtk_css_animation_new (const char *name,
|
||||
|
||||
animation->name = g_strdup (name);
|
||||
animation->keyframes = _gtk_css_keyframes_ref (keyframes);
|
||||
animation->ease = gtk_css_value_ref (ease);
|
||||
animation->ease = _gtk_css_value_ref (ease);
|
||||
animation->direction = direction;
|
||||
animation->play_state = play_state;
|
||||
animation->fill_mode = fill_mode;
|
||||
@@ -242,7 +242,7 @@ _gtk_css_animation_advance_with_play_state (GtkCssAnimation *source,
|
||||
|
||||
animation->name = g_strdup (source->name);
|
||||
animation->keyframes = _gtk_css_keyframes_ref (source->keyframes);
|
||||
animation->ease = gtk_css_value_ref (source->ease);
|
||||
animation->ease = _gtk_css_value_ref (source->ease);
|
||||
animation->direction = source->direction;
|
||||
animation->play_state = play_state;
|
||||
animation->fill_mode = source->fill_mode;
|
||||
|
||||
@@ -35,15 +35,18 @@ gtk_css_value_array_free (GtkCssValue *value)
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < value->n_values; i++)
|
||||
gtk_css_value_unref (value->values[i]);
|
||||
_gtk_css_value_unref (value->values[i]);
|
||||
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_array_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_array_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkCssValue *i_value;
|
||||
@@ -52,24 +55,24 @@ gtk_css_value_array_compute (GtkCssValue *value,
|
||||
result = NULL;
|
||||
for (i = 0; i < value->n_values; i++)
|
||||
{
|
||||
i_value = gtk_css_value_compute (value->values[i], property_id, context);
|
||||
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (result == NULL &&
|
||||
i_value != value->values[i])
|
||||
{
|
||||
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
|
||||
for (j = 0; j < i; j++)
|
||||
gtk_css_value_ref (result->values[j]);
|
||||
_gtk_css_value_ref (result->values[j]);
|
||||
}
|
||||
|
||||
if (result != NULL)
|
||||
result->values[i] = i_value;
|
||||
else
|
||||
gtk_css_value_unref (i_value);
|
||||
_gtk_css_value_unref (i_value);
|
||||
}
|
||||
|
||||
if (result == NULL)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -85,8 +88,8 @@ gtk_css_value_array_equal (const GtkCssValue *value1,
|
||||
|
||||
for (i = 0; i < value1->n_values; i++)
|
||||
{
|
||||
if (!gtk_css_value_equal (value1->values[i],
|
||||
value2->values[i]))
|
||||
if (!_gtk_css_value_equal (value1->values[i],
|
||||
value2->values[i]))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -125,14 +128,14 @@ gtk_css_value_array_transition_repeat (GtkCssValue *start,
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
transitions[i] = gtk_css_value_transition (start->values[i % start->n_values],
|
||||
end->values[i % end->n_values],
|
||||
property_id,
|
||||
progress);
|
||||
transitions[i] = _gtk_css_value_transition (start->values[i % start->n_values],
|
||||
end->values[i % end->n_values],
|
||||
property_id,
|
||||
progress);
|
||||
if (transitions[i] == NULL)
|
||||
{
|
||||
while (i--)
|
||||
gtk_css_value_unref (transitions[i]);
|
||||
_gtk_css_value_unref (transitions[i]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -166,14 +169,14 @@ gtk_css_value_array_transition_extend (GtkCssValue *start,
|
||||
|
||||
for (i = 0; i < MIN (start->n_values, end->n_values); i++)
|
||||
{
|
||||
transitions[i] = gtk_css_value_transition (start->values[i],
|
||||
end->values[i],
|
||||
property_id,
|
||||
progress);
|
||||
transitions[i] = _gtk_css_value_transition (start->values[i],
|
||||
end->values[i],
|
||||
property_id,
|
||||
progress);
|
||||
if (transitions[i] == NULL)
|
||||
{
|
||||
while (i--)
|
||||
gtk_css_value_unref (transitions[i]);
|
||||
_gtk_css_value_unref (transitions[i]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -186,28 +189,28 @@ gtk_css_value_array_transition_extend (GtkCssValue *start,
|
||||
|
||||
for (; i < start->n_values; i++)
|
||||
{
|
||||
transitions[i] = gtk_css_value_transition (start->values[i],
|
||||
default_value,
|
||||
property_id,
|
||||
progress);
|
||||
transitions[i] = _gtk_css_value_transition (start->values[i],
|
||||
default_value,
|
||||
property_id,
|
||||
progress);
|
||||
if (transitions[i] == NULL)
|
||||
{
|
||||
while (i--)
|
||||
gtk_css_value_unref (transitions[i]);
|
||||
_gtk_css_value_unref (transitions[i]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < end->n_values; i++)
|
||||
{
|
||||
transitions[i] = gtk_css_value_transition (default_value,
|
||||
end->values[i],
|
||||
property_id,
|
||||
progress);
|
||||
transitions[i] = _gtk_css_value_transition (default_value,
|
||||
end->values[i],
|
||||
property_id,
|
||||
progress);
|
||||
if (transitions[i] == NULL)
|
||||
{
|
||||
while (i--)
|
||||
gtk_css_value_unref (transitions[i]);
|
||||
_gtk_css_value_unref (transitions[i]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -325,17 +328,17 @@ gtk_css_value_array_get_dynamic_value (GtkCssValue *value,
|
||||
{
|
||||
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
|
||||
for (j = 0; j < i; j++)
|
||||
gtk_css_value_ref (result->values[j]);
|
||||
_gtk_css_value_ref (result->values[j]);
|
||||
}
|
||||
|
||||
if (result != NULL)
|
||||
result->values[i] = i_value;
|
||||
else
|
||||
gtk_css_value_unref (i_value);
|
||||
_gtk_css_value_unref (i_value);
|
||||
}
|
||||
|
||||
if (result == NULL)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -356,7 +359,7 @@ gtk_css_value_array_print (const GtkCssValue *value,
|
||||
{
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (value->values[i], string);
|
||||
_gtk_css_value_print (value->values[i], string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,12 +395,11 @@ _gtk_css_array_value_new_from_array (GtkCssValue **values,
|
||||
if (n_values == 1)
|
||||
return values[0];
|
||||
|
||||
result = gtk_css_value_alloc (>K_CSS_VALUE_ARRAY, sizeof (GtkCssValue) + sizeof (GtkCssValue *) * (n_values - 1));
|
||||
result = _gtk_css_value_alloc (>K_CSS_VALUE_ARRAY, sizeof (GtkCssValue) + sizeof (GtkCssValue *) * (n_values - 1));
|
||||
result->n_values = n_values;
|
||||
memcpy (&result->values[0], values, sizeof (GtkCssValue *) * n_values);
|
||||
|
||||
result->is_computed = TRUE;
|
||||
result->contains_variables = FALSE;
|
||||
for (i = 0; i < n_values; i ++)
|
||||
{
|
||||
if (!gtk_css_value_is_computed (values[i]))
|
||||
@@ -428,7 +430,7 @@ _gtk_css_array_value_parse (GtkCssParser *parser,
|
||||
if (value == NULL)
|
||||
{
|
||||
for (i = 0; i < n_values; i ++)
|
||||
gtk_css_value_unref (values[i]);
|
||||
_gtk_css_value_unref (values[i]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -33,39 +33,42 @@ static void
|
||||
gtk_css_value_bg_size_free (GtkCssValue *value)
|
||||
{
|
||||
if (value->x)
|
||||
gtk_css_value_unref (value->x);
|
||||
_gtk_css_value_unref (value->x);
|
||||
if (value->y)
|
||||
gtk_css_value_unref (value->y);
|
||||
_gtk_css_value_unref (value->y);
|
||||
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_bg_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_bg_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
if (value->x == NULL && value->y == NULL)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
x = y = NULL;
|
||||
|
||||
if (value->x)
|
||||
x = gtk_css_value_compute (value->x, property_id, context);
|
||||
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (value->y)
|
||||
y = gtk_css_value_compute (value->y, property_id, context);
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (x == value->x && y == value->y)
|
||||
{
|
||||
if (x)
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
if (y)
|
||||
gtk_css_value_unref (y);
|
||||
_gtk_css_value_unref (y);
|
||||
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
||||
@@ -80,10 +83,10 @@ gtk_css_value_bg_size_equal (const GtkCssValue *value1,
|
||||
value1->contain == value2->contain &&
|
||||
(value1->x == value2->x ||
|
||||
(value1->x != NULL && value2->x != NULL &&
|
||||
gtk_css_value_equal (value1->x, value2->x))) &&
|
||||
_gtk_css_value_equal (value1->x, value2->x))) &&
|
||||
(value1->y == value2->y ||
|
||||
(value1->y != NULL && value2->y != NULL &&
|
||||
gtk_css_value_equal (value1->y, value2->y)));
|
||||
_gtk_css_value_equal (value1->y, value2->y)));
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
@@ -95,9 +98,9 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
if (start->cover)
|
||||
return end->cover ? gtk_css_value_ref (end) : NULL;
|
||||
return end->cover ? _gtk_css_value_ref (end) : NULL;
|
||||
if (start->contain)
|
||||
return end->contain ? gtk_css_value_ref (end) : NULL;
|
||||
return end->contain ? _gtk_css_value_ref (end) : NULL;
|
||||
|
||||
if ((start->x != NULL) ^ (end->x != NULL) ||
|
||||
(start->y != NULL) ^ (end->y != NULL))
|
||||
@@ -105,7 +108,7 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
|
||||
|
||||
if (start->x)
|
||||
{
|
||||
x = gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
if (x == NULL)
|
||||
return NULL;
|
||||
}
|
||||
@@ -114,10 +117,10 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
|
||||
|
||||
if (start->y)
|
||||
{
|
||||
y = gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -140,12 +143,12 @@ gtk_css_value_bg_size_print (const GtkCssValue *value,
|
||||
if (value->x == NULL)
|
||||
g_string_append (string, "auto");
|
||||
else
|
||||
gtk_css_value_print (value->x, string);
|
||||
_gtk_css_value_print (value->x, string);
|
||||
|
||||
if (value->y)
|
||||
{
|
||||
g_string_append_c (string, ' ');
|
||||
gtk_css_value_print (value->y, string);
|
||||
_gtk_css_value_print (value->y, string);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,9 +175,9 @@ _gtk_css_bg_size_value_new (GtkCssValue *x,
|
||||
GtkCssValue *result;
|
||||
|
||||
if (x == NULL && y == NULL)
|
||||
return gtk_css_value_ref (&auto_singleton);
|
||||
return _gtk_css_value_ref (&auto_singleton);
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_BG_SIZE);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_BG_SIZE);
|
||||
result->x = x;
|
||||
result->y = y;
|
||||
result->is_computed = (!x || gtk_css_value_is_computed (x)) &&
|
||||
@@ -189,9 +192,9 @@ _gtk_css_bg_size_value_parse (GtkCssParser *parser)
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
if (gtk_css_parser_try_ident (parser, "cover"))
|
||||
return gtk_css_value_ref (&cover_singleton);
|
||||
return _gtk_css_value_ref (&cover_singleton);
|
||||
else if (gtk_css_parser_try_ident (parser, "contain"))
|
||||
return gtk_css_value_ref (&contain_singleton);
|
||||
return _gtk_css_value_ref (&contain_singleton);
|
||||
|
||||
if (gtk_css_parser_try_ident (parser, "auto"))
|
||||
x = NULL;
|
||||
@@ -217,7 +220,7 @@ _gtk_css_bg_size_value_parse (GtkCssParser *parser)
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,16 +35,19 @@ gtk_css_value_border_free (GtkCssValue *value)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (value->values[i])
|
||||
gtk_css_value_unref (value->values[i]);
|
||||
_gtk_css_value_unref (value->values[i]);
|
||||
}
|
||||
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_border_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_border_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *values[4];
|
||||
GtkCssValue *computed;
|
||||
@@ -55,7 +58,7 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
{
|
||||
if (value->values[i])
|
||||
{
|
||||
values[i] = gtk_css_value_compute (value->values[i], property_id, context);
|
||||
values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, variables);
|
||||
changed |= (values[i] != value->values[i]);
|
||||
}
|
||||
else
|
||||
@@ -69,9 +72,9 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (values[i] != NULL)
|
||||
gtk_css_value_unref (values[i]);
|
||||
_gtk_css_value_unref (values[i]);
|
||||
}
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
computed = _gtk_css_border_value_new (values[0], values[1], values[2], values[3]);
|
||||
@@ -91,7 +94,7 @@ gtk_css_value_border_equal (const GtkCssValue *value1,
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (!gtk_css_value_equal0 (value1->values[i], value2->values[i]))
|
||||
if (!_gtk_css_value_equal0 (value1->values[i], value2->values[i]))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -113,11 +116,11 @@ gtk_css_value_border_print (const GtkCssValue *value,
|
||||
{
|
||||
guint i, n;
|
||||
|
||||
if (!gtk_css_value_equal0 (value->values[GTK_CSS_RIGHT], value->values[GTK_CSS_LEFT]))
|
||||
if (!_gtk_css_value_equal0 (value->values[GTK_CSS_RIGHT], value->values[GTK_CSS_LEFT]))
|
||||
n = 4;
|
||||
else if (!gtk_css_value_equal0 (value->values[GTK_CSS_TOP], value->values[GTK_CSS_BOTTOM]))
|
||||
else if (!_gtk_css_value_equal0 (value->values[GTK_CSS_TOP], value->values[GTK_CSS_BOTTOM]))
|
||||
n = 3;
|
||||
else if (!gtk_css_value_equal0 (value->values[GTK_CSS_TOP], value->values[GTK_CSS_RIGHT]))
|
||||
else if (!_gtk_css_value_equal0 (value->values[GTK_CSS_TOP], value->values[GTK_CSS_RIGHT]))
|
||||
n = 2;
|
||||
else
|
||||
n = 1;
|
||||
@@ -130,7 +133,7 @@ gtk_css_value_border_print (const GtkCssValue *value,
|
||||
if (value->values[i] == NULL)
|
||||
g_string_append (string, "auto");
|
||||
else
|
||||
gtk_css_value_print (value->values[i], string);
|
||||
_gtk_css_value_print (value->values[i], string);
|
||||
}
|
||||
|
||||
if (value->fill)
|
||||
@@ -156,7 +159,7 @@ _gtk_css_border_value_new (GtkCssValue *top,
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_BORDER);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_BORDER);
|
||||
result->values[GTK_CSS_TOP] = top;
|
||||
result->values[GTK_CSS_RIGHT] = right;
|
||||
result->values[GTK_CSS_BOTTOM] = bottom;
|
||||
@@ -194,7 +197,7 @@ _gtk_css_border_value_parse (GtkCssParser *parser,
|
||||
result->values[i] = _gtk_css_number_value_parse (parser, flags);
|
||||
if (result->values[i] == NULL)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -202,7 +205,7 @@ _gtk_css_border_value_parse (GtkCssParser *parser,
|
||||
if (i == 0)
|
||||
{
|
||||
gtk_css_parser_error_syntax (parser, "Expected a number");
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -212,7 +215,7 @@ _gtk_css_border_value_parse (GtkCssParser *parser,
|
||||
for (; i < 4; i++)
|
||||
{
|
||||
if (result->values[(i - 1) >> 1])
|
||||
result->values[i] = gtk_css_value_ref (result->values[(i - 1) >> 1]);
|
||||
result->values[i] = _gtk_css_value_ref (result->values[(i - 1) >> 1]);
|
||||
}
|
||||
|
||||
result->is_computed = TRUE;
|
||||
|
||||
@@ -99,8 +99,8 @@ gtk_css_calc_value_parse_product (GtkCssParser *parser,
|
||||
temp = gtk_css_number_value_multiply (result, _gtk_css_number_value_get (value, 100));
|
||||
else
|
||||
temp = gtk_css_number_value_multiply (value, _gtk_css_number_value_get (result, 100));
|
||||
gtk_css_value_unref (value);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (result);
|
||||
result = temp;
|
||||
}
|
||||
else if (gtk_css_parser_try_delim (parser, '/'))
|
||||
@@ -109,8 +109,8 @@ gtk_css_calc_value_parse_product (GtkCssParser *parser,
|
||||
if (value == NULL)
|
||||
goto fail;
|
||||
temp = gtk_css_number_value_multiply (result, 1.0 / _gtk_css_number_value_get (value, 100));
|
||||
gtk_css_value_unref (value);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (result);
|
||||
result = temp;
|
||||
}
|
||||
else
|
||||
@@ -132,7 +132,7 @@ gtk_css_calc_value_parse_product (GtkCssParser *parser,
|
||||
return result;
|
||||
|
||||
fail:
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ gtk_css_calc_value_parse_sum (GtkCssParser *parser,
|
||||
if (temp == NULL)
|
||||
goto fail;
|
||||
next = gtk_css_number_value_multiply (temp, -1);
|
||||
gtk_css_value_unref (temp);
|
||||
_gtk_css_value_unref (temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -178,15 +178,15 @@ gtk_css_calc_value_parse_sum (GtkCssParser *parser,
|
||||
}
|
||||
|
||||
temp = gtk_css_number_value_add (result, next);
|
||||
gtk_css_value_unref (result);
|
||||
gtk_css_value_unref (next);
|
||||
_gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (next);
|
||||
result = temp;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
fail:
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ static void
|
||||
gtk_css_value_color_free (GtkCssValue *color)
|
||||
{
|
||||
if (color->last_value)
|
||||
gtk_css_value_unref (color->last_value);
|
||||
_gtk_css_value_unref (color->last_value);
|
||||
|
||||
switch (color->type)
|
||||
{
|
||||
@@ -75,14 +75,14 @@ gtk_css_value_color_free (GtkCssValue *color)
|
||||
g_free (color->sym_col.name);
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
gtk_css_value_unref (color->sym_col.shade.color);
|
||||
_gtk_css_value_unref (color->sym_col.shade.color);
|
||||
break;
|
||||
case COLOR_TYPE_ALPHA:
|
||||
gtk_css_value_unref (color->sym_col.alpha.color);
|
||||
_gtk_css_value_unref (color->sym_col.alpha.color);
|
||||
break;
|
||||
case COLOR_TYPE_MIX:
|
||||
gtk_css_value_unref (color->sym_col.mix.color1);
|
||||
gtk_css_value_unref (color->sym_col.mix.color2);
|
||||
_gtk_css_value_unref (color->sym_col.mix.color1);
|
||||
_gtk_css_value_unref (color->sym_col.mix.color2);
|
||||
break;
|
||||
case COLOR_TYPE_LITERAL:
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
@@ -94,8 +94,11 @@ gtk_css_value_color_free (GtkCssValue *color)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_color_get_fallback (guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_color_get_fallback (guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
switch (property_id)
|
||||
{
|
||||
@@ -114,11 +117,14 @@ gtk_css_value_color_get_fallback (guint property_id,
|
||||
case GTK_CSS_PROPERTY_OUTLINE_COLOR:
|
||||
case GTK_CSS_PROPERTY_CARET_COLOR:
|
||||
case GTK_CSS_PROPERTY_SECONDARY_CARET_COLOR:
|
||||
return gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
case GTK_CSS_PROPERTY_ICON_PALETTE:
|
||||
return gtk_css_value_ref (context->style->core->color);
|
||||
return _gtk_css_value_ref (style->core->color);
|
||||
default:
|
||||
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
|
||||
g_warning ("No fallback color defined for property '%s'",
|
||||
@@ -128,9 +134,12 @@ gtk_css_value_color_get_fallback (guint property_id,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_color_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_color_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *resolved;
|
||||
|
||||
@@ -142,32 +151,32 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
{
|
||||
GtkCssValue *current;
|
||||
|
||||
if (context->parent_style)
|
||||
current = context->parent_style->core->color;
|
||||
if (parent_style)
|
||||
current = parent_style->core->color;
|
||||
else
|
||||
current = NULL;
|
||||
|
||||
resolved = _gtk_css_color_value_resolve (value,
|
||||
context->provider,
|
||||
provider,
|
||||
current,
|
||||
NULL);
|
||||
}
|
||||
else if (value->type == COLOR_TYPE_LITERAL)
|
||||
{
|
||||
resolved = gtk_css_value_ref (value);
|
||||
resolved = _gtk_css_value_ref (value);
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkCssValue *current = context->style->core->color;
|
||||
GtkCssValue *current = style->core->color;
|
||||
|
||||
resolved = _gtk_css_color_value_resolve (value,
|
||||
context->provider,
|
||||
provider,
|
||||
current,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (resolved == NULL)
|
||||
return gtk_css_value_color_get_fallback (property_id, context);
|
||||
return gtk_css_value_color_get_fallback (property_id, provider, style, parent_style, variables);
|
||||
|
||||
return resolved;
|
||||
}
|
||||
@@ -187,18 +196,18 @@ gtk_css_value_color_equal (const GtkCssValue *value1,
|
||||
return g_str_equal (value1->sym_col.name, value2->sym_col.name);
|
||||
case COLOR_TYPE_SHADE:
|
||||
return value1->sym_col.shade.factor == value2->sym_col.shade.factor &&
|
||||
gtk_css_value_equal (value1->sym_col.shade.color,
|
||||
value2->sym_col.shade.color);
|
||||
_gtk_css_value_equal (value1->sym_col.shade.color,
|
||||
value2->sym_col.shade.color);
|
||||
case COLOR_TYPE_ALPHA:
|
||||
return value1->sym_col.alpha.factor == value2->sym_col.alpha.factor &&
|
||||
gtk_css_value_equal (value1->sym_col.alpha.color,
|
||||
value2->sym_col.alpha.color);
|
||||
_gtk_css_value_equal (value1->sym_col.alpha.color,
|
||||
value2->sym_col.alpha.color);
|
||||
case COLOR_TYPE_MIX:
|
||||
return value1->sym_col.mix.factor == value2->sym_col.mix.factor &&
|
||||
gtk_css_value_equal (value1->sym_col.mix.color1,
|
||||
value2->sym_col.mix.color1) &&
|
||||
gtk_css_value_equal (value1->sym_col.mix.color2,
|
||||
value2->sym_col.mix.color2);
|
||||
_gtk_css_value_equal (value1->sym_col.mix.color1,
|
||||
value2->sym_col.mix.color1) &&
|
||||
_gtk_css_value_equal (value1->sym_col.mix.color2,
|
||||
value2->sym_col.mix.color2);
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
return TRUE;
|
||||
default:
|
||||
@@ -238,7 +247,7 @@ gtk_css_value_color_print (const GtkCssValue *value,
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "shade(");
|
||||
gtk_css_value_print (value->sym_col.shade.color, string);
|
||||
_gtk_css_value_print (value->sym_col.shade.color, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.shade.factor);
|
||||
g_string_append (string, factor);
|
||||
@@ -250,7 +259,7 @@ gtk_css_value_color_print (const GtkCssValue *value,
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "alpha(");
|
||||
gtk_css_value_print (value->sym_col.alpha.color, string);
|
||||
_gtk_css_value_print (value->sym_col.alpha.color, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.alpha.factor);
|
||||
g_string_append (string, factor);
|
||||
@@ -262,9 +271,9 @@ gtk_css_value_color_print (const GtkCssValue *value,
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "mix(");
|
||||
gtk_css_value_print (value->sym_col.mix.color1, string);
|
||||
_gtk_css_value_print (value->sym_col.mix.color1, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (value->sym_col.mix.color2, string);
|
||||
_gtk_css_value_print (value->sym_col.mix.color2, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.mix.factor);
|
||||
g_string_append (string, factor);
|
||||
@@ -354,7 +363,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
return gtk_css_value_ref (color);
|
||||
return _gtk_css_value_ref (color);
|
||||
case COLOR_TYPE_NAME:
|
||||
{
|
||||
GtkCssValue *named;
|
||||
@@ -389,7 +398,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
apply_shade (c, &shade, color->sym_col.shade.factor);
|
||||
|
||||
value = _gtk_css_color_value_new_literal (&shade);
|
||||
gtk_css_value_unref (val);
|
||||
_gtk_css_value_unref (val);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -407,7 +416,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
apply_alpha (c, &alpha, color->sym_col.alpha.factor);
|
||||
|
||||
value = _gtk_css_color_value_new_literal (&alpha);
|
||||
gtk_css_value_unref (val);
|
||||
_gtk_css_value_unref (val);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -430,15 +439,15 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
apply_mix (color1, color2, &res, color->sym_col.mix.factor);
|
||||
|
||||
value = _gtk_css_color_value_new_literal (&res);
|
||||
gtk_css_value_unref (val1);
|
||||
gtk_css_value_unref (val2);
|
||||
_gtk_css_value_unref (val1);
|
||||
_gtk_css_value_unref (val2);
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
if (current)
|
||||
{
|
||||
return gtk_css_value_ref (current);
|
||||
return _gtk_css_value_ref (current);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -453,7 +462,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
}
|
||||
else
|
||||
{
|
||||
return gtk_css_value_ref (initial);
|
||||
return _gtk_css_value_ref (initial);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -463,16 +472,16 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
}
|
||||
|
||||
if (color->last_value != NULL &&
|
||||
gtk_css_value_equal (color->last_value, value))
|
||||
_gtk_css_value_equal (color->last_value, value))
|
||||
{
|
||||
gtk_css_value_unref (value);
|
||||
value = gtk_css_value_ref (color->last_value);
|
||||
_gtk_css_value_unref (value);
|
||||
value = _gtk_css_value_ref (color->last_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (color->last_value != NULL)
|
||||
gtk_css_value_unref (color->last_value);
|
||||
color->last_value = gtk_css_value_ref (value);
|
||||
_gtk_css_value_unref (color->last_value);
|
||||
color->last_value = _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -487,13 +496,13 @@ static GtkCssValue white_singleton = { >K_CSS_VALUE_COLOR, 1, TRUE
|
||||
GtkCssValue *
|
||||
gtk_css_color_value_new_transparent (void)
|
||||
{
|
||||
return gtk_css_value_ref (&transparent_black_singleton);
|
||||
return _gtk_css_value_ref (&transparent_black_singleton);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
gtk_css_color_value_new_white (void)
|
||||
{
|
||||
return gtk_css_value_ref (&white_singleton);
|
||||
return _gtk_css_value_ref (&white_singleton);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -504,12 +513,12 @@ _gtk_css_color_value_new_literal (const GdkRGBA *color)
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
if (gdk_rgba_equal (color, &white_singleton.sym_col.rgba))
|
||||
return gtk_css_value_ref (&white_singleton);
|
||||
return _gtk_css_value_ref (&white_singleton);
|
||||
|
||||
if (gdk_rgba_equal (color, &transparent_black_singleton.sym_col.rgba))
|
||||
return gtk_css_value_ref (&transparent_black_singleton);
|
||||
return _gtk_css_value_ref (&transparent_black_singleton);
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_LITERAL;
|
||||
value->is_computed = TRUE;
|
||||
value->sym_col.rgba = *color;
|
||||
@@ -524,7 +533,7 @@ _gtk_css_color_value_new_name (const char *name)
|
||||
|
||||
gtk_internal_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_NAME;
|
||||
value->sym_col.name = g_strdup (name);
|
||||
|
||||
@@ -548,9 +557,9 @@ _gtk_css_color_value_new_shade (GtkCssValue *color,
|
||||
return _gtk_css_color_value_new_literal (&c);
|
||||
}
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_SHADE;
|
||||
value->sym_col.shade.color = gtk_css_value_ref (color);
|
||||
value->sym_col.shade.color = _gtk_css_value_ref (color);
|
||||
value->sym_col.shade.factor = factor;
|
||||
|
||||
return value;
|
||||
@@ -573,9 +582,9 @@ _gtk_css_color_value_new_alpha (GtkCssValue *color,
|
||||
return _gtk_css_color_value_new_literal (&c);
|
||||
}
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_ALPHA;
|
||||
value->sym_col.alpha.color = gtk_css_value_ref (color);
|
||||
value->sym_col.alpha.color = _gtk_css_value_ref (color);
|
||||
value->sym_col.alpha.factor = factor;
|
||||
|
||||
return value;
|
||||
@@ -602,10 +611,10 @@ _gtk_css_color_value_new_mix (GtkCssValue *color1,
|
||||
|
||||
}
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_MIX;
|
||||
value->sym_col.mix.color1 = gtk_css_value_ref (color1);
|
||||
value->sym_col.mix.color2 = gtk_css_value_ref (color2);
|
||||
value->sym_col.mix.color1 = _gtk_css_value_ref (color1);
|
||||
value->sym_col.mix.color2 = _gtk_css_value_ref (color2);
|
||||
value->sym_col.mix.factor = factor;
|
||||
|
||||
return value;
|
||||
@@ -616,7 +625,7 @@ _gtk_css_color_value_new_current_color (void)
|
||||
{
|
||||
static GtkCssValue current_color = { >K_CSS_VALUE_COLOR, 1, FALSE, FALSE, COLOR_TYPE_CURRENT_COLOR, NULL, };
|
||||
|
||||
return gtk_css_value_ref (¤t_color);
|
||||
return _gtk_css_value_ref (¤t_color);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -30,26 +30,29 @@ struct _GtkCssValue {
|
||||
static void
|
||||
gtk_css_value_corner_free (GtkCssValue *value)
|
||||
{
|
||||
gtk_css_value_unref (value->x);
|
||||
gtk_css_value_unref (value->y);
|
||||
_gtk_css_value_unref (value->x);
|
||||
_gtk_css_value_unref (value->y);
|
||||
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_corner_compute (GtkCssValue *corner,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_corner_compute (GtkCssValue *corner,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
x = gtk_css_value_compute (corner->x, property_id, context);
|
||||
y = gtk_css_value_compute (corner->y, property_id, context);
|
||||
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style, variables);
|
||||
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style, variables);
|
||||
if (x == corner->x && y == corner->y)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
gtk_css_value_unref (y);
|
||||
return gtk_css_value_ref (corner);
|
||||
_gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (y);
|
||||
return _gtk_css_value_ref (corner);
|
||||
}
|
||||
|
||||
return _gtk_css_corner_value_new (x, y);
|
||||
@@ -59,8 +62,8 @@ static gboolean
|
||||
gtk_css_value_corner_equal (const GtkCssValue *corner1,
|
||||
const GtkCssValue *corner2)
|
||||
{
|
||||
return gtk_css_value_equal (corner1->x, corner2->x)
|
||||
&& gtk_css_value_equal (corner1->y, corner2->y);
|
||||
return _gtk_css_value_equal (corner1->x, corner2->x)
|
||||
&& _gtk_css_value_equal (corner1->y, corner2->y);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
@@ -71,13 +74,13 @@ gtk_css_value_corner_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
x = gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
if (x == NULL)
|
||||
return NULL;
|
||||
y = gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -88,11 +91,11 @@ static void
|
||||
gtk_css_value_corner_print (const GtkCssValue *corner,
|
||||
GString *string)
|
||||
{
|
||||
gtk_css_value_print (corner->x, string);
|
||||
if (!gtk_css_value_equal (corner->x, corner->y))
|
||||
_gtk_css_value_print (corner->x, string);
|
||||
if (!_gtk_css_value_equal (corner->x, corner->y))
|
||||
{
|
||||
g_string_append_c (string, ' ');
|
||||
gtk_css_value_print (corner->y, string);
|
||||
_gtk_css_value_print (corner->y, string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +161,7 @@ _gtk_css_corner_value_new (GtkCssValue *x,
|
||||
}
|
||||
}
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_CORNER);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_CORNER);
|
||||
result->x = x;
|
||||
result->y = y;
|
||||
|
||||
@@ -178,7 +181,7 @@ _gtk_css_corner_value_parse (GtkCssParser *parser)
|
||||
return NULL;
|
||||
|
||||
if (!gtk_css_number_value_can_parse (parser))
|
||||
y = gtk_css_value_ref (x);
|
||||
y = _gtk_css_value_ref (x);
|
||||
else
|
||||
{
|
||||
y = _gtk_css_number_value_parse (parser,
|
||||
@@ -187,7 +190,7 @@ _gtk_css_corner_value_parse (GtkCssParser *parser)
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,11 +50,14 @@ gtk_css_value_ease_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_ease_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_ease_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -156,7 +159,7 @@ _gtk_css_ease_value_new_cubic_bezier (double x1,
|
||||
g_return_val_if_fail (x2 >= 0.0, NULL);
|
||||
g_return_val_if_fail (x2 <= 1.0, NULL);
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_EASE);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_EASE);
|
||||
|
||||
value->type = GTK_CSS_EASE_CUBIC_BEZIER;
|
||||
value->u.cubic.x1 = x1;
|
||||
@@ -176,7 +179,7 @@ _gtk_css_ease_value_new_steps (guint n_steps,
|
||||
|
||||
g_return_val_if_fail (n_steps > 0, NULL);
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_EASE);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_EASE);
|
||||
|
||||
value->type = GTK_CSS_EASE_STEPS;
|
||||
value->u.steps.steps = n_steps;
|
||||
|
||||
@@ -41,11 +41,14 @@ gtk_css_value_enum_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_enum_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_enum_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -102,7 +105,7 @@ _gtk_css_border_style_value_new (GtkBorderStyle border_style)
|
||||
{
|
||||
g_return_val_if_fail (border_style < G_N_ELEMENTS (border_style_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&border_style_values[border_style]);
|
||||
return _gtk_css_value_ref (&border_style_values[border_style]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -115,7 +118,7 @@ _gtk_css_border_style_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (border_style_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, border_style_values[i].name))
|
||||
return gtk_css_value_ref (&border_style_values[i]);
|
||||
return _gtk_css_value_ref (&border_style_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -166,7 +169,7 @@ _gtk_css_blend_mode_value_new (GskBlendMode blend_mode)
|
||||
{
|
||||
g_return_val_if_fail (blend_mode < G_N_ELEMENTS (blend_mode_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&blend_mode_values[blend_mode]);
|
||||
return _gtk_css_value_ref (&blend_mode_values[blend_mode]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -179,7 +182,7 @@ _gtk_css_blend_mode_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (blend_mode_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, blend_mode_values[i].name))
|
||||
return gtk_css_value_ref (&blend_mode_values[i]);
|
||||
return _gtk_css_value_ref (&blend_mode_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -227,14 +230,13 @@ gtk_css_font_size_get_default_px (GtkStyleProvider *provider,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkStyleProvider *provider = context->provider;
|
||||
GtkCssStyle *style = context->style;
|
||||
GtkCssStyle *parent_style = context->parent_style;
|
||||
|
||||
double font_size;
|
||||
|
||||
switch (value->value)
|
||||
@@ -312,7 +314,7 @@ _gtk_css_font_size_value_new (GtkCssFontSize font_size)
|
||||
{
|
||||
g_return_val_if_fail (font_size < G_N_ELEMENTS (font_size_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&font_size_values[font_size]);
|
||||
return _gtk_css_value_ref (&font_size_values[font_size]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -325,7 +327,7 @@ _gtk_css_font_size_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_size_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_size_values[i].name))
|
||||
return gtk_css_value_ref (&font_size_values[i]);
|
||||
return _gtk_css_value_ref (&font_size_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -363,7 +365,7 @@ _gtk_css_font_style_value_new (PangoStyle font_style)
|
||||
{
|
||||
g_return_val_if_fail (font_style < G_N_ELEMENTS (font_style_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&font_style_values[font_style]);
|
||||
return _gtk_css_value_ref (&font_style_values[font_style]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -376,7 +378,7 @@ _gtk_css_font_style_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_style_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_style_values[i].name))
|
||||
return gtk_css_value_ref (&font_style_values[i]);
|
||||
return _gtk_css_value_ref (&font_style_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -396,18 +398,21 @@ _gtk_css_font_style_value_get (const GtkCssValue *value)
|
||||
#define LIGHTER -2
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_weight_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_font_weight_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
PangoWeight new_weight;
|
||||
int parent_value;
|
||||
|
||||
if (value->value >= 0)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
if (context->parent_style)
|
||||
parent_value = _gtk_css_number_value_get (context->parent_style->font->font_weight, 100);
|
||||
if (parent_style)
|
||||
parent_value = _gtk_css_number_value_get (parent_style->font->font_weight, 100);
|
||||
else
|
||||
parent_value = 400;
|
||||
|
||||
@@ -464,7 +469,7 @@ gtk_css_font_weight_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_weight_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_weight_values[i].name))
|
||||
return gtk_css_value_ref (&font_weight_values[i]);
|
||||
return _gtk_css_value_ref (&font_weight_values[i]);
|
||||
}
|
||||
|
||||
if (gtk_css_parser_try_ident (parser, "normal"))
|
||||
@@ -516,7 +521,7 @@ _gtk_css_font_stretch_value_new (PangoStretch font_stretch)
|
||||
{
|
||||
g_return_val_if_fail (font_stretch < G_N_ELEMENTS (font_stretch_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&font_stretch_values[font_stretch]);
|
||||
return _gtk_css_value_ref (&font_stretch_values[font_stretch]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -529,7 +534,7 @@ _gtk_css_font_stretch_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_stretch_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_stretch_values[i].name))
|
||||
return gtk_css_value_ref (&font_stretch_values[i]);
|
||||
return _gtk_css_value_ref (&font_stretch_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -567,7 +572,7 @@ _gtk_css_text_decoration_style_value_new (GtkTextDecorationStyle style)
|
||||
{
|
||||
g_return_val_if_fail (style < G_N_ELEMENTS (text_decoration_style_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&text_decoration_style_values[style]);
|
||||
return _gtk_css_value_ref (&text_decoration_style_values[style]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -580,7 +585,7 @@ _gtk_css_text_decoration_style_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (text_decoration_style_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, text_decoration_style_values[i].name))
|
||||
return gtk_css_value_ref (&text_decoration_style_values[i]);
|
||||
return _gtk_css_value_ref (&text_decoration_style_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -621,7 +626,7 @@ _gtk_css_area_value_new (GtkCssArea area)
|
||||
for (i = 0; i < G_N_ELEMENTS (area_values); i++)
|
||||
{
|
||||
if (area_values[i].value == area)
|
||||
return gtk_css_value_ref (&area_values[i]);
|
||||
return _gtk_css_value_ref (&area_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -637,7 +642,7 @@ _gtk_css_area_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (area_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, area_values[i].name))
|
||||
return gtk_css_value_ref (&area_values[i]);
|
||||
return _gtk_css_value_ref (&area_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -679,7 +684,7 @@ _gtk_css_direction_value_new (GtkCssDirection direction)
|
||||
for (i = 0; i < G_N_ELEMENTS (direction_values); i++)
|
||||
{
|
||||
if (direction_values[i].value == direction)
|
||||
return gtk_css_value_ref (&direction_values[i]);
|
||||
return _gtk_css_value_ref (&direction_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -698,7 +703,7 @@ _gtk_css_direction_value_try_parse (GtkCssParser *parser)
|
||||
for (i = G_N_ELEMENTS (direction_values) - 1; i >= 0; i--)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, direction_values[i].name))
|
||||
return gtk_css_value_ref (&direction_values[i]);
|
||||
return _gtk_css_value_ref (&direction_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -738,7 +743,7 @@ _gtk_css_play_state_value_new (GtkCssPlayState play_state)
|
||||
for (i = 0; i < G_N_ELEMENTS (play_state_values); i++)
|
||||
{
|
||||
if (play_state_values[i].value == play_state)
|
||||
return gtk_css_value_ref (&play_state_values[i]);
|
||||
return _gtk_css_value_ref (&play_state_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -754,7 +759,7 @@ _gtk_css_play_state_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (play_state_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, play_state_values[i].name))
|
||||
return gtk_css_value_ref (&play_state_values[i]);
|
||||
return _gtk_css_value_ref (&play_state_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -796,7 +801,7 @@ _gtk_css_fill_mode_value_new (GtkCssFillMode fill_mode)
|
||||
for (i = 0; i < G_N_ELEMENTS (fill_mode_values); i++)
|
||||
{
|
||||
if (fill_mode_values[i].value == fill_mode)
|
||||
return gtk_css_value_ref (&fill_mode_values[i]);
|
||||
return _gtk_css_value_ref (&fill_mode_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -812,7 +817,7 @@ _gtk_css_fill_mode_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (fill_mode_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, fill_mode_values[i].name))
|
||||
return gtk_css_value_ref (&fill_mode_values[i]);
|
||||
return _gtk_css_value_ref (&fill_mode_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -853,7 +858,7 @@ _gtk_css_icon_style_value_new (GtkCssIconStyle icon_style)
|
||||
for (i = 0; i < G_N_ELEMENTS (icon_style_values); i++)
|
||||
{
|
||||
if (icon_style_values[i].value == icon_style)
|
||||
return gtk_css_value_ref (&icon_style_values[i]);
|
||||
return _gtk_css_value_ref (&icon_style_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -869,7 +874,7 @@ _gtk_css_icon_style_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (icon_style_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, icon_style_values[i].name))
|
||||
return gtk_css_value_ref (&icon_style_values[i]);
|
||||
return _gtk_css_value_ref (&icon_style_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -910,7 +915,7 @@ _gtk_css_font_kerning_value_new (GtkCssFontKerning kerning)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_kerning_values); i++)
|
||||
{
|
||||
if (font_kerning_values[i].value == kerning)
|
||||
return gtk_css_value_ref (&font_kerning_values[i]);
|
||||
return _gtk_css_value_ref (&font_kerning_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -926,7 +931,7 @@ _gtk_css_font_kerning_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_kerning_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_kerning_values[i].name))
|
||||
return gtk_css_value_ref (&font_kerning_values[i]);
|
||||
return _gtk_css_value_ref (&font_kerning_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -967,7 +972,7 @@ _gtk_css_font_variant_position_value_new (GtkCssFontVariantPosition position)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_position_values); i++)
|
||||
{
|
||||
if (font_variant_position_values[i].value == position)
|
||||
return gtk_css_value_ref (&font_variant_position_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_position_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -983,7 +988,7 @@ _gtk_css_font_variant_position_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_position_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_variant_position_values[i].name))
|
||||
return gtk_css_value_ref (&font_variant_position_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_position_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1028,7 +1033,7 @@ _gtk_css_font_variant_caps_value_new (GtkCssFontVariantCaps caps)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_caps_values); i++)
|
||||
{
|
||||
if (font_variant_caps_values[i].value == caps)
|
||||
return gtk_css_value_ref (&font_variant_caps_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_caps_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -1044,7 +1049,7 @@ _gtk_css_font_variant_caps_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_caps_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_variant_caps_values[i].name))
|
||||
return gtk_css_value_ref (&font_variant_caps_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_caps_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1084,7 +1089,7 @@ _gtk_css_font_variant_alternate_value_new (GtkCssFontVariantAlternate alternate)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_alternate_values); i++)
|
||||
{
|
||||
if (font_variant_alternate_values[i].value == alternate)
|
||||
return gtk_css_value_ref (&font_variant_alternate_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_alternate_values[i]);
|
||||
}
|
||||
|
||||
g_return_val_if_reached (NULL);
|
||||
@@ -1100,7 +1105,7 @@ _gtk_css_font_variant_alternate_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (font_variant_alternate_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, font_variant_alternate_values[i].name))
|
||||
return gtk_css_value_ref (&font_variant_alternate_values[i]);
|
||||
return _gtk_css_value_ref (&font_variant_alternate_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1197,7 +1202,7 @@ _gtk_css_text_decoration_line_value_new (GtkTextDecorationLine line)
|
||||
if (!text_decoration_line_is_valid (line))
|
||||
return NULL;
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_TEXT_DECORATION_LINE);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_TEXT_DECORATION_LINE);
|
||||
value->value = line;
|
||||
value->name = NULL;
|
||||
value->is_computed = TRUE;
|
||||
@@ -1306,7 +1311,7 @@ _gtk_css_font_variant_ligature_value_new (GtkCssFontVariantLigature ligatures)
|
||||
if (!ligature_value_is_valid (ligatures))
|
||||
return NULL;
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_LIGATURE);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_LIGATURE);
|
||||
value->value = ligatures;
|
||||
value->name = NULL;
|
||||
value->is_computed = TRUE;
|
||||
@@ -1410,7 +1415,7 @@ _gtk_css_font_variant_numeric_value_new (GtkCssFontVariantNumeric numeric)
|
||||
if (!numeric_value_is_valid (numeric))
|
||||
return NULL;
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_NUMERIC);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_NUMERIC);
|
||||
value->value = numeric;
|
||||
value->name = NULL;
|
||||
value->is_computed = TRUE;
|
||||
@@ -1521,7 +1526,7 @@ _gtk_css_font_variant_east_asian_value_new (GtkCssFontVariantEastAsian east_asia
|
||||
if (!east_asian_value_is_valid (east_asian))
|
||||
return NULL;
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_EAST_ASIAN);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_EAST_ASIAN);
|
||||
value->value = east_asian;
|
||||
value->name = NULL;
|
||||
value->is_computed = TRUE;
|
||||
@@ -1592,7 +1597,7 @@ _gtk_css_text_transform_value_new (GtkTextTransform transform)
|
||||
{
|
||||
g_return_val_if_fail (transform < G_N_ELEMENTS (text_transform_values), NULL);
|
||||
|
||||
return gtk_css_value_ref (&text_transform_values[transform]);
|
||||
return _gtk_css_value_ref (&text_transform_values[transform]);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -1605,7 +1610,7 @@ _gtk_css_text_transform_value_try_parse (GtkCssParser *parser)
|
||||
for (i = 0; i < G_N_ELEMENTS (text_transform_values); i++)
|
||||
{
|
||||
if (gtk_css_parser_try_ident (parser, text_transform_values[i].name))
|
||||
return gtk_css_value_ref (&text_transform_values[i]);
|
||||
return _gtk_css_value_ref (&text_transform_values[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -65,34 +65,34 @@ gtk_css_filter_clear (GtkCssFilter *filter)
|
||||
switch (filter->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
gtk_css_value_unref (filter->brightness.value);
|
||||
_gtk_css_value_unref (filter->brightness.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_CONTRAST:
|
||||
gtk_css_value_unref (filter->contrast.value);
|
||||
_gtk_css_value_unref (filter->contrast.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_GRAYSCALE:
|
||||
gtk_css_value_unref (filter->grayscale.value);
|
||||
_gtk_css_value_unref (filter->grayscale.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_HUE_ROTATE:
|
||||
gtk_css_value_unref (filter->hue_rotate.value);
|
||||
_gtk_css_value_unref (filter->hue_rotate.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_INVERT:
|
||||
gtk_css_value_unref (filter->invert.value);
|
||||
_gtk_css_value_unref (filter->invert.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_OPACITY:
|
||||
gtk_css_value_unref (filter->opacity.value);
|
||||
_gtk_css_value_unref (filter->opacity.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_SATURATE:
|
||||
gtk_css_value_unref (filter->saturate.value);
|
||||
_gtk_css_value_unref (filter->saturate.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_SEPIA:
|
||||
gtk_css_value_unref (filter->sepia.value);
|
||||
_gtk_css_value_unref (filter->sepia.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_BLUR:
|
||||
gtk_css_value_unref (filter->blur.value);
|
||||
_gtk_css_value_unref (filter->blur.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
gtk_css_value_unref (filter->drop_shadow.value);
|
||||
_gtk_css_value_unref (filter->drop_shadow.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
default:
|
||||
@@ -307,53 +307,56 @@ gtk_css_value_filter_free (GtkCssValue *value)
|
||||
|
||||
/* returns TRUE if dest == src */
|
||||
static gboolean
|
||||
gtk_css_filter_compute (GtkCssFilter *dest,
|
||||
GtkCssFilter *src,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_filter_compute (GtkCssFilter *dest,
|
||||
GtkCssFilter *src,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
dest->type = src->type;
|
||||
|
||||
switch (src->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
dest->brightness.value = gtk_css_value_compute (src->brightness.value, property_id, context);
|
||||
dest->brightness.value = _gtk_css_value_compute (src->brightness.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->brightness.value == src->brightness.value;
|
||||
|
||||
case GTK_CSS_FILTER_CONTRAST:
|
||||
dest->contrast.value = gtk_css_value_compute (src->contrast.value, property_id, context);
|
||||
dest->contrast.value = _gtk_css_value_compute (src->contrast.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->contrast.value == src->contrast.value;
|
||||
|
||||
case GTK_CSS_FILTER_GRAYSCALE:
|
||||
dest->grayscale.value = gtk_css_value_compute (src->grayscale.value, property_id, context);
|
||||
dest->grayscale.value = _gtk_css_value_compute (src->grayscale.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->grayscale.value == src->grayscale.value;
|
||||
|
||||
case GTK_CSS_FILTER_HUE_ROTATE:
|
||||
dest->hue_rotate.value = gtk_css_value_compute (src->hue_rotate.value, property_id, context);
|
||||
dest->hue_rotate.value = _gtk_css_value_compute (src->hue_rotate.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->hue_rotate.value == src->hue_rotate.value;
|
||||
|
||||
case GTK_CSS_FILTER_INVERT:
|
||||
dest->invert.value = gtk_css_value_compute (src->invert.value, property_id, context);
|
||||
dest->invert.value = _gtk_css_value_compute (src->invert.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->invert.value == src->invert.value;
|
||||
|
||||
case GTK_CSS_FILTER_OPACITY:
|
||||
dest->opacity.value = gtk_css_value_compute (src->opacity.value, property_id, context);
|
||||
dest->opacity.value = _gtk_css_value_compute (src->opacity.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->opacity.value == src->opacity.value;
|
||||
|
||||
case GTK_CSS_FILTER_SATURATE:
|
||||
dest->saturate.value = gtk_css_value_compute (src->saturate.value, property_id, context);
|
||||
dest->saturate.value = _gtk_css_value_compute (src->saturate.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->saturate.value == src->saturate.value;
|
||||
|
||||
case GTK_CSS_FILTER_SEPIA:
|
||||
dest->sepia.value = gtk_css_value_compute (src->sepia.value, property_id, context);
|
||||
dest->sepia.value = _gtk_css_value_compute (src->sepia.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->sepia.value == src->sepia.value;
|
||||
|
||||
case GTK_CSS_FILTER_BLUR:
|
||||
dest->blur.value = gtk_css_value_compute (src->blur.value, property_id, context);
|
||||
dest->blur.value = _gtk_css_value_compute (src->blur.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->blur.value == src->blur.value;
|
||||
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
dest->drop_shadow.value = gtk_css_value_compute (src->drop_shadow.value, property_id, context);
|
||||
dest->drop_shadow.value = _gtk_css_value_compute (src->drop_shadow.value, property_id, provider, style, parent_style, variables);
|
||||
return dest->drop_shadow.value == src->drop_shadow.value;
|
||||
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
@@ -364,9 +367,12 @@ gtk_css_filter_compute (GtkCssFilter *dest,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_filter_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_filter_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
gboolean changes;
|
||||
@@ -374,7 +380,7 @@ gtk_css_value_filter_compute (GtkCssValue *value,
|
||||
|
||||
/* Special case the 99% case of "none" */
|
||||
if (gtk_css_filter_value_is_none (value))
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
changes = FALSE;
|
||||
result = gtk_css_filter_value_alloc (value->n_filters);
|
||||
@@ -384,13 +390,16 @@ gtk_css_value_filter_compute (GtkCssValue *value,
|
||||
changes |= !gtk_css_filter_compute (&result->filters[i],
|
||||
&value->filters[i],
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
}
|
||||
|
||||
if (!changes)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
result = gtk_css_value_ref (value);
|
||||
_gtk_css_value_unref (result);
|
||||
result = _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -406,34 +415,34 @@ gtk_css_filter_equal (const GtkCssFilter *filter1,
|
||||
switch (filter1->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
return gtk_css_value_equal (filter1->brightness.value, filter2->brightness.value);
|
||||
return _gtk_css_value_equal (filter1->brightness.value, filter2->brightness.value);
|
||||
|
||||
case GTK_CSS_FILTER_CONTRAST:
|
||||
return gtk_css_value_equal (filter1->contrast.value, filter2->contrast.value);
|
||||
return _gtk_css_value_equal (filter1->contrast.value, filter2->contrast.value);
|
||||
|
||||
case GTK_CSS_FILTER_GRAYSCALE:
|
||||
return gtk_css_value_equal (filter1->grayscale.value, filter2->grayscale.value);
|
||||
return _gtk_css_value_equal (filter1->grayscale.value, filter2->grayscale.value);
|
||||
|
||||
case GTK_CSS_FILTER_HUE_ROTATE:
|
||||
return gtk_css_value_equal (filter1->hue_rotate.value, filter2->hue_rotate.value);
|
||||
return _gtk_css_value_equal (filter1->hue_rotate.value, filter2->hue_rotate.value);
|
||||
|
||||
case GTK_CSS_FILTER_INVERT:
|
||||
return gtk_css_value_equal (filter1->invert.value, filter2->invert.value);
|
||||
return _gtk_css_value_equal (filter1->invert.value, filter2->invert.value);
|
||||
|
||||
case GTK_CSS_FILTER_OPACITY:
|
||||
return gtk_css_value_equal (filter1->opacity.value, filter2->opacity.value);
|
||||
return _gtk_css_value_equal (filter1->opacity.value, filter2->opacity.value);
|
||||
|
||||
case GTK_CSS_FILTER_SATURATE:
|
||||
return gtk_css_value_equal (filter1->saturate.value, filter2->saturate.value);
|
||||
return _gtk_css_value_equal (filter1->saturate.value, filter2->saturate.value);
|
||||
|
||||
case GTK_CSS_FILTER_SEPIA:
|
||||
return gtk_css_value_equal (filter1->sepia.value, filter2->sepia.value);
|
||||
return _gtk_css_value_equal (filter1->sepia.value, filter2->sepia.value);
|
||||
|
||||
case GTK_CSS_FILTER_BLUR:
|
||||
return gtk_css_value_equal (filter1->blur.value, filter2->blur.value);
|
||||
return _gtk_css_value_equal (filter1->blur.value, filter2->blur.value);
|
||||
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
return gtk_css_value_equal (filter1->drop_shadow.value, filter2->drop_shadow.value);
|
||||
return _gtk_css_value_equal (filter1->drop_shadow.value, filter2->drop_shadow.value);
|
||||
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
default:
|
||||
@@ -488,43 +497,43 @@ gtk_css_filter_transition (GtkCssFilter *result,
|
||||
switch (start->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
result->brightness.value = gtk_css_value_transition (start->brightness.value, end->brightness.value, property_id, progress);
|
||||
result->brightness.value = _gtk_css_value_transition (start->brightness.value, end->brightness.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_CONTRAST:
|
||||
result->contrast.value = gtk_css_value_transition (start->contrast.value, end->contrast.value, property_id, progress);
|
||||
result->contrast.value = _gtk_css_value_transition (start->contrast.value, end->contrast.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_GRAYSCALE:
|
||||
result->grayscale.value = gtk_css_value_transition (start->grayscale.value, end->grayscale.value, property_id, progress);
|
||||
result->grayscale.value = _gtk_css_value_transition (start->grayscale.value, end->grayscale.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_HUE_ROTATE:
|
||||
result->hue_rotate.value = gtk_css_value_transition (start->hue_rotate.value, end->hue_rotate.value, property_id, progress);
|
||||
result->hue_rotate.value = _gtk_css_value_transition (start->hue_rotate.value, end->hue_rotate.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_INVERT:
|
||||
result->invert.value = gtk_css_value_transition (start->invert.value, end->invert.value, property_id, progress);
|
||||
result->invert.value = _gtk_css_value_transition (start->invert.value, end->invert.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_OPACITY:
|
||||
result->opacity.value = gtk_css_value_transition (start->opacity.value, end->opacity.value, property_id, progress);
|
||||
result->opacity.value = _gtk_css_value_transition (start->opacity.value, end->opacity.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_SATURATE:
|
||||
result->saturate.value = gtk_css_value_transition (start->saturate.value, end->saturate.value, property_id, progress);
|
||||
result->saturate.value = _gtk_css_value_transition (start->saturate.value, end->saturate.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_SEPIA:
|
||||
result->sepia.value = gtk_css_value_transition (start->sepia.value, end->sepia.value, property_id, progress);
|
||||
result->sepia.value = _gtk_css_value_transition (start->sepia.value, end->sepia.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_BLUR:
|
||||
result->blur.value = gtk_css_value_transition (start->blur.value, end->blur.value, property_id, progress);
|
||||
result->blur.value = _gtk_css_value_transition (start->blur.value, end->blur.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
result->drop_shadow.value = gtk_css_value_transition (start->drop_shadow.value, end->drop_shadow.value, property_id, progress);
|
||||
result->drop_shadow.value = _gtk_css_value_transition (start->drop_shadow.value, end->drop_shadow.value, property_id, progress);
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
@@ -546,7 +555,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
|
||||
if (gtk_css_filter_value_is_none (start))
|
||||
{
|
||||
if (gtk_css_filter_value_is_none (end))
|
||||
return gtk_css_value_ref (start);
|
||||
return _gtk_css_value_ref (start);
|
||||
|
||||
n = 0;
|
||||
}
|
||||
@@ -620,61 +629,61 @@ gtk_css_filter_print (const GtkCssFilter *filter,
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
g_string_append (string, "brightness(");
|
||||
gtk_css_value_print (filter->brightness.value, string);
|
||||
_gtk_css_value_print (filter->brightness.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_CONTRAST:
|
||||
g_string_append (string, "contrast(");
|
||||
gtk_css_value_print (filter->contrast.value, string);
|
||||
_gtk_css_value_print (filter->contrast.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_GRAYSCALE:
|
||||
g_string_append (string, "grayscale(");
|
||||
gtk_css_value_print (filter->grayscale.value, string);
|
||||
_gtk_css_value_print (filter->grayscale.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_HUE_ROTATE:
|
||||
g_string_append (string, "hue-rotate(");
|
||||
gtk_css_value_print (filter->hue_rotate.value, string);
|
||||
_gtk_css_value_print (filter->hue_rotate.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_INVERT:
|
||||
g_string_append (string, "invert(");
|
||||
gtk_css_value_print (filter->invert.value, string);
|
||||
_gtk_css_value_print (filter->invert.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_OPACITY:
|
||||
g_string_append (string, "opacity(");
|
||||
gtk_css_value_print (filter->opacity.value, string);
|
||||
_gtk_css_value_print (filter->opacity.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_SATURATE:
|
||||
g_string_append (string, "saturate(");
|
||||
gtk_css_value_print (filter->saturate.value, string);
|
||||
_gtk_css_value_print (filter->saturate.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_SEPIA:
|
||||
g_string_append (string, "sepia(");
|
||||
gtk_css_value_print (filter->sepia.value, string);
|
||||
_gtk_css_value_print (filter->sepia.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_BLUR:
|
||||
g_string_append (string, "blur(");
|
||||
gtk_css_value_print (filter->blur.value, string);
|
||||
_gtk_css_value_print (filter->blur.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
g_string_append (string, "drop-shadow(");
|
||||
gtk_css_value_print (filter->drop_shadow.value, string);
|
||||
_gtk_css_value_print (filter->drop_shadow.value, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
|
||||
@@ -726,7 +735,7 @@ gtk_css_filter_value_alloc (guint n_filters)
|
||||
|
||||
g_return_val_if_fail (n_filters > 0, NULL);
|
||||
|
||||
result = gtk_css_value_alloc (>K_CSS_VALUE_FILTER, sizeof (GtkCssValue) + sizeof (GtkCssFilter) * (n_filters - 1));
|
||||
result = _gtk_css_value_alloc (>K_CSS_VALUE_FILTER, sizeof (GtkCssValue) + sizeof (GtkCssFilter) * (n_filters - 1));
|
||||
result->n_filters = n_filters;
|
||||
|
||||
return result;
|
||||
@@ -735,7 +744,7 @@ gtk_css_filter_value_alloc (guint n_filters)
|
||||
GtkCssValue *
|
||||
gtk_css_filter_value_new_none (void)
|
||||
{
|
||||
return gtk_css_value_ref (&filter_none_singleton);
|
||||
return _gtk_css_value_ref (&filter_none_singleton);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -53,11 +53,14 @@ gtk_css_value_font_features_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_features_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_font_features_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (specified);
|
||||
return _gtk_css_value_ref (specified);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -168,7 +171,7 @@ gtk_css_font_features_value_new_empty (void)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_FEATURES);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_FEATURES);
|
||||
result->features = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
result->is_computed = TRUE;
|
||||
|
||||
@@ -181,7 +184,7 @@ gtk_css_font_features_value_new_default (void)
|
||||
if (default_font_features == NULL)
|
||||
default_font_features = gtk_css_font_features_value_new_empty ();
|
||||
|
||||
return gtk_css_value_ref (default_font_features);
|
||||
return _gtk_css_value_ref (default_font_features);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -215,7 +218,7 @@ gtk_css_font_features_value_parse (GtkCssParser *parser)
|
||||
name = gtk_css_parser_consume_string (parser);
|
||||
if (name == NULL)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -223,7 +226,7 @@ gtk_css_font_features_value_parse (GtkCssParser *parser)
|
||||
{
|
||||
gtk_css_parser_error_value (parser, "Not a valid OpenType tag.");
|
||||
g_free (name);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -236,7 +239,7 @@ gtk_css_font_features_value_parse (GtkCssParser *parser)
|
||||
if (!gtk_css_parser_consume_integer (parser, &num))
|
||||
{
|
||||
g_free (name);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,11 +52,14 @@ gtk_css_value_font_variations_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_variations_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_font_variations_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (specified);
|
||||
return _gtk_css_value_ref (specified);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -76,7 +79,7 @@ gtk_css_value_font_variations_equal (const GtkCssValue *value1,
|
||||
if (coord2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_css_value_equal (coord1, coord2))
|
||||
if (!_gtk_css_value_equal (coord1, coord2))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -106,9 +109,9 @@ gtk_css_value_font_variations_transition (GtkCssValue *start,
|
||||
{
|
||||
end_coord = g_hash_table_lookup (end->axes, name);
|
||||
if (end_coord == NULL)
|
||||
transition = gtk_css_value_ref (start_coord);
|
||||
transition = _gtk_css_value_ref (start_coord);
|
||||
else
|
||||
transition = gtk_css_value_transition (start_coord, end_coord, property_id, progress);
|
||||
transition = _gtk_css_value_transition (start_coord, end_coord, property_id, progress);
|
||||
|
||||
gtk_css_font_variations_value_add_axis (result, name, transition);
|
||||
}
|
||||
@@ -120,7 +123,7 @@ gtk_css_value_font_variations_transition (GtkCssValue *start,
|
||||
if (start_coord != NULL)
|
||||
continue;
|
||||
|
||||
gtk_css_font_variations_value_add_axis (result, name, gtk_css_value_ref (end_coord));
|
||||
gtk_css_font_variations_value_add_axis (result, name, _gtk_css_value_ref (end_coord));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -149,7 +152,7 @@ gtk_css_value_font_variations_print (const GtkCssValue *value,
|
||||
else
|
||||
g_string_append (string, ", ");
|
||||
g_string_append_printf (string, "\"%s\" ", name);
|
||||
gtk_css_value_print (coord, string);
|
||||
_gtk_css_value_print (coord, string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,10 +172,10 @@ gtk_css_font_variations_value_new_empty (void)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIATIONS);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIATIONS);
|
||||
result->axes = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free,
|
||||
(GDestroyNotify) gtk_css_value_unref);
|
||||
(GDestroyNotify) _gtk_css_value_unref);
|
||||
result->is_computed = TRUE;
|
||||
|
||||
return result;
|
||||
@@ -184,7 +187,7 @@ gtk_css_font_variations_value_new_default (void)
|
||||
if (default_font_variations == NULL)
|
||||
default_font_variations = gtk_css_font_variations_value_new_empty ();
|
||||
|
||||
return gtk_css_value_ref (default_font_variations);
|
||||
return _gtk_css_value_ref (default_font_variations);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -217,7 +220,7 @@ gtk_css_font_variations_value_parse (GtkCssParser *parser)
|
||||
name = gtk_css_parser_consume_string (parser);
|
||||
if (name == NULL)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -225,7 +228,7 @@ gtk_css_font_variations_value_parse (GtkCssParser *parser)
|
||||
{
|
||||
gtk_css_parser_error_value (parser, "Not a valid OpenType tag.");
|
||||
g_free (name);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -233,7 +236,7 @@ gtk_css_font_variations_value_parse (GtkCssParser *parser)
|
||||
if (coord == NULL)
|
||||
{
|
||||
g_free (name);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,9 +65,12 @@ gtk_css_image_real_get_aspect_ratio (GtkCssImage *image)
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_real_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_real_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return g_object_ref (image);
|
||||
}
|
||||
@@ -171,19 +174,22 @@ _gtk_css_image_get_aspect_ratio (GtkCssImage *image)
|
||||
}
|
||||
|
||||
GtkCssImage *
|
||||
_gtk_css_image_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
_gtk_css_image_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageClass *klass;
|
||||
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (context->style), NULL);
|
||||
gtk_internal_return_val_if_fail (context->parent_style == NULL || GTK_IS_CSS_STYLE (context->parent_style), NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
gtk_internal_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
|
||||
klass = GTK_CSS_IMAGE_GET_CLASS (image);
|
||||
|
||||
return klass->compute (image, property_id, context);
|
||||
return klass->compute (image, property_id, provider, style, parent_style, variables);
|
||||
}
|
||||
|
||||
GtkCssImage *
|
||||
|
||||
@@ -272,10 +272,10 @@ gtk_css_image_conic_print (GtkCssImage *image,
|
||||
GtkCssValue *compare = _gtk_css_position_value_new (_gtk_css_number_value_new (50, GTK_CSS_PERCENT),
|
||||
_gtk_css_number_value_new (50, GTK_CSS_PERCENT));
|
||||
|
||||
if (!gtk_css_value_equal (self->center, compare))
|
||||
if (!_gtk_css_value_equal (self->center, compare))
|
||||
{
|
||||
g_string_append (string, "from ");
|
||||
gtk_css_value_print (self->center, string);
|
||||
_gtk_css_value_print (self->center, string);
|
||||
written = TRUE;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ gtk_css_image_conic_print (GtkCssImage *image,
|
||||
if (written)
|
||||
g_string_append_c (string, ' ');
|
||||
g_string_append (string, "at ");
|
||||
gtk_css_value_print (self->rotation, string);
|
||||
_gtk_css_value_print (self->rotation, string);
|
||||
}
|
||||
|
||||
if (written)
|
||||
@@ -300,12 +300,12 @@ gtk_css_image_conic_print (GtkCssImage *image,
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
|
||||
gtk_css_value_print (stop->color, string);
|
||||
_gtk_css_value_print (stop->color, string);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
g_string_append (string, " ");
|
||||
gtk_css_value_print (stop->offset, string);
|
||||
_gtk_css_value_print (stop->offset, string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,9 +313,12 @@ gtk_css_image_conic_print (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_conic_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_conic_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageConic *self = GTK_CSS_IMAGE_CONIC (image);
|
||||
GtkCssImageConic *copy;
|
||||
@@ -323,8 +326,8 @@ gtk_css_image_conic_compute (GtkCssImage *image,
|
||||
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_CONIC, NULL);
|
||||
|
||||
copy->center = gtk_css_value_compute (self->center, property_id, context);
|
||||
copy->rotation = gtk_css_value_compute (self->rotation, property_id, context);
|
||||
copy->center = _gtk_css_value_compute (self->center, property_id, provider, style, parent_style, variables);
|
||||
copy->rotation = _gtk_css_value_compute (self->rotation, property_id, provider, style, parent_style, variables);
|
||||
|
||||
copy->n_stops = self->n_stops;
|
||||
copy->color_stops = g_malloc (sizeof (GtkCssImageConicColorStop) * copy->n_stops);
|
||||
@@ -333,11 +336,11 @@ gtk_css_image_conic_compute (GtkCssImage *image,
|
||||
const GtkCssImageConicColorStop *stop = &self->color_stops[i];
|
||||
GtkCssImageConicColorStop *scopy = ©->color_stops[i];
|
||||
|
||||
scopy->color = gtk_css_value_compute (stop->color, property_id, context);
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
scopy->offset = gtk_css_value_compute (stop->offset, property_id, context);
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, variables);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -372,11 +375,11 @@ gtk_css_image_conic_transition (GtkCssImage *start_image,
|
||||
|
||||
result = g_object_new (GTK_TYPE_CSS_IMAGE_CONIC, NULL);
|
||||
|
||||
result->center = gtk_css_value_transition (start->center, end->center, property_id, progress);
|
||||
result->center = _gtk_css_value_transition (start->center, end->center, property_id, progress);
|
||||
if (result->center == NULL)
|
||||
goto fail;
|
||||
|
||||
result->rotation = gtk_css_value_transition (start->rotation, end->rotation, property_id, progress);
|
||||
result->rotation = _gtk_css_value_transition (start->rotation, end->rotation, property_id, progress);
|
||||
if (result->rotation == NULL)
|
||||
goto fail;
|
||||
|
||||
@@ -397,22 +400,22 @@ gtk_css_image_conic_transition (GtkCssImage *start_image,
|
||||
}
|
||||
else
|
||||
{
|
||||
stop->offset = gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
stop->offset = _gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->offset == NULL)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
stop->color = gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
stop->color = _gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->color == NULL)
|
||||
{
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -434,8 +437,8 @@ gtk_css_image_conic_equal (GtkCssImage *image1,
|
||||
GtkCssImageConic *conic2 = (GtkCssImageConic *) image2;
|
||||
guint i;
|
||||
|
||||
if (!gtk_css_value_equal (conic1->center, conic2->center) ||
|
||||
!gtk_css_value_equal (conic1->rotation, conic2->rotation))
|
||||
if (!_gtk_css_value_equal (conic1->center, conic2->center) ||
|
||||
!_gtk_css_value_equal (conic1->rotation, conic2->rotation))
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < conic1->n_stops; i++)
|
||||
@@ -443,8 +446,8 @@ gtk_css_image_conic_equal (GtkCssImage *image1,
|
||||
const GtkCssImageConicColorStop *stop1 = &conic1->color_stops[i];
|
||||
const GtkCssImageConicColorStop *stop2 = &conic2->color_stops[i];
|
||||
|
||||
if (!gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!gtk_css_value_equal (stop1->color, stop2->color))
|
||||
if (!_gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!_gtk_css_value_equal (stop1->color, stop2->color))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -461,9 +464,9 @@ gtk_css_image_conic_dispose (GObject *object)
|
||||
{
|
||||
GtkCssImageConicColorStop *stop = &self->color_stops[i];
|
||||
|
||||
gtk_css_value_unref (stop->color);
|
||||
_gtk_css_value_unref (stop->color);
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
}
|
||||
g_free (self->color_stops);
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ parse_progress (GtkCssParser *parser,
|
||||
if (number == NULL)
|
||||
return FALSE;
|
||||
*progress = _gtk_css_number_value_get (number, 1);
|
||||
gtk_css_value_unref (number);
|
||||
_gtk_css_value_unref (number);
|
||||
|
||||
if (*progress > 1.0)
|
||||
{
|
||||
@@ -399,9 +399,12 @@ gtk_css_image_cross_fade_print (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_cross_fade_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_cross_fade_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageCrossFade *self = GTK_CSS_IMAGE_CROSS_FADE (image);
|
||||
GtkCssImageCrossFade *result;
|
||||
@@ -416,7 +419,7 @@ gtk_css_image_cross_fade_compute (GtkCssImage *image,
|
||||
gtk_css_image_cross_fade_add (result,
|
||||
entry->has_progress,
|
||||
entry->progress,
|
||||
_gtk_css_image_compute (entry->image, property_id, context));
|
||||
_gtk_css_image_compute (entry->image, property_id, provider, style, parent_style, variables));
|
||||
}
|
||||
|
||||
return GTK_CSS_IMAGE (result);
|
||||
|
||||
@@ -105,7 +105,7 @@ gtk_css_image_fallback_print (GtkCssImage *image,
|
||||
{
|
||||
if (fallback->n_images > 0)
|
||||
g_string_append (string, ",");
|
||||
gtk_css_value_print (fallback->color, string);
|
||||
_gtk_css_value_print (fallback->color, string);
|
||||
}
|
||||
|
||||
g_string_append (string, ")");
|
||||
@@ -124,7 +124,7 @@ gtk_css_image_fallback_dispose (GObject *object)
|
||||
|
||||
if (fallback->color)
|
||||
{
|
||||
gtk_css_value_unref (fallback->color);
|
||||
_gtk_css_value_unref (fallback->color);
|
||||
fallback->color = NULL;
|
||||
}
|
||||
|
||||
@@ -133,9 +133,12 @@ gtk_css_image_fallback_dispose (GObject *object)
|
||||
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_fallback_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_fallback_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageFallback *fallback = GTK_CSS_IMAGE_FALLBACK (image);
|
||||
GtkCssImageFallback *copy;
|
||||
@@ -146,9 +149,12 @@ gtk_css_image_fallback_compute (GtkCssImage *image,
|
||||
GtkCssValue *computed_color = NULL;
|
||||
|
||||
if (fallback->color)
|
||||
computed_color = gtk_css_value_compute (fallback->color,
|
||||
property_id,
|
||||
context);
|
||||
computed_color = _gtk_css_value_compute (fallback->color,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
|
||||
/* image($color) that didn't change */
|
||||
if (computed_color && !fallback->images &&
|
||||
@@ -162,7 +168,10 @@ gtk_css_image_fallback_compute (GtkCssImage *image,
|
||||
{
|
||||
copy->images[i] = _gtk_css_image_compute (fallback->images[i],
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
|
||||
if (gtk_css_image_is_invalid (copy->images[i]))
|
||||
continue;
|
||||
@@ -234,7 +243,7 @@ gtk_css_image_fallback_parse (GtkCssImage *image,
|
||||
|
||||
if (!gtk_css_parser_consume_function (parser, 1, G_MAXUINT, gtk_css_image_fallback_parse_arg, &data))
|
||||
{
|
||||
g_clear_pointer (&data.color, gtk_css_value_unref);
|
||||
g_clear_pointer (&data.color, _gtk_css_value_unref);
|
||||
if (data.images)
|
||||
g_ptr_array_free (data.images, TRUE);
|
||||
return FALSE;
|
||||
@@ -267,7 +276,7 @@ gtk_css_image_fallback_equal (GtkCssImage *image1,
|
||||
if (fallback2->used >= 0)
|
||||
return FALSE;
|
||||
|
||||
return gtk_css_value_equal (fallback1->color, fallback2->color);
|
||||
return _gtk_css_value_equal (fallback1->color, fallback2->color);
|
||||
}
|
||||
|
||||
if (fallback2->used < 0)
|
||||
|
||||
@@ -138,9 +138,12 @@ gtk_css_image_icon_theme_print (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
|
||||
GtkCssImageIconTheme *copy;
|
||||
@@ -149,12 +152,12 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_ICON_THEME, NULL);
|
||||
copy->name = g_strdup (icon_theme->name);
|
||||
settings = gtk_style_provider_get_settings (context->provider);
|
||||
settings = gtk_style_provider_get_settings (provider);
|
||||
display = _gtk_settings_get_display (settings);
|
||||
copy->icon_theme = gtk_icon_theme_get_for_display (display);
|
||||
copy->serial = gtk_icon_theme_get_serial (copy->icon_theme);
|
||||
copy->scale = gtk_style_provider_get_scale (context->provider);
|
||||
gtk_css_style_lookup_symbolic_colors (context->style, copy->colors);
|
||||
copy->scale = gtk_style_provider_get_scale (provider);
|
||||
gtk_css_style_lookup_symbolic_colors (style, copy->colors);
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ gtk_css_image_linear_parse_color_stop (GtkCssImageLinear *self,
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (stop.offset == NULL)
|
||||
{
|
||||
gtk_css_value_unref (stop.color);
|
||||
_gtk_css_value_unref (stop.color);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -464,7 +464,7 @@ gtk_css_image_linear_print (GtkCssImage *image,
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_css_value_print (linear->angle, string);
|
||||
_gtk_css_value_print (linear->angle, string);
|
||||
g_string_append (string, ", ");
|
||||
}
|
||||
|
||||
@@ -475,12 +475,12 @@ gtk_css_image_linear_print (GtkCssImage *image,
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
|
||||
gtk_css_value_print (stop->color, string);
|
||||
_gtk_css_value_print (stop->color, string);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
g_string_append (string, " ");
|
||||
gtk_css_value_print (stop->offset, string);
|
||||
_gtk_css_value_print (stop->offset, string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,9 +488,12 @@ gtk_css_image_linear_print (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
|
||||
GtkCssImageLinear *copy;
|
||||
@@ -501,7 +504,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
copy->side = linear->side;
|
||||
|
||||
if (linear->angle)
|
||||
copy->angle = gtk_css_value_compute (linear->angle, property_id, context);
|
||||
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style, variables);
|
||||
|
||||
copy->n_stops = linear->n_stops;
|
||||
copy->color_stops = g_malloc (sizeof (GtkCssImageLinearColorStop) * copy->n_stops);
|
||||
@@ -510,11 +513,11 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
const GtkCssImageLinearColorStop *stop = &linear->color_stops[i];
|
||||
GtkCssImageLinearColorStop *scopy = ©->color_stops[i];
|
||||
|
||||
scopy->color = gtk_css_value_compute (stop->color, property_id, context);
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
scopy->offset = gtk_css_value_compute (stop->offset, property_id, context);
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, variables);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -556,7 +559,7 @@ gtk_css_image_linear_transition (GtkCssImage *start_image,
|
||||
|
||||
result->side = start->side;
|
||||
if (result->side == 0)
|
||||
result->angle = gtk_css_value_transition (start->angle, end->angle, property_id, progress);
|
||||
result->angle = _gtk_css_value_transition (start->angle, end->angle, property_id, progress);
|
||||
if (result->angle == NULL)
|
||||
goto fail;
|
||||
|
||||
@@ -578,22 +581,22 @@ gtk_css_image_linear_transition (GtkCssImage *start_image,
|
||||
}
|
||||
else
|
||||
{
|
||||
stop->offset = gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
stop->offset = _gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->offset == NULL)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
stop->color = gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
stop->color = _gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->color == NULL)
|
||||
{
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -617,7 +620,7 @@ gtk_css_image_linear_equal (GtkCssImage *image1,
|
||||
|
||||
if (linear1->repeating != linear2->repeating ||
|
||||
linear1->side != linear2->side ||
|
||||
(linear1->side == 0 && !gtk_css_value_equal (linear1->angle, linear2->angle)) ||
|
||||
(linear1->side == 0 && !_gtk_css_value_equal (linear1->angle, linear2->angle)) ||
|
||||
linear1->n_stops != linear2->n_stops)
|
||||
return FALSE;
|
||||
|
||||
@@ -626,8 +629,8 @@ gtk_css_image_linear_equal (GtkCssImage *image1,
|
||||
const GtkCssImageLinearColorStop *stop1 = &linear1->color_stops[i];
|
||||
const GtkCssImageLinearColorStop *stop2 = &linear2->color_stops[i];
|
||||
|
||||
if (!gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!gtk_css_value_equal (stop1->color, stop2->color))
|
||||
if (!_gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!_gtk_css_value_equal (stop1->color, stop2->color))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -644,16 +647,16 @@ gtk_css_image_linear_dispose (GObject *object)
|
||||
{
|
||||
GtkCssImageLinearColorStop *stop = &linear->color_stops[i];
|
||||
|
||||
gtk_css_value_unref (stop->color);
|
||||
_gtk_css_value_unref (stop->color);
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
}
|
||||
g_free (linear->color_stops);
|
||||
|
||||
linear->side = 0;
|
||||
if (linear->angle)
|
||||
{
|
||||
gtk_css_value_unref (linear->angle);
|
||||
_gtk_css_value_unref (linear->angle);
|
||||
linear->angle = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcssimagepaintableprivate.h"
|
||||
#include "gtkcssvalueprivate.h"
|
||||
|
||||
#include "gtkprivate.h"
|
||||
|
||||
@@ -97,9 +96,12 @@ gtk_css_image_paintable_get_static_image (GtkCssImage *image)
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_paintable_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_paintable_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_image_paintable_get_static_image (image);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "gtk/css/gtkcssparserprivate.h"
|
||||
#include "gtk/gtkcsstypesprivate.h"
|
||||
#include "gtk/gtkcssvariablesetprivate.h"
|
||||
#include "gtk/gtkcssvalueprivate.h"
|
||||
#include "gtk/gtksnapshot.h"
|
||||
#include "gtk/gtkstyleprovider.h"
|
||||
|
||||
@@ -62,7 +61,10 @@ struct _GtkCssImageClass
|
||||
/* create "computed value" in CSS terms, returns a new reference */
|
||||
GtkCssImage *(* compute) (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context);
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables);
|
||||
/* compare two images for equality */
|
||||
gboolean (* equal) (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
@@ -104,7 +106,10 @@ double _gtk_css_image_get_aspect_ratio (GtkCssImage *
|
||||
|
||||
GtkCssImage * _gtk_css_image_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context);
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables);
|
||||
gboolean _gtk_css_image_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2) G_GNUC_PURE;
|
||||
GtkCssImage * _gtk_css_image_transition (GtkCssImage *start,
|
||||
|
||||
@@ -234,7 +234,7 @@ gtk_css_image_radial_parse_color_stop (GtkCssImageRadial *radial,
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (stop.offset == NULL)
|
||||
{
|
||||
gtk_css_value_unref (stop.color);
|
||||
_gtk_css_value_unref (stop.color);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ gtk_css_image_radial_parse_first_arg (GtkCssImageRadial *radial,
|
||||
if (has_size && !radial->circle)
|
||||
{
|
||||
if (radial->sizes[0] && !radial->sizes[1])
|
||||
radial->sizes[1] = gtk_css_value_ref (radial->sizes[0]);
|
||||
radial->sizes[1] = _gtk_css_value_ref (radial->sizes[0]);
|
||||
}
|
||||
|
||||
if (found_one)
|
||||
@@ -456,16 +456,16 @@ gtk_css_image_radial_print (GtkCssImage *image,
|
||||
else
|
||||
{
|
||||
if (radial->sizes[0])
|
||||
gtk_css_value_print (radial->sizes[0], string);
|
||||
_gtk_css_value_print (radial->sizes[0], string);
|
||||
if (radial->sizes[1])
|
||||
{
|
||||
g_string_append (string, " ");
|
||||
gtk_css_value_print (radial->sizes[1], string);
|
||||
_gtk_css_value_print (radial->sizes[1], string);
|
||||
}
|
||||
}
|
||||
|
||||
g_string_append (string, " at ");
|
||||
gtk_css_value_print (radial->position, string);
|
||||
_gtk_css_value_print (radial->position, string);
|
||||
|
||||
g_string_append (string, ", ");
|
||||
|
||||
@@ -476,12 +476,12 @@ gtk_css_image_radial_print (GtkCssImage *image,
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
|
||||
gtk_css_value_print (stop->color, string);
|
||||
_gtk_css_value_print (stop->color, string);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
g_string_append (string, " ");
|
||||
gtk_css_value_print (stop->offset, string);
|
||||
_gtk_css_value_print (stop->offset, string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,9 +489,12 @@ gtk_css_image_radial_print (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_radial_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_radial_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageRadial *radial = GTK_CSS_IMAGE_RADIAL (image);
|
||||
GtkCssImageRadial *copy;
|
||||
@@ -502,13 +505,13 @@ gtk_css_image_radial_compute (GtkCssImage *image,
|
||||
copy->circle = radial->circle;
|
||||
copy->size = radial->size;
|
||||
|
||||
copy->position = gtk_css_value_compute (radial->position, property_id, context);
|
||||
copy->position = _gtk_css_value_compute (radial->position, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (radial->sizes[0])
|
||||
copy->sizes[0] = gtk_css_value_compute (radial->sizes[0], property_id, context);
|
||||
copy->sizes[0] = _gtk_css_value_compute (radial->sizes[0], property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (radial->sizes[1])
|
||||
copy->sizes[1] = gtk_css_value_compute (radial->sizes[1], property_id, context);
|
||||
copy->sizes[1] = _gtk_css_value_compute (radial->sizes[1], property_id, provider, style, parent_style, variables);
|
||||
|
||||
copy->n_stops = radial->n_stops;
|
||||
copy->color_stops = g_malloc (sizeof (GtkCssImageRadialColorStop) * copy->n_stops);
|
||||
@@ -517,11 +520,11 @@ gtk_css_image_radial_compute (GtkCssImage *image,
|
||||
const GtkCssImageRadialColorStop *stop = &radial->color_stops[i];
|
||||
GtkCssImageRadialColorStop *scopy = ©->color_stops[i];
|
||||
|
||||
scopy->color = gtk_css_value_compute (stop->color, property_id, context);
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
scopy->offset = gtk_css_value_compute (stop->offset, property_id, context);
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, variables);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -562,13 +565,13 @@ gtk_css_image_radial_transition (GtkCssImage *start_image,
|
||||
result->circle = start->circle;
|
||||
result->size = start->size;
|
||||
|
||||
result->position = gtk_css_value_transition (start->position, end->position, property_id, progress);
|
||||
result->position = _gtk_css_value_transition (start->position, end->position, property_id, progress);
|
||||
if (result->position == NULL)
|
||||
goto fail;
|
||||
|
||||
if (start->sizes[0] && end->sizes[0])
|
||||
{
|
||||
result->sizes[0] = gtk_css_value_transition (start->sizes[0], end->sizes[0], property_id, progress);
|
||||
result->sizes[0] = _gtk_css_value_transition (start->sizes[0], end->sizes[0], property_id, progress);
|
||||
if (result->sizes[0] == NULL)
|
||||
goto fail;
|
||||
}
|
||||
@@ -577,7 +580,7 @@ gtk_css_image_radial_transition (GtkCssImage *start_image,
|
||||
|
||||
if (start->sizes[1] && end->sizes[1])
|
||||
{
|
||||
result->sizes[1] = gtk_css_value_transition (start->sizes[1], end->sizes[1], property_id, progress);
|
||||
result->sizes[1] = _gtk_css_value_transition (start->sizes[1], end->sizes[1], property_id, progress);
|
||||
if (result->sizes[1] == NULL)
|
||||
goto fail;
|
||||
}
|
||||
@@ -601,22 +604,22 @@ gtk_css_image_radial_transition (GtkCssImage *start_image,
|
||||
}
|
||||
else
|
||||
{
|
||||
stop->offset = gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
stop->offset = _gtk_css_value_transition (start_stop->offset,
|
||||
end_stop->offset,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->offset == NULL)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
stop->color = gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
stop->color = _gtk_css_value_transition (start_stop->color,
|
||||
end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
if (stop->color == NULL)
|
||||
{
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -640,11 +643,11 @@ gtk_css_image_radial_equal (GtkCssImage *image1,
|
||||
|
||||
if (radial1->repeating != radial2->repeating ||
|
||||
radial1->size != radial2->size ||
|
||||
!gtk_css_value_equal (radial1->position, radial2->position) ||
|
||||
!_gtk_css_value_equal (radial1->position, radial2->position) ||
|
||||
((radial1->sizes[0] == NULL) != (radial2->sizes[0] == NULL)) ||
|
||||
(radial1->sizes[0] && radial2->sizes[0] && !gtk_css_value_equal (radial1->sizes[0], radial2->sizes[0])) ||
|
||||
(radial1->sizes[0] && radial2->sizes[0] && !_gtk_css_value_equal (radial1->sizes[0], radial2->sizes[0])) ||
|
||||
((radial1->sizes[1] == NULL) != (radial2->sizes[1] == NULL)) ||
|
||||
(radial1->sizes[1] && radial2->sizes[1] && !gtk_css_value_equal (radial1->sizes[1], radial2->sizes[1])) ||
|
||||
(radial1->sizes[1] && radial2->sizes[1] && !_gtk_css_value_equal (radial1->sizes[1], radial2->sizes[1])) ||
|
||||
radial1->n_stops != radial2->n_stops)
|
||||
return FALSE;
|
||||
|
||||
@@ -653,8 +656,8 @@ gtk_css_image_radial_equal (GtkCssImage *image1,
|
||||
const GtkCssImageRadialColorStop *stop1 = &radial1->color_stops[i];
|
||||
const GtkCssImageRadialColorStop *stop2 = &radial2->color_stops[i];
|
||||
|
||||
if (!gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!gtk_css_value_equal (stop1->color, stop2->color))
|
||||
if (!_gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!_gtk_css_value_equal (stop1->color, stop2->color))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -671,22 +674,22 @@ gtk_css_image_radial_dispose (GObject *object)
|
||||
{
|
||||
GtkCssImageRadialColorStop *stop = &radial->color_stops[i];
|
||||
|
||||
gtk_css_value_unref (stop->color);
|
||||
_gtk_css_value_unref (stop->color);
|
||||
if (stop->offset)
|
||||
gtk_css_value_unref (stop->offset);
|
||||
_gtk_css_value_unref (stop->offset);
|
||||
}
|
||||
g_free (radial->color_stops);
|
||||
|
||||
if (radial->position)
|
||||
{
|
||||
gtk_css_value_unref (radial->position);
|
||||
_gtk_css_value_unref (radial->position);
|
||||
radial->position = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
if (radial->sizes[i])
|
||||
{
|
||||
gtk_css_value_unref (radial->sizes[i]);
|
||||
_gtk_css_value_unref (radial->sizes[i]);
|
||||
radial->sizes[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ gtk_css_image_recolor_print (GtkCssImage *image,
|
||||
if (recolor->palette)
|
||||
{
|
||||
g_string_append (string, ",");
|
||||
gtk_css_value_print (recolor->palette, string);
|
||||
_gtk_css_value_print (recolor->palette, string);
|
||||
}
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
@@ -54,7 +54,7 @@ gtk_css_image_recolor_dispose (GObject *object)
|
||||
{
|
||||
GtkCssImageRecolor *recolor = GTK_CSS_IMAGE_RECOLOR (object);
|
||||
|
||||
g_clear_pointer (&recolor->palette, gtk_css_value_unref);
|
||||
g_clear_pointer (&recolor->palette, _gtk_css_value_unref);
|
||||
g_clear_object (&recolor->file);
|
||||
g_clear_object (&recolor->texture);
|
||||
|
||||
@@ -201,9 +201,12 @@ gtk_css_image_recolor_snapshot (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_recolor_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_recolor_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageRecolor *recolor = GTK_CSS_IMAGE_RECOLOR (image);
|
||||
GtkCssValue *palette;
|
||||
@@ -211,23 +214,23 @@ gtk_css_image_recolor_compute (GtkCssImage *image,
|
||||
int scale;
|
||||
GError *error = NULL;
|
||||
|
||||
scale = gtk_style_provider_get_scale (context->provider);
|
||||
scale = gtk_style_provider_get_scale (provider);
|
||||
|
||||
if (recolor->palette)
|
||||
palette = gtk_css_value_compute (recolor->palette, property_id, context);
|
||||
palette = _gtk_css_value_compute (recolor->palette, property_id, provider, style, parent_style, variables);
|
||||
else
|
||||
palette = gtk_css_value_ref (context->style->core->icon_palette);
|
||||
palette = _gtk_css_value_ref (style->core->icon_palette);
|
||||
|
||||
img = gtk_css_image_recolor_load (recolor, context->style, palette, scale, &error);
|
||||
img = gtk_css_image_recolor_load (recolor, style, palette, scale, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
GtkCssSection *section = gtk_css_style_get_section (context->style, property_id);
|
||||
gtk_style_provider_emit_error (context->provider, section, error);
|
||||
GtkCssSection *section = gtk_css_style_get_section (style, property_id);
|
||||
gtk_style_provider_emit_error (provider, section, error);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
gtk_css_value_unref (palette);
|
||||
_gtk_css_value_unref (palette);
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
@@ -97,9 +97,12 @@ gtk_css_image_scaled_dispose (GObject *object)
|
||||
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageScaled *scaled = GTK_CSS_IMAGE_SCALED (image);
|
||||
int scale;
|
||||
@@ -107,7 +110,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
int i;
|
||||
int best;
|
||||
|
||||
scale = gtk_style_provider_get_scale (context->provider);
|
||||
scale = gtk_style_provider_get_scale (provider);
|
||||
scale = MAX(scale, 1);
|
||||
|
||||
best = 0;
|
||||
@@ -133,7 +136,10 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
|
||||
res->images[0] = _gtk_css_image_compute (scaled->images[best],
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
res->scales[0] = scaled->scales[best];
|
||||
|
||||
return GTK_CSS_IMAGE (res);
|
||||
|
||||
@@ -112,9 +112,12 @@ gtk_css_image_url_snapshot (GtkCssImage *image,
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_url_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_image_url_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);
|
||||
GtkCssImage *copy;
|
||||
@@ -123,8 +126,8 @@ gtk_css_image_url_compute (GtkCssImage *image,
|
||||
copy = gtk_css_image_url_load_image (url, &error);
|
||||
if (error)
|
||||
{
|
||||
GtkCssSection *section = gtk_css_style_get_section (context->style, property_id);
|
||||
gtk_style_provider_emit_error (context->provider, section, error);
|
||||
GtkCssSection *section = gtk_css_style_get_section (style, property_id);
|
||||
gtk_style_provider_emit_error (provider, section, error);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,23 +34,26 @@ gtk_css_value_image_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_image_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_image_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssImage *image, *computed;
|
||||
|
||||
image = _gtk_css_image_value_get_image (value);
|
||||
|
||||
if (image == NULL)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
computed = _gtk_css_image_compute (image, property_id, context);
|
||||
computed = _gtk_css_image_compute (image, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (computed == image)
|
||||
{
|
||||
g_object_unref (computed);
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return _gtk_css_image_value_new (computed);
|
||||
@@ -138,9 +141,9 @@ _gtk_css_image_value_new (GtkCssImage *image)
|
||||
GtkCssValue *value;
|
||||
|
||||
if (image == NULL)
|
||||
return gtk_css_value_ref (&image_none_singleton);
|
||||
return _gtk_css_value_ref (&image_none_singleton);
|
||||
|
||||
value = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_IMAGE);
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_IMAGE);
|
||||
value->image = image;
|
||||
value->is_computed = gtk_css_image_is_computed (image);
|
||||
|
||||
|
||||
@@ -34,19 +34,25 @@ gtk_css_value_inherit_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_inherit_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_inherit_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
if (context->parent_style)
|
||||
if (parent_style)
|
||||
{
|
||||
return gtk_css_value_ref (gtk_css_style_get_value (context->parent_style, property_id));
|
||||
return _gtk_css_value_ref (gtk_css_style_get_value (parent_style, property_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return gtk_css_value_compute (_gtk_css_initial_value_get (),
|
||||
property_id,
|
||||
context);
|
||||
return _gtk_css_value_compute (_gtk_css_initial_value_get (),
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +95,7 @@ static GtkCssValue inherit = { >K_CSS_VALUE_INHERIT, 1 };
|
||||
GtkCssValue *
|
||||
_gtk_css_inherit_value_new (void)
|
||||
{
|
||||
return gtk_css_value_ref (&inherit);
|
||||
return _gtk_css_value_ref (&inherit);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
|
||||
@@ -38,16 +38,19 @@ gtk_css_value_initial_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case GTK_CSS_PROPERTY_DPI:
|
||||
settings = gtk_style_provider_get_settings (context->provider);
|
||||
settings = gtk_style_provider_get_settings (provider);
|
||||
if (settings)
|
||||
{
|
||||
int dpi_int;
|
||||
@@ -60,7 +63,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
break;
|
||||
|
||||
case GTK_CSS_PROPERTY_FONT_FAMILY:
|
||||
settings = gtk_style_provider_get_settings (context->provider);
|
||||
settings = gtk_style_provider_get_settings (provider);
|
||||
if (settings && gtk_settings_get_font_family (settings) != NULL)
|
||||
return _gtk_css_array_value_new (_gtk_css_string_value_new (gtk_settings_get_font_family (settings)));
|
||||
break;
|
||||
@@ -69,9 +72,12 @@ gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
break;
|
||||
}
|
||||
|
||||
return gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -113,7 +119,7 @@ static GtkCssValue initial = { >K_CSS_VALUE_INITIAL, 1 };
|
||||
GtkCssValue *
|
||||
_gtk_css_initial_value_new (void)
|
||||
{
|
||||
return gtk_css_value_ref (&initial);
|
||||
return _gtk_css_value_ref (&initial);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -122,10 +128,15 @@ _gtk_css_initial_value_get (void)
|
||||
return &initial;
|
||||
}
|
||||
GtkCssValue *
|
||||
_gtk_css_initial_value_new_compute (guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
_gtk_css_initial_value_new_compute (guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return gtk_css_value_initial_compute (NULL,
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,10 @@ G_BEGIN_DECLS
|
||||
|
||||
GtkCssValue * _gtk_css_initial_value_new (void);
|
||||
GtkCssValue * _gtk_css_initial_value_get (void);
|
||||
GtkCssValue * _gtk_css_initial_value_new_compute (guint property_id,
|
||||
GtkCssComputeContext *context);
|
||||
GtkCssValue * _gtk_css_initial_value_new_compute (guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -74,7 +74,7 @@ _gtk_css_keyframes_unref (GtkCssKeyframes *keyframes)
|
||||
{
|
||||
for (p = 0; p < keyframes->n_properties; p++)
|
||||
{
|
||||
gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
_gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
KEYFRAMES_VALUE (keyframes, k, p) = NULL;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ gtk_css_keyframes_add_keyframe (GtkCssKeyframes *keyframes,
|
||||
if (KEYFRAMES_VALUE (keyframes, k, p) == NULL)
|
||||
continue;
|
||||
|
||||
gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
_gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
KEYFRAMES_VALUE (keyframes, k, p) = NULL;
|
||||
|
||||
/* XXX: GC properties that are now unset
|
||||
@@ -244,9 +244,9 @@ keyframes_set_value (GtkCssKeyframes *keyframes,
|
||||
p = gtk_css_keyframes_lookup_property (keyframes, _gtk_css_style_property_get_id (property));
|
||||
|
||||
if (KEYFRAMES_VALUE (keyframes, k, p))
|
||||
gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
_gtk_css_value_unref (KEYFRAMES_VALUE (keyframes, k, p));
|
||||
|
||||
KEYFRAMES_VALUE (keyframes, k, p) = gtk_css_value_ref (value);
|
||||
KEYFRAMES_VALUE (keyframes, k, p) = _gtk_css_value_ref (value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ gtk_css_keyframes_parse_declaration (GtkCssKeyframes *keyframes,
|
||||
if (!gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_EOF))
|
||||
{
|
||||
gtk_css_parser_error_syntax (parser, "Junk at end of value");
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ gtk_css_keyframes_parse_declaration (GtkCssKeyframes *keyframes,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ _gtk_css_keyframes_print (GtkCssKeyframes *keyframes,
|
||||
GTK_STYLE_PROPERTY (
|
||||
_gtk_css_style_property_lookup_by_id (
|
||||
keyframes->property_ids[sorted[p]]))));
|
||||
gtk_css_value_print (KEYFRAMES_VALUE (keyframes, k, sorted[p]), string);
|
||||
_gtk_css_value_print (KEYFRAMES_VALUE (keyframes, k, sorted[p]), string);
|
||||
g_string_append (string, ";\n");
|
||||
}
|
||||
|
||||
@@ -615,7 +615,6 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
GtkCssKeyframes *resolved;
|
||||
guint k, p;
|
||||
|
||||
@@ -631,10 +630,6 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
|
||||
resolved->property_ids = g_memdup2 (keyframes->property_ids, keyframes->n_properties * sizeof (guint));
|
||||
resolved->values = g_new0 (GtkCssValue *, resolved->n_keyframes * resolved->n_properties);
|
||||
|
||||
context.provider = provider;
|
||||
context.style = style;
|
||||
context.parent_style = parent_style;
|
||||
|
||||
for (p = 0; p < resolved->n_properties; p++)
|
||||
{
|
||||
for (k = 0; k < resolved->n_keyframes; k++)
|
||||
@@ -642,11 +637,12 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
|
||||
if (KEYFRAMES_VALUE (keyframes, k, p) == NULL)
|
||||
continue;
|
||||
|
||||
context.variables = keyframes->variables ? keyframes->variables[k] : NULL;
|
||||
|
||||
KEYFRAMES_VALUE (resolved, k, p) = gtk_css_value_compute (KEYFRAMES_VALUE (keyframes, k, p),
|
||||
resolved->property_ids[p],
|
||||
&context);
|
||||
KEYFRAMES_VALUE (resolved, k, p) = _gtk_css_value_compute (KEYFRAMES_VALUE (keyframes, k, p),
|
||||
resolved->property_ids[p],
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
keyframes->variables ? keyframes->variables[k] : NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,7 +708,7 @@ _gtk_css_keyframes_get_value (GtkCssKeyframes *keyframes,
|
||||
|
||||
if (keyframes->keyframe_progress[k] == progress)
|
||||
{
|
||||
return gtk_css_value_ref (KEYFRAMES_VALUE (keyframes, k, id));
|
||||
return _gtk_css_value_ref (KEYFRAMES_VALUE (keyframes, k, id));
|
||||
}
|
||||
else if (keyframes->keyframe_progress[k] < progress)
|
||||
{
|
||||
@@ -729,14 +725,14 @@ _gtk_css_keyframes_get_value (GtkCssKeyframes *keyframes,
|
||||
|
||||
progress = (progress - start_progress) / (end_progress - start_progress);
|
||||
|
||||
result = gtk_css_value_transition (start_value,
|
||||
end_value,
|
||||
keyframes->property_ids[id],
|
||||
progress);
|
||||
result = _gtk_css_value_transition (start_value,
|
||||
end_value,
|
||||
keyframes->property_ids[id],
|
||||
progress);
|
||||
|
||||
/* XXX: Dear spec, what's the correct thing to do here? */
|
||||
if (result == NULL)
|
||||
return gtk_css_value_ref (start_value);
|
||||
return _gtk_css_value_ref (start_value);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -34,18 +34,21 @@ static GtkCssValue *gtk_css_value_line_height_new (GtkCssValue *height);
|
||||
static void
|
||||
gtk_css_value_line_height_free (GtkCssValue *value)
|
||||
{
|
||||
gtk_css_value_unref (value->height);
|
||||
_gtk_css_value_unref (value->height);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_line_height_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_line_height_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *height;
|
||||
|
||||
height = gtk_css_value_compute (value->height, property_id, context);
|
||||
height = _gtk_css_value_compute (value->height, property_id, provider, style, parent_style, variables);
|
||||
|
||||
if (gtk_css_number_value_get_dimension (height) == GTK_CSS_DIMENSION_PERCENTAGE)
|
||||
{
|
||||
@@ -53,9 +56,9 @@ gtk_css_value_line_height_compute (GtkCssValue *value,
|
||||
GtkCssValue *computed;
|
||||
|
||||
factor = _gtk_css_number_value_get (height, 1);
|
||||
computed = gtk_css_number_value_multiply (context->style->core->font_size, factor);
|
||||
computed = gtk_css_number_value_multiply (style->core->font_size, factor);
|
||||
|
||||
gtk_css_value_unref (height);
|
||||
_gtk_css_value_unref (height);
|
||||
|
||||
return computed;
|
||||
}
|
||||
@@ -72,7 +75,7 @@ gtk_css_value_line_height_equal (const GtkCssValue *value1,
|
||||
if (value1->height == NULL || value2->height == NULL)
|
||||
return FALSE;
|
||||
|
||||
return gtk_css_value_equal (value1->height, value2->height);
|
||||
return _gtk_css_value_equal (value1->height, value2->height);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
@@ -86,7 +89,7 @@ gtk_css_value_line_height_transition (GtkCssValue *start,
|
||||
if (start->height == NULL || end->height == NULL)
|
||||
return NULL;
|
||||
|
||||
height = gtk_css_value_transition (start->height, end->height, property_id, progress);
|
||||
height = _gtk_css_value_transition (start->height, end->height, property_id, progress);
|
||||
if (height == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -100,7 +103,7 @@ gtk_css_value_line_height_print (const GtkCssValue *value,
|
||||
if (value->height == NULL)
|
||||
g_string_append (string, "normal");
|
||||
else
|
||||
gtk_css_value_print (value->height, string);
|
||||
_gtk_css_value_print (value->height, string);
|
||||
}
|
||||
|
||||
static const GtkCssValueClass GTK_CSS_VALUE_LINE_HEIGHT = {
|
||||
@@ -119,7 +122,7 @@ gtk_css_value_line_height_new_empty (void)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_LINE_HEIGHT);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_LINE_HEIGHT);
|
||||
result->height = NULL;
|
||||
result->is_computed = TRUE;
|
||||
|
||||
@@ -131,7 +134,7 @@ gtk_css_value_line_height_new (GtkCssValue *height)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_LINE_HEIGHT);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_LINE_HEIGHT);
|
||||
result->height = height;
|
||||
|
||||
return result;
|
||||
@@ -152,7 +155,7 @@ gtk_css_line_height_value_parse (GtkCssParser *parser)
|
||||
GtkCssValue *height;
|
||||
|
||||
if (gtk_css_parser_try_ident (parser, "normal"))
|
||||
return gtk_css_value_ref (gtk_css_line_height_value_get_default ());
|
||||
return _gtk_css_value_ref (gtk_css_line_height_value_get_default ());
|
||||
|
||||
height = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_NUMBER |
|
||||
GTK_CSS_PARSE_PERCENT |
|
||||
|
||||
@@ -78,7 +78,7 @@ gtk_css_value_number_free (GtkCssValue *number)
|
||||
const guint n_terms = number->calc.n_terms;
|
||||
|
||||
for (guint i = 0; i < n_terms; i++)
|
||||
gtk_css_value_unref (number->calc.terms[i]);
|
||||
_gtk_css_value_unref (number->calc.terms[i]);
|
||||
}
|
||||
|
||||
g_free (number);
|
||||
@@ -108,13 +108,13 @@ get_base_font_size_px (guint property_id,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_number_compute (GtkCssValue *number,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_number_compute (GtkCssValue *number,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkStyleProvider *provider = context->provider;
|
||||
GtkCssStyle *style = context->style;
|
||||
GtkCssStyle *parent_style = context->parent_style;
|
||||
double value;
|
||||
|
||||
if (G_UNLIKELY (number->type == TYPE_CALC))
|
||||
@@ -129,9 +129,10 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
|
||||
for (i = 0; i < n_terms; i++)
|
||||
{
|
||||
GtkCssValue *computed = gtk_css_value_compute (number->calc.terms[i],
|
||||
property_id,
|
||||
context);
|
||||
GtkCssValue *computed = _gtk_css_value_compute (number->calc.terms[i],
|
||||
property_id, provider, style,
|
||||
parent_style,
|
||||
variables);
|
||||
changed |= computed != number->calc.terms[i];
|
||||
new_values[i] = computed;
|
||||
}
|
||||
@@ -145,7 +146,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
for (i = 0; i < n_terms; i++)
|
||||
gtk_css_value_unref (new_values[i]);
|
||||
|
||||
result = gtk_css_value_ref (number);
|
||||
result = _gtk_css_value_ref (number);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -167,7 +168,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
case GTK_CSS_PX:
|
||||
case GTK_CSS_DEG:
|
||||
case GTK_CSS_S:
|
||||
return gtk_css_value_ref (number);
|
||||
return _gtk_css_value_ref (number);
|
||||
case GTK_CSS_PT:
|
||||
return gtk_css_dimension_value_new (value * get_dpi (style) / 72.0,
|
||||
GTK_CSS_PX);
|
||||
@@ -235,7 +236,7 @@ gtk_css_value_number_equal (const GtkCssValue *val1,
|
||||
|
||||
for (i = 0; i < val1->calc.n_terms; i++)
|
||||
{
|
||||
if (!gtk_css_value_equal (val1->calc.terms[i], val2->calc.terms[i]))
|
||||
if (!_gtk_css_value_equal (val1->calc.terms[i], val2->calc.terms[i]))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -287,12 +288,12 @@ gtk_css_value_number_print (const GtkCssValue *value,
|
||||
g_assert (value->type == TYPE_CALC);
|
||||
|
||||
g_string_append (string, "calc(");
|
||||
gtk_css_value_print (value->calc.terms[0], string);
|
||||
_gtk_css_value_print (value->calc.terms[0], string);
|
||||
|
||||
for (i = 1; i < value->calc.n_terms; i++)
|
||||
{
|
||||
g_string_append (string, " + ");
|
||||
gtk_css_value_print (value->calc.terms[i], string);
|
||||
_gtk_css_value_print (value->calc.terms[i], string);
|
||||
}
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
@@ -306,7 +307,7 @@ gtk_css_value_number_transition (GtkCssValue *start,
|
||||
GtkCssValue *result, *mul_start, *mul_end;
|
||||
|
||||
if (start == end)
|
||||
return gtk_css_value_ref (start);
|
||||
return _gtk_css_value_ref (start);
|
||||
|
||||
if (G_LIKELY (start->type == TYPE_DIMENSION && end->type == TYPE_DIMENSION))
|
||||
{
|
||||
@@ -324,8 +325,8 @@ gtk_css_value_number_transition (GtkCssValue *start,
|
||||
|
||||
result = gtk_css_number_value_add (mul_start, mul_end);
|
||||
|
||||
gtk_css_value_unref (mul_start);
|
||||
gtk_css_value_unref (mul_end);
|
||||
_gtk_css_value_unref (mul_start);
|
||||
_gtk_css_value_unref (mul_end);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -354,8 +355,8 @@ gtk_css_calc_value_new (guint n_terms)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_alloc (>K_CSS_VALUE_NUMBER,
|
||||
gtk_css_value_calc_get_size (n_terms));
|
||||
result = _gtk_css_value_alloc (>K_CSS_VALUE_NUMBER,
|
||||
gtk_css_value_calc_get_size (n_terms));
|
||||
result->type = TYPE_CALC;
|
||||
result->calc.n_terms = n_terms;
|
||||
|
||||
@@ -406,10 +407,10 @@ gtk_css_dimension_value_new (double value,
|
||||
{
|
||||
case GTK_CSS_NUMBER:
|
||||
if (value == 0 || value == 1)
|
||||
return gtk_css_value_ref (&number_singletons[(int) value]);
|
||||
return _gtk_css_value_ref (&number_singletons[(int) value]);
|
||||
|
||||
if (value == 96)
|
||||
return gtk_css_value_ref (&number_singletons[2]);
|
||||
return _gtk_css_value_ref (&number_singletons[2]);
|
||||
|
||||
break;
|
||||
|
||||
@@ -423,41 +424,41 @@ gtk_css_dimension_value_new (double value,
|
||||
value == 6 ||
|
||||
value == 7 ||
|
||||
value == 8)
|
||||
return gtk_css_value_ref (&px_singletons[(int) value]);
|
||||
return _gtk_css_value_ref (&px_singletons[(int) value]);
|
||||
if (value == 16)
|
||||
return gtk_css_value_ref (&px_singletons[9]);
|
||||
return _gtk_css_value_ref (&px_singletons[9]);
|
||||
if (value == 32)
|
||||
return gtk_css_value_ref (&px_singletons[10]);
|
||||
return _gtk_css_value_ref (&px_singletons[10]);
|
||||
if (value == 64)
|
||||
return gtk_css_value_ref (&px_singletons[11]);
|
||||
return _gtk_css_value_ref (&px_singletons[11]);
|
||||
|
||||
break;
|
||||
|
||||
case GTK_CSS_PERCENT:
|
||||
if (value == 0)
|
||||
return gtk_css_value_ref (&percent_singletons[0]);
|
||||
return _gtk_css_value_ref (&percent_singletons[0]);
|
||||
if (value == 50)
|
||||
return gtk_css_value_ref (&percent_singletons[1]);
|
||||
return _gtk_css_value_ref (&percent_singletons[1]);
|
||||
if (value == 100)
|
||||
return gtk_css_value_ref (&percent_singletons[2]);
|
||||
return _gtk_css_value_ref (&percent_singletons[2]);
|
||||
|
||||
break;
|
||||
|
||||
case GTK_CSS_S:
|
||||
if (value == 0 || value == 1)
|
||||
return gtk_css_value_ref (&second_singletons[(int)value]);
|
||||
return _gtk_css_value_ref (&second_singletons[(int)value]);
|
||||
|
||||
break;
|
||||
|
||||
case GTK_CSS_DEG:
|
||||
if (value == 0)
|
||||
return gtk_css_value_ref (°_singletons[0]);
|
||||
return _gtk_css_value_ref (°_singletons[0]);
|
||||
if (value == 90)
|
||||
return gtk_css_value_ref (°_singletons[1]);
|
||||
return _gtk_css_value_ref (°_singletons[1]);
|
||||
if (value == 180)
|
||||
return gtk_css_value_ref (°_singletons[2]);
|
||||
return _gtk_css_value_ref (°_singletons[2]);
|
||||
if (value == 270)
|
||||
return gtk_css_value_ref (°_singletons[3]);
|
||||
return _gtk_css_value_ref (°_singletons[3]);
|
||||
|
||||
break;
|
||||
|
||||
@@ -465,7 +466,7 @@ gtk_css_dimension_value_new (double value,
|
||||
;
|
||||
}
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_NUMBER);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_NUMBER);
|
||||
result->type = TYPE_DIMENSION;
|
||||
result->dimension.unit = unit;
|
||||
result->dimension.value = value;
|
||||
@@ -541,7 +542,7 @@ gtk_css_calc_array_add (GPtrArray *array, GtkCssValue *value)
|
||||
if (sum)
|
||||
{
|
||||
g_ptr_array_index (array, i) = sum;
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
return;
|
||||
}
|
||||
else if (gtk_css_number_value_get_calc_term_order (g_ptr_array_index (array, i)) > calc_term_order)
|
||||
@@ -569,12 +570,12 @@ gtk_css_calc_value_new_sum (GtkCssValue *value1,
|
||||
{
|
||||
for (i = 0; i < value1->calc.n_terms; i++)
|
||||
{
|
||||
gtk_css_calc_array_add (array, gtk_css_value_ref (value1->calc.terms[i]));
|
||||
gtk_css_calc_array_add (array, _gtk_css_value_ref (value1->calc.terms[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_css_calc_array_add (array, gtk_css_value_ref (value1));
|
||||
gtk_css_calc_array_add (array, _gtk_css_value_ref (value1));
|
||||
}
|
||||
|
||||
if (value2->class == >K_CSS_VALUE_NUMBER &&
|
||||
@@ -582,12 +583,12 @@ gtk_css_calc_value_new_sum (GtkCssValue *value1,
|
||||
{
|
||||
for (i = 0; i < value2->calc.n_terms; i++)
|
||||
{
|
||||
gtk_css_calc_array_add (array, gtk_css_value_ref (value2->calc.terms[i]));
|
||||
gtk_css_calc_array_add (array, _gtk_css_value_ref (value2->calc.terms[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_css_calc_array_add (array, gtk_css_value_ref (value2));
|
||||
gtk_css_calc_array_add (array, _gtk_css_value_ref (value2));
|
||||
}
|
||||
|
||||
result = gtk_css_calc_value_new_from_array ((GtkCssValue **)array->pdata, array->len);
|
||||
@@ -644,7 +645,7 @@ gtk_css_number_value_multiply (GtkCssValue *value,
|
||||
guint i;
|
||||
|
||||
if (factor == 1)
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
if (G_LIKELY (value->type == TYPE_DIMENSION))
|
||||
{
|
||||
@@ -687,10 +688,10 @@ gtk_css_number_value_try_add (GtkCssValue *value1,
|
||||
return NULL;
|
||||
|
||||
if (value1->dimension.value == 0)
|
||||
return gtk_css_value_ref (value2);
|
||||
return _gtk_css_value_ref (value2);
|
||||
|
||||
if (value2->dimension.value == 0)
|
||||
return gtk_css_value_ref (value1);
|
||||
return _gtk_css_value_ref (value1);
|
||||
|
||||
return gtk_css_dimension_value_new (value1->dimension.value + value2->dimension.value,
|
||||
value1->dimension.unit);
|
||||
|
||||
@@ -94,7 +94,7 @@ gtk_css_value_palette_free (GtkCssValue *value)
|
||||
for (i = 0; i < value->n_colors; i ++)
|
||||
{
|
||||
g_free (value->color_names[i]);
|
||||
gtk_css_value_unref (value->color_values[i]);
|
||||
_gtk_css_value_unref (value->color_values[i]);
|
||||
}
|
||||
|
||||
g_free (value->color_names);
|
||||
@@ -103,9 +103,12 @@ gtk_css_value_palette_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_palette_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_palette_compute (GtkCssValue *specified,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *computed_color;
|
||||
GtkCssValue *result;
|
||||
@@ -118,7 +121,7 @@ gtk_css_value_palette_compute (GtkCssValue *specified,
|
||||
{
|
||||
GtkCssValue *value = specified->color_values[i];
|
||||
|
||||
computed_color = gtk_css_value_compute (value, property_id, context);
|
||||
computed_color = _gtk_css_value_compute (value, property_id, provider, style, parent_style, variables);
|
||||
result->color_names[i] = g_strdup (specified->color_names[i]);
|
||||
result->color_values[i] = computed_color;
|
||||
|
||||
@@ -127,8 +130,8 @@ gtk_css_value_palette_compute (GtkCssValue *specified,
|
||||
|
||||
if (!changes)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
result = gtk_css_value_ref (specified);
|
||||
_gtk_css_value_unref (result);
|
||||
result = _gtk_css_value_ref (specified);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -148,7 +151,7 @@ gtk_css_value_palette_equal (const GtkCssValue *value1,
|
||||
if (strcmp (value1->color_names[i], value2->color_names[i]) != 0)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_css_value_equal (value1->color_values[i], value2->color_values[i]))
|
||||
if (!_gtk_css_value_equal (value1->color_values[i], value2->color_values[i]))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -184,9 +187,9 @@ gtk_css_value_palette_transition (GtkCssValue *start,
|
||||
end_color = gtk_css_palette_value_find_color (end, name);
|
||||
|
||||
if (end_color == NULL)
|
||||
transition = gtk_css_value_ref (start_color);
|
||||
transition = _gtk_css_value_ref (start_color);
|
||||
else
|
||||
transition = gtk_css_value_transition (start_color, end_color, property_id, progress);
|
||||
transition = _gtk_css_value_transition (start_color, end_color, property_id, progress);
|
||||
|
||||
g_ptr_array_add (new_names, g_strdup (name));
|
||||
g_ptr_array_add (new_values, transition);
|
||||
@@ -202,7 +205,7 @@ gtk_css_value_palette_transition (GtkCssValue *start,
|
||||
continue;
|
||||
|
||||
g_ptr_array_add (new_names, g_strdup (name));
|
||||
g_ptr_array_add (new_values, gtk_css_value_ref (end_color));
|
||||
g_ptr_array_add (new_values, _gtk_css_value_ref (end_color));
|
||||
}
|
||||
|
||||
result->n_colors = new_names->len;
|
||||
@@ -235,7 +238,7 @@ gtk_css_value_palette_print (const GtkCssValue *value,
|
||||
|
||||
g_string_append (string, value->color_names[i]);
|
||||
g_string_append_c (string, ' ');
|
||||
gtk_css_value_print (value->color_values[i], string);
|
||||
_gtk_css_value_print (value->color_values[i], string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +258,7 @@ gtk_css_palette_value_new_empty (void)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_PALETTE);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_PALETTE);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -265,7 +268,7 @@ gtk_css_palette_value_new_sized (guint size)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_PALETTE);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_PALETTE);
|
||||
result->n_colors = size;
|
||||
result->color_names = g_malloc (sizeof (char *) * size);
|
||||
result->color_values = g_malloc (sizeof (GtkCssValue *) * size);
|
||||
@@ -288,7 +291,7 @@ gtk_css_palette_value_new_default (void)
|
||||
/* Above is already sorted */
|
||||
}
|
||||
|
||||
return gtk_css_value_ref (default_palette);
|
||||
return _gtk_css_value_ref (default_palette);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
@@ -310,7 +313,7 @@ gtk_css_palette_value_parse (GtkCssParser *parser)
|
||||
ident = gtk_css_parser_consume_ident (parser);
|
||||
if (ident == NULL)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -318,7 +321,7 @@ gtk_css_palette_value_parse (GtkCssParser *parser)
|
||||
if (color == NULL)
|
||||
{
|
||||
g_free (ident);
|
||||
gtk_css_value_unref (result);
|
||||
_gtk_css_value_unref (result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,25 +30,28 @@ struct _GtkCssValue {
|
||||
static void
|
||||
gtk_css_value_position_free (GtkCssValue *value)
|
||||
{
|
||||
gtk_css_value_unref (value->x);
|
||||
gtk_css_value_unref (value->y);
|
||||
_gtk_css_value_unref (value->x);
|
||||
_gtk_css_value_unref (value->y);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_position_compute (GtkCssValue *position,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_position_compute (GtkCssValue *position,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
x = gtk_css_value_compute (position->x, property_id, context);
|
||||
y = gtk_css_value_compute (position->y, property_id, context);
|
||||
x = _gtk_css_value_compute (position->x, property_id, provider, style, parent_style, variables);
|
||||
y = _gtk_css_value_compute (position->y, property_id, provider, style, parent_style, variables);
|
||||
if (x == position->x && y == position->y)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
gtk_css_value_unref (y);
|
||||
return gtk_css_value_ref (position);
|
||||
_gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (y);
|
||||
return _gtk_css_value_ref (position);
|
||||
}
|
||||
|
||||
return _gtk_css_position_value_new (x, y);
|
||||
@@ -58,8 +61,8 @@ static gboolean
|
||||
gtk_css_value_position_equal (const GtkCssValue *position1,
|
||||
const GtkCssValue *position2)
|
||||
{
|
||||
return gtk_css_value_equal (position1->x, position2->x)
|
||||
&& gtk_css_value_equal (position1->y, position2->y);
|
||||
return _gtk_css_value_equal (position1->x, position2->x)
|
||||
&& _gtk_css_value_equal (position1->y, position2->y);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
@@ -70,13 +73,13 @@ gtk_css_value_position_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
|
||||
x = gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
|
||||
if (x == NULL)
|
||||
return NULL;
|
||||
y = gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -98,9 +101,9 @@ gtk_css_value_position_print (const GtkCssValue *position,
|
||||
GtkCssValue *center = _gtk_css_number_value_new (50, GTK_CSS_PERCENT);
|
||||
guint i;
|
||||
|
||||
if (gtk_css_value_equal (position->x, center))
|
||||
if (_gtk_css_value_equal (position->x, center))
|
||||
{
|
||||
if (gtk_css_value_equal (position->y, center))
|
||||
if (_gtk_css_value_equal (position->y, center))
|
||||
{
|
||||
g_string_append (string, "center");
|
||||
goto done;
|
||||
@@ -110,16 +113,16 @@ gtk_css_value_position_print (const GtkCssValue *position,
|
||||
{
|
||||
for (i = 0; i < G_N_ELEMENTS (values); i++)
|
||||
{
|
||||
if (gtk_css_value_equal (position->x, values[i].number))
|
||||
if (_gtk_css_value_equal (position->x, values[i].number))
|
||||
{
|
||||
g_string_append (string, values[i].x_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == G_N_ELEMENTS (values))
|
||||
gtk_css_value_print (position->x, string);
|
||||
_gtk_css_value_print (position->x, string);
|
||||
|
||||
if (gtk_css_value_equal (position->y, center))
|
||||
if (_gtk_css_value_equal (position->y, center))
|
||||
goto done;
|
||||
|
||||
g_string_append_c (string, ' ');
|
||||
@@ -127,7 +130,7 @@ gtk_css_value_position_print (const GtkCssValue *position,
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (values); i++)
|
||||
{
|
||||
if (gtk_css_value_equal (position->y, values[i].number))
|
||||
if (_gtk_css_value_equal (position->y, values[i].number))
|
||||
{
|
||||
g_string_append (string, values[i].y_name);
|
||||
goto done;
|
||||
@@ -135,15 +138,15 @@ gtk_css_value_position_print (const GtkCssValue *position,
|
||||
}
|
||||
if (i == G_N_ELEMENTS (values))
|
||||
{
|
||||
if (gtk_css_value_equal (position->x, center))
|
||||
if (_gtk_css_value_equal (position->x, center))
|
||||
g_string_append (string, "center ");
|
||||
gtk_css_value_print (position->y, string);
|
||||
_gtk_css_value_print (position->y, string);
|
||||
}
|
||||
|
||||
done:
|
||||
for (i = 0; i < G_N_ELEMENTS (values); i++)
|
||||
gtk_css_value_unref (values[i].number);
|
||||
gtk_css_value_unref (center);
|
||||
_gtk_css_value_unref (values[i].number);
|
||||
_gtk_css_value_unref (center);
|
||||
}
|
||||
|
||||
static const GtkCssValueClass GTK_CSS_VALUE_POSITION = {
|
||||
@@ -163,7 +166,7 @@ _gtk_css_position_value_new (GtkCssValue *x,
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_POSITION);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_POSITION);
|
||||
result->x = x;
|
||||
result->y = y;
|
||||
result->is_computed = gtk_css_value_is_computed (x) &&
|
||||
@@ -263,7 +266,7 @@ position_value_parse (GtkCssParser *parser, gboolean try)
|
||||
{
|
||||
if (!try)
|
||||
gtk_css_parser_error_syntax (parser, "Invalid combination of values");
|
||||
gtk_css_value_unref (y);
|
||||
_gtk_css_value_unref (y);
|
||||
return NULL;
|
||||
}
|
||||
y = _gtk_css_number_value_parse (parser,
|
||||
@@ -271,7 +274,7 @@ position_value_parse (GtkCssParser *parser, gboolean try)
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -313,13 +316,13 @@ gtk_css_position_value_parse_spacing (GtkCssParser *parser)
|
||||
y = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_LENGTH | GTK_CSS_POSITIVE_ONLY);
|
||||
if (y == NULL)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
_gtk_css_value_unref (x);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
y = gtk_css_value_ref (x);
|
||||
y = _gtk_css_value_ref (x);
|
||||
}
|
||||
|
||||
return _gtk_css_position_value_new (x, y);
|
||||
|
||||
@@ -269,7 +269,7 @@ gtk_css_ruleset_clear (GtkCssRuleset *ruleset)
|
||||
|
||||
for (i = 0; i < ruleset->n_styles; i++)
|
||||
{
|
||||
gtk_css_value_unref (ruleset->styles[i].value);
|
||||
_gtk_css_value_unref (ruleset->styles[i].value);
|
||||
ruleset->styles[i].value = NULL;
|
||||
if (ruleset->styles[i].section)
|
||||
gtk_css_section_unref (ruleset->styles[i].section);
|
||||
@@ -300,7 +300,7 @@ gtk_css_ruleset_add (GtkCssRuleset *ruleset,
|
||||
{
|
||||
if (ruleset->styles[i].property == property)
|
||||
{
|
||||
gtk_css_value_unref (ruleset->styles[i].value);
|
||||
_gtk_css_value_unref (ruleset->styles[i].value);
|
||||
ruleset->styles[i].value = NULL;
|
||||
if (ruleset->styles[i].section)
|
||||
gtk_css_section_unref (ruleset->styles[i].section);
|
||||
@@ -440,7 +440,7 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
|
||||
|
||||
priv->symbolic_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) gtk_css_value_unref);
|
||||
(GDestroyNotify) _gtk_css_value_unref);
|
||||
priv->keyframes = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) _gtk_css_keyframes_unref);
|
||||
@@ -778,7 +778,7 @@ parse_color_definition (GtkCssScanner *scanner)
|
||||
if (!gtk_css_parser_has_token (scanner->parser, GTK_CSS_TOKEN_EOF))
|
||||
{
|
||||
g_free (name);
|
||||
gtk_css_value_unref (color);
|
||||
_gtk_css_value_unref (color);
|
||||
gtk_css_parser_error_syntax (scanner->parser,
|
||||
"Missing semicolon at end of color definition");
|
||||
return TRUE;
|
||||
@@ -1030,10 +1030,10 @@ parse_declaration (GtkCssScanner *scanner,
|
||||
GtkCssStyleProperty *child = _gtk_css_shorthand_property_get_subproperty (shorthand, i);
|
||||
GtkCssValue *sub = _gtk_css_array_value_get_nth (value, i);
|
||||
|
||||
gtk_css_ruleset_add (ruleset, child, gtk_css_value_ref (sub), section);
|
||||
gtk_css_ruleset_add (ruleset, child, _gtk_css_value_ref (sub), section);
|
||||
}
|
||||
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
}
|
||||
else if (GTK_IS_CSS_STYLE_PROPERTY (property))
|
||||
{
|
||||
@@ -1043,7 +1043,7 @@ parse_declaration (GtkCssScanner *scanner,
|
||||
else
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
}
|
||||
|
||||
g_clear_pointer (§ion, gtk_css_section_unref);
|
||||
@@ -1689,7 +1689,7 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
|
||||
g_string_append (str, " ");
|
||||
g_string_append (str, _gtk_style_property_get_name (GTK_STYLE_PROPERTY (prop->property)));
|
||||
g_string_append (str, ": ");
|
||||
gtk_css_value_print (prop->value, str);
|
||||
_gtk_css_value_print (prop->value, str);
|
||||
g_string_append (str, ";\n");
|
||||
}
|
||||
|
||||
@@ -1742,7 +1742,7 @@ gtk_css_provider_print_colors (GHashTable *colors,
|
||||
g_string_append (str, "@define-color ");
|
||||
g_string_append (str, name);
|
||||
g_string_append (str, " ");
|
||||
gtk_css_value_print (color, str);
|
||||
_gtk_css_value_print (color, str);
|
||||
g_string_append (str, ";\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -245,27 +245,19 @@ parser_error (GtkCssParser *parser,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_reference_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_reference_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *result = NULL, *computed;
|
||||
GtkCssRefs refs;
|
||||
guint shorthand_id = G_MAXUINT;
|
||||
|
||||
if (GTK_IS_CSS_SHORTHAND_PROPERTY (value->property))
|
||||
{
|
||||
shorthand_id = _gtk_css_shorthand_property_get_id (GTK_CSS_SHORTHAND_PROPERTY (value->property));
|
||||
if (context->shorthands && context->shorthands[shorthand_id])
|
||||
{
|
||||
result = gtk_css_value_ref (context->shorthands[shorthand_id]);
|
||||
goto pick_subproperty;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_css_refs_init (&refs);
|
||||
|
||||
resolve_references (value->value, property_id, context->style, context->variables, &refs);
|
||||
resolve_references (value->value, property_id, style, variables, &refs);
|
||||
|
||||
if (gtk_css_refs_get_size (&refs) > 0)
|
||||
{
|
||||
@@ -276,8 +268,7 @@ gtk_css_value_reference_compute (GtkCssValue *value,
|
||||
value->file,
|
||||
(GtkCssVariableValue **) refs.start,
|
||||
gtk_css_refs_get_size (&refs),
|
||||
parser_error, context->provider,
|
||||
NULL);
|
||||
parser_error, provider, NULL);
|
||||
|
||||
result = _gtk_style_property_parse_value (value->property, value_parser);
|
||||
token = gtk_css_parser_peek_token (value_parser);
|
||||
@@ -301,23 +292,19 @@ gtk_css_value_reference_compute (GtkCssValue *value,
|
||||
if (result == NULL)
|
||||
result = _gtk_css_unset_value_new ();
|
||||
|
||||
if (shorthand_id != G_MAXUINT)
|
||||
if (GTK_IS_CSS_SHORTHAND_PROPERTY (value->property))
|
||||
{
|
||||
GtkCssValue *sub;
|
||||
|
||||
if (context->shorthands)
|
||||
{
|
||||
g_assert (context->shorthands[shorthand_id] == NULL);
|
||||
context->shorthands[shorthand_id] = gtk_css_value_ref (result);
|
||||
}
|
||||
|
||||
pick_subproperty:
|
||||
sub = gtk_css_value_ref (_gtk_css_array_value_get_nth (result, value->subproperty));
|
||||
GtkCssValue *sub = gtk_css_value_ref (_gtk_css_array_value_get_nth (result, value->subproperty));
|
||||
gtk_css_value_unref (result);
|
||||
result = sub;
|
||||
}
|
||||
|
||||
computed = gtk_css_value_compute (result, property_id, context);
|
||||
computed = _gtk_css_value_compute (result,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
computed->is_computed = TRUE;
|
||||
|
||||
gtk_css_value_unref (result);
|
||||
@@ -366,7 +353,7 @@ _gtk_css_reference_value_new (GtkStyleProperty *property,
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_REFERENCE);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_REFERENCE);
|
||||
result->property = property;
|
||||
result->value = gtk_css_variable_value_ref (value);
|
||||
result->contains_variables = TRUE;
|
||||
|
||||
@@ -34,11 +34,14 @@ gtk_css_value_repeat_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_repeat_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_repeat_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -167,7 +170,7 @@ GtkCssValue *
|
||||
_gtk_css_background_repeat_value_new (GtkCssRepeatStyle x,
|
||||
GtkCssRepeatStyle y)
|
||||
{
|
||||
return gtk_css_value_ref (&background_repeat_values[x].values[y]);
|
||||
return _gtk_css_value_ref (&background_repeat_values[x].values[y]);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -261,7 +264,7 @@ GtkCssValue *
|
||||
_gtk_css_border_repeat_value_new (GtkCssRepeatStyle x,
|
||||
GtkCssRepeatStyle y)
|
||||
{
|
||||
return gtk_css_value_ref (&border_repeat_values[x].values[y]);
|
||||
return _gtk_css_value_ref (&border_repeat_values[x].values[y]);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -69,11 +69,11 @@ shadow_value_for_transition (ShadowValue *result,
|
||||
static void
|
||||
shadow_value_unref (const ShadowValue *shadow)
|
||||
{
|
||||
gtk_css_value_unref (shadow->hoffset);
|
||||
gtk_css_value_unref (shadow->voffset);
|
||||
gtk_css_value_unref (shadow->spread);
|
||||
gtk_css_value_unref (shadow->radius);
|
||||
gtk_css_value_unref (shadow->color);
|
||||
_gtk_css_value_unref (shadow->hoffset);
|
||||
_gtk_css_value_unref (shadow->voffset);
|
||||
_gtk_css_value_unref (shadow->spread);
|
||||
_gtk_css_value_unref (shadow->radius);
|
||||
_gtk_css_value_unref (shadow->color);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -88,11 +88,11 @@ shadow_value_transition (const ShadowValue *start,
|
||||
return FALSE;
|
||||
|
||||
result->inset = start->inset;
|
||||
result->hoffset = gtk_css_value_transition (start->hoffset, end->hoffset, property_id, progress);
|
||||
result->voffset = gtk_css_value_transition (start->voffset, end->voffset, property_id, progress);
|
||||
result->radius = gtk_css_value_transition (start->radius, end->radius, property_id, progress);
|
||||
result->spread = gtk_css_value_transition (start->spread, end->spread, property_id, progress);
|
||||
result->color = gtk_css_value_transition (start->color, end->color, property_id, progress);
|
||||
result->hoffset = _gtk_css_value_transition (start->hoffset, end->hoffset, property_id, progress);
|
||||
result->voffset = _gtk_css_value_transition (start->voffset, end->voffset, property_id, progress);
|
||||
result->radius = _gtk_css_value_transition (start->radius, end->radius, property_id, progress);
|
||||
result->spread = _gtk_css_value_transition (start->spread, end->spread, property_id, progress);
|
||||
result->color = _gtk_css_value_transition (start->color, end->color, property_id, progress);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -113,9 +113,12 @@ gtk_css_value_shadow_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_shadow_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_shadow_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
guint i;
|
||||
ShadowValue *shadows;
|
||||
@@ -126,11 +129,11 @@ gtk_css_value_shadow_compute (GtkCssValue *value,
|
||||
{
|
||||
const ShadowValue *shadow = &value->shadows[i];
|
||||
|
||||
shadows[i].hoffset = gtk_css_value_compute (shadow->hoffset, property_id, context);
|
||||
shadows[i].voffset = gtk_css_value_compute (shadow->voffset, property_id, context);
|
||||
shadows[i].radius = gtk_css_value_compute (shadow->radius, property_id, context);
|
||||
shadows[i].spread = gtk_css_value_compute (shadow->spread, property_id, context),
|
||||
shadows[i].color = gtk_css_value_compute (shadow->color, property_id, context);
|
||||
shadows[i].hoffset = _gtk_css_value_compute (shadow->hoffset, property_id, provider, style, parent_style, variables);
|
||||
shadows[i].voffset = _gtk_css_value_compute (shadow->voffset, property_id, provider, style, parent_style, variables);
|
||||
shadows[i].radius = _gtk_css_value_compute (shadow->radius, property_id, provider, style, parent_style, variables);
|
||||
shadows[i].spread = _gtk_css_value_compute (shadow->spread, property_id, provider, style, parent_style, variables),
|
||||
shadows[i].color = _gtk_css_value_compute (shadow->color, property_id, provider, style, parent_style, variables);
|
||||
shadows[i].inset = shadow->inset;
|
||||
}
|
||||
|
||||
@@ -152,11 +155,11 @@ gtk_css_value_shadow_equal (const GtkCssValue *value1,
|
||||
const ShadowValue *shadow2 = &value2->shadows[i];
|
||||
|
||||
if (shadow1->inset != shadow2->inset ||
|
||||
!gtk_css_value_equal (shadow1->hoffset, shadow2->hoffset) ||
|
||||
!gtk_css_value_equal (shadow1->voffset, shadow2->voffset) ||
|
||||
!gtk_css_value_equal (shadow1->radius, shadow2->radius) ||
|
||||
!gtk_css_value_equal (shadow1->spread, shadow2->spread) ||
|
||||
!gtk_css_value_equal (shadow1->color, shadow2->color))
|
||||
!_gtk_css_value_equal (shadow1->hoffset, shadow2->hoffset) ||
|
||||
!_gtk_css_value_equal (shadow1->voffset, shadow2->voffset) ||
|
||||
!_gtk_css_value_equal (shadow1->radius, shadow2->radius) ||
|
||||
!_gtk_css_value_equal (shadow1->spread, shadow2->spread) ||
|
||||
!_gtk_css_value_equal (shadow1->color, shadow2->color))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -250,24 +253,24 @@ gtk_css_value_shadow_print (const GtkCssValue *value,
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
|
||||
gtk_css_value_print (shadow->hoffset, string);
|
||||
_gtk_css_value_print (shadow->hoffset, string);
|
||||
g_string_append_c (string, ' ');
|
||||
gtk_css_value_print (shadow->voffset, string);
|
||||
_gtk_css_value_print (shadow->voffset, string);
|
||||
g_string_append_c (string, ' ');
|
||||
if (_gtk_css_number_value_get (shadow->radius, 100) != 0 ||
|
||||
_gtk_css_number_value_get (shadow->spread, 100) != 0)
|
||||
{
|
||||
gtk_css_value_print (shadow->radius, string);
|
||||
_gtk_css_value_print (shadow->radius, string);
|
||||
g_string_append_c (string, ' ');
|
||||
}
|
||||
|
||||
if (_gtk_css_number_value_get (shadow->spread, 100) != 0)
|
||||
{
|
||||
gtk_css_value_print (shadow->spread, string);
|
||||
_gtk_css_value_print (shadow->spread, string);
|
||||
g_string_append_c (string, ' ');
|
||||
}
|
||||
|
||||
gtk_css_value_print (shadow->color, string);
|
||||
_gtk_css_value_print (shadow->color, string);
|
||||
|
||||
if (shadow->inset)
|
||||
g_string_append (string, " inset");
|
||||
@@ -290,7 +293,7 @@ static GtkCssValue shadow_none_singleton = { >K_CSS_VALUE_SHADOW, 1, TRUE, FAL
|
||||
GtkCssValue *
|
||||
gtk_css_shadow_value_new_none (void)
|
||||
{
|
||||
return gtk_css_value_ref (&shadow_none_singleton);
|
||||
return _gtk_css_value_ref (&shadow_none_singleton);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
@@ -304,7 +307,7 @@ gtk_css_shadow_value_new (ShadowValue *shadows,
|
||||
if (n_shadows == 0)
|
||||
return gtk_css_shadow_value_new_none ();
|
||||
|
||||
retval = gtk_css_value_alloc (>K_CSS_VALUE_SHADOW, sizeof (GtkCssValue) + sizeof (ShadowValue) * (n_shadows - 1));
|
||||
retval = _gtk_css_value_alloc (>K_CSS_VALUE_SHADOW, sizeof (GtkCssValue) + sizeof (ShadowValue) * (n_shadows - 1));
|
||||
retval->n_shadows = n_shadows;
|
||||
retval->is_filter = is_filter;
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
|
||||
for (i = 0; i < n_props; i++)
|
||||
{
|
||||
if (data[i] != NULL)
|
||||
gtk_css_value_unref (data[i]);
|
||||
_gtk_css_value_unref (data[i]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -160,14 +160,7 @@ guint
|
||||
_gtk_css_shorthand_property_get_n_subproperties (GtkCssShorthandProperty *shorthand)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CSS_SHORTHAND_PROPERTY (shorthand), 0);
|
||||
|
||||
|
||||
return shorthand->subproperties->len;
|
||||
}
|
||||
|
||||
guint
|
||||
_gtk_css_shorthand_property_get_id (GtkCssShorthandProperty *shorthand)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CSS_SHORTHAND_PROPERTY (shorthand), 0);
|
||||
|
||||
return shorthand->id;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ parse_four_numbers (GtkCssShorthandProperty *shorthand,
|
||||
|
||||
for (; i < 4; i++)
|
||||
{
|
||||
values[i] = gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -148,7 +148,7 @@ parse_border_radius (GtkCssShorthandProperty *shorthand,
|
||||
* according to spec. Feel free to check the 4 cases
|
||||
*/
|
||||
for (; i < 4; i++)
|
||||
x[i] = gtk_css_value_ref (x[(i - 1) >> 1]);
|
||||
x[i] = _gtk_css_value_ref (x[(i - 1) >> 1]);
|
||||
|
||||
if (gtk_css_parser_try_delim (parser, '/'))
|
||||
{
|
||||
@@ -171,12 +171,12 @@ parse_border_radius (GtkCssShorthandProperty *shorthand,
|
||||
}
|
||||
|
||||
for (; i < 4; i++)
|
||||
y[i] = gtk_css_value_ref (y[(i - 1) >> 1]);
|
||||
y[i] = _gtk_css_value_ref (y[(i - 1) >> 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
y[i] = gtk_css_value_ref (x[i]);
|
||||
y[i] = _gtk_css_value_ref (x[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -190,9 +190,9 @@ fail:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (x[i])
|
||||
gtk_css_value_unref (x[i]);
|
||||
_gtk_css_value_unref (x[i]);
|
||||
if (y[i])
|
||||
gtk_css_value_unref (y[i]);
|
||||
_gtk_css_value_unref (y[i]);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ parse_border_color (GtkCssShorthandProperty *shorthand,
|
||||
|
||||
for (i++; i < 4; i++)
|
||||
{
|
||||
values[i] = gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -243,7 +243,7 @@ parse_border_style (GtkCssShorthandProperty *shorthand,
|
||||
}
|
||||
|
||||
for (; i < 4; i++)
|
||||
values[i] = gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -371,16 +371,16 @@ parse_border (GtkCssShorthandProperty *shorthand,
|
||||
| GTK_CSS_PARSE_LENGTH);
|
||||
if (values[0] == NULL)
|
||||
return FALSE;
|
||||
values[1] = gtk_css_value_ref (values[0]);
|
||||
values[2] = gtk_css_value_ref (values[0]);
|
||||
values[3] = gtk_css_value_ref (values[0]);
|
||||
values[1] = _gtk_css_value_ref (values[0]);
|
||||
values[2] = _gtk_css_value_ref (values[0]);
|
||||
values[3] = _gtk_css_value_ref (values[0]);
|
||||
}
|
||||
else if (values[4] == NULL &&
|
||||
(values[4] = _gtk_css_border_style_value_try_parse (parser)))
|
||||
{
|
||||
values[5] = gtk_css_value_ref (values[4]);
|
||||
values[6] = gtk_css_value_ref (values[4]);
|
||||
values[7] = gtk_css_value_ref (values[4]);
|
||||
values[5] = _gtk_css_value_ref (values[4]);
|
||||
values[6] = _gtk_css_value_ref (values[4]);
|
||||
values[7] = _gtk_css_value_ref (values[4]);
|
||||
}
|
||||
else if (values[8] == NULL)
|
||||
{
|
||||
@@ -388,9 +388,9 @@ parse_border (GtkCssShorthandProperty *shorthand,
|
||||
if (values[8] == NULL)
|
||||
return FALSE;
|
||||
|
||||
values[9] = gtk_css_value_ref (values[8]);
|
||||
values[10] = gtk_css_value_ref (values[8]);
|
||||
values[11] = gtk_css_value_ref (values[8]);
|
||||
values[9] = _gtk_css_value_ref (values[8]);
|
||||
values[10] = _gtk_css_value_ref (values[8]);
|
||||
values[11] = _gtk_css_value_ref (values[8]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -557,7 +557,7 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
value = _gtk_css_color_value_parse (parser);
|
||||
if (value == NULL)
|
||||
values[6] = gtk_css_value_ref (_gtk_css_style_property_get_initial_value
|
||||
values[6] = _gtk_css_value_ref (_gtk_css_style_property_get_initial_value
|
||||
(_gtk_css_shorthand_property_get_subproperty (shorthand, 6)));
|
||||
else
|
||||
values[6] = value;
|
||||
@@ -576,7 +576,7 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
|
||||
while (!value_is_done_parsing (parser));
|
||||
|
||||
if (values[5] != NULL && values[4] == NULL)
|
||||
values[4] = gtk_css_value_ref (values[5]);
|
||||
values[4] = _gtk_css_value_ref (values[5]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -603,7 +603,7 @@ parse_background (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) gtk_css_value_unref);
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
}
|
||||
return FALSE;
|
||||
@@ -615,7 +615,7 @@ parse_background (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
GtkCssValue *initial = _gtk_css_style_property_get_initial_value (
|
||||
_gtk_css_shorthand_property_get_subproperty (shorthand, i));
|
||||
step_values[i] = gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
step_values[i] = _gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
}
|
||||
|
||||
g_ptr_array_add (arrays[i], step_values[i]);
|
||||
@@ -714,7 +714,7 @@ parse_transition (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) gtk_css_value_unref);
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
}
|
||||
return FALSE;
|
||||
@@ -726,7 +726,7 @@ parse_transition (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
GtkCssValue *initial = _gtk_css_style_property_get_initial_value (
|
||||
_gtk_css_shorthand_property_get_subproperty (shorthand, i));
|
||||
step_values[i] = gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
step_values[i] = _gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
}
|
||||
|
||||
g_ptr_array_add (arrays[i], step_values[i]);
|
||||
@@ -831,7 +831,7 @@ parse_animation (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) gtk_css_value_unref);
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
}
|
||||
return FALSE;
|
||||
@@ -843,7 +843,7 @@ parse_animation (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
GtkCssValue *initial = _gtk_css_style_property_get_initial_value (
|
||||
_gtk_css_shorthand_property_get_subproperty (shorthand, i));
|
||||
step_values[i] = gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
step_values[i] = _gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
|
||||
}
|
||||
|
||||
g_ptr_array_add (arrays[i], step_values[i]);
|
||||
@@ -1093,7 +1093,6 @@ parse_all (GtkCssShorthandProperty *shorthand,
|
||||
|
||||
static void
|
||||
gtk_css_shorthand_property_register (const char *name,
|
||||
unsigned int id,
|
||||
const char **subproperties,
|
||||
GtkCssShorthandPropertyParseFunc parse_func)
|
||||
{
|
||||
@@ -1104,8 +1103,6 @@ gtk_css_shorthand_property_register (const char *name,
|
||||
"subproperties", subproperties,
|
||||
NULL);
|
||||
|
||||
node->id = id;
|
||||
|
||||
node->parse = parse_func;
|
||||
}
|
||||
|
||||
@@ -1161,85 +1158,65 @@ _gtk_css_shorthand_property_init_properties (void)
|
||||
const char **all_subproperties;
|
||||
|
||||
gtk_css_shorthand_property_register ("font",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_FONT,
|
||||
font_subproperties,
|
||||
parse_font);
|
||||
gtk_css_shorthand_property_register ("margin",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_MARGIN,
|
||||
margin_subproperties,
|
||||
parse_margin);
|
||||
gtk_css_shorthand_property_register ("padding",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_PADDING,
|
||||
padding_subproperties,
|
||||
parse_padding);
|
||||
gtk_css_shorthand_property_register ("border-width",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_WIDTH,
|
||||
border_width_subproperties,
|
||||
parse_border_width);
|
||||
gtk_css_shorthand_property_register ("border-radius",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_RADIUS,
|
||||
border_radius_subproperties,
|
||||
parse_border_radius);
|
||||
gtk_css_shorthand_property_register ("border-color",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_COLOR,
|
||||
border_color_subproperties,
|
||||
parse_border_color);
|
||||
gtk_css_shorthand_property_register ("border-style",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_STYLE,
|
||||
border_style_subproperties,
|
||||
parse_border_style);
|
||||
gtk_css_shorthand_property_register ("border-image",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_IMAGE,
|
||||
border_image_subproperties,
|
||||
parse_border_image);
|
||||
gtk_css_shorthand_property_register ("border-top",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_TOP,
|
||||
border_top_subproperties,
|
||||
parse_border_side);
|
||||
gtk_css_shorthand_property_register ("border-right",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_RIGHT,
|
||||
border_right_subproperties,
|
||||
parse_border_side);
|
||||
gtk_css_shorthand_property_register ("border-bottom",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_BOTTOM,
|
||||
border_bottom_subproperties,
|
||||
parse_border_side);
|
||||
gtk_css_shorthand_property_register ("border-left",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_LEFT,
|
||||
border_left_subproperties,
|
||||
parse_border_side);
|
||||
gtk_css_shorthand_property_register ("border",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER,
|
||||
border_subproperties,
|
||||
parse_border);
|
||||
gtk_css_shorthand_property_register ("outline",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_OUTLINE,
|
||||
outline_subproperties,
|
||||
parse_border_side);
|
||||
gtk_css_shorthand_property_register ("background",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BACKGROUND,
|
||||
background_subproperties,
|
||||
parse_background);
|
||||
gtk_css_shorthand_property_register ("transition",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_TRANSITION,
|
||||
transition_subproperties,
|
||||
parse_transition);
|
||||
gtk_css_shorthand_property_register ("animation",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_ANIMATION,
|
||||
animation_subproperties,
|
||||
parse_animation);
|
||||
gtk_css_shorthand_property_register ("text-decoration",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_TEXT_DECORATION,
|
||||
text_decoration_subproperties,
|
||||
parse_text_decoration);
|
||||
gtk_css_shorthand_property_register ("font-variant",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_FONT_VARIANT,
|
||||
font_variant_subproperties,
|
||||
parse_font_variant);
|
||||
|
||||
all_subproperties = get_all_subproperties ();
|
||||
gtk_css_shorthand_property_register ("all",
|
||||
GTK_CSS_SHORTHAND_PROPERTY_ALL,
|
||||
all_subproperties,
|
||||
parse_all);
|
||||
g_free (all_subproperties);
|
||||
|
||||
@@ -49,8 +49,6 @@ struct _GtkCssShorthandProperty
|
||||
|
||||
GPtrArray *subproperties;
|
||||
|
||||
guint id;
|
||||
|
||||
GtkCssShorthandPropertyParseFunc parse;
|
||||
};
|
||||
|
||||
@@ -67,8 +65,6 @@ GtkCssStyleProperty * _gtk_css_shorthand_property_get_subproperty (GtkCssS
|
||||
guint property);
|
||||
guint _gtk_css_shorthand_property_get_n_subproperties (GtkCssShorthandProperty *shorthand) G_GNUC_CONST;
|
||||
|
||||
guint _gtk_css_shorthand_property_get_id (GtkCssShorthandProperty *shorthand) G_GNUC_CONST;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -39,11 +39,12 @@
|
||||
#include "gtkstyleproviderprivate.h"
|
||||
#include "gtkcssdimensionvalueprivate.h"
|
||||
|
||||
static void gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
guint id,
|
||||
GtkCssValue *specified,
|
||||
GtkCssSection *section,
|
||||
GtkCssComputeContext *context);
|
||||
static void gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *parent_style,
|
||||
guint id,
|
||||
GtkCssValue *specified,
|
||||
GtkCssSection *section);
|
||||
|
||||
#define GET_VALUES(v) (GtkCssValue **)((guint8*)(v) + sizeof (GtkCssValues))
|
||||
|
||||
@@ -61,7 +62,7 @@ gtk_css_## NAME ## _values_compute_changes_and_affects (GtkCssStyle *style1, \
|
||||
{ \
|
||||
GtkCssValue *v1 = g1[i] ? g1[i] : style1->core->color; \
|
||||
GtkCssValue *v2 = g2[i] ? g2[i] : style2->core->color; \
|
||||
if (!gtk_css_value_equal (v1, v2)) \
|
||||
if (!_gtk_css_value_equal (v1, v2)) \
|
||||
{ \
|
||||
guint id = NAME ## _props[i]; \
|
||||
*changes = _gtk_bitmask_set (*changes, id, TRUE); \
|
||||
@@ -71,9 +72,10 @@ gtk_css_## NAME ## _values_compute_changes_and_affects (GtkCssStyle *style1, \
|
||||
} \
|
||||
\
|
||||
static inline void \
|
||||
gtk_css_ ## NAME ## _values_new_compute (GtkCssStaticStyle *sstyle, \
|
||||
GtkCssLookup *lookup, \
|
||||
GtkCssComputeContext *context) \
|
||||
gtk_css_ ## NAME ## _values_new_compute (GtkCssStaticStyle *sstyle, \
|
||||
GtkStyleProvider *provider, \
|
||||
GtkCssStyle *parent_style, \
|
||||
GtkCssLookup *lookup) \
|
||||
{ \
|
||||
GtkCssStyle *style = (GtkCssStyle *)sstyle; \
|
||||
int i; \
|
||||
@@ -84,10 +86,11 @@ gtk_css_ ## NAME ## _values_new_compute (GtkCssStaticStyle *sstyle, \
|
||||
{ \
|
||||
guint id = NAME ## _props[i]; \
|
||||
gtk_css_static_style_compute_value (sstyle, \
|
||||
provider, \
|
||||
parent_style, \
|
||||
id, \
|
||||
lookup->values[id].value, \
|
||||
lookup->values[id].section, \
|
||||
context); \
|
||||
lookup->values[id].section); \
|
||||
} \
|
||||
} \
|
||||
static GtkBitmask * gtk_css_ ## NAME ## _values_mask; \
|
||||
@@ -267,7 +270,7 @@ static void
|
||||
maybe_unref_value (gpointer value)
|
||||
{
|
||||
if (value)
|
||||
gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (value);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -590,7 +593,7 @@ gtk_css_static_style_set_value (GtkCssStaticStyle *sstyle,
|
||||
if (sstyle->original_values && sstyle->original_values->len > id &&
|
||||
g_ptr_array_index (sstyle->original_values, id))
|
||||
{
|
||||
gtk_css_value_unref (g_ptr_array_index (sstyle->original_values, id));
|
||||
_gtk_css_value_unref (g_ptr_array_index (sstyle->original_values, id));
|
||||
g_ptr_array_index (sstyle->original_values, id) = NULL;
|
||||
}
|
||||
|
||||
@@ -600,7 +603,7 @@ gtk_css_static_style_set_value (GtkCssStaticStyle *sstyle,
|
||||
sstyle->original_values = g_ptr_array_new_with_free_func (maybe_unref_value);
|
||||
if (sstyle->original_values->len <= id)
|
||||
g_ptr_array_set_size (sstyle->original_values, id + 1);
|
||||
g_ptr_array_index (sstyle->original_values, id) = gtk_css_value_ref (original_value);
|
||||
g_ptr_array_index (sstyle->original_values, id) = _gtk_css_value_ref (original_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,19 +650,18 @@ static GtkCssValues *
|
||||
gtk_css_background_create_initial_values (void)
|
||||
{
|
||||
GtkCssBackgroundValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssBackgroundValues *)gtk_css_values_new (GTK_CSS_BACKGROUND_INITIAL_VALUES);
|
||||
|
||||
values->background_color = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_COLOR, &context);
|
||||
values->box_shadow = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BOX_SHADOW, &context);
|
||||
values->background_clip = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_CLIP, &context);
|
||||
values->background_origin = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_ORIGIN, &context);
|
||||
values->background_size = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_SIZE, &context);
|
||||
values->background_position = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_POSITION, &context);
|
||||
values->background_repeat = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_REPEAT, &context);
|
||||
values->background_image = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_IMAGE, &context);
|
||||
values->background_blend_mode = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_BLEND_MODE, &context);
|
||||
values->background_color = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_COLOR, NULL, NULL, NULL);
|
||||
values->box_shadow = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BOX_SHADOW, NULL, NULL, NULL);
|
||||
values->background_clip = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_CLIP, NULL, NULL, NULL);
|
||||
values->background_origin = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_ORIGIN, NULL, NULL, NULL);
|
||||
values->background_size = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_SIZE, NULL, NULL, NULL);
|
||||
values->background_position = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_POSITION, NULL, NULL, NULL);
|
||||
values->background_repeat = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_REPEAT, NULL, NULL, NULL);
|
||||
values->background_image = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_IMAGE, NULL, NULL, NULL);
|
||||
values->background_blend_mode = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BACKGROUND_BLEND_MODE, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -668,30 +670,29 @@ static GtkCssValues *
|
||||
gtk_css_border_create_initial_values (void)
|
||||
{
|
||||
GtkCssBorderValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssBorderValues *)gtk_css_values_new (GTK_CSS_BORDER_INITIAL_VALUES);
|
||||
|
||||
values->border_top_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_STYLE, &context);
|
||||
values->border_top_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_WIDTH, &context);
|
||||
values->border_left_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_LEFT_STYLE, &context);
|
||||
values->border_left_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH, &context);
|
||||
values->border_bottom_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE, &context);
|
||||
values->border_bottom_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH, &context);
|
||||
values->border_right_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE, &context);
|
||||
values->border_right_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH, &context);
|
||||
values->border_top_left_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS, &context);
|
||||
values->border_top_right_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS, &context);
|
||||
values->border_bottom_left_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS, &context);
|
||||
values->border_bottom_right_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS, &context);
|
||||
values->border_top_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_STYLE, NULL, NULL, NULL);
|
||||
values->border_top_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_WIDTH, NULL, NULL, NULL);
|
||||
values->border_left_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_LEFT_STYLE, NULL, NULL, NULL);
|
||||
values->border_left_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH, NULL, NULL, NULL);
|
||||
values->border_bottom_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE, NULL, NULL, NULL);
|
||||
values->border_bottom_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH, NULL, NULL, NULL);
|
||||
values->border_right_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE, NULL, NULL, NULL);
|
||||
values->border_right_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH, NULL, NULL, NULL);
|
||||
values->border_top_left_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS, NULL, NULL, NULL);
|
||||
values->border_top_right_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS, NULL, NULL, NULL);
|
||||
values->border_bottom_left_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS, NULL, NULL, NULL);
|
||||
values->border_bottom_right_radius = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS, NULL, NULL, NULL);
|
||||
values->border_top_color = NULL;
|
||||
values->border_right_color = NULL;
|
||||
values->border_bottom_color = NULL;
|
||||
values->border_left_color = NULL;
|
||||
values->border_image_source = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE, &context);
|
||||
values->border_image_repeat = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT, &context);
|
||||
values->border_image_slice = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE, &context);
|
||||
values->border_image_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH, &context);
|
||||
values->border_image_source = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE, NULL, NULL, NULL);
|
||||
values->border_image_repeat = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT, NULL, NULL, NULL);
|
||||
values->border_image_slice = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE, NULL, NULL, NULL);
|
||||
values->border_image_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -700,13 +701,12 @@ static GtkCssValues *
|
||||
gtk_css_outline_create_initial_values (void)
|
||||
{
|
||||
GtkCssOutlineValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssOutlineValues *)gtk_css_values_new (GTK_CSS_OUTLINE_INITIAL_VALUES);
|
||||
|
||||
values->outline_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_STYLE, &context);
|
||||
values->outline_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_WIDTH, &context);
|
||||
values->outline_offset = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_OFFSET, &context);
|
||||
values->outline_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_STYLE, NULL, NULL, NULL);
|
||||
values->outline_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_WIDTH, NULL, NULL, NULL);
|
||||
values->outline_offset = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_OFFSET, NULL, NULL, NULL);
|
||||
values->outline_color = NULL;
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
@@ -728,21 +728,20 @@ static GtkCssValues *
|
||||
gtk_css_font_variant_create_initial_values (void)
|
||||
{
|
||||
GtkCssFontVariantValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssFontVariantValues *)gtk_css_values_new (GTK_CSS_FONT_VARIANT_INITIAL_VALUES);
|
||||
|
||||
values->text_decoration_line = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_DECORATION_LINE, &context);
|
||||
values->text_decoration_line = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_DECORATION_LINE, NULL, NULL, NULL);
|
||||
values->text_decoration_color = NULL;
|
||||
values->text_decoration_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_DECORATION_STYLE, &context);
|
||||
values->text_transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_TRANSFORM, &context);
|
||||
values->font_kerning = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_KERNING, &context);
|
||||
values->font_variant_ligatures = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_LIGATURES, &context);
|
||||
values->font_variant_position = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_POSITION, &context);
|
||||
values->font_variant_caps = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_CAPS, &context);
|
||||
values->font_variant_numeric = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_NUMERIC, &context);
|
||||
values->font_variant_alternates = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_ALTERNATES, &context);
|
||||
values->font_variant_east_asian = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_EAST_ASIAN, &context);
|
||||
values->text_decoration_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_DECORATION_STYLE, NULL, NULL, NULL);
|
||||
values->text_transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TEXT_TRANSFORM, NULL, NULL, NULL);
|
||||
values->font_kerning = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_KERNING, NULL, NULL, NULL);
|
||||
values->font_variant_ligatures = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_LIGATURES, NULL, NULL, NULL);
|
||||
values->font_variant_position = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_POSITION, NULL, NULL, NULL);
|
||||
values->font_variant_caps = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_CAPS, NULL, NULL, NULL);
|
||||
values->font_variant_numeric = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_NUMERIC, NULL, NULL, NULL);
|
||||
values->font_variant_alternates = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_ALTERNATES, NULL, NULL, NULL);
|
||||
values->font_variant_east_asian = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FONT_VARIANT_EAST_ASIAN, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -751,18 +750,17 @@ static GtkCssValues *
|
||||
gtk_css_animation_create_initial_values (void)
|
||||
{
|
||||
GtkCssAnimationValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssAnimationValues *)gtk_css_values_new (GTK_CSS_ANIMATION_INITIAL_VALUES);
|
||||
|
||||
values->animation_name = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_NAME, &context);
|
||||
values->animation_duration = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DURATION, &context);
|
||||
values->animation_timing_function = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_TIMING_FUNCTION, &context);
|
||||
values->animation_iteration_count = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_ITERATION_COUNT, &context);
|
||||
values->animation_direction = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DIRECTION, &context);
|
||||
values->animation_play_state = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_PLAY_STATE, &context);
|
||||
values->animation_delay = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DELAY, &context);
|
||||
values->animation_fill_mode = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_FILL_MODE, &context);
|
||||
values->animation_name = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_NAME, NULL, NULL, NULL);
|
||||
values->animation_duration = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DURATION, NULL, NULL, NULL);
|
||||
values->animation_timing_function = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_TIMING_FUNCTION, NULL, NULL, NULL);
|
||||
values->animation_iteration_count = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_ITERATION_COUNT, NULL, NULL, NULL);
|
||||
values->animation_direction = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DIRECTION, NULL, NULL, NULL);
|
||||
values->animation_play_state = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_PLAY_STATE, NULL, NULL, NULL);
|
||||
values->animation_delay = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_DELAY, NULL, NULL, NULL);
|
||||
values->animation_fill_mode = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ANIMATION_FILL_MODE, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -771,14 +769,13 @@ static GtkCssValues *
|
||||
gtk_css_transition_create_initial_values (void)
|
||||
{
|
||||
GtkCssTransitionValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssTransitionValues *)gtk_css_values_new (GTK_CSS_TRANSITION_INITIAL_VALUES);
|
||||
|
||||
values->transition_property = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_PROPERTY, &context);
|
||||
values->transition_duration = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_DURATION, &context);
|
||||
values->transition_timing_function = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION, &context);
|
||||
values->transition_delay = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_DELAY, &context);
|
||||
values->transition_property = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_PROPERTY, NULL, NULL, NULL);
|
||||
values->transition_duration = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_DURATION, NULL, NULL, NULL);
|
||||
values->transition_timing_function = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION, NULL, NULL, NULL);
|
||||
values->transition_delay = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSITION_DELAY, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -787,21 +784,20 @@ static GtkCssValues *
|
||||
gtk_css_size_create_initial_values (void)
|
||||
{
|
||||
GtkCssSizeValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssSizeValues *)gtk_css_values_new (GTK_CSS_SIZE_INITIAL_VALUES);
|
||||
|
||||
values->margin_top = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_TOP, &context);
|
||||
values->margin_left = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_LEFT, &context);
|
||||
values->margin_bottom = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_BOTTOM, &context);
|
||||
values->margin_right = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_RIGHT, &context);
|
||||
values->padding_top = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_TOP, &context);
|
||||
values->padding_left = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_LEFT, &context);
|
||||
values->padding_bottom = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_BOTTOM, &context);
|
||||
values->padding_right = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_RIGHT, &context);
|
||||
values->border_spacing = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_SPACING, &context);
|
||||
values->min_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MIN_WIDTH, &context);
|
||||
values->min_height = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MIN_HEIGHT, &context);
|
||||
values->margin_top = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_TOP, NULL, NULL, NULL);
|
||||
values->margin_left = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_LEFT, NULL, NULL, NULL);
|
||||
values->margin_bottom = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_BOTTOM, NULL, NULL, NULL);
|
||||
values->margin_right = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MARGIN_RIGHT, NULL, NULL, NULL);
|
||||
values->padding_top = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_TOP, NULL, NULL, NULL);
|
||||
values->padding_left = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_LEFT, NULL, NULL, NULL);
|
||||
values->padding_bottom = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_BOTTOM, NULL, NULL, NULL);
|
||||
values->padding_right = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_PADDING_RIGHT, NULL, NULL, NULL);
|
||||
values->border_spacing = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_BORDER_SPACING, NULL, NULL, NULL);
|
||||
values->min_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MIN_WIDTH, NULL, NULL, NULL);
|
||||
values->min_height = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_MIN_HEIGHT, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -810,17 +806,16 @@ static GtkCssValues *
|
||||
gtk_css_other_create_initial_values (void)
|
||||
{
|
||||
GtkCssOtherValues *values;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
values = (GtkCssOtherValues *)gtk_css_values_new (GTK_CSS_OTHER_INITIAL_VALUES);
|
||||
|
||||
values->icon_source = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_SOURCE, &context);
|
||||
values->icon_transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_TRANSFORM, &context);
|
||||
values->icon_filter = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_FILTER, &context);
|
||||
values->transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSFORM, &context);
|
||||
values->transform_origin = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSFORM_ORIGIN, &context);
|
||||
values->opacity = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OPACITY, &context);
|
||||
values->filter = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FILTER, &context);
|
||||
values->icon_source = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_SOURCE, NULL, NULL, NULL);
|
||||
values->icon_transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_TRANSFORM, NULL, NULL, NULL);
|
||||
values->icon_filter = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_ICON_FILTER, NULL, NULL, NULL);
|
||||
values->transform = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSFORM, NULL, NULL, NULL);
|
||||
values->transform_origin = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_TRANSFORM_ORIGIN, NULL, NULL, NULL);
|
||||
values->opacity = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OPACITY, NULL, NULL, NULL);
|
||||
values->filter = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_FILTER, NULL, NULL, NULL);
|
||||
|
||||
return (GtkCssValues *)values;
|
||||
}
|
||||
@@ -832,8 +827,6 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssStyle *style = (GtkCssStyle *)sstyle;
|
||||
GtkCssValue *shorthands[GTK_CSS_SHORTHAND_PROPERTY_N_PROPERTIES] = { NULL, };
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
gtk_internal_return_if_fail (lookup != NULL);
|
||||
gtk_internal_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
|
||||
@@ -846,7 +839,6 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
|
||||
gpointer id;
|
||||
GtkCssVariableValue *value;
|
||||
|
||||
g_clear_pointer (&style->variables, gtk_css_variable_set_unref);
|
||||
style->variables = gtk_css_variable_set_new ();
|
||||
|
||||
g_hash_table_iter_init (&iter, lookup->custom_values);
|
||||
@@ -867,11 +859,6 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
|
||||
style->variables = gtk_css_variable_set_ref (parent_style->variables);
|
||||
}
|
||||
|
||||
context.provider = provider;
|
||||
context.style = (GtkCssStyle *) sstyle;
|
||||
context.parent_style = parent_style;
|
||||
context.shorthands = shorthands;
|
||||
|
||||
if (_gtk_bitmask_is_empty (_gtk_css_lookup_get_set_values (lookup)))
|
||||
{
|
||||
style->background = (GtkCssBackgroundValues *)gtk_css_values_ref (gtk_css_background_initial_values);
|
||||
@@ -891,9 +878,9 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_css_core_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_icon_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_font_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_core_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
gtk_css_icon_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
gtk_css_font_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -902,63 +889,57 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
|
||||
if (parent_style && gtk_css_core_values_unset (lookup))
|
||||
style->core = (GtkCssCoreValues *)gtk_css_values_ref ((GtkCssValues *)parent_style->core);
|
||||
else
|
||||
gtk_css_core_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_core_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_background_values_unset (lookup))
|
||||
style->background = (GtkCssBackgroundValues *)gtk_css_values_ref (gtk_css_background_initial_values);
|
||||
else
|
||||
gtk_css_background_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_background_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_border_values_unset (lookup))
|
||||
style->border = (GtkCssBorderValues *)gtk_css_values_ref (gtk_css_border_initial_values);
|
||||
else
|
||||
gtk_css_border_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_border_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (parent_style && gtk_css_icon_values_unset (lookup))
|
||||
style->icon = (GtkCssIconValues *)gtk_css_values_ref ((GtkCssValues *)parent_style->icon);
|
||||
else
|
||||
gtk_css_icon_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_icon_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_outline_values_unset (lookup))
|
||||
style->outline = (GtkCssOutlineValues *)gtk_css_values_ref (gtk_css_outline_initial_values);
|
||||
else
|
||||
gtk_css_outline_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_outline_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (parent_style && gtk_css_font_values_unset (lookup))
|
||||
style->font = (GtkCssFontValues *)gtk_css_values_ref ((GtkCssValues *)parent_style->font);
|
||||
else
|
||||
gtk_css_font_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_font_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_font_variant_values_unset (lookup))
|
||||
style->font_variant = (GtkCssFontVariantValues *)gtk_css_values_ref (gtk_css_font_variant_initial_values);
|
||||
else
|
||||
gtk_css_font_variant_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_font_variant_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_animation_values_unset (lookup))
|
||||
style->animation = (GtkCssAnimationValues *)gtk_css_values_ref (gtk_css_animation_initial_values);
|
||||
else
|
||||
gtk_css_animation_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_animation_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_transition_values_unset (lookup))
|
||||
style->transition = (GtkCssTransitionValues *)gtk_css_values_ref (gtk_css_transition_initial_values);
|
||||
else
|
||||
gtk_css_transition_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_transition_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_size_values_unset (lookup))
|
||||
style->size = (GtkCssSizeValues *)gtk_css_values_ref (gtk_css_size_initial_values);
|
||||
else
|
||||
gtk_css_size_values_new_compute (sstyle, lookup, &context);
|
||||
gtk_css_size_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
|
||||
if (gtk_css_other_values_unset (lookup))
|
||||
style->other = (GtkCssOtherValues *)gtk_css_values_ref (gtk_css_other_initial_values);
|
||||
else
|
||||
gtk_css_other_values_new_compute (sstyle, lookup, &context);
|
||||
|
||||
for (unsigned int i = 0; i < GTK_CSS_SHORTHAND_PROPERTY_N_PROPERTIES; i++)
|
||||
{
|
||||
if (shorthands[i])
|
||||
gtk_css_value_unref (shorthands[i]);
|
||||
}
|
||||
gtk_css_other_values_new_compute (sstyle, provider, parent_style, lookup);
|
||||
}
|
||||
|
||||
GtkCssStyle *
|
||||
@@ -1006,11 +987,12 @@ G_STATIC_ASSERT (GTK_CSS_PROPERTY_BORDER_LEFT_STYLE == GTK_CSS_PROPERTY_BORDER_L
|
||||
G_STATIC_ASSERT (GTK_CSS_PROPERTY_OUTLINE_STYLE == GTK_CSS_PROPERTY_OUTLINE_WIDTH - 1);
|
||||
|
||||
static void
|
||||
gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
guint id,
|
||||
GtkCssValue *specified,
|
||||
GtkCssSection *section,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *parent_style,
|
||||
guint id,
|
||||
GtkCssValue *specified,
|
||||
GtkCssSection *section)
|
||||
{
|
||||
GtkCssValue *value, *original_value;
|
||||
GtkBorderStyle border_style;
|
||||
@@ -1050,21 +1032,21 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
*/
|
||||
if (specified)
|
||||
{
|
||||
value = gtk_css_value_compute (specified, id, context);
|
||||
value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style, NULL);
|
||||
|
||||
if (gtk_css_value_contains_variables (specified))
|
||||
original_value = specified;
|
||||
else
|
||||
original_value = NULL;
|
||||
}
|
||||
else if (context->parent_style && _gtk_css_style_property_is_inherit (_gtk_css_style_property_lookup_by_id (id)))
|
||||
else if (parent_style && _gtk_css_style_property_is_inherit (_gtk_css_style_property_lookup_by_id (id)))
|
||||
{
|
||||
GtkCssValue *parent_original_value;
|
||||
|
||||
/* Just take the style from the parent */
|
||||
value = gtk_css_value_ref (gtk_css_style_get_value (context->parent_style, id));
|
||||
value = _gtk_css_value_ref (gtk_css_style_get_value (parent_style, id));
|
||||
|
||||
parent_original_value = gtk_css_style_get_original_value (context->parent_style, id);
|
||||
parent_original_value = gtk_css_style_get_original_value (parent_style, id);
|
||||
|
||||
if (parent_original_value)
|
||||
original_value = parent_original_value;
|
||||
@@ -1073,7 +1055,7 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
}
|
||||
else
|
||||
{
|
||||
value = _gtk_css_initial_value_new_compute (id, context);
|
||||
value = _gtk_css_initial_value_new_compute (id, provider, (GtkCssStyle *)style, parent_style);
|
||||
original_value = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,14 @@ gtk_css_value_string_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_string_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_string_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -148,7 +151,7 @@ _gtk_css_string_value_new_take (char *string)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_STRING);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_STRING);
|
||||
result->string = string;
|
||||
result->is_computed = TRUE;
|
||||
|
||||
@@ -189,7 +192,7 @@ _gtk_css_ident_value_new_take (char *ident)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
result = gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_IDENT);
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_IDENT);
|
||||
result->string = ident;
|
||||
result->is_computed = TRUE;
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ gtk_css_style_print (GtkCssStyle *style,
|
||||
value = gtk_css_style_get_value (style, i);
|
||||
|
||||
g_string_append_printf (string, "%*s%s: ", indent, "", name);
|
||||
gtk_css_value_print (value, string);
|
||||
_gtk_css_value_print (value, string);
|
||||
g_string_append_c (string, ';');
|
||||
|
||||
if (section)
|
||||
|
||||
@@ -186,12 +186,12 @@ gtk_css_style_change_print (GtkCssStyleChange *change,
|
||||
|
||||
g_string_append_printf (string, "%s: ", name);
|
||||
value = gtk_css_style_get_value (old, i);
|
||||
gtk_css_value_print (value, string);
|
||||
_gtk_css_value_print (value, string);
|
||||
g_string_append (string, "\n");
|
||||
|
||||
g_string_append_printf (string, "%s: ", name);
|
||||
value = gtk_css_style_get_value (new, i);
|
||||
gtk_css_value_print (value, string);
|
||||
_gtk_css_value_print (value, string);
|
||||
g_string_append (string, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ gtk_css_style_property_register (const char * name,
|
||||
|
||||
node->parse_value = parse_value;
|
||||
|
||||
gtk_css_value_unref (initial_value);
|
||||
_gtk_css_value_unref (initial_value);
|
||||
|
||||
g_assert (_gtk_css_style_property_get_id (node) == expected_id);
|
||||
}
|
||||
@@ -1434,5 +1434,5 @@ _gtk_css_style_property_init_properties (void)
|
||||
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_TEXT_ATTRS | GTK_CSS_AFFECTS_TEXT_SIZE,
|
||||
parse_line_height,
|
||||
gtk_css_value_ref (gtk_css_line_height_value_get_default ()));
|
||||
_gtk_css_value_ref (gtk_css_line_height_value_get_default ()));
|
||||
}
|
||||
|
||||
@@ -90,33 +90,33 @@ gtk_css_transform_clear (GtkCssTransform *transform)
|
||||
case GTK_CSS_TRANSFORM_MATRIX:
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
gtk_css_value_unref (transform->translate.x);
|
||||
gtk_css_value_unref (transform->translate.y);
|
||||
gtk_css_value_unref (transform->translate.z);
|
||||
_gtk_css_value_unref (transform->translate.x);
|
||||
_gtk_css_value_unref (transform->translate.y);
|
||||
_gtk_css_value_unref (transform->translate.z);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
gtk_css_value_unref (transform->rotate.x);
|
||||
gtk_css_value_unref (transform->rotate.y);
|
||||
gtk_css_value_unref (transform->rotate.z);
|
||||
gtk_css_value_unref (transform->rotate.angle);
|
||||
_gtk_css_value_unref (transform->rotate.x);
|
||||
_gtk_css_value_unref (transform->rotate.y);
|
||||
_gtk_css_value_unref (transform->rotate.z);
|
||||
_gtk_css_value_unref (transform->rotate.angle);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
gtk_css_value_unref (transform->scale.x);
|
||||
gtk_css_value_unref (transform->scale.y);
|
||||
gtk_css_value_unref (transform->scale.z);
|
||||
_gtk_css_value_unref (transform->scale.x);
|
||||
_gtk_css_value_unref (transform->scale.y);
|
||||
_gtk_css_value_unref (transform->scale.z);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
gtk_css_value_unref (transform->skew.x);
|
||||
gtk_css_value_unref (transform->skew.y);
|
||||
_gtk_css_value_unref (transform->skew.x);
|
||||
_gtk_css_value_unref (transform->skew.y);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
gtk_css_value_unref (transform->skew_x.skew);
|
||||
_gtk_css_value_unref (transform->skew_x.skew);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
gtk_css_value_unref (transform->skew_y.skew);
|
||||
_gtk_css_value_unref (transform->skew_y.skew);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_PERSPECTIVE:
|
||||
gtk_css_value_unref (transform->perspective.depth);
|
||||
_gtk_css_value_unref (transform->perspective.depth);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_NONE:
|
||||
default:
|
||||
@@ -273,10 +273,13 @@ gtk_css_value_transform_free (GtkCssValue *value)
|
||||
|
||||
/* returns TRUE if dest == src */
|
||||
static gboolean
|
||||
gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
GtkCssTransform *src,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
GtkCssTransform *src,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
dest->type = src->type;
|
||||
|
||||
@@ -286,41 +289,41 @@ gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
memcpy (dest, src, sizeof (GtkCssTransform));
|
||||
return TRUE;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
dest->translate.x = gtk_css_value_compute (src->translate.x, property_id, context);
|
||||
dest->translate.y = gtk_css_value_compute (src->translate.y, property_id, context);
|
||||
dest->translate.z = gtk_css_value_compute (src->translate.z, property_id, context);
|
||||
dest->translate.x = _gtk_css_value_compute (src->translate.x, property_id, provider, style, parent_style, variables);
|
||||
dest->translate.y = _gtk_css_value_compute (src->translate.y, property_id, provider, style, parent_style, variables);
|
||||
dest->translate.z = _gtk_css_value_compute (src->translate.z, property_id, provider, style, parent_style, variables);
|
||||
return dest->translate.x == src->translate.x
|
||||
&& dest->translate.y == src->translate.y
|
||||
&& dest->translate.z == src->translate.z;
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
dest->rotate.x = gtk_css_value_compute (src->rotate.x, property_id, context);
|
||||
dest->rotate.y = gtk_css_value_compute (src->rotate.y, property_id, context);
|
||||
dest->rotate.z = gtk_css_value_compute (src->rotate.z, property_id, context);
|
||||
dest->rotate.angle = gtk_css_value_compute (src->rotate.angle, property_id, context);
|
||||
dest->rotate.x = _gtk_css_value_compute (src->rotate.x, property_id, provider, style, parent_style, variables);
|
||||
dest->rotate.y = _gtk_css_value_compute (src->rotate.y, property_id, provider, style, parent_style, variables);
|
||||
dest->rotate.z = _gtk_css_value_compute (src->rotate.z, property_id, provider, style, parent_style, variables);
|
||||
dest->rotate.angle = _gtk_css_value_compute (src->rotate.angle, property_id, provider, style, parent_style, variables);
|
||||
return dest->rotate.x == src->rotate.x
|
||||
&& dest->rotate.y == src->rotate.y
|
||||
&& dest->rotate.z == src->rotate.z
|
||||
&& dest->rotate.angle == src->rotate.angle;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
dest->scale.x = gtk_css_value_compute (src->scale.x, property_id, context);
|
||||
dest->scale.y = gtk_css_value_compute (src->scale.y, property_id, context);
|
||||
dest->scale.z = gtk_css_value_compute (src->scale.z, property_id, context);
|
||||
dest->scale.x = _gtk_css_value_compute (src->scale.x, property_id, provider, style, parent_style, variables);
|
||||
dest->scale.y = _gtk_css_value_compute (src->scale.y, property_id, provider, style, parent_style, variables);
|
||||
dest->scale.z = _gtk_css_value_compute (src->scale.z, property_id, provider, style, parent_style, variables);
|
||||
return dest->scale.x == src->scale.x
|
||||
&& dest->scale.y == src->scale.y
|
||||
&& dest->scale.z == src->scale.z;
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
dest->skew.x = gtk_css_value_compute (src->skew.x, property_id, context);
|
||||
dest->skew.y = gtk_css_value_compute (src->skew.y, property_id, context);
|
||||
dest->skew.x = _gtk_css_value_compute (src->skew.x, property_id, provider, style, parent_style, variables);
|
||||
dest->skew.y = _gtk_css_value_compute (src->skew.y, property_id, provider, style, parent_style, variables);
|
||||
return dest->skew.x == src->skew.x
|
||||
&& dest->skew.y == src->skew.y;
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
dest->skew_x.skew = gtk_css_value_compute (src->skew_x.skew, property_id, context);
|
||||
dest->skew_x.skew = _gtk_css_value_compute (src->skew_x.skew, property_id, provider, style, parent_style, variables);
|
||||
return dest->skew_x.skew == src->skew_x.skew;
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
dest->skew_y.skew = gtk_css_value_compute (src->skew_y.skew, property_id, context);
|
||||
dest->skew_y.skew = _gtk_css_value_compute (src->skew_y.skew, property_id, provider, style, parent_style, variables);
|
||||
return dest->skew_y.skew == src->skew_y.skew;
|
||||
case GTK_CSS_TRANSFORM_PERSPECTIVE:
|
||||
dest->perspective.depth = gtk_css_value_compute (src->perspective.depth, property_id, context);
|
||||
dest->perspective.depth = _gtk_css_value_compute (src->perspective.depth, property_id, provider, style, parent_style, variables);
|
||||
return dest->perspective.depth == src->perspective.depth;
|
||||
case GTK_CSS_TRANSFORM_NONE:
|
||||
default:
|
||||
@@ -330,9 +333,12 @@ gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
gboolean changes;
|
||||
@@ -340,7 +346,7 @@ gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
|
||||
/* Special case the 99% case of "none" */
|
||||
if (gtk_css_transform_value_is_none (value))
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
changes = FALSE;
|
||||
result = gtk_css_transform_value_alloc (value->n_transforms);
|
||||
@@ -350,13 +356,16 @@ gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
changes |= !gtk_css_transform_compute (&result->transforms[i],
|
||||
&value->transforms[i],
|
||||
property_id,
|
||||
context);
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
}
|
||||
|
||||
if (!changes)
|
||||
{
|
||||
gtk_css_value_unref (result);
|
||||
result = gtk_css_value_ref (value);
|
||||
_gtk_css_value_unref (result);
|
||||
result = _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -385,27 +394,27 @@ gtk_css_transform_equal (const GtkCssTransform *transform1,
|
||||
return TRUE;
|
||||
}
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
return gtk_css_value_equal (transform1->translate.x, transform2->translate.x)
|
||||
&& gtk_css_value_equal (transform1->translate.y, transform2->translate.y)
|
||||
&& gtk_css_value_equal (transform1->translate.z, transform2->translate.z);
|
||||
return _gtk_css_value_equal (transform1->translate.x, transform2->translate.x)
|
||||
&& _gtk_css_value_equal (transform1->translate.y, transform2->translate.y)
|
||||
&& _gtk_css_value_equal (transform1->translate.z, transform2->translate.z);
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
return gtk_css_value_equal (transform1->rotate.x, transform2->rotate.x)
|
||||
&& gtk_css_value_equal (transform1->rotate.y, transform2->rotate.y)
|
||||
&& gtk_css_value_equal (transform1->rotate.z, transform2->rotate.z)
|
||||
&& gtk_css_value_equal (transform1->rotate.angle, transform2->rotate.angle);
|
||||
return _gtk_css_value_equal (transform1->rotate.x, transform2->rotate.x)
|
||||
&& _gtk_css_value_equal (transform1->rotate.y, transform2->rotate.y)
|
||||
&& _gtk_css_value_equal (transform1->rotate.z, transform2->rotate.z)
|
||||
&& _gtk_css_value_equal (transform1->rotate.angle, transform2->rotate.angle);
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
return gtk_css_value_equal (transform1->scale.x, transform2->scale.x)
|
||||
&& gtk_css_value_equal (transform1->scale.y, transform2->scale.y)
|
||||
&& gtk_css_value_equal (transform1->scale.z, transform2->scale.z);
|
||||
return _gtk_css_value_equal (transform1->scale.x, transform2->scale.x)
|
||||
&& _gtk_css_value_equal (transform1->scale.y, transform2->scale.y)
|
||||
&& _gtk_css_value_equal (transform1->scale.z, transform2->scale.z);
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
return gtk_css_value_equal (transform1->skew.x, transform2->skew.x)
|
||||
&& gtk_css_value_equal (transform1->skew.y, transform2->skew.y);
|
||||
return _gtk_css_value_equal (transform1->skew.x, transform2->skew.x)
|
||||
&& _gtk_css_value_equal (transform1->skew.y, transform2->skew.y);
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
return gtk_css_value_equal (transform1->skew_x.skew, transform2->skew_x.skew);
|
||||
return _gtk_css_value_equal (transform1->skew_x.skew, transform2->skew_x.skew);
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
return gtk_css_value_equal (transform1->skew_y.skew, transform2->skew_y.skew);
|
||||
return _gtk_css_value_equal (transform1->skew_y.skew, transform2->skew_y.skew);
|
||||
case GTK_CSS_TRANSFORM_PERSPECTIVE:
|
||||
return gtk_css_value_equal (transform1->perspective.depth, transform2->perspective.depth);
|
||||
return _gtk_css_value_equal (transform1->perspective.depth, transform2->perspective.depth);
|
||||
case GTK_CSS_TRANSFORM_NONE:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
@@ -498,30 +507,30 @@ gtk_css_transform_transition (GtkCssTransform *result,
|
||||
&result->matrix.matrix);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
result->translate.x = gtk_css_value_transition (start->translate.x, end->translate.x, property_id, progress);
|
||||
result->translate.y = gtk_css_value_transition (start->translate.y, end->translate.y, property_id, progress);
|
||||
result->translate.z = gtk_css_value_transition (start->translate.z, end->translate.z, property_id, progress);
|
||||
result->translate.x = _gtk_css_value_transition (start->translate.x, end->translate.x, property_id, progress);
|
||||
result->translate.y = _gtk_css_value_transition (start->translate.y, end->translate.y, property_id, progress);
|
||||
result->translate.z = _gtk_css_value_transition (start->translate.z, end->translate.z, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
result->rotate.x = gtk_css_value_transition (start->rotate.x, end->rotate.x, property_id, progress);
|
||||
result->rotate.y = gtk_css_value_transition (start->rotate.y, end->rotate.y, property_id, progress);
|
||||
result->rotate.z = gtk_css_value_transition (start->rotate.z, end->rotate.z, property_id, progress);
|
||||
result->rotate.angle = gtk_css_value_transition (start->rotate.angle, end->rotate.angle, property_id, progress);
|
||||
result->rotate.x = _gtk_css_value_transition (start->rotate.x, end->rotate.x, property_id, progress);
|
||||
result->rotate.y = _gtk_css_value_transition (start->rotate.y, end->rotate.y, property_id, progress);
|
||||
result->rotate.z = _gtk_css_value_transition (start->rotate.z, end->rotate.z, property_id, progress);
|
||||
result->rotate.angle = _gtk_css_value_transition (start->rotate.angle, end->rotate.angle, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
result->scale.x = gtk_css_value_transition (start->scale.x, end->scale.x, property_id, progress);
|
||||
result->scale.y = gtk_css_value_transition (start->scale.y, end->scale.y, property_id, progress);
|
||||
result->scale.z = gtk_css_value_transition (start->scale.z, end->scale.z, property_id, progress);
|
||||
result->scale.x = _gtk_css_value_transition (start->scale.x, end->scale.x, property_id, progress);
|
||||
result->scale.y = _gtk_css_value_transition (start->scale.y, end->scale.y, property_id, progress);
|
||||
result->scale.z = _gtk_css_value_transition (start->scale.z, end->scale.z, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
result->skew.x = gtk_css_value_transition (start->skew.x, end->skew.x, property_id, progress);
|
||||
result->skew.y = gtk_css_value_transition (start->skew.y, end->skew.y, property_id, progress);
|
||||
result->skew.x = _gtk_css_value_transition (start->skew.x, end->skew.x, property_id, progress);
|
||||
result->skew.y = _gtk_css_value_transition (start->skew.y, end->skew.y, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
result->skew_x.skew = gtk_css_value_transition (start->skew_x.skew, end->skew_x.skew, property_id, progress);
|
||||
result->skew_x.skew = _gtk_css_value_transition (start->skew_x.skew, end->skew_x.skew, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
result->skew_y.skew = gtk_css_value_transition (start->skew_y.skew, end->skew_y.skew, property_id, progress);
|
||||
result->skew_y.skew = _gtk_css_value_transition (start->skew_y.skew, end->skew_y.skew, property_id, progress);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_PERSPECTIVE:
|
||||
gtk_css_transform_transition_default (result, start, end, property_id, progress);
|
||||
@@ -545,7 +554,7 @@ gtk_css_value_transform_transition (GtkCssValue *start,
|
||||
if (gtk_css_transform_value_is_none (start))
|
||||
{
|
||||
if (gtk_css_transform_value_is_none (end))
|
||||
return gtk_css_value_ref (start);
|
||||
return _gtk_css_value_ref (start);
|
||||
|
||||
n = 0;
|
||||
}
|
||||
@@ -693,67 +702,67 @@ gtk_css_transform_print (const GtkCssTransform *transform,
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
g_string_append (string, "translate3d(");
|
||||
gtk_css_value_print (transform->translate.x, string);
|
||||
_gtk_css_value_print (transform->translate.x, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->translate.y, string);
|
||||
_gtk_css_value_print (transform->translate.y, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->translate.z, string);
|
||||
_gtk_css_value_print (transform->translate.z, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
g_string_append (string, "rotate3d(");
|
||||
gtk_css_value_print (transform->rotate.x, string);
|
||||
_gtk_css_value_print (transform->rotate.x, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->rotate.y, string);
|
||||
_gtk_css_value_print (transform->rotate.y, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->rotate.z, string);
|
||||
_gtk_css_value_print (transform->rotate.z, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->rotate.angle, string);
|
||||
_gtk_css_value_print (transform->rotate.angle, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
if (_gtk_css_number_value_get (transform->scale.z, 100) == 1)
|
||||
{
|
||||
g_string_append (string, "scale(");
|
||||
gtk_css_value_print (transform->scale.x, string);
|
||||
if (!gtk_css_value_equal (transform->scale.x, transform->scale.y))
|
||||
_gtk_css_value_print (transform->scale.x, string);
|
||||
if (!_gtk_css_value_equal (transform->scale.x, transform->scale.y))
|
||||
{
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->scale.y, string);
|
||||
_gtk_css_value_print (transform->scale.y, string);
|
||||
}
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append (string, "scale3d(");
|
||||
gtk_css_value_print (transform->scale.x, string);
|
||||
_gtk_css_value_print (transform->scale.x, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->scale.y, string);
|
||||
_gtk_css_value_print (transform->scale.y, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->scale.z, string);
|
||||
_gtk_css_value_print (transform->scale.z, string);
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
g_string_append (string, "skew(");
|
||||
gtk_css_value_print (transform->skew.x, string);
|
||||
_gtk_css_value_print (transform->skew.x, string);
|
||||
g_string_append (string, ", ");
|
||||
gtk_css_value_print (transform->skew.y, string);
|
||||
_gtk_css_value_print (transform->skew.y, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
g_string_append (string, "skewX(");
|
||||
gtk_css_value_print (transform->skew_x.skew, string);
|
||||
_gtk_css_value_print (transform->skew_x.skew, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
g_string_append (string, "skewY(");
|
||||
gtk_css_value_print (transform->skew_y.skew, string);
|
||||
_gtk_css_value_print (transform->skew_y.skew, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_PERSPECTIVE:
|
||||
g_string_append (string, "perspective(");
|
||||
gtk_css_value_print (transform->perspective.depth, string);
|
||||
_gtk_css_value_print (transform->perspective.depth, string);
|
||||
g_string_append (string, ")");
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_NONE:
|
||||
@@ -804,7 +813,7 @@ gtk_css_transform_value_alloc (guint n_transforms)
|
||||
|
||||
g_return_val_if_fail (n_transforms > 0, NULL);
|
||||
|
||||
result = gtk_css_value_alloc (>K_CSS_VALUE_TRANSFORM, sizeof (GtkCssValue) + sizeof (GtkCssTransform) * (n_transforms - 1));
|
||||
result = _gtk_css_value_alloc (>K_CSS_VALUE_TRANSFORM, sizeof (GtkCssValue) + sizeof (GtkCssTransform) * (n_transforms - 1));
|
||||
result->n_transforms = n_transforms;
|
||||
|
||||
return result;
|
||||
@@ -813,7 +822,7 @@ gtk_css_transform_value_alloc (guint n_transforms)
|
||||
GtkCssValue *
|
||||
_gtk_css_transform_value_new_none (void)
|
||||
{
|
||||
return gtk_css_value_ref (&transform_none_singleton);
|
||||
return _gtk_css_value_ref (&transform_none_singleton);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -57,22 +57,22 @@ gtk_css_transition_apply_values (GtkStyleAnimation *style_animation,
|
||||
state = gtk_progress_tracker_get_state (&transition->tracker);
|
||||
|
||||
if (state == GTK_PROGRESS_STATE_BEFORE)
|
||||
value = gtk_css_value_ref (transition->start);
|
||||
value = _gtk_css_value_ref (transition->start);
|
||||
else if (state == GTK_PROGRESS_STATE_DURING)
|
||||
{
|
||||
progress = gtk_progress_tracker_get_progress (&transition->tracker, FALSE);
|
||||
progress = _gtk_css_ease_value_transform (transition->ease, progress);
|
||||
|
||||
value = gtk_css_value_transition (transition->start,
|
||||
end,
|
||||
transition->property,
|
||||
progress);
|
||||
value = _gtk_css_value_transition (transition->start,
|
||||
end,
|
||||
transition->property,
|
||||
progress);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if (value == NULL)
|
||||
value = gtk_css_value_ref (end);
|
||||
value = _gtk_css_value_ref (end);
|
||||
|
||||
gtk_css_animated_style_set_animated_value (style, transition->property, value);
|
||||
}
|
||||
@@ -124,8 +124,8 @@ gtk_css_transition_advance (GtkStyleAnimation *style_animation,
|
||||
transition->parent.ref_count = 1;
|
||||
|
||||
transition->property = source->property;
|
||||
transition->start = gtk_css_value_ref (source->start);
|
||||
transition->ease = gtk_css_value_ref (source->ease);
|
||||
transition->start = _gtk_css_value_ref (source->start);
|
||||
transition->ease = _gtk_css_value_ref (source->ease);
|
||||
|
||||
gtk_progress_tracker_init_copy (&source->tracker, &transition->tracker);
|
||||
gtk_progress_tracker_advance_frame (&transition->tracker, timestamp);
|
||||
@@ -151,8 +151,8 @@ _gtk_css_transition_new (guint property,
|
||||
transition->parent.ref_count = 1;
|
||||
|
||||
transition->property = property;
|
||||
transition->start = gtk_css_value_ref (start);
|
||||
transition->ease = gtk_css_value_ref (ease);
|
||||
transition->start = _gtk_css_value_ref (start);
|
||||
transition->ease = _gtk_css_value_ref (ease);
|
||||
gtk_progress_tracker_start (&transition->tracker, duration_us, delay_us, 1.0);
|
||||
gtk_progress_tracker_advance_frame (&transition->tracker, timestamp);
|
||||
transition->finished = gtk_progress_tracker_get_state (&transition->tracker) == GTK_PROGRESS_STATE_AFTER;
|
||||
|
||||
@@ -281,31 +281,6 @@ enum { /*< skip >*/
|
||||
GTK_CSS_PROPERTY_CUSTOM,
|
||||
};
|
||||
|
||||
enum {
|
||||
GTK_CSS_SHORTHAND_PROPERTY_FONT,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_MARGIN,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_PADDING,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_WIDTH,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_RADIUS,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_COLOR,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_STYLE,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_IMAGE,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_TOP,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_RIGHT,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_BOTTOM,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER_LEFT,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BORDER,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_OUTLINE,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_BACKGROUND,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_TRANSITION,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_ANIMATION,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_TEXT_DECORATION,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_FONT_VARIANT,
|
||||
GTK_CSS_SHORTHAND_PROPERTY_ALL,
|
||||
/* add more */
|
||||
GTK_CSS_SHORTHAND_PROPERTY_N_PROPERTIES,
|
||||
};
|
||||
|
||||
typedef enum /*< skip >*/ {
|
||||
GTK_CSS_AREA_BORDER_BOX,
|
||||
GTK_CSS_AREA_PADDING_BOX,
|
||||
|
||||
@@ -35,9 +35,12 @@ gtk_css_value_unset_free (GtkCssValue *value)
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_unset_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
gtk_css_value_unset_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
GtkCssStyleProperty *property;
|
||||
GtkCssValue *unset_value;
|
||||
@@ -49,7 +52,12 @@ gtk_css_value_unset_compute (GtkCssValue *value,
|
||||
else
|
||||
unset_value = _gtk_css_initial_value_get ();
|
||||
|
||||
return gtk_css_value_compute (unset_value, property_id, context);
|
||||
return _gtk_css_value_compute (unset_value,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
variables);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -91,5 +99,5 @@ static GtkCssValue unset = { >K_CSS_VALUE_UNSET, 1 };
|
||||
GtkCssValue *
|
||||
_gtk_css_unset_value_new (void)
|
||||
{
|
||||
return gtk_css_value_ref (&unset);
|
||||
return _gtk_css_value_ref (&unset);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ struct _GtkCssValue {
|
||||
GTK_CSS_VALUE_BASE
|
||||
};
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GtkCssValue, gtk_css_value, gtk_css_value_ref, gtk_css_value_unref)
|
||||
G_DEFINE_BOXED_TYPE (GtkCssValue, _gtk_css_value, _gtk_css_value_ref, _gtk_css_value_unref)
|
||||
|
||||
#undef CSS_VALUE_ACCOUNTING
|
||||
|
||||
@@ -137,8 +137,8 @@ get_accounting_data (const char *class)
|
||||
#endif
|
||||
|
||||
GtkCssValue *
|
||||
gtk_css_value_alloc (const GtkCssValueClass *klass,
|
||||
gsize size)
|
||||
_gtk_css_value_alloc (const GtkCssValueClass *klass,
|
||||
gsize size)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
@@ -161,7 +161,7 @@ gtk_css_value_alloc (const GtkCssValueClass *klass,
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
(gtk_css_value_ref) (GtkCssValue *value)
|
||||
gtk_css_value_ref (GtkCssValue *value)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (value != NULL, NULL);
|
||||
|
||||
@@ -171,7 +171,7 @@ GtkCssValue *
|
||||
}
|
||||
|
||||
void
|
||||
(gtk_css_value_unref) (GtkCssValue *value)
|
||||
gtk_css_value_unref (GtkCssValue *value)
|
||||
{
|
||||
if (value == NULL)
|
||||
return;
|
||||
@@ -193,14 +193,13 @@ void
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_css_value_compute:
|
||||
* _gtk_css_value_compute:
|
||||
* @value: the value to compute from
|
||||
* @property_id: the ID of the property to compute
|
||||
* @provider: Style provider for looking up extra information
|
||||
* @style: Style to compute for
|
||||
* @parent_style: parent style to use for inherited values
|
||||
* @variables: an additional set of variables to use along with @style
|
||||
* @shorthands: (nullable): Already computed values for shorthands
|
||||
*
|
||||
* Converts the specified @value into the computed value for the CSS
|
||||
* property given by @property_id using the information in @context.
|
||||
@@ -210,23 +209,26 @@ void
|
||||
* Returns: the computed value
|
||||
**/
|
||||
GtkCssValue *
|
||||
gtk_css_value_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context)
|
||||
_gtk_css_value_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables)
|
||||
{
|
||||
if (gtk_css_value_is_computed (value))
|
||||
return gtk_css_value_ref (value);
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
#ifdef CSS_VALUE_ACCOUNTING
|
||||
get_accounting_data (value->class->type_name)->computed++;
|
||||
#endif
|
||||
|
||||
return value->class->compute (value, property_id, context);
|
||||
return value->class->compute (value, property_id, provider, style, parent_style, variables);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_value_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
_gtk_css_value_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (value1 != NULL, FALSE);
|
||||
gtk_internal_return_val_if_fail (value2 != NULL, FALSE);
|
||||
@@ -241,8 +243,8 @@ gtk_css_value_equal (const GtkCssValue *value1,
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_value_equal0 (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
_gtk_css_value_equal0 (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
{
|
||||
/* Includes both values being NULL */
|
||||
if (value1 == value2)
|
||||
@@ -251,14 +253,14 @@ gtk_css_value_equal0 (const GtkCssValue *value1,
|
||||
if (value1 == NULL || value2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
return gtk_css_value_equal (value1, value2);
|
||||
return _gtk_css_value_equal (value1, value2);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
gtk_css_value_transition (GtkCssValue *start,
|
||||
GtkCssValue *end,
|
||||
guint property_id,
|
||||
double progress)
|
||||
_gtk_css_value_transition (GtkCssValue *start,
|
||||
GtkCssValue *end,
|
||||
guint property_id,
|
||||
double progress)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (start != NULL, NULL);
|
||||
gtk_internal_return_val_if_fail (end != NULL, NULL);
|
||||
@@ -267,13 +269,13 @@ gtk_css_value_transition (GtkCssValue *start,
|
||||
return NULL;
|
||||
|
||||
if (progress == 0)
|
||||
return gtk_css_value_ref (start);
|
||||
return _gtk_css_value_ref (start);
|
||||
|
||||
if (progress == 1)
|
||||
return gtk_css_value_ref (end);
|
||||
return _gtk_css_value_ref (end);
|
||||
|
||||
if (start == end)
|
||||
return gtk_css_value_ref (start);
|
||||
return _gtk_css_value_ref (start);
|
||||
|
||||
#ifdef CSS_VALUE_ACCOUNTING
|
||||
get_accounting_data (start->class->type_name)->transitioned++;
|
||||
@@ -283,19 +285,19 @@ gtk_css_value_transition (GtkCssValue *start,
|
||||
}
|
||||
|
||||
char *
|
||||
gtk_css_value_to_string (const GtkCssValue *value)
|
||||
_gtk_css_value_to_string (const GtkCssValue *value)
|
||||
{
|
||||
GString *string;
|
||||
|
||||
gtk_internal_return_val_if_fail (value != NULL, NULL);
|
||||
|
||||
string = g_string_new (NULL);
|
||||
gtk_css_value_print (value, string);
|
||||
_gtk_css_value_print (value, string);
|
||||
return g_string_free (string, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_css_value_print:
|
||||
* _gtk_css_value_print:
|
||||
* @value: the value to print
|
||||
* @string: the string to print to
|
||||
*
|
||||
@@ -304,8 +306,8 @@ gtk_css_value_to_string (const GtkCssValue *value)
|
||||
* via _gtk_style_property_assign().
|
||||
**/
|
||||
void
|
||||
gtk_css_value_print (const GtkCssValue *value,
|
||||
GString *string)
|
||||
_gtk_css_value_print (const GtkCssValue *value,
|
||||
GString *string)
|
||||
{
|
||||
gtk_internal_return_if_fail (value != NULL);
|
||||
gtk_internal_return_if_fail (string != NULL);
|
||||
@@ -361,3 +363,15 @@ gtk_css_value_get_dynamic_value (GtkCssValue *value,
|
||||
|
||||
return value->class->get_dynamic_value (value, monotonic_time);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_value_is_computed (const GtkCssValue *value)
|
||||
{
|
||||
return value->is_computed;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_value_contains_variables (const GtkCssValue *value)
|
||||
{
|
||||
return value->contains_variables;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CSS_VALUE (gtk_css_value_get_type ())
|
||||
#define GTK_TYPE_CSS_VALUE (_gtk_css_value_get_type ())
|
||||
|
||||
/* A GtkCssValue is a refcounted immutable value type */
|
||||
|
||||
@@ -41,21 +41,16 @@ typedef struct _GtkCssValueClass GtkCssValueClass;
|
||||
guint is_computed: 1; \
|
||||
guint contains_variables: 1;
|
||||
|
||||
typedef struct {
|
||||
GtkStyleProvider *provider;
|
||||
GtkCssStyle *style;
|
||||
GtkCssStyle *parent_style;
|
||||
GtkCssVariableSet *variables;
|
||||
GtkCssValue **shorthands;
|
||||
} GtkCssComputeContext;
|
||||
|
||||
struct _GtkCssValueClass {
|
||||
const char *type_name;
|
||||
void (* free) (GtkCssValue *value);
|
||||
|
||||
GtkCssValue * (* compute) (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context);
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables);
|
||||
gboolean (* equal) (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2);
|
||||
GtkCssValue * (* transition) (GtkCssValue *start,
|
||||
@@ -69,78 +64,40 @@ struct _GtkCssValueClass {
|
||||
GString *string);
|
||||
};
|
||||
|
||||
GType gtk_css_value_get_type (void) G_GNUC_CONST;
|
||||
GType _gtk_css_value_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkCssValue * gtk_css_value_alloc (const GtkCssValueClass *klass,
|
||||
GtkCssValue *_gtk_css_value_alloc (const GtkCssValueClass *klass,
|
||||
gsize size);
|
||||
#define gtk_css_value_new(name, klass) ((name *) gtk_css_value_alloc ((klass), sizeof (name)))
|
||||
#define _gtk_css_value_new(_name, _klass) ((_name *) _gtk_css_value_alloc ((_klass), sizeof (_name)))
|
||||
|
||||
GtkCssValue * (gtk_css_value_ref) (GtkCssValue *value);
|
||||
void (gtk_css_value_unref) (GtkCssValue *value);
|
||||
#define _gtk_css_value_ref gtk_css_value_ref
|
||||
GtkCssValue * gtk_css_value_ref (GtkCssValue *value);
|
||||
#define _gtk_css_value_unref gtk_css_value_unref
|
||||
void gtk_css_value_unref (GtkCssValue *value);
|
||||
|
||||
GtkCssValue * gtk_css_value_compute (GtkCssValue *value,
|
||||
GtkCssValue *_gtk_css_value_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkCssComputeContext *context) G_GNUC_PURE;
|
||||
gboolean gtk_css_value_equal (const GtkCssValue *value1,
|
||||
GtkStyleProvider *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssVariableSet *variables) G_GNUC_PURE;
|
||||
gboolean _gtk_css_value_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2) G_GNUC_PURE;
|
||||
gboolean gtk_css_value_equal0 (const GtkCssValue *value1,
|
||||
gboolean _gtk_css_value_equal0 (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2) G_GNUC_PURE;
|
||||
GtkCssValue * gtk_css_value_transition (GtkCssValue *start,
|
||||
GtkCssValue *_gtk_css_value_transition (GtkCssValue *start,
|
||||
GtkCssValue *end,
|
||||
guint property_id,
|
||||
double progress);
|
||||
gboolean gtk_css_value_is_dynamic (const GtkCssValue *value) G_GNUC_PURE;
|
||||
GtkCssValue * gtk_css_value_get_dynamic_value (GtkCssValue *value,
|
||||
gboolean gtk_css_value_is_dynamic (const GtkCssValue *value) G_GNUC_PURE;
|
||||
GtkCssValue * gtk_css_value_get_dynamic_value (GtkCssValue *value,
|
||||
gint64 monotonic_time);
|
||||
|
||||
char * gtk_css_value_to_string (const GtkCssValue *value);
|
||||
void gtk_css_value_print (const GtkCssValue *value,
|
||||
char * _gtk_css_value_to_string (const GtkCssValue *value);
|
||||
void _gtk_css_value_print (const GtkCssValue *value,
|
||||
GString *string);
|
||||
|
||||
typedef struct { GTK_CSS_VALUE_BASE } GtkCssValueBase;
|
||||
|
||||
static inline GtkCssValue *
|
||||
gtk_css_value_ref_inline (GtkCssValue *value)
|
||||
{
|
||||
GtkCssValueBase *value_base = (GtkCssValueBase *) value;
|
||||
|
||||
value_base->ref_count += 1;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline void
|
||||
gtk_css_value_unref_inline (GtkCssValue *value)
|
||||
{
|
||||
GtkCssValueBase *value_base = (GtkCssValueBase *) value;
|
||||
|
||||
if (value_base && value_base->ref_count > 1)
|
||||
{
|
||||
value_base->ref_count -= 1;
|
||||
return;
|
||||
}
|
||||
|
||||
(gtk_css_value_unref) (value);
|
||||
}
|
||||
|
||||
#define gtk_css_value_ref(value) gtk_css_value_ref_inline (value)
|
||||
#define gtk_css_value_unref(value) gtk_css_value_unref_inline (value)
|
||||
|
||||
static inline gboolean
|
||||
gtk_css_value_is_computed (const GtkCssValue *value)
|
||||
{
|
||||
GtkCssValueBase *value_base = (GtkCssValueBase *) value;
|
||||
|
||||
return value_base->is_computed;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
gtk_css_value_contains_variables (const GtkCssValue *value)
|
||||
{
|
||||
GtkCssValueBase *value_base = (GtkCssValueBase *) value;
|
||||
|
||||
return value_base->contains_variables;
|
||||
}
|
||||
gboolean gtk_css_value_is_computed (const GtkCssValue *value) G_GNUC_PURE;
|
||||
gboolean gtk_css_value_contains_variables (const GtkCssValue *value) G_GNUC_PURE;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ G_BEGIN_DECLS
|
||||
* are interpreted relative to text direction.
|
||||
*
|
||||
* Baseline support is optional for containers and widgets, and is only available
|
||||
* for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL`
|
||||
* for vertical alignment. `GTK_ALIGN_BASELINE_CENTER and `GTK_ALIGN_BASELINE_FILL`
|
||||
* are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it
|
||||
* positions the widget to line up the baselines, where that is supported.
|
||||
*/
|
||||
|
||||
@@ -1576,8 +1576,7 @@ gtk_grid_view_get_tab_behavior (GtkGridView *self)
|
||||
/**
|
||||
* gtk_grid_view_scroll_to:
|
||||
* @self: The gridview to scroll in
|
||||
* @pos: position of the item. Must be less than the number of
|
||||
* items in the view.
|
||||
* @pos: position of the item
|
||||
* @flags: actions to perform
|
||||
* @scroll: (nullable) (transfer full): details of how to perform
|
||||
* the scroll operation or %NULL to scroll into view
|
||||
@@ -1597,7 +1596,6 @@ gtk_grid_view_scroll_to (GtkGridView *self,
|
||||
GtkScrollInfo *scroll)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_GRID_VIEW (self));
|
||||
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self)));
|
||||
|
||||
gtk_list_base_scroll_to (GTK_LIST_BASE (self), pos, flags, scroll);
|
||||
}
|
||||
|
||||
@@ -1356,8 +1356,7 @@ gtk_list_view_get_tab_behavior (GtkListView *self)
|
||||
/**
|
||||
* gtk_list_view_scroll_to:
|
||||
* @self: The listview to scroll in
|
||||
* @pos: position of the item. Must be less than the number of
|
||||
* items in the view.
|
||||
* @pos: position of the item
|
||||
* @flags: actions to perform
|
||||
* @scroll: (nullable) (transfer full): details of how to perform
|
||||
* the scroll operation or %NULL to scroll into view
|
||||
@@ -1377,7 +1376,6 @@ gtk_list_view_scroll_to (GtkListView *self,
|
||||
GtkScrollInfo *scroll)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_LIST_VIEW (self));
|
||||
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self)));
|
||||
|
||||
gtk_list_base_scroll_to (GTK_LIST_BASE (self), pos, flags, scroll);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ gtk_print_setup_unref (GtkPrintSetup *setup)
|
||||
* They may be different from the `GtkPrintDialog`'s settings
|
||||
* if the user changed them during the setup process.
|
||||
*
|
||||
* Returns: (transfer none): the print settings, or `NULL`
|
||||
* Returns: (nullable) (transfer none): the print settings, or `NULL`
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
@@ -168,7 +168,7 @@ gtk_print_setup_set_print_settings (GtkPrintSetup *setup,
|
||||
* It may be different from the `GtkPrintDialog`'s page setup
|
||||
* if the user changed it during the setup process.
|
||||
*
|
||||
* Returns: (transfer none): the page setup, or `NULL`
|
||||
* Returns: (nullable) (transfer none): the page setup, or `NULL`
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
@@ -585,7 +585,7 @@ gtk_print_dialog_set_modal (GtkPrintDialog *self,
|
||||
*
|
||||
* Returns the page setup.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the page setup
|
||||
* Returns: (transfer none): the page setup
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
@@ -623,7 +623,7 @@ gtk_print_dialog_set_page_setup (GtkPrintDialog *self,
|
||||
*
|
||||
* Returns the print settings for the print dialog.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the settings
|
||||
* Returns: (transfer none): the settings
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
@@ -1502,7 +1502,7 @@ gtk_print_dialog_setup (GtkPrintDialog *self,
|
||||
* which contains the print settings and page setup information that
|
||||
* will be used to print.
|
||||
*
|
||||
* Returns: The `GtkPrintSetup` object that resulted from the call,
|
||||
* Returns: (nullable): The `GtkPrintSetup` object that resulted from the call,
|
||||
* or `NULL` if the call was not successful
|
||||
*
|
||||
* Since: 4.14
|
||||
@@ -1628,7 +1628,7 @@ gtk_print_dialog_print (GtkPrintDialog *self,
|
||||
* call may not be instant as it operation will for the printer to finish
|
||||
* printing.
|
||||
*
|
||||
* Returns: (transfer full): a [class@Gio.OutputStream]
|
||||
* Returns: (nullable) (transfer full): a [class@Gio.OutputStream]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
|
||||
@@ -366,10 +366,9 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
|
||||
GdkSeat *seat;
|
||||
GdkDevice *device;
|
||||
GdkSurface *surface;
|
||||
double px, py;
|
||||
int x, y;
|
||||
double x, y;
|
||||
graphene_point_t p;
|
||||
GtkWidget *toplevel;
|
||||
GtkWidget *target_widget;
|
||||
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
@@ -382,7 +381,7 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
|
||||
else
|
||||
device = NULL;
|
||||
if (device)
|
||||
surface = gdk_device_get_surface_at_position (device, &px, &py);
|
||||
surface = gdk_device_get_surface_at_position (device, &x, &y);
|
||||
else
|
||||
surface = NULL;
|
||||
if (!surface)
|
||||
@@ -396,12 +395,10 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
|
||||
if (gtk_native_get_surface (GTK_NATIVE (toplevel)) != surface)
|
||||
return;
|
||||
|
||||
x = round (px);
|
||||
y = round (py);
|
||||
if (!gtk_widget_compute_point (toplevel, widget, &GRAPHENE_POINT_INIT (x, y), &p))
|
||||
graphene_point_init (&p, x, y);
|
||||
|
||||
target_widget = _gtk_widget_find_at_coords (surface, x, y, &x, &y);
|
||||
|
||||
gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, surface, target_widget, x, y);
|
||||
gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, surface, widget, p.x, p.y);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -822,7 +822,7 @@ gtk_inspector_css_node_tree_update_style (GtkInspectorCssNodeTree *cnt,
|
||||
|
||||
if (new_style)
|
||||
{
|
||||
value = gtk_css_value_to_string (gtk_css_style_get_value (new_style, i));
|
||||
value = _gtk_css_value_to_string (gtk_css_style_get_value (new_style, i));
|
||||
|
||||
section = gtk_css_style_get_section (new_style, i);
|
||||
if (section)
|
||||
|
||||
268
po/ka.po
268
po/ka.po
@@ -11,8 +11,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-05-11 03:40+0000\n"
|
||||
"PO-Revision-Date: 2024-05-13 02:43+0200\n"
|
||||
"POT-Creation-Date: 2024-03-30 09:15+0000\n"
|
||||
"PO-Revision-Date: 2024-03-30 19:22+0100\n"
|
||||
"Last-Translator: Ekaterine Papava <papava.e@gtu.ge>\n"
|
||||
"Language-Team: Georgian <http://mail.gnome.org/mailman/listinfo/gnome-ge-"
|
||||
"list>\n"
|
||||
@@ -55,7 +55,7 @@ msgstr "შემცველობის %s-ად გამოტანა შ
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "მიმდინარე უკანაბოლოს OpenGL-ის მხარდაჭერა არ გააჩნია"
|
||||
|
||||
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1636
|
||||
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1600
|
||||
msgid "Vulkan support disabled via GDK_DEBUG"
|
||||
msgstr "Vulkan-ის მხარდაჭერა გამორთულია GDK_DEBUG-ით"
|
||||
|
||||
@@ -139,7 +139,7 @@ msgstr "აპლიკაციას %s-ის API-ის მხარდა
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2121
|
||||
#: gdk/gdkglcontext.c:2123
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "%s გამოყენების მცდელობა, მაგრამ %s უკვე გამოიყენება"
|
||||
@@ -535,7 +535,7 @@ msgstr "JPEG გამოსახულების ფაილის კი
|
||||
msgid "Unsupported JPEG colorspace (%d)"
|
||||
msgstr "მხარდაუჭერელი JPEG ფერთა სივრცე (%d)"
|
||||
|
||||
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:289 gdk/loaders/gdktiff.c:472
|
||||
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:286 gdk/loaders/gdktiff.c:472
|
||||
#, c-format
|
||||
msgid "Not enough memory for image size %ux%u"
|
||||
msgstr "არასაკმარისი მეხსიერება გამოსახულების ჩასატვირთად %ux%u"
|
||||
@@ -545,17 +545,17 @@ msgstr "არასაკმარისი მეხსიერება გ
|
||||
msgid "Error reading png (%s)"
|
||||
msgstr "PNG-ის წაკითხვის შეცდომა (%s)"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:215
|
||||
#: gdk/loaders/gdkpng.c:212
|
||||
#, c-format
|
||||
msgid "Unsupported depth %u in png image"
|
||||
msgstr "PNG გამოსახულების მხარდაუჭერელი ფერთა სიღრმე %u"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:265
|
||||
#: gdk/loaders/gdkpng.c:262
|
||||
#, c-format
|
||||
msgid "Unsupported color type %u in png image"
|
||||
msgstr "PNG გამოსახულების ფერების მხარდაუჭერელი ტიპი %u"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:275
|
||||
#: gdk/loaders/gdkpng.c:272
|
||||
#, c-format
|
||||
msgid "Image stride too large for image size %ux%u"
|
||||
msgstr "გამოსახულებს ბიჯი მეტისმეტად დიდია გამოსახულების ზომისთვის %ux%u"
|
||||
@@ -2274,7 +2274,7 @@ msgstr "ფაილი ამ სახელით უკვე არსე
|
||||
#: gtk/gtkmessagedialog.c:179 gtk/gtkmountoperation.c:608
|
||||
#: gtk/print/gtkpagesetupunixdialog.c:282 gtk/print/gtkprintbackend.c:638
|
||||
#: gtk/print/gtkprintunixdialog.c:682 gtk/print/gtkprintunixdialog.c:839
|
||||
#: gtk/gtkwindow.c:6257 gtk/ui/gtkappchooserdialog.ui:48
|
||||
#: gtk/gtkwindow.c:6256 gtk/ui/gtkappchooserdialog.ui:48
|
||||
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:36
|
||||
#: gtk/ui/gtkfontchooserdialog.ui:27
|
||||
msgid "_Cancel"
|
||||
@@ -2362,7 +2362,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "თუ წაშლით ელემენტს, ის სამუდამოდ დაიკარგება."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5745 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
|
||||
msgid "_Delete"
|
||||
msgstr "წაშლა"
|
||||
|
||||
@@ -2688,7 +2688,7 @@ msgstr "სტილის ვარიაციები"
|
||||
msgid "Character Variations"
|
||||
msgstr "სიმბოლოების ვარიანტები"
|
||||
|
||||
#: gtk/gtkglarea.c:316
|
||||
#: gtk/gtkglarea.c:309
|
||||
msgid "OpenGL context creation failed"
|
||||
msgstr "OpenGL-ის კონტექსტის შექმნის შეცდომა"
|
||||
|
||||
@@ -2701,31 +2701,31 @@ msgstr "დახურვა"
|
||||
msgid "Close the infobar"
|
||||
msgstr "საინფორმაციო ზოლის დახურვა"
|
||||
|
||||
#: gtk/gtklabel.c:5742 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
|
||||
msgid "Cu_t"
|
||||
msgstr "ამოჭრა"
|
||||
|
||||
#: gtk/gtklabel.c:5743 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
|
||||
msgid "_Copy"
|
||||
msgstr "ასლი"
|
||||
|
||||
#: gtk/gtklabel.c:5744 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
|
||||
msgid "_Paste"
|
||||
msgstr "ჩასმა"
|
||||
|
||||
#: gtk/gtklabel.c:5750 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
|
||||
msgid "Select _All"
|
||||
msgstr "ყველაფრის _მონიშვნა"
|
||||
|
||||
#: gtk/gtklabel.c:5755
|
||||
#: gtk/gtklabel.c:5722
|
||||
msgid "_Open Link"
|
||||
msgstr "_ბმულის გახსნა"
|
||||
|
||||
#: gtk/gtklabel.c:5759
|
||||
#: gtk/gtklabel.c:5726
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "დაა_კოპირე ბმულის მისამართი"
|
||||
|
||||
#: gtk/gtklabel.c:5803 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
|
||||
msgid "Context menu"
|
||||
msgstr "კონტექსტური მენიუ"
|
||||
|
||||
@@ -2733,7 +2733,7 @@ msgstr "კონტექსტური მენიუ"
|
||||
msgid "_Copy URL"
|
||||
msgstr "URL-ის _კოპირება"
|
||||
|
||||
#: gtk/gtklinkbutton.c:589
|
||||
#: gtk/gtklinkbutton.c:567
|
||||
msgid "Invalid URI"
|
||||
msgstr "მცდარი URI"
|
||||
|
||||
@@ -2796,7 +2796,7 @@ msgid "Play"
|
||||
msgstr "დაკვრა"
|
||||
|
||||
#: gtk/gtkmessagedialog.c:162 gtk/gtkmessagedialog.c:180
|
||||
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6258
|
||||
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6257
|
||||
msgid "_OK"
|
||||
msgstr "_დიახ"
|
||||
|
||||
@@ -3414,7 +3414,7 @@ msgstr "არ არის ქაღალდი"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: gtk/print/gtkprintoperation-win32.c:640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1533
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1528
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2639
|
||||
msgid "Paused"
|
||||
msgstr "შეჩერებულია"
|
||||
@@ -3485,42 +3485,42 @@ msgstr "პრინტერის ინფორმაციის მიღ
|
||||
#. * multiple pages on a sheet when printing
|
||||
#.
|
||||
#: gtk/print/gtkprintunixdialog.c:2753
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5677
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5672
|
||||
msgid "Left to right, top to bottom"
|
||||
msgstr "მარცხნიდან მარჯვნივ, ქვევიდან ზემოთ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2753
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5677
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5672
|
||||
msgid "Left to right, bottom to top"
|
||||
msgstr "მარცხნიდან მარჯვნივ, ქვემოდან ზემოთ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2754
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5678
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5673
|
||||
msgid "Right to left, top to bottom"
|
||||
msgstr "მარჯვნიდან მარცხნივ, ზევიდან ქვემოთ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2754
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5678
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5673
|
||||
msgid "Right to left, bottom to top"
|
||||
msgstr "მარჯვნიდან მარცხნივ, ქვემოდან ზემოთ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2755
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5679
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5674
|
||||
msgid "Top to bottom, left to right"
|
||||
msgstr "ზემოდან ქვემოთ, მარცხნიდან მარჯვნივ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2755
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5679
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5674
|
||||
msgid "Top to bottom, right to left"
|
||||
msgstr "ზემოდან ქვემოთ, მარჯვნიდან მარცხნივ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2756
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5680
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5675
|
||||
msgid "Bottom to top, left to right"
|
||||
msgstr "ქვემოდან ზემოთ, მარცხნიდან მარჯვნივ"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2756
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5680
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5675
|
||||
msgid "Bottom to top, right to left"
|
||||
msgstr "ქვემოდან ზემოთ, მარჯვნიდან მარცხნივ"
|
||||
|
||||
@@ -3672,12 +3672,12 @@ msgstr "_დაბრუნება"
|
||||
msgid "_Redo"
|
||||
msgstr "_გამეორება"
|
||||
|
||||
#: gtk/gtkwindow.c:6246
|
||||
#: gtk/gtkwindow.c:6245
|
||||
#, c-format
|
||||
msgid "Do you want to use GTK Inspector?"
|
||||
msgstr "გნებავთ GTK-ის ინსპექტორის გამოყენება?"
|
||||
|
||||
#: gtk/gtkwindow.c:6248
|
||||
#: gtk/gtkwindow.c:6247
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK Inspector is an interactive debugger that lets you explore and modify "
|
||||
@@ -3688,7 +3688,7 @@ msgstr ""
|
||||
"ნებისმიერი GTK აპლიკაციის შიდა პარამეტრები დაათვალიეროთ და შეცვალოთ. მისი "
|
||||
"გამოყენებით ასევე შეიძლება პროგრამა ავარიულად დასრულდეს."
|
||||
|
||||
#: gtk/gtkwindow.c:6253
|
||||
#: gtk/gtkwindow.c:6252
|
||||
msgid "Don’t show this message again"
|
||||
msgstr "მეტჯერ აღარ მაჩვენო ეს გაფრთხილება"
|
||||
|
||||
@@ -3866,37 +3866,37 @@ msgstr "სტილის კლასები"
|
||||
msgid "CSS Property"
|
||||
msgstr "CSS-ის თვისება"
|
||||
|
||||
#: gtk/inspector/general.c:371
|
||||
#: gtk/inspector/general.c:370
|
||||
msgctxt "GL version"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:462
|
||||
#: gtk/inspector/general.c:461
|
||||
msgctxt "GL version"
|
||||
msgid "Unknown"
|
||||
msgstr "უცნობი"
|
||||
|
||||
#: gtk/inspector/general.c:524
|
||||
#: gtk/inspector/general.c:523
|
||||
msgctxt "Vulkan device"
|
||||
msgid "Disabled"
|
||||
msgstr "გამორთულია"
|
||||
|
||||
#: gtk/inspector/general.c:525 gtk/inspector/general.c:526
|
||||
#: gtk/inspector/general.c:524 gtk/inspector/general.c:525
|
||||
msgctxt "Vulkan version"
|
||||
msgid "Disabled"
|
||||
msgstr "გამორთულია"
|
||||
|
||||
#: gtk/inspector/general.c:577
|
||||
#: gtk/inspector/general.c:576
|
||||
msgctxt "Vulkan device"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:578 gtk/inspector/general.c:579
|
||||
#: gtk/inspector/general.c:577 gtk/inspector/general.c:578
|
||||
msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:930
|
||||
#: gtk/inspector/general.c:924
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "IM-ის კონტექსტი GTK_IM_MODULE-ში ხელითაა ჩაწერილი"
|
||||
|
||||
@@ -4206,7 +4206,7 @@ msgstr "წყარო:"
|
||||
msgid "Defined At"
|
||||
msgstr "აღწერის წერტილი"
|
||||
|
||||
#: gtk/inspector/recorder.c:1950
|
||||
#: gtk/inspector/recorder.c:1941
|
||||
#, c-format
|
||||
msgid "Saving RenderNode failed"
|
||||
msgstr "RenderNode-ის შენახვის შეცდომა"
|
||||
@@ -4344,7 +4344,7 @@ msgstr "იერარქია"
|
||||
msgid "Implements"
|
||||
msgstr "იმპლემენტაციას უკეთებს"
|
||||
|
||||
#: gtk/inspector/visual.c:690 gtk/inspector/visual.c:708
|
||||
#: gtk/inspector/visual.c:765 gtk/inspector/visual.c:784
|
||||
msgid "Theme is hardcoded by GTK_THEME"
|
||||
msgstr "თემა ჩადგმულია GTK_THEME-ის მიერ"
|
||||
|
||||
@@ -4389,28 +4389,43 @@ msgid "Slowdown"
|
||||
msgstr "შენელება"
|
||||
|
||||
#: gtk/inspector/visual.ui:362
|
||||
msgid "Rendering"
|
||||
msgstr "რენდერი"
|
||||
msgid "Antialiasing"
|
||||
msgstr "მომრგვალება"
|
||||
|
||||
#: gtk/inspector/visual.ui:377
|
||||
msgctxt "Font rendering"
|
||||
msgid "Automatic"
|
||||
msgstr "ავტომატური"
|
||||
#: gtk/inspector/visual.ui:387
|
||||
msgid "Hinting"
|
||||
msgstr "მომრგვალება"
|
||||
|
||||
#: gtk/inspector/visual.ui:378
|
||||
msgctxt "Font rendering"
|
||||
msgid "Manual"
|
||||
msgstr "ხელით"
|
||||
#: gtk/inspector/visual.ui:402
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/visual.ui:403
|
||||
msgid "Slight"
|
||||
msgstr "ოდნავ"
|
||||
|
||||
#: gtk/inspector/visual.ui:404 modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5667
|
||||
msgid "Medium"
|
||||
msgstr "საშუალო"
|
||||
|
||||
#: gtk/inspector/visual.ui:405
|
||||
msgid "Full"
|
||||
msgstr "სრული"
|
||||
|
||||
#: gtk/inspector/visual.ui:422
|
||||
msgid "Metrics Hinting"
|
||||
msgstr "მეტრიკის მომრგვალება"
|
||||
|
||||
#: gtk/inspector/visual.ui:457
|
||||
msgid "Show Framerate"
|
||||
msgstr "კადრების სიხშირის ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:430
|
||||
#: gtk/inspector/visual.ui:482
|
||||
msgid "Show Graphic Updates"
|
||||
msgstr "გრაფიკული განახლებების ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:450
|
||||
#: gtk/inspector/visual.ui:502
|
||||
msgid ""
|
||||
"Tints all the places where the current renderer uses Cairo instead of the "
|
||||
"GPU."
|
||||
@@ -4418,47 +4433,47 @@ msgstr ""
|
||||
"შეღებავს ყველა ადგილს, სადაც მიმდინარე რენდერერი GPU-ის მაგიერ Cairo-ს "
|
||||
"იყენებს."
|
||||
|
||||
#: gtk/inspector/visual.ui:456
|
||||
#: gtk/inspector/visual.ui:508
|
||||
msgid "Show Cairo Rendering"
|
||||
msgstr "Cairo-ის რენდერის ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:481
|
||||
#: gtk/inspector/visual.ui:533
|
||||
msgid "Show Baselines"
|
||||
msgstr "საბაზისო ხაზების ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:509
|
||||
#: gtk/inspector/visual.ui:561
|
||||
msgid "Show Layout Borders"
|
||||
msgstr "განლაგების საზღვრების ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:566
|
||||
#: gtk/inspector/visual.ui:618
|
||||
msgid "CSS Padding"
|
||||
msgstr "CSS-ის შეწევა"
|
||||
|
||||
#: gtk/inspector/visual.ui:576
|
||||
#: gtk/inspector/visual.ui:628
|
||||
msgid "CSS Border"
|
||||
msgstr "CSS-ის საზღვარი"
|
||||
|
||||
#: gtk/inspector/visual.ui:586
|
||||
#: gtk/inspector/visual.ui:638
|
||||
msgid "CSS Margin"
|
||||
msgstr "CSS-ის შეწევა"
|
||||
|
||||
#: gtk/inspector/visual.ui:596
|
||||
#: gtk/inspector/visual.ui:648
|
||||
msgid "Widget Margin"
|
||||
msgstr "ვიჯეტის შეწევა"
|
||||
|
||||
#: gtk/inspector/visual.ui:631
|
||||
#: gtk/inspector/visual.ui:683
|
||||
msgid "Show Focus"
|
||||
msgstr "ფოკუსის ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:656
|
||||
#: gtk/inspector/visual.ui:708
|
||||
msgid "Show Accessibility warnings"
|
||||
msgstr "წვდომადობის გაფრთხილებების ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:681
|
||||
#: gtk/inspector/visual.ui:733
|
||||
msgid "Show Graphics Offload"
|
||||
msgstr "გრაფიკის რენდერის გატანის ჩვენება"
|
||||
|
||||
#: gtk/inspector/visual.ui:713
|
||||
#: gtk/inspector/visual.ui:765
|
||||
msgid "Inspect Inspector"
|
||||
msgstr "კონტროლის ინსპექტორი"
|
||||
|
||||
@@ -6584,35 +6599,29 @@ msgstr "დამატებითი"
|
||||
msgid "Some of the settings in the dialog conflict"
|
||||
msgstr "კონფლიქტი ფანჯრის რამდენიმე პარამეტრს შორის"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:542
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5668
|
||||
msgctxt "Print job priority"
|
||||
#. Translators: These strings name the possible values of the
|
||||
#. * job priority option in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5667
|
||||
msgid "Urgent"
|
||||
msgstr "გადაუდებელი"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:543
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5669
|
||||
msgctxt "Print job priority"
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5667
|
||||
msgid "High"
|
||||
msgstr "მაღალი"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:544
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5670
|
||||
msgctxt "Print job priority"
|
||||
msgid "Medium"
|
||||
msgstr "საშუალო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:545
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5671
|
||||
msgctxt "Print job priority"
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5667
|
||||
msgid "Low"
|
||||
msgstr "დაბალი"
|
||||
|
||||
#. Translators, this is the label used for the option in the print
|
||||
#. * dialog that controls the front cover page.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:567
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5814
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:562
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5809
|
||||
msgctxt "printer option"
|
||||
msgid "Before"
|
||||
msgstr "ჯერ"
|
||||
@@ -6620,33 +6629,33 @@ msgstr "ჯერ"
|
||||
#. Translators, this is the label used for the option in the print
|
||||
#. * dialog that controls the back cover page.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:574
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5829
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:569
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5824
|
||||
msgctxt "printer option"
|
||||
msgid "After"
|
||||
msgstr "შემდეგ"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:597
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:592
|
||||
msgid "Print at"
|
||||
msgstr "დაბეჭდვის დრო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:607
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:602
|
||||
msgid "Print at time"
|
||||
msgstr "დაბეჭდვის დრო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:670
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:665
|
||||
msgctxt "print option"
|
||||
msgid "Borderless"
|
||||
msgstr "საზღვრების გარეშე"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1530
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1525
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2636
|
||||
msgid "Paused; Rejecting Jobs"
|
||||
msgstr "შეყოვნებულია; დავალებების უარყოფა"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1536
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1531
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2642
|
||||
msgid "Rejecting Jobs"
|
||||
msgstr "დავალებების უარყოფა"
|
||||
@@ -7012,51 +7021,51 @@ msgstr "ნაგულისხმევი პრინტერი"
|
||||
#. Translators, this string is used to label the job priority option
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5702
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5697
|
||||
msgid "Job Priority"
|
||||
msgstr "ამოცანის პრიორიტეტი"
|
||||
|
||||
#. Translators, this string is used to label the billing info entry
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5713
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5708
|
||||
msgid "Billing Info"
|
||||
msgstr "ანგარიშთა ინფორმაცია"
|
||||
|
||||
#. Translators, these strings are names for various 'standard' cover
|
||||
#. * pages that the printing system may support.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5737
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5732
|
||||
msgctxt "cover page"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5738
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5733
|
||||
msgctxt "cover page"
|
||||
msgid "Classified"
|
||||
msgstr "საიდუმლო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5739
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5734
|
||||
msgctxt "cover page"
|
||||
msgid "Confidential"
|
||||
msgstr "კონფიდენციალური"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5740
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5735
|
||||
msgctxt "cover page"
|
||||
msgid "Secret"
|
||||
msgstr "სამხედრო საიდუმლო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5741
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5736
|
||||
msgctxt "cover page"
|
||||
msgid "Standard"
|
||||
msgstr "სტანდარტული"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5742
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5737
|
||||
msgctxt "cover page"
|
||||
msgid "Top Secret"
|
||||
msgstr "უმაღლესი დონის საიდუმლო"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5743
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5738
|
||||
msgctxt "cover page"
|
||||
msgid "Unclassified"
|
||||
msgstr "არასაიდუმლო"
|
||||
@@ -7064,7 +7073,7 @@ msgstr "არასაიდუმლო"
|
||||
#. Translators, this string is used to label the pages-per-sheet option
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5755
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5750
|
||||
msgctxt "printer option"
|
||||
msgid "Pages per Sheet"
|
||||
msgstr "გვერდები ფურცელზე"
|
||||
@@ -7072,7 +7081,7 @@ msgstr "გვერდები ფურცელზე"
|
||||
#. Translators, this string is used to label the option in the print
|
||||
#. * dialog that controls in what order multiple pages are arranged
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5772
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5767
|
||||
msgctxt "printer option"
|
||||
msgid "Page Ordering"
|
||||
msgstr "გვერდის დალაგება"
|
||||
@@ -7081,7 +7090,7 @@ msgstr "გვერდის დალაგება"
|
||||
#. * a print job is printed. Possible values are 'now', a specified time,
|
||||
#. * or 'on hold'
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5849
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5844
|
||||
msgctxt "printer option"
|
||||
msgid "Print at"
|
||||
msgstr "დაბეჭდვის დრო"
|
||||
@@ -7089,7 +7098,7 @@ msgstr "დაბეჭდვის დრო"
|
||||
#. Translators: this is the name of the option that allows the user
|
||||
#. * to specify a time when a print job will be printed.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5860
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5855
|
||||
msgctxt "printer option"
|
||||
msgid "Print at time"
|
||||
msgstr "დაბეჭდვის დრო"
|
||||
@@ -7099,19 +7108,19 @@ msgstr "დაბეჭდვის დრო"
|
||||
#. * the width and height in points. E.g: "Custom
|
||||
#. * 230.4x142.9"
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5907
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5902
|
||||
#, c-format
|
||||
msgid "Custom %s×%s"
|
||||
msgstr "ხელით %s×%s"
|
||||
|
||||
#. TRANSLATORS: this is the ICC color profile to use for this job
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6018
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6013
|
||||
msgctxt "printer option"
|
||||
msgid "Printer Profile"
|
||||
msgstr "პრინტერის პროფილი"
|
||||
|
||||
#. TRANSLATORS: this is when color profile information is unavailable
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6025
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6020
|
||||
msgctxt "printer option value"
|
||||
msgid "Unavailable"
|
||||
msgstr "მიუწვდომელია"
|
||||
@@ -7172,22 +7181,22 @@ msgstr "მიმდინარის მაგიერ ამ საქაღ
|
||||
msgid "Generate debug output"
|
||||
msgstr "პროგრამის გამართვის ინფორმაციის გენერაცია"
|
||||
|
||||
#: tools/encodesymbolic.c:95
|
||||
#: tools/encodesymbolic.c:92
|
||||
#, c-format
|
||||
msgid "Invalid size %s\n"
|
||||
msgstr "არასწორი ზომა: %s\n"
|
||||
|
||||
#: tools/encodesymbolic.c:107 tools/encodesymbolic.c:116
|
||||
#: tools/encodesymbolic.c:104 tools/encodesymbolic.c:113
|
||||
#, c-format
|
||||
msgid "Can’t load file: %s\n"
|
||||
msgstr "ფაილის ჩატვირთვა შეუძლებელია: \"%s\"\n"
|
||||
|
||||
#: tools/encodesymbolic.c:144 tools/encodesymbolic.c:162
|
||||
#: tools/encodesymbolic.c:141 tools/encodesymbolic.c:147
|
||||
#, c-format
|
||||
msgid "Can’t save file %s: %s\n"
|
||||
msgstr "ფაილის შენახვა შეუძლებელია: \"%s\": %s\n"
|
||||
|
||||
#: tools/encodesymbolic.c:168
|
||||
#: tools/encodesymbolic.c:153
|
||||
#, c-format
|
||||
msgid "Can’t close stream"
|
||||
msgstr "ნაკადის დახურვა შეუძლებელია"
|
||||
@@ -7260,7 +7269,7 @@ msgstr "სტილის CSS ფაილიდან გამოყენე
|
||||
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
|
||||
#: tools/gtk-builder-tool-validate.c:268
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:106
|
||||
#: tools/gtk-rendernode-tool-render.c:262 tools/gtk-rendernode-tool-show.c:113
|
||||
#: tools/gtk-rendernode-tool-render.c:203 tools/gtk-rendernode-tool-show.c:113
|
||||
#, c-format
|
||||
msgid "Could not initialize windowing system\n"
|
||||
msgstr "ფანჯრული სისტემის ინიციალიზაციის შეცდომა\n"
|
||||
@@ -7305,13 +7314,13 @@ msgstr ""
|
||||
"თავზე გადასაწერად გამოიყენეთ --force.\n"
|
||||
|
||||
#: tools/gtk-builder-tool-screenshot.c:332
|
||||
#: tools/gtk-rendernode-tool-render.c:230
|
||||
#: tools/gtk-rendernode-tool-render.c:171
|
||||
#, c-format
|
||||
msgid "Output written to %s.\n"
|
||||
msgstr "გამოტანილი ინფორმაცია ჩაწერილია %s-ში.\n"
|
||||
|
||||
#: tools/gtk-builder-tool-screenshot.c:336
|
||||
#: tools/gtk-rendernode-tool-render.c:234
|
||||
#: tools/gtk-rendernode-tool-render.c:175
|
||||
#, c-format
|
||||
msgid "Failed to save %s: %s\n"
|
||||
msgstr "\"%s'-ის შენახვის შეცდომა: %s\n"
|
||||
@@ -7330,7 +7339,7 @@ msgstr "არსებულ ფაილზე გადაწერა"
|
||||
|
||||
#: tools/gtk-builder-tool-screenshot.c:363
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:97
|
||||
#: tools/gtk-rendernode-tool-render.c:255
|
||||
#: tools/gtk-rendernode-tool-render.c:196
|
||||
msgid "FILE…"
|
||||
msgstr "FILE…"
|
||||
|
||||
@@ -7826,7 +7835,7 @@ msgstr "რენდერერის დამატება ტესტი
|
||||
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:94
|
||||
#: tools/gtk-rendernode-tool-compare.c:65
|
||||
#: tools/gtk-rendernode-tool-render.c:254
|
||||
#: tools/gtk-rendernode-tool-render.c:195
|
||||
msgid "RENDERER"
|
||||
msgstr "რენდერერი"
|
||||
|
||||
@@ -7847,7 +7856,7 @@ msgid "Benchmark rendering of a .node file."
|
||||
msgstr ".node ფაილის სატესტო რენდერი."
|
||||
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:127
|
||||
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:283
|
||||
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:224
|
||||
#: tools/gtk-rendernode-tool-show.c:134
|
||||
#, c-format
|
||||
msgid "No .node file specified\n"
|
||||
@@ -7859,7 +7868,7 @@ msgid "Can only benchmark a single .node file\n"
|
||||
msgstr "შეგიძლიათ მხოლოდ ერთი .node ფაილის დატესტვა\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-compare.c:65
|
||||
#: tools/gtk-rendernode-tool-render.c:254
|
||||
#: tools/gtk-rendernode-tool-render.c:195
|
||||
msgid "Renderer to use"
|
||||
msgstr "გამოყენებული რენდერერი"
|
||||
|
||||
@@ -7881,7 +7890,7 @@ msgid "Must specify two files\n"
|
||||
msgstr "აუცილებელია ორი ფაილის მითითება\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-compare.c:102
|
||||
#: tools/gtk-rendernode-tool-render.c:209
|
||||
#: tools/gtk-rendernode-tool-render.c:150
|
||||
#, c-format
|
||||
msgid "Failed to create renderer: %s\n"
|
||||
msgstr "რენდერერის შექმნა ჩავარდა: %s\n"
|
||||
@@ -7942,7 +7951,7 @@ msgstr "შეიყვანეთ ინფორმაცია რენდ
|
||||
msgid "Can only accept a single .node file\n"
|
||||
msgstr "შეგიძლიათ მხოლოდ ერთი .node ფაილის მიღება\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-render.c:170
|
||||
#: tools/gtk-rendernode-tool-render.c:123
|
||||
#, c-format
|
||||
msgid ""
|
||||
"File %s exists.\n"
|
||||
@@ -7952,17 +7961,16 @@ msgstr ""
|
||||
"თუ გნებავთ, თავზე გადააწეროთ, ფაილის სახელი მიუთითეთ.\n"
|
||||
"\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-render.c:184
|
||||
#: tools/gtk-rendernode-tool-render.c:196
|
||||
#: tools/gtk-rendernode-tool-render.c:137
|
||||
#, c-format
|
||||
msgid "Failed to generate SVG: %s\n"
|
||||
msgstr "შეცდომა SVG-ის გენერაციისას: %s\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-render.c:270
|
||||
#: tools/gtk-rendernode-tool-render.c:211
|
||||
msgid "Render a .node file to an image."
|
||||
msgstr ".ui ფაილის რენდერი გამოსახულებაში."
|
||||
|
||||
#: tools/gtk-rendernode-tool-render.c:289
|
||||
#: tools/gtk-rendernode-tool-render.c:230
|
||||
#, c-format
|
||||
msgid "Can only render a single .node file to a single output file\n"
|
||||
msgstr "ერთი .node ფაილის მხოლოდ ერთ გამოტანის ფაილში რენდერი შეგიძლიათ\n"
|
||||
@@ -8098,24 +8106,6 @@ msgstr ""
|
||||
"თუ მართლა გნებავთ, ხატულების კეში აქ შექმნათ, --ignore-theme-index "
|
||||
"გამოიყენეთ.\n"
|
||||
|
||||
#~ msgid "Antialiasing"
|
||||
#~ msgstr "მომრგვალება"
|
||||
|
||||
#~ msgid "Hinting"
|
||||
#~ msgstr "მომრგვალება"
|
||||
|
||||
#~ msgid "None"
|
||||
#~ msgstr "არცერთი"
|
||||
|
||||
#~ msgid "Slight"
|
||||
#~ msgstr "ოდნავ"
|
||||
|
||||
#~ msgid "Full"
|
||||
#~ msgstr "სრული"
|
||||
|
||||
#~ msgid "Metrics Hinting"
|
||||
#~ msgstr "მეტრიკის მომრგვალება"
|
||||
|
||||
#~ msgid "Backend does not support window scaling"
|
||||
#~ msgstr "უკანაბოლოს ფანჯრის მასშტაბირების მხარდაჭერა არ გააჩნია"
|
||||
|
||||
|
||||
@@ -269,17 +269,6 @@ add_tests_for_files_in_directory (GFile *dir)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
if (argc >= 2 && strcmp (argv[1], "--generate") == 0)
|
||||
{
|
||||
GFile *file;
|
||||
|
||||
file = g_file_new_for_commandline_arg (argv[2]);
|
||||
parse_css_file (file, TRUE);
|
||||
g_object_unref (file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
gtk_test_init (&argc, &argv);
|
||||
|
||||
if (argc < 2)
|
||||
@@ -293,14 +282,27 @@ main (int argc, char **argv)
|
||||
|
||||
g_object_unref (dir);
|
||||
}
|
||||
else if (strcmp (argv[1], "--generate") == 0)
|
||||
{
|
||||
if (argc >= 3)
|
||||
{
|
||||
GFile *file = g_file_new_for_commandline_arg (argv[2]);
|
||||
|
||||
parse_css_file (file, TRUE);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (guint i = 1; i < argc; i++)
|
||||
{
|
||||
GFile *file;
|
||||
guint i;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
GFile *file = g_file_new_for_commandline_arg (argv[i]);
|
||||
|
||||
file = g_file_new_for_commandline_arg (argv[i]);
|
||||
add_test_for_file (file);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
:root {
|
||||
--color1: red;
|
||||
--not-a-color: 20px;
|
||||
|
||||
/* A dependency cycle */
|
||||
--test1: var(--test2);
|
||||
@@ -95,6 +96,11 @@
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.label-7 {
|
||||
/* Invalid variable, but this declaration still wins over the one above */
|
||||
background-color: var(--not-a-color);
|
||||
}
|
||||
|
||||
@keyframes test {
|
||||
from {
|
||||
--test1: red;
|
||||
@@ -139,4 +145,3 @@
|
||||
--duration2: var(--duration, 4s);
|
||||
transition-duration: var(--duration2, 5s);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,184 +1,189 @@
|
||||
window.background:dir(ltr)
|
||||
--color1: red; /* variables.css:2:13-16 */
|
||||
--color1: red; /* variables.css:2:3-17 */
|
||||
--not-a-color: 20px; /* variables.css:3:3-23 */
|
||||
|
||||
box.horizontal:dir(ltr)
|
||||
--color1: red; /* variables.css:2:13-16 */
|
||||
--color1: red; /* variables.css:2:3-17 */
|
||||
--not-a-color: 20px; /* variables.css:3:3-23 */
|
||||
|
||||
label.label-1:dir(ltr)
|
||||
color: rgb(255,0,0); /* variables.css:10:3-24 */
|
||||
background-color: rgb(255,0,0); /* variables.css:13:3-42 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:16:3-65 */
|
||||
--color1: red; /* variables.css:2:13-16 */
|
||||
color: rgb(255,0,0); /* variables.css:11:3-24 */
|
||||
background-color: rgb(255,0,0); /* variables.css:14:3-42 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:17:3-65 */
|
||||
--color1: red; /* variables.css:2:3-17 */
|
||||
--not-a-color: 20px; /* variables.css:3:3-23 */
|
||||
label.label-2:dir(ltr)
|
||||
color: rgb(255,255,0); /* variables.css:22:3-24 */
|
||||
background-color: rgb(0,128,0); /* variables.css:25:3-42 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:28:3-50 */
|
||||
--color1: yellow; /* variables.css:21:13-19 */
|
||||
color: rgb(255,255,0); /* variables.css:23:3-24 */
|
||||
background-color: rgb(0,128,0); /* variables.css:26:3-42 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:29:3-50 */
|
||||
--color1: yellow; /* variables.css:22:3-20 */
|
||||
label.label-3:dir(ltr)
|
||||
color: rgb(0,128,0); /* variables.css:34:3-31 */
|
||||
border-top-style: solid; /* variables.css:39:3-46 */
|
||||
border-top-width: 3px; /* variables.css:39:3-46 */
|
||||
border-left-style: solid; /* variables.css:39:3-46 */
|
||||
border-left-width: 3px; /* variables.css:39:3-46 */
|
||||
border-bottom-style: solid; /* variables.css:39:3-46 */
|
||||
border-bottom-width: 3px; /* variables.css:39:3-46 */
|
||||
border-right-style: solid; /* variables.css:39:3-46 */
|
||||
border-right-width: 3px; /* variables.css:39:3-46 */
|
||||
border-top-color: rgb(255,0,0); /* variables.css:39:3-46 */
|
||||
border-right-color: rgb(255,0,0); /* variables.css:39:3-46 */
|
||||
border-bottom-color: rgb(255,0,0); /* variables.css:39:3-46 */
|
||||
border-left-color: rgb(255,0,0); /* variables.css:39:3-46 */
|
||||
border-image-source: none; /* variables.css:39:3-46 */
|
||||
border-image-repeat: stretch; /* variables.css:39:3-46 */
|
||||
border-image-slice: 100%; /* variables.css:39:3-46 */
|
||||
border-image-width: 1; /* variables.css:39:3-46 */
|
||||
--border1: 3px; /* variables.css:37:14-17 */
|
||||
--border2: solid red; /* variables.css:38:14-23 */
|
||||
--color1: initial; /* variables.css:33:13-20 */
|
||||
color: rgb(0,128,0); /* variables.css:35:3-31 */
|
||||
border-top-style: solid; /* variables.css:40:3-46 */
|
||||
border-top-width: 3px; /* variables.css:40:3-46 */
|
||||
border-left-style: solid; /* variables.css:40:3-46 */
|
||||
border-left-width: 3px; /* variables.css:40:3-46 */
|
||||
border-bottom-style: solid; /* variables.css:40:3-46 */
|
||||
border-bottom-width: 3px; /* variables.css:40:3-46 */
|
||||
border-right-style: solid; /* variables.css:40:3-46 */
|
||||
border-right-width: 3px; /* variables.css:40:3-46 */
|
||||
border-top-color: rgb(255,0,0); /* variables.css:40:3-46 */
|
||||
border-right-color: rgb(255,0,0); /* variables.css:40:3-46 */
|
||||
border-bottom-color: rgb(255,0,0); /* variables.css:40:3-46 */
|
||||
border-left-color: rgb(255,0,0); /* variables.css:40:3-46 */
|
||||
border-image-source: none; /* variables.css:40:3-46 */
|
||||
border-image-repeat: stretch; /* variables.css:40:3-46 */
|
||||
border-image-slice: 100%; /* variables.css:40:3-46 */
|
||||
border-image-width: 1; /* variables.css:40:3-46 */
|
||||
--border1: 3px; /* variables.css:38:3-18 */
|
||||
--border2: solid red; /* variables.css:39:3-24 */
|
||||
--color1: initial; /* variables.css:34:3-21 */
|
||||
label.label-4:dir(ltr)
|
||||
color: rgb(0,128,0); /* variables.css:45:3-30 */
|
||||
background-color: rgb(128,0,128); /* variables.css:49:3-42 */
|
||||
color: rgb(0,128,0); /* variables.css:46:3-30 */
|
||||
background-color: rgb(128,0,128); /* variables.css:50:3-42 */
|
||||
label.label-5:dir(ltr)
|
||||
color: rgb(255,0,0); /* variables.css:55:3-30 */
|
||||
background-color: rgb(0,128,0); /* variables.css:56:3-41 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:81:3-50 */
|
||||
--prop1: lol; /* variables.css:58:12-15 */
|
||||
--prop10: var(--prop9) var(--prop9); /* variables.css:67:13-38 */
|
||||
--prop11: var(--prop10) var(--prop10); /* variables.css:68:13-40 */
|
||||
--prop12: var(--prop11) var(--prop11); /* variables.css:69:13-40 */
|
||||
--prop13: var(--prop12) var(--prop12); /* variables.css:70:13-40 */
|
||||
--prop14: var(--prop13) var(--prop13); /* variables.css:71:13-40 */
|
||||
--prop15: var(--prop14) var(--prop14); /* variables.css:72:13-40 */
|
||||
--prop16: var(--prop15) var(--prop15); /* variables.css:73:13-40 */
|
||||
--prop17: var(--prop16) var(--prop16); /* variables.css:74:13-40 */
|
||||
--prop18: var(--prop17) var(--prop17); /* variables.css:75:13-40 */
|
||||
--prop19: var(--prop18) var(--prop18); /* variables.css:76:13-40 */
|
||||
--prop2: var(--prop1) var(--prop1); /* variables.css:59:12-37 */
|
||||
--prop20: var(--prop19) var(--prop19); /* variables.css:77:13-40 */
|
||||
--prop3: var(--prop2) var(--prop2); /* variables.css:60:12-37 */
|
||||
--prop4: var(--prop3) var(--prop3); /* variables.css:61:12-37 */
|
||||
--prop5: var(--prop4) var(--prop4); /* variables.css:62:12-37 */
|
||||
--prop6: var(--prop5) var(--prop5); /* variables.css:63:12-37 */
|
||||
--prop7: var(--prop6) var(--prop6); /* variables.css:64:12-37 */
|
||||
--prop8: var(--prop7) var(--prop7); /* variables.css:65:12-37 */
|
||||
--prop9: var(--prop8) var(--prop8); /* variables.css:66:12-37 */
|
||||
--test1: red; /* variables.css:54:12-15 */
|
||||
color: rgb(255,0,0); /* variables.css:56:3-30 */
|
||||
background-color: rgb(0,128,0); /* variables.css:57:3-41 */
|
||||
box-shadow: 0 0 3px rgb(0,128,0) inset; /* variables.css:82:3-50 */
|
||||
--prop1: lol; /* variables.css:59:3-16 */
|
||||
--prop10: var(--prop9) var(--prop9); /* variables.css:68:3-39 */
|
||||
--prop11: var(--prop10) var(--prop10); /* variables.css:69:3-41 */
|
||||
--prop12: var(--prop11) var(--prop11); /* variables.css:70:3-41 */
|
||||
--prop13: var(--prop12) var(--prop12); /* variables.css:71:3-41 */
|
||||
--prop14: var(--prop13) var(--prop13); /* variables.css:72:3-41 */
|
||||
--prop15: var(--prop14) var(--prop14); /* variables.css:73:3-41 */
|
||||
--prop16: var(--prop15) var(--prop15); /* variables.css:74:3-41 */
|
||||
--prop17: var(--prop16) var(--prop16); /* variables.css:75:3-41 */
|
||||
--prop18: var(--prop17) var(--prop17); /* variables.css:76:3-41 */
|
||||
--prop19: var(--prop18) var(--prop18); /* variables.css:77:3-41 */
|
||||
--prop2: var(--prop1) var(--prop1); /* variables.css:60:3-38 */
|
||||
--prop20: var(--prop19) var(--prop19); /* variables.css:78:3-41 */
|
||||
--prop3: var(--prop2) var(--prop2); /* variables.css:61:3-38 */
|
||||
--prop4: var(--prop3) var(--prop3); /* variables.css:62:3-38 */
|
||||
--prop5: var(--prop4) var(--prop4); /* variables.css:63:3-38 */
|
||||
--prop6: var(--prop5) var(--prop5); /* variables.css:64:3-38 */
|
||||
--prop7: var(--prop6) var(--prop6); /* variables.css:65:3-38 */
|
||||
--prop8: var(--prop7) var(--prop7); /* variables.css:66:3-38 */
|
||||
--prop9: var(--prop8) var(--prop8); /* variables.css:67:3-38 */
|
||||
--test1: red; /* variables.css:55:3-16 */
|
||||
label.label-6:dir(ltr)
|
||||
color: rgb(255,0,0); /* variables.css:88:3-31 */
|
||||
-gtk-dpi: 96; /* variables.css:85:3-14 */
|
||||
font-size: 13.333333333333334px; /* variables.css:85:3-14 */
|
||||
-gtk-icon-palette: error rgb(255,255,255), success rgb(255,255,255), warning rgb(255,255,255); /* variables.css:85:3-14 */
|
||||
background-color: rgba(0,0,0,0); /* variables.css:85:3-14 */
|
||||
font-family: "Sans"; /* variables.css:85:3-14 */
|
||||
font-style: normal; /* variables.css:85:3-14 */
|
||||
font-weight: 400; /* variables.css:85:3-14 */
|
||||
font-stretch: normal; /* variables.css:85:3-14 */
|
||||
letter-spacing: 0; /* variables.css:85:3-14 */
|
||||
text-decoration-line: none; /* variables.css:85:3-14 */
|
||||
text-decoration-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
text-decoration-style: solid; /* variables.css:85:3-14 */
|
||||
text-transform: none; /* variables.css:85:3-14 */
|
||||
font-kerning: auto; /* variables.css:85:3-14 */
|
||||
font-variant-ligatures: normal; /* variables.css:85:3-14 */
|
||||
font-variant-position: normal; /* variables.css:85:3-14 */
|
||||
font-variant-caps: normal; /* variables.css:85:3-14 */
|
||||
font-variant-numeric: normal; /* variables.css:85:3-14 */
|
||||
font-variant-alternates: normal; /* variables.css:85:3-14 */
|
||||
font-variant-east-asian: normal; /* variables.css:85:3-14 */
|
||||
text-shadow: none; /* variables.css:85:3-14 */
|
||||
box-shadow: none; /* variables.css:85:3-14 */
|
||||
margin-top: 0; /* variables.css:85:3-14 */
|
||||
margin-left: 0; /* variables.css:85:3-14 */
|
||||
margin-bottom: 0; /* variables.css:85:3-14 */
|
||||
margin-right: 0; /* variables.css:85:3-14 */
|
||||
padding-top: 0; /* variables.css:85:3-14 */
|
||||
padding-left: 0; /* variables.css:85:3-14 */
|
||||
padding-bottom: 0; /* variables.css:85:3-14 */
|
||||
padding-right: 0; /* variables.css:85:3-14 */
|
||||
border-top-style: none; /* variables.css:85:3-14 */
|
||||
border-top-width: 0; /* variables.css:85:3-14 */
|
||||
border-left-style: none; /* variables.css:85:3-14 */
|
||||
border-left-width: 0; /* variables.css:85:3-14 */
|
||||
border-bottom-style: none; /* variables.css:85:3-14 */
|
||||
border-bottom-width: 0; /* variables.css:85:3-14 */
|
||||
border-right-style: none; /* variables.css:85:3-14 */
|
||||
border-right-width: 0; /* variables.css:85:3-14 */
|
||||
border-top-left-radius: 0; /* variables.css:85:3-14 */
|
||||
border-top-right-radius: 0; /* variables.css:85:3-14 */
|
||||
border-bottom-right-radius: 0; /* variables.css:85:3-14 */
|
||||
border-bottom-left-radius: 0; /* variables.css:85:3-14 */
|
||||
outline-style: none; /* variables.css:85:3-14 */
|
||||
outline-width: 0; /* variables.css:85:3-14 */
|
||||
outline-offset: 0; /* variables.css:85:3-14 */
|
||||
background-clip: border-box; /* variables.css:85:3-14 */
|
||||
background-origin: padding-box; /* variables.css:85:3-14 */
|
||||
background-size: auto; /* variables.css:85:3-14 */
|
||||
background-position: left top; /* variables.css:85:3-14 */
|
||||
border-top-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
border-right-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
border-bottom-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
border-left-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
outline-color: rgb(255,0,0); /* variables.css:85:3-14 */
|
||||
background-repeat: repeat; /* variables.css:85:3-14 */
|
||||
background-image: none; /* variables.css:85:3-14 */
|
||||
background-blend-mode: normal; /* variables.css:85:3-14 */
|
||||
border-image-source: none; /* variables.css:85:3-14 */
|
||||
border-image-repeat: stretch; /* variables.css:85:3-14 */
|
||||
border-image-slice: 100%; /* variables.css:85:3-14 */
|
||||
border-image-width: 1; /* variables.css:85:3-14 */
|
||||
-gtk-icon-source: none; /* variables.css:85:3-14 */
|
||||
-gtk-icon-size: 16px; /* variables.css:85:3-14 */
|
||||
-gtk-icon-shadow: none; /* variables.css:85:3-14 */
|
||||
-gtk-icon-style: requested; /* variables.css:85:3-14 */
|
||||
-gtk-icon-transform: none; /* variables.css:85:3-14 */
|
||||
-gtk-icon-filter: none; /* variables.css:85:3-14 */
|
||||
border-spacing: 0 0; /* variables.css:85:3-14 */
|
||||
transform: none; /* variables.css:85:3-14 */
|
||||
transform-origin: center; /* variables.css:85:3-14 */
|
||||
min-width: 0; /* variables.css:85:3-14 */
|
||||
min-height: 0; /* variables.css:85:3-14 */
|
||||
transition-property: all; /* variables.css:85:3-14 */
|
||||
transition-duration: 0; /* variables.css:85:3-14 */
|
||||
transition-timing-function: ease; /* variables.css:85:3-14 */
|
||||
transition-delay: 0; /* variables.css:85:3-14 */
|
||||
animation-name: none; /* variables.css:85:3-14 */
|
||||
animation-duration: 0; /* variables.css:85:3-14 */
|
||||
animation-timing-function: ease; /* variables.css:85:3-14 */
|
||||
animation-iteration-count: 1; /* variables.css:85:3-14 */
|
||||
animation-direction: normal; /* variables.css:85:3-14 */
|
||||
animation-play-state: running; /* variables.css:85:3-14 */
|
||||
animation-delay: 0; /* variables.css:85:3-14 */
|
||||
animation-fill-mode: none; /* variables.css:85:3-14 */
|
||||
opacity: 1; /* variables.css:85:3-14 */
|
||||
filter: none; /* variables.css:85:3-14 */
|
||||
caret-color: rgb(255,255,255); /* variables.css:85:3-14 */
|
||||
-gtk-secondary-caret-color: rgb(255,255,255); /* variables.css:85:3-14 */
|
||||
font-feature-settings: normal; /* variables.css:85:3-14 */
|
||||
font-variation-settings: normal; /* variables.css:85:3-14 */
|
||||
line-height: normal; /* variables.css:85:3-14 */
|
||||
--color1: red; /* variables.css:2:13-16 */
|
||||
color: rgb(255,0,0); /* variables.css:89:3-31 */
|
||||
-gtk-dpi: 96; /* variables.css:86:3-14 */
|
||||
font-size: 13.333333333333334px; /* variables.css:86:3-14 */
|
||||
-gtk-icon-palette: error rgb(255,255,255), success rgb(255,255,255), warning rgb(255,255,255); /* variables.css:86:3-14 */
|
||||
background-color: rgba(0,0,0,0); /* variables.css:86:3-14 */
|
||||
font-family: "Sans"; /* variables.css:86:3-14 */
|
||||
font-style: normal; /* variables.css:86:3-14 */
|
||||
font-weight: 400; /* variables.css:86:3-14 */
|
||||
font-stretch: normal; /* variables.css:86:3-14 */
|
||||
letter-spacing: 0; /* variables.css:86:3-14 */
|
||||
text-decoration-line: none; /* variables.css:86:3-14 */
|
||||
text-decoration-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
text-decoration-style: solid; /* variables.css:86:3-14 */
|
||||
text-transform: none; /* variables.css:86:3-14 */
|
||||
font-kerning: auto; /* variables.css:86:3-14 */
|
||||
font-variant-ligatures: normal; /* variables.css:86:3-14 */
|
||||
font-variant-position: normal; /* variables.css:86:3-14 */
|
||||
font-variant-caps: normal; /* variables.css:86:3-14 */
|
||||
font-variant-numeric: normal; /* variables.css:86:3-14 */
|
||||
font-variant-alternates: normal; /* variables.css:86:3-14 */
|
||||
font-variant-east-asian: normal; /* variables.css:86:3-14 */
|
||||
text-shadow: none; /* variables.css:86:3-14 */
|
||||
box-shadow: none; /* variables.css:86:3-14 */
|
||||
margin-top: 0; /* variables.css:86:3-14 */
|
||||
margin-left: 0; /* variables.css:86:3-14 */
|
||||
margin-bottom: 0; /* variables.css:86:3-14 */
|
||||
margin-right: 0; /* variables.css:86:3-14 */
|
||||
padding-top: 0; /* variables.css:86:3-14 */
|
||||
padding-left: 0; /* variables.css:86:3-14 */
|
||||
padding-bottom: 0; /* variables.css:86:3-14 */
|
||||
padding-right: 0; /* variables.css:86:3-14 */
|
||||
border-top-style: none; /* variables.css:86:3-14 */
|
||||
border-top-width: 0; /* variables.css:86:3-14 */
|
||||
border-left-style: none; /* variables.css:86:3-14 */
|
||||
border-left-width: 0; /* variables.css:86:3-14 */
|
||||
border-bottom-style: none; /* variables.css:86:3-14 */
|
||||
border-bottom-width: 0; /* variables.css:86:3-14 */
|
||||
border-right-style: none; /* variables.css:86:3-14 */
|
||||
border-right-width: 0; /* variables.css:86:3-14 */
|
||||
border-top-left-radius: 0; /* variables.css:86:3-14 */
|
||||
border-top-right-radius: 0; /* variables.css:86:3-14 */
|
||||
border-bottom-right-radius: 0; /* variables.css:86:3-14 */
|
||||
border-bottom-left-radius: 0; /* variables.css:86:3-14 */
|
||||
outline-style: none; /* variables.css:86:3-14 */
|
||||
outline-width: 0; /* variables.css:86:3-14 */
|
||||
outline-offset: 0; /* variables.css:86:3-14 */
|
||||
background-clip: border-box; /* variables.css:86:3-14 */
|
||||
background-origin: padding-box; /* variables.css:86:3-14 */
|
||||
background-size: auto; /* variables.css:86:3-14 */
|
||||
background-position: left top; /* variables.css:86:3-14 */
|
||||
border-top-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
border-right-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
border-bottom-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
border-left-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
outline-color: rgb(255,0,0); /* variables.css:86:3-14 */
|
||||
background-repeat: repeat; /* variables.css:86:3-14 */
|
||||
background-image: none; /* variables.css:86:3-14 */
|
||||
background-blend-mode: normal; /* variables.css:86:3-14 */
|
||||
border-image-source: none; /* variables.css:86:3-14 */
|
||||
border-image-repeat: stretch; /* variables.css:86:3-14 */
|
||||
border-image-slice: 100%; /* variables.css:86:3-14 */
|
||||
border-image-width: 1; /* variables.css:86:3-14 */
|
||||
-gtk-icon-source: none; /* variables.css:86:3-14 */
|
||||
-gtk-icon-size: 16px; /* variables.css:86:3-14 */
|
||||
-gtk-icon-shadow: none; /* variables.css:86:3-14 */
|
||||
-gtk-icon-style: requested; /* variables.css:86:3-14 */
|
||||
-gtk-icon-transform: none; /* variables.css:86:3-14 */
|
||||
-gtk-icon-filter: none; /* variables.css:86:3-14 */
|
||||
border-spacing: 0 0; /* variables.css:86:3-14 */
|
||||
transform: none; /* variables.css:86:3-14 */
|
||||
transform-origin: center; /* variables.css:86:3-14 */
|
||||
min-width: 0; /* variables.css:86:3-14 */
|
||||
min-height: 0; /* variables.css:86:3-14 */
|
||||
transition-property: all; /* variables.css:86:3-14 */
|
||||
transition-duration: 0; /* variables.css:86:3-14 */
|
||||
transition-timing-function: ease; /* variables.css:86:3-14 */
|
||||
transition-delay: 0; /* variables.css:86:3-14 */
|
||||
animation-name: none; /* variables.css:86:3-14 */
|
||||
animation-duration: 0; /* variables.css:86:3-14 */
|
||||
animation-timing-function: ease; /* variables.css:86:3-14 */
|
||||
animation-iteration-count: 1; /* variables.css:86:3-14 */
|
||||
animation-direction: normal; /* variables.css:86:3-14 */
|
||||
animation-play-state: running; /* variables.css:86:3-14 */
|
||||
animation-delay: 0; /* variables.css:86:3-14 */
|
||||
animation-fill-mode: none; /* variables.css:86:3-14 */
|
||||
opacity: 1; /* variables.css:86:3-14 */
|
||||
filter: none; /* variables.css:86:3-14 */
|
||||
caret-color: rgb(255,255,255); /* variables.css:86:3-14 */
|
||||
-gtk-secondary-caret-color: rgb(255,255,255); /* variables.css:86:3-14 */
|
||||
font-feature-settings: normal; /* variables.css:86:3-14 */
|
||||
font-variation-settings: normal; /* variables.css:86:3-14 */
|
||||
line-height: normal; /* variables.css:86:3-14 */
|
||||
--color1: red; /* variables.css:2:3-17 */
|
||||
--not-a-color: 20px; /* variables.css:3:3-23 */
|
||||
label.label-7:dir(ltr)
|
||||
color: rgb(255,0,0); /* variables.css:93:3-39 */
|
||||
background-color: rgb(255,0,0); /* variables.css:95:3-25 */
|
||||
--color1: red; /* variables.css:2:13-16 */
|
||||
color: rgb(255,0,0); /* variables.css:94:3-39 */
|
||||
background-color: rgba(0,0,0,0); /* variables.css:101:3-40 */
|
||||
--color1: red; /* variables.css:2:3-17 */
|
||||
--not-a-color: 20px; /* variables.css:3:3-23 */
|
||||
label.label-8:dir(ltr)
|
||||
color: rgb(255,192,203); /* variables.css:130:3-31 */
|
||||
background-color: rgb(255,255,0); /* variables.css:133:3-42 */
|
||||
box-shadow: 0 0 3px rgb(255,255,0) inset; /* variables.css:136:3-50 */
|
||||
padding-left: 1px; /* variables.css:118:3-19 */
|
||||
padding-right: 10px; /* variables.css:119:3-20 */
|
||||
transition-duration: 4s; /* variables.css:140:3-45 */
|
||||
animation-name: test; /* variables.css:125:3-39 */
|
||||
animation-duration: 10s; /* variables.css:125:3-39 */
|
||||
animation-timing-function: linear; /* variables.css:125:3-39 */
|
||||
animation-iteration-count: infinite; /* variables.css:125:3-39 */
|
||||
animation-direction: normal; /* variables.css:125:3-39 */
|
||||
animation-delay: 0; /* variables.css:125:3-39 */
|
||||
animation-fill-mode: none; /* variables.css:125:3-39 */
|
||||
color: rgb(255,0,0); /* variables.css:136:3-31 */
|
||||
background-color: rgb(0,0,255); /* variables.css:139:3-42 */
|
||||
box-shadow: 0 0 3px rgb(255,255,0) inset; /* variables.css:142:3-50 */
|
||||
padding-left: 1px; /* variables.css:124:3-19 */
|
||||
padding-right: 10px; /* variables.css:125:3-20 */
|
||||
transition-duration: 5s; /* variables.css:146:3-45 */
|
||||
animation-name: test; /* variables.css:131:3-39 */
|
||||
animation-duration: 10s; /* variables.css:131:3-39 */
|
||||
animation-timing-function: linear; /* variables.css:131:3-39 */
|
||||
animation-iteration-count: infinite; /* variables.css:131:3-39 */
|
||||
animation-direction: normal; /* variables.css:131:3-39 */
|
||||
animation-delay: 0; /* variables.css:131:3-39 */
|
||||
animation-fill-mode: none; /* variables.css:131:3-39 */
|
||||
--duration: 2s;
|
||||
--duration2: var(--duration, 4s); /* variables.css:139:16-35 */
|
||||
--duration2: var(--duration, 4s); /* variables.css:145:3-36 */
|
||||
--padding-right: 10px;
|
||||
--padding1: 1px; /* variables.css:121:15-18 */
|
||||
--padding2: 2px; /* variables.css:122:15-18 */
|
||||
--padding1: 1px; /* variables.css:127:3-19 */
|
||||
--padding2: 2px; /* variables.css:128:3-19 */
|
||||
--test1: red;
|
||||
--test2: blue;
|
||||
|
||||
@@ -43,7 +43,7 @@ value_is_near (int prop,
|
||||
GtkCssValue *value1,
|
||||
GtkCssValue *value2)
|
||||
{
|
||||
if (gtk_css_value_equal (value1, value2))
|
||||
if (_gtk_css_value_equal (value1, value2))
|
||||
return TRUE;
|
||||
|
||||
switch (prop)
|
||||
@@ -85,8 +85,8 @@ assert_css_value (int prop,
|
||||
if (((result == NULL) != (expected == NULL)) ||
|
||||
!value_is_near (prop, result, expected))
|
||||
{
|
||||
char *r = result ? gtk_css_value_to_string (result) : g_strdup ("(nil)");
|
||||
char *e = expected ? gtk_css_value_to_string (expected) : g_strdup ("(nil)");
|
||||
char *r = result ? _gtk_css_value_to_string (result) : g_strdup ("(nil)");
|
||||
char *e = expected ? _gtk_css_value_to_string (expected) : g_strdup ("(nil)");
|
||||
g_print ("Expected %s\nGot %s\n", e, r);
|
||||
g_free (r);
|
||||
g_free (e);
|
||||
@@ -215,35 +215,31 @@ test_transition (gconstpointer data)
|
||||
GtkCssValue *result;
|
||||
GtkStyleProvider *provider;
|
||||
GtkCssStyle *style;
|
||||
GtkCssComputeContext context = { NULL, };
|
||||
|
||||
provider = GTK_STYLE_PROVIDER (gtk_settings_get_default ());
|
||||
style = gtk_css_static_style_get_default ();
|
||||
|
||||
context.provider = provider;
|
||||
context.style = style;
|
||||
|
||||
prop = (GtkStyleProperty *)_gtk_css_style_property_lookup_by_id (test->prop);
|
||||
|
||||
value1 = value_from_string (prop, test->value1);
|
||||
g_assert_nonnull (value1);
|
||||
computed1 = gtk_css_value_compute (value1, test->prop, &context);
|
||||
computed1 = _gtk_css_value_compute (value1, test->prop, provider, style, NULL, NULL);
|
||||
|
||||
value2 = value_from_string (prop, test->value2);
|
||||
g_assert_nonnull (value2);
|
||||
computed2 = gtk_css_value_compute (value2, test->prop, &context);
|
||||
computed2 = _gtk_css_value_compute (value2, test->prop, provider, style, NULL, NULL);
|
||||
|
||||
if (test->value3)
|
||||
{
|
||||
value3 = value_from_string (prop, test->value3);
|
||||
computed3 = gtk_css_value_compute (value3, test->prop, &context);
|
||||
computed3 = _gtk_css_value_compute (value3, test->prop, provider, style, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
value3 = computed3 = NULL;
|
||||
}
|
||||
|
||||
result = gtk_css_value_transition (computed1, computed2, test->prop, test->progress);
|
||||
result = _gtk_css_value_transition (computed1, computed2, test->prop, test->progress);
|
||||
assert_css_value (test->prop, result, computed3);
|
||||
|
||||
gtk_css_value_unref (value1);
|
||||
|
||||
@@ -110,7 +110,6 @@ gdk_array(test_splice) (void)
|
||||
#undef gdk_array_paste
|
||||
#undef gdk_array
|
||||
#undef GDK_ARRAY_REAL_SIZE
|
||||
#undef GDK_ARRAY_MAX_SIZE
|
||||
|
||||
#undef GDK_ARRAY_ELEMENT_TYPE
|
||||
#undef GDK_ARRAY_NAME
|
||||
|
||||
Reference in New Issue
Block a user