Compare commits
1 Commits
icon-provi
...
uberless-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2af0682074 |
48
NEWS
48
NEWS
@@ -1,54 +1,6 @@
|
||||
Overview of Changes in 4.15.1, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
* GtkGraphicsOffload:
|
||||
- Don't crash without a child
|
||||
|
||||
* CSS:
|
||||
- Support the :root selector
|
||||
|
||||
* Icontheme:
|
||||
- Make symbolic svg loading more efficient
|
||||
- Handle color-free symbolics more efficiently
|
||||
|
||||
* Accessibility:
|
||||
- Make the gtk-demo sidebar search more accessible
|
||||
- Stop emitting focus events
|
||||
|
||||
* GDK:
|
||||
- Support XDG_ACTIVATION_TOKEN
|
||||
- dmabuf: Be more defensive when importing unknown formats to GL
|
||||
- dmabuf: Use narrow range for YUV
|
||||
|
||||
* GSK:
|
||||
- Improve logging for GDK_DEBUG=offload
|
||||
- Improve logging for GSK_DEBUG=renderer
|
||||
- gpu: Warn about inefficient texture import
|
||||
- gpu: Handle tiny offscreens correctly
|
||||
- vulkan: Add profiler marks in various places
|
||||
- vulkan: Fix a problem with imported dmabufs showing up black
|
||||
|
||||
* Wayland:
|
||||
- Use wl_compositor version 6
|
||||
|
||||
* X11:
|
||||
- Implement a missing method
|
||||
|
||||
* Build:
|
||||
- Fix many ubsan warnings
|
||||
|
||||
* Debugging:
|
||||
- Show more texture details in the recorder
|
||||
|
||||
* macOS:
|
||||
- Fix problems with events handed back to the OS
|
||||
- Respect GDK_DEBUG=default-settings
|
||||
|
||||
* Translation updates:
|
||||
Korean
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.15.0, 21-04-2024
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -363,9 +363,7 @@ insert_markup_idle (gpointer data)
|
||||
|
||||
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
||||
{
|
||||
guint id;
|
||||
id = g_idle_add (insert_markup_idle, data);
|
||||
g_source_set_name_by_id (id, "[gtk-demo] insert_markup_idle");
|
||||
g_idle_add (insert_markup_idle, data);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -400,9 +398,7 @@ parse_markup_idle (gpointer data)
|
||||
do {
|
||||
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
||||
{
|
||||
guint id;
|
||||
id = g_idle_add (parse_markup_idle, data);
|
||||
g_source_set_name_by_id (id, "[gtk-demo] parse_markup_idle");
|
||||
g_idle_add (parse_markup_idle, data);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
|
||||
{
|
||||
wchar_t *langname_w = NULL;
|
||||
wchar_t locale_abbrev_w[9];
|
||||
gchar *langname, *locale_abbrev, *locale;
|
||||
gchar *langname, *locale_abbrev, *locale, *p;
|
||||
gint i;
|
||||
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
|
||||
GHashTable *ht_scripts_langs = (GHashTable *) param;
|
||||
@@ -59,6 +59,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
|
||||
GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, langname_size);
|
||||
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
|
||||
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
|
||||
p = strchr (locale, '-');
|
||||
lang = pango_language_from_string (locale);
|
||||
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
|
||||
g_hash_table_insert (ht_scripts_langs, lang, langname);
|
||||
|
||||
@@ -330,7 +330,6 @@ stroke bounds of the path.
|
||||
| offset | `<point>` | 0 0 | non-default |
|
||||
| hint-style | `<hint style>` | slight | non-default |
|
||||
| antialias | `<antialias>` | gray | non-default |
|
||||
| hint-metrics | `<hint metrics>` | off | non-default |
|
||||
|
||||
Creates a node like `gsk_text_node_new()` with the given properties.
|
||||
|
||||
@@ -347,7 +346,6 @@ font, an error node will be returned.
|
||||
|
||||
Possible values for hint-style are none, slight or full.
|
||||
Possible value for antialias are none or gray.
|
||||
Possible value for hint-metrics are on or off.
|
||||
|
||||
### texture
|
||||
|
||||
|
||||
@@ -155,7 +155,6 @@ Each property name is part of the `GtkAccessibleProperty` enumeration.
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN | “aria-valuemin” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW | “aria-valuenow” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT | “aria-valuetext” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_HELP_TEXT | N/A | translatable string |
|
||||
|
||||
#### List of accessible relations
|
||||
|
||||
@@ -217,10 +216,6 @@ are accessible as part of the development process. The GTK Inspector shows
|
||||
the accessible attributes of each widget, and also provides an overlay that
|
||||
can highlight accessibility issues.
|
||||
|
||||
If you support some non-standard keyboard interactions for a widget, you
|
||||
**should** set an appropriate `GTK_ACCESSIBLE_PROPERTY_HELP_TEXT` to help
|
||||
discoverability of the behavior.
|
||||
|
||||
It is possible to set accessible attributes in UI files as well:
|
||||
```xml
|
||||
<object class="GtkButton" id="button1">
|
||||
|
||||
@@ -163,8 +163,6 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
||||
return NULL;
|
||||
|
||||
previous = gdk_gl_context_get_current ();
|
||||
if (previous)
|
||||
g_object_ref (previous);
|
||||
formats = gdk_dmabuf_formats_builder_new ();
|
||||
external = gdk_dmabuf_formats_builder_new ();
|
||||
|
||||
@@ -196,10 +194,7 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
||||
}
|
||||
|
||||
if (previous)
|
||||
{
|
||||
gdk_gl_context_make_current (previous);
|
||||
g_object_unref (previous);
|
||||
}
|
||||
gdk_gl_context_make_current (previous);
|
||||
|
||||
return GDK_DMABUF_DOWNLOADER (renderer);
|
||||
}
|
||||
|
||||
@@ -1956,6 +1956,8 @@ gdk_gl_context_get_glsl_version_string (GdkGLContext *self)
|
||||
return "#version 310 es";
|
||||
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
|
||||
return "#version 300 es";
|
||||
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
|
||||
return "#version 300 es";
|
||||
else
|
||||
return "#version 100";
|
||||
}
|
||||
|
||||
@@ -632,7 +632,6 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
||||
{
|
||||
GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context);
|
||||
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
|
||||
VkResult acquire_result;
|
||||
guint i;
|
||||
|
||||
if (depth != priv->current_format)
|
||||
@@ -654,29 +653,12 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
||||
cairo_region_union (priv->regions[i], region);
|
||||
}
|
||||
|
||||
acquire_next_image:
|
||||
acquire_result = GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
|
||||
priv->swapchain,
|
||||
UINT64_MAX,
|
||||
priv->draw_semaphore,
|
||||
VK_NULL_HANDLE,
|
||||
&priv->draw_index);
|
||||
if ((acquire_result == VK_ERROR_OUT_OF_DATE_KHR) ||
|
||||
(acquire_result == VK_SUBOPTIMAL_KHR))
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
GDK_DEBUG (VULKAN, "Recreating the swapchain");
|
||||
|
||||
if (!gdk_vulkan_context_check_swapchain (context, &error))
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
goto acquire_next_image;
|
||||
}
|
||||
GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
|
||||
priv->swapchain,
|
||||
UINT64_MAX,
|
||||
priv->draw_semaphore,
|
||||
VK_NULL_HANDLE,
|
||||
&priv->draw_index);
|
||||
|
||||
cairo_region_union (region, priv->regions[priv->draw_index]);
|
||||
}
|
||||
|
||||
@@ -908,9 +908,7 @@ _gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||
width = cairo_image_surface_get_width (surface);
|
||||
height = cairo_image_surface_get_height (surface);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
icon = pixbuf_to_hicon (pixbuf, is_icon, x, y);
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ create_dummy_gl_window (void)
|
||||
{
|
||||
WNDCLASS wclass = { 0, };
|
||||
ATOM klass;
|
||||
HWND hwnd = NULL;
|
||||
HWND hwnd;
|
||||
|
||||
wclass.lpszClassName = "GdkGLDummyWindow";
|
||||
wclass.lpfnWndProc = DefWindowProc;
|
||||
|
||||
@@ -38,6 +38,7 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
|
||||
{
|
||||
GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
|
||||
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
|
||||
GdkWin32Surface *win32_surface = GDK_WIN32_SURFACE (window);
|
||||
VkWin32SurfaceCreateInfoKHR info;
|
||||
VkResult result;
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ gsk_gpu_device_maybe_gc (GskGpuDevice *self)
|
||||
|
||||
if (priv->cache_timeout == 0 || dead_texture_pixels > 1000000)
|
||||
{
|
||||
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%" G_GSIZE_FORMAT " dead pixels)", dead_texture_pixels);
|
||||
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%lu dead pixels)", dead_texture_pixels);
|
||||
gsk_gpu_device_gc (self, g_get_monotonic_time ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,7 +1139,7 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
|
||||
format);
|
||||
|
||||
GSK_DEBUG (SHADERS,
|
||||
"Create Vulkan pipeline (%s %s, %u/%s/%s/%u) for layout (%" G_GSIZE_FORMAT "/%" G_GSIZE_FORMAT "/%" G_GSIZE_FORMAT ")",
|
||||
"Create Vulkan pipeline (%s %s, %u/%s/%s/%u) for layout (%lu/%lu/%lu)",
|
||||
op_class->shader_name,
|
||||
version_string + 1,
|
||||
variation,
|
||||
|
||||
@@ -110,6 +110,11 @@ gsk_vulkan_renderer_create_context (GskGpuRenderer *renderer,
|
||||
!gdk_display_has_vulkan_feature (display, GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING))
|
||||
*supported &= ~GSK_GPU_OPTIMIZE_UBER;
|
||||
|
||||
/* Sadly, there are too many systems out there where compiling the uber shader
|
||||
* takes multiple seconds, or even minutes. So just disabled it for now.
|
||||
*/
|
||||
*supported &= ~GSK_GPU_OPTIMIZE_UBER;
|
||||
|
||||
return GDK_DRAW_CONTEXT (context);
|
||||
}
|
||||
|
||||
|
||||
@@ -2312,25 +2312,6 @@ parse_antialias (GtkCssParser *parser,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_hint_metrics (GtkCssParser *parser,
|
||||
Context *context,
|
||||
gpointer out)
|
||||
{
|
||||
if (!parse_enum (parser, CAIRO_GOBJECT_TYPE_HINT_METRICS, out))
|
||||
return FALSE;
|
||||
|
||||
if (*(cairo_hint_metrics_t *) out != CAIRO_HINT_METRICS_OFF &&
|
||||
*(cairo_hint_metrics_t *) out != CAIRO_HINT_METRICS_ON)
|
||||
{
|
||||
gtk_css_parser_error_value (parser, "Unsupported value for enum \"%s\"",
|
||||
g_type_name (CAIRO_GOBJECT_TYPE_HINT_METRICS));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GskRenderNode *
|
||||
parse_text_node (GtkCssParser *parser,
|
||||
Context *context)
|
||||
@@ -2341,7 +2322,6 @@ parse_text_node (GtkCssParser *parser,
|
||||
PangoGlyphString *glyphs = NULL;
|
||||
cairo_hint_style_t hint_style = CAIRO_HINT_STYLE_SLIGHT;
|
||||
cairo_antialias_t antialias = CAIRO_ANTIALIAS_GRAY;
|
||||
cairo_hint_metrics_t hint_metrics = CAIRO_HINT_METRICS_OFF;
|
||||
PangoFont *hinted;
|
||||
const Declaration declarations[] = {
|
||||
{ "font", parse_font, clear_font, &font },
|
||||
@@ -2350,7 +2330,6 @@ parse_text_node (GtkCssParser *parser,
|
||||
{ "glyphs", parse_glyphs, clear_glyphs, &glyphs },
|
||||
{ "hint-style", parse_hint_style, NULL, &hint_style },
|
||||
{ "antialias", parse_antialias, NULL, &antialias },
|
||||
{ "hint-metrics", parse_hint_metrics, NULL, &hint_metrics },
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
@@ -2362,7 +2341,7 @@ parse_text_node (GtkCssParser *parser,
|
||||
g_assert (font);
|
||||
}
|
||||
|
||||
hinted = gsk_reload_font (font, 1.0, hint_metrics, hint_style, antialias);
|
||||
hinted = gsk_reload_font (font, 1.0, CAIRO_HINT_METRICS_OFF, hint_style, antialias);
|
||||
g_object_unref (font);
|
||||
font = hinted;
|
||||
|
||||
@@ -3560,13 +3539,13 @@ append_texture_param (Printer *p,
|
||||
case GDK_MEMORY_U8:
|
||||
case GDK_MEMORY_U16:
|
||||
bytes = gdk_texture_save_to_png_bytes (texture);
|
||||
g_string_append (p->str, "url(\"data:image/png;base64,\\\n");
|
||||
g_string_append (p->str, "url(\"data:image/png;base64,");
|
||||
break;
|
||||
|
||||
case GDK_MEMORY_FLOAT16:
|
||||
case GDK_MEMORY_FLOAT32:
|
||||
bytes = gdk_texture_save_to_tiff_bytes (texture);
|
||||
g_string_append (p->str, "url(\"data:image/tiff;base64,\\\n");
|
||||
g_string_append (p->str, "url(\"data:image/tiff;base64,");
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -3625,7 +3604,7 @@ gsk_text_node_serialize_font (GskRenderNode *node,
|
||||
|
||||
b64 = base64_encode_with_linebreaks ((const guchar *) data, len);
|
||||
|
||||
g_string_append (p->str, " url(\"data:font/ttf;base64,\\\n");
|
||||
g_string_append (p->str, " url(\"data:font/ttf;base64,");
|
||||
append_escaping_newlines (p->str, b64);
|
||||
g_string_append (p->str, "\")");
|
||||
|
||||
@@ -3644,13 +3623,11 @@ gsk_text_node_serialize_font_options (GskRenderNode *node,
|
||||
cairo_font_options_t *options;
|
||||
cairo_hint_style_t hint_style;
|
||||
cairo_antialias_t antialias;
|
||||
cairo_hint_metrics_t hint_metrics;
|
||||
|
||||
options = cairo_font_options_create ();
|
||||
cairo_scaled_font_get_font_options (sf, options);
|
||||
hint_style = cairo_font_options_get_hint_style (options);
|
||||
antialias = cairo_font_options_get_antialias (options);
|
||||
hint_metrics = cairo_font_options_get_hint_metrics (options);
|
||||
cairo_font_options_destroy (options);
|
||||
|
||||
/* medium and full are identical in the absence of subpixel modes */
|
||||
@@ -3666,12 +3643,6 @@ gsk_text_node_serialize_font_options (GskRenderNode *node,
|
||||
*/
|
||||
if (antialias == CAIRO_ANTIALIAS_NONE)
|
||||
append_enum_param (p, "antialias", CAIRO_GOBJECT_TYPE_ANTIALIAS, antialias);
|
||||
|
||||
/* CAIRO_HINT_METRICS_ON is the only value we ever emit here, since off is the default,
|
||||
* and we don't accept any other values.
|
||||
*/
|
||||
if (hint_metrics == CAIRO_HINT_METRICS_ON)
|
||||
append_enum_param (p, "hint-metrics", CAIRO_GOBJECT_TYPE_HINT_METRICS, CAIRO_HINT_METRICS_ON);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -4443,7 +4414,7 @@ render_node_print (Printer *p,
|
||||
cairo_surface_write_to_png_stream (surface, cairo_write_array, array);
|
||||
|
||||
_indent (p);
|
||||
g_string_append (p->str, "pixels: url(\"data:image/png;base64,\\\n");
|
||||
g_string_append (p->str, "pixels: url(\"data:image/png;base64,");
|
||||
b64 = base64_encode_with_linebreaks (array->data, array->len);
|
||||
append_escaping_newlines (p->str, b64);
|
||||
g_free (b64);
|
||||
@@ -4463,7 +4434,7 @@ render_node_print (Printer *p,
|
||||
if (cairo_script_from_recording_surface (script, surface) == CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
_indent (p);
|
||||
g_string_append (p->str, "script: url(\"data:;base64,\\\n");
|
||||
g_string_append (p->str, "script: url(\"data:;base64,");
|
||||
b64 = base64_encode_with_linebreaks (array->data, array->len);
|
||||
append_escaping_newlines (p->str, b64);
|
||||
g_free (b64);
|
||||
|
||||
@@ -720,16 +720,6 @@ handle_accessible_get_property (GDBusConnection *connection,
|
||||
res = get_parent_context_ref (accessible);
|
||||
else if (g_strcmp0 (property_name, "ChildCount") == 0)
|
||||
res = g_variant_new_int32 (gtk_at_spi_context_get_child_count (self));
|
||||
else if (g_strcmp0 (property_name, "HelpText"))
|
||||
{
|
||||
if (gtk_at_context_has_accessible_property (GTK_AT_CONTEXT (self), GTK_ACCESSIBLE_PROPERTY_HELP_TEXT))
|
||||
{
|
||||
GtkAccessibleValue *value = gtk_at_context_get_accessible_property (GTK_AT_CONTEXT (self), GTK_ACCESSIBLE_PROPERTY_HELP_TEXT);
|
||||
res = g_variant_new_string (gtk_string_accessible_value_get (value));
|
||||
}
|
||||
else
|
||||
res = g_variant_new_string ("");
|
||||
}
|
||||
else
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
"Unknown property '%s'", property_name);
|
||||
@@ -1146,7 +1136,7 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
}
|
||||
|
||||
if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_DESCRIPTION)
|
||||
{
|
||||
{
|
||||
char *label = gtk_at_context_get_description (GTK_AT_CONTEXT (self));
|
||||
GVariant *v = g_variant_new_take_string (label);
|
||||
emit_property_changed (self, "accessible-description", v);
|
||||
@@ -1159,14 +1149,6 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
"accessible-value",
|
||||
g_variant_new_double (gtk_number_accessible_value_get (value)));
|
||||
}
|
||||
|
||||
if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_HELP_TEXT)
|
||||
{
|
||||
value = gtk_accessible_attribute_set_get_value (properties, GTK_ACCESSIBLE_PROPERTY_HELP_TEXT);
|
||||
emit_property_changed (self,
|
||||
"accessible-help-text",
|
||||
g_variant_new_string (gtk_string_accessible_value_get (value)));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -97,7 +97,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
|
||||
return ATSPI_ROLE_FORM;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_GENERIC:
|
||||
return ATSPI_ROLE_PANEL;
|
||||
return ATSPI_ROLE_FILLER;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_GRID:
|
||||
return ATSPI_ROLE_TABLE;
|
||||
@@ -106,7 +106,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
|
||||
return ATSPI_ROLE_TABLE_CELL;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_GROUP:
|
||||
return ATSPI_ROLE_GROUPING;
|
||||
return ATSPI_ROLE_PANEL;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_HEADING:
|
||||
return ATSPI_ROLE_HEADING;
|
||||
|
||||
@@ -28,33 +28,6 @@
|
||||
|
||||
typedef struct _GtkCssParserBlock GtkCssParserBlock;
|
||||
|
||||
struct _GtkCssParserBlock
|
||||
{
|
||||
GtkCssLocation start_location;
|
||||
GtkCssTokenType end_token;
|
||||
GtkCssTokenType inherited_end_token;
|
||||
GtkCssTokenType alternative_token;
|
||||
};
|
||||
|
||||
#define GDK_ARRAY_NAME gtk_css_parser_blocks
|
||||
#define GDK_ARRAY_TYPE_NAME GtkCssParserBlocks
|
||||
#define GDK_ARRAY_ELEMENT_TYPE GtkCssParserBlock
|
||||
#define GDK_ARAY_PREALLOC 32
|
||||
#define GDK_ARRAY_NO_MEMSET 1
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
static inline GtkCssParserBlock *
|
||||
gtk_css_parser_blocks_get_last (GtkCssParserBlocks *blocks)
|
||||
{
|
||||
return gtk_css_parser_blocks_index (blocks, gtk_css_parser_blocks_get_size (blocks) - 1);
|
||||
}
|
||||
|
||||
static inline void
|
||||
gtk_css_parser_blocks_drop_last (GtkCssParserBlocks *blocks)
|
||||
{
|
||||
gtk_css_parser_blocks_set_size (blocks, gtk_css_parser_blocks_get_size (blocks) - 1);
|
||||
}
|
||||
|
||||
struct _GtkCssParser
|
||||
{
|
||||
volatile int ref_count;
|
||||
@@ -66,11 +39,19 @@ struct _GtkCssParser
|
||||
gpointer user_data;
|
||||
GDestroyNotify user_destroy;
|
||||
|
||||
GtkCssParserBlocks blocks;
|
||||
GArray *blocks;
|
||||
GtkCssLocation location;
|
||||
GtkCssToken token;
|
||||
};
|
||||
|
||||
struct _GtkCssParserBlock
|
||||
{
|
||||
GtkCssLocation start_location;
|
||||
GtkCssTokenType end_token;
|
||||
GtkCssTokenType inherited_end_token;
|
||||
GtkCssTokenType alternative_token;
|
||||
};
|
||||
|
||||
static GtkCssParser *
|
||||
gtk_css_parser_new (GtkCssTokenizer *tokenizer,
|
||||
GFile *file,
|
||||
@@ -85,12 +66,15 @@ gtk_css_parser_new (GtkCssTokenizer *tokenizer,
|
||||
self->ref_count = 1;
|
||||
self->tokenizer = gtk_css_tokenizer_ref (tokenizer);
|
||||
if (file)
|
||||
self->file = g_object_ref (file);
|
||||
{
|
||||
self->file = g_object_ref (file);
|
||||
self->directory = g_file_get_parent (file);
|
||||
}
|
||||
|
||||
self->error_func = error_func;
|
||||
self->user_data = user_data;
|
||||
self->user_destroy = user_destroy;
|
||||
gtk_css_parser_blocks_init (&self->blocks);
|
||||
self->blocks = g_array_new (FALSE, FALSE, sizeof (GtkCssParserBlock));
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -142,9 +126,9 @@ gtk_css_parser_finalize (GtkCssParser *self)
|
||||
g_clear_pointer (&self->tokenizer, gtk_css_tokenizer_unref);
|
||||
g_clear_object (&self->file);
|
||||
g_clear_object (&self->directory);
|
||||
if (gtk_css_parser_blocks_get_size (&self->blocks) > 0)
|
||||
g_critical ("Finalizing CSS parser with %lu remaining blocks", gtk_css_parser_blocks_get_size (&self->blocks));
|
||||
gtk_css_parser_blocks_clear (&self->blocks);
|
||||
if (self->blocks->len)
|
||||
g_critical ("Finalizing CSS parser with %u remaining blocks", self->blocks->len);
|
||||
g_array_free (self->blocks, TRUE);
|
||||
|
||||
g_free (self);
|
||||
}
|
||||
@@ -204,12 +188,7 @@ gtk_css_parser_resolve_url (GtkCssParser *self,
|
||||
}
|
||||
|
||||
if (self->directory == NULL)
|
||||
{
|
||||
if (self->file)
|
||||
self->directory = g_file_get_parent (self->file);
|
||||
if (self->directory == NULL)
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
return g_file_resolve_relative_path (self->directory, url);
|
||||
}
|
||||
@@ -280,13 +259,13 @@ gtk_css_parser_get_block_location (GtkCssParser *self)
|
||||
{
|
||||
const GtkCssParserBlock *block;
|
||||
|
||||
if (gtk_css_parser_blocks_get_size (&self->blocks) == 0)
|
||||
if (self->blocks->len == 0)
|
||||
{
|
||||
static const GtkCssLocation start_of_document = { 0, };
|
||||
return &start_of_document;
|
||||
}
|
||||
|
||||
block = gtk_css_parser_blocks_get_last (&self->blocks);
|
||||
block = &g_array_index (self->blocks, GtkCssParserBlock, self->blocks->len - 1);
|
||||
return &block->start_location;
|
||||
}
|
||||
|
||||
@@ -316,9 +295,9 @@ gtk_css_parser_peek_token (GtkCssParser *self)
|
||||
|
||||
gtk_css_parser_ensure_token (self);
|
||||
|
||||
if (gtk_css_parser_blocks_get_size (&self->blocks) > 0)
|
||||
if (self->blocks->len)
|
||||
{
|
||||
const GtkCssParserBlock *block = gtk_css_parser_blocks_get_last (&self->blocks);
|
||||
const GtkCssParserBlock *block = &g_array_index (self->blocks, GtkCssParserBlock, self->blocks->len - 1);
|
||||
if (gtk_css_token_is (&self->token, block->end_token) ||
|
||||
gtk_css_token_is (&self->token, block->inherited_end_token) ||
|
||||
gtk_css_token_is (&self->token, block->alternative_token))
|
||||
@@ -373,7 +352,7 @@ gtk_css_parser_start_block (GtkCssParser *self)
|
||||
block.inherited_end_token = GTK_CSS_TOKEN_EOF;
|
||||
block.alternative_token = GTK_CSS_TOKEN_EOF;
|
||||
block.start_location = self->location;
|
||||
gtk_css_parser_blocks_append (&self->blocks, block);
|
||||
g_array_append_val (self->blocks, block);
|
||||
|
||||
gtk_css_token_clear (&self->token);
|
||||
}
|
||||
@@ -385,13 +364,13 @@ gtk_css_parser_start_semicolon_block (GtkCssParser *self,
|
||||
GtkCssParserBlock block;
|
||||
|
||||
block.end_token = GTK_CSS_TOKEN_SEMICOLON;
|
||||
if (gtk_css_parser_blocks_get_size (&self->blocks) > 0)
|
||||
block.inherited_end_token = gtk_css_parser_blocks_get_last (&self->blocks)->end_token;
|
||||
if (self->blocks->len)
|
||||
block.inherited_end_token = g_array_index (self->blocks, GtkCssParserBlock, self->blocks->len - 1).end_token;
|
||||
else
|
||||
block.inherited_end_token = GTK_CSS_TOKEN_EOF;
|
||||
block.alternative_token = alternative_token;
|
||||
block.start_location = self->location;
|
||||
gtk_css_parser_blocks_append (&self->blocks, block);
|
||||
g_array_append_val (self->blocks, block);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -399,9 +378,9 @@ gtk_css_parser_end_block_prelude (GtkCssParser *self)
|
||||
{
|
||||
GtkCssParserBlock *block;
|
||||
|
||||
g_return_if_fail (gtk_css_parser_blocks_get_size (&self->blocks) > 0);
|
||||
g_return_if_fail (self->blocks->len > 0);
|
||||
|
||||
block = gtk_css_parser_blocks_get_last (&self->blocks);
|
||||
block = &g_array_index (self->blocks, GtkCssParserBlock, self->blocks->len - 1);
|
||||
|
||||
if (block->alternative_token == GTK_CSS_TOKEN_EOF)
|
||||
return;
|
||||
@@ -426,11 +405,11 @@ gtk_css_parser_end_block (GtkCssParser *self)
|
||||
{
|
||||
GtkCssParserBlock *block;
|
||||
|
||||
g_return_if_fail (gtk_css_parser_blocks_get_size (&self->blocks) > 0);
|
||||
g_return_if_fail (self->blocks->len > 0);
|
||||
|
||||
gtk_css_parser_skip_until (self, GTK_CSS_TOKEN_EOF);
|
||||
|
||||
block = gtk_css_parser_blocks_get_last (&self->blocks);
|
||||
block = &g_array_index (self->blocks, GtkCssParserBlock, self->blocks->len - 1);
|
||||
|
||||
if (gtk_css_token_is (&self->token, GTK_CSS_TOKEN_EOF))
|
||||
{
|
||||
@@ -439,7 +418,7 @@ gtk_css_parser_end_block (GtkCssParser *self)
|
||||
gtk_css_parser_get_block_location (self),
|
||||
gtk_css_parser_get_start_location (self),
|
||||
"Unterminated block at end of document");
|
||||
gtk_css_parser_blocks_drop_last (&self->blocks);
|
||||
g_array_set_size (self->blocks, self->blocks->len - 1);
|
||||
}
|
||||
else if (gtk_css_token_is (&self->token, block->inherited_end_token))
|
||||
{
|
||||
@@ -449,11 +428,11 @@ gtk_css_parser_end_block (GtkCssParser *self)
|
||||
gtk_css_parser_get_block_location (self),
|
||||
gtk_css_parser_get_start_location (self),
|
||||
"Expected ';' at end of block");
|
||||
gtk_css_parser_blocks_drop_last (&self->blocks);
|
||||
g_array_set_size (self->blocks, self->blocks->len - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_css_parser_blocks_drop_last (&self->blocks);
|
||||
g_array_set_size (self->blocks, self->blocks->len - 1);
|
||||
if (gtk_css_token_is_preserved (&self->token, NULL))
|
||||
{
|
||||
gtk_css_token_clear (&self->token);
|
||||
|
||||
@@ -163,7 +163,6 @@
|
||||
#include <gtk/gtkgridview.h>
|
||||
#include <gtk/gtkheaderbar.h>
|
||||
#include <gtk/gtkicontheme.h>
|
||||
#include <gtk/gtkiconprovider.h>
|
||||
#include <gtk/deprecated/gtkiconview.h>
|
||||
#include <gtk/gtkimage.h>
|
||||
#include <gtk/gtkimcontext.h>
|
||||
|
||||
@@ -808,11 +808,6 @@ static const GtkAccessibleCollect collect_props[] = {
|
||||
.ctype = GTK_ACCESSIBLE_COLLECT_STRING,
|
||||
.name = "valuetext"
|
||||
},
|
||||
[GTK_ACCESSIBLE_PROPERTY_HELP_TEXT] = {
|
||||
.value = GTK_ACCESSIBLE_PROPERTY_HELP_TEXT,
|
||||
.ctype = GTK_ACCESSIBLE_COLLECT_STRING,
|
||||
.name = "helptext"
|
||||
},
|
||||
};
|
||||
|
||||
/* § 6.6.4 Relationship Attributes */
|
||||
@@ -1667,7 +1662,7 @@ gtk_accessible_value_get_default_for_property (GtkAccessibleProperty property)
|
||||
{
|
||||
const GtkAccessibleCollect *cstate = &collect_props[property];
|
||||
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
|
||||
|
||||
switch (cstate->value)
|
||||
{
|
||||
@@ -1697,7 +1692,6 @@ gtk_accessible_value_get_default_for_property (GtkAccessibleProperty property)
|
||||
case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER:
|
||||
case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION:
|
||||
case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT:
|
||||
case GTK_ACCESSIBLE_PROPERTY_HELP_TEXT:
|
||||
return gtk_undefined_accessible_value_new ();
|
||||
|
||||
/* Token properties */
|
||||
@@ -1738,7 +1732,7 @@ gtk_accessible_value_collect_for_property (GtkAccessibleProperty property,
|
||||
{
|
||||
const GtkAccessibleCollect *cstate = &collect_props[property];
|
||||
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
|
||||
|
||||
return gtk_accessible_value_collect_valist (cstate, error, args);
|
||||
}
|
||||
@@ -1766,7 +1760,7 @@ gtk_accessible_value_collect_for_property_value (GtkAccessibleProperty propert
|
||||
{
|
||||
const GtkAccessibleCollect *cstate = &collect_props[property];
|
||||
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
|
||||
|
||||
return gtk_accessible_value_collect_value (cstate, value, error);
|
||||
}
|
||||
@@ -1779,7 +1773,7 @@ gtk_accessible_value_parse_for_property (GtkAccessibleProperty property,
|
||||
{
|
||||
const GtkAccessibleCollect *cstate = &collect_props[property];
|
||||
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
|
||||
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
|
||||
|
||||
return gtk_accessible_value_parse (cstate, str, len, error);
|
||||
}
|
||||
@@ -1800,7 +1794,7 @@ gtk_accessible_property_init_value (GtkAccessibleProperty property,
|
||||
{
|
||||
const GtkAccessibleCollect *cstate = &collect_props[property];
|
||||
|
||||
g_return_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT);
|
||||
g_return_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT);
|
||||
|
||||
gtk_accessible_attribute_init_value (cstate, value);
|
||||
}
|
||||
|
||||
@@ -328,7 +328,6 @@ static const char *property_attrs[] = {
|
||||
[GTK_ACCESSIBLE_PROPERTY_VALUE_MIN] = "valuemin",
|
||||
[GTK_ACCESSIBLE_PROPERTY_VALUE_NOW] = "valuenow",
|
||||
[GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT] = "valuetext",
|
||||
[GTK_ACCESSIBLE_PROPERTY_HELP_TEXT] = "helptext",
|
||||
};
|
||||
|
||||
/*< private >
|
||||
@@ -343,7 +342,7 @@ const char *
|
||||
gtk_accessible_property_get_attribute_name (GtkAccessibleProperty property)
|
||||
{
|
||||
g_return_val_if_fail (property >= GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE &&
|
||||
property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT,
|
||||
property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
|
||||
"<none>");
|
||||
|
||||
return property_attrs[property];
|
||||
|
||||
@@ -47,8 +47,7 @@ typedef enum {
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_VALUE_MAX = 1 << GTK_ACCESSIBLE_PROPERTY_VALUE_MAX,
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_VALUE_MIN = 1 << GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_VALUE_NOW = 1 << GTK_ACCESSIBLE_PROPERTY_VALUE_NOW,
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_VALUE_TEXT = 1 << GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_HELP_TEXT = 1 << GTK_ACCESSIBLE_PROPERTY_HELP_TEXT,
|
||||
GTK_ACCESSIBLE_PROPERTY_CHANGE_VALUE_TEXT = 1 << GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT
|
||||
} GtkAccessiblePropertyChange;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -32,12 +32,8 @@
|
||||
* `GtkBuilderListItemFactory` is a `GtkListItemFactory` that creates
|
||||
* widgets by instantiating `GtkBuilder` UI templates.
|
||||
*
|
||||
* The templates must extend the class that the parent widget expects.
|
||||
* For example, a factory provided to [property@Gtk.ListView:factory] must have
|
||||
* a template that extends [class@Gtk.ListItem].
|
||||
*
|
||||
* Templates typically use `GtkExpression`s to obtain data from the items
|
||||
* in the model.
|
||||
* The templates must be extending `GtkListItem`, and typically use
|
||||
* `GtkExpression`s to obtain data from the items in the model.
|
||||
*
|
||||
* Example:
|
||||
* ```xml
|
||||
@@ -207,7 +203,7 @@ gtk_builder_list_item_factory_set_property (GObject *object,
|
||||
case PROP_RESOURCE:
|
||||
{
|
||||
GError *error = NULL;
|
||||
GBytes *bytes;
|
||||
GBytes *bytes;
|
||||
const char *resource;
|
||||
|
||||
resource = g_value_get_string (value);
|
||||
|
||||
@@ -861,8 +861,6 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
|
||||
*
|
||||
* The factory used for configuring rows.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ColumnViewRow] objects.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
properties[PROP_ROW_FACTORY] =
|
||||
@@ -928,8 +926,6 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
|
||||
*
|
||||
* Factory for creating header widgets.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ListHeader] objects.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
properties[PROP_HEADER_FACTORY] =
|
||||
|
||||
@@ -255,8 +255,6 @@ gtk_column_view_column_class_init (GtkColumnViewColumnClass *klass)
|
||||
* GtkColumnViewColumn:factory: (attributes org.gtk.Property.get=gtk_column_view_column_get_factory org.gtk.Property.set=gtk_column_view_column_set_factory)
|
||||
*
|
||||
* Factory for populating list items.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ColumnViewCell] objects.
|
||||
*/
|
||||
properties[PROP_FACTORY] =
|
||||
g_param_spec_object ("factory", NULL, NULL,
|
||||
@@ -763,7 +761,7 @@ gtk_column_view_column_remove_from_sorter (GtkColumnViewColumn *self)
|
||||
{
|
||||
if (self->view == NULL)
|
||||
return;
|
||||
|
||||
|
||||
gtk_column_view_sorter_remove_column (GTK_COLUMN_VIEW_SORTER (gtk_column_view_get_sorter (self->view)), self);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
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 (provider);
|
||||
gtk_css_style_lookup_symbolic_colors (style, copy->colors);
|
||||
gtk_icon_theme_lookup_symbolic_colors (style, copy->colors);
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "gtkcssinitialvalueprivate.h"
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcsspalettevalueprivate.h"
|
||||
#include "gtkcssshorthandpropertyprivate.h"
|
||||
#include "gtkcssstringvalueprivate.h"
|
||||
#include "gtkcssfontvariationsvalueprivate.h"
|
||||
@@ -751,33 +750,6 @@ gtk_css_style_get_pango_font (GtkCssStyle *style)
|
||||
return description;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_style_lookup_symbolic_colors (GtkCssStyle *style,
|
||||
GdkRGBA color_out[4])
|
||||
{
|
||||
GtkCssValue *palette, *color;
|
||||
const char *names[4] = {
|
||||
[GTK_SYMBOLIC_COLOR_ERROR] = "error",
|
||||
[GTK_SYMBOLIC_COLOR_WARNING] = "warning",
|
||||
[GTK_SYMBOLIC_COLOR_SUCCESS] = "success"
|
||||
};
|
||||
|
||||
color = style->core->color;
|
||||
palette = style->core->icon_palette;
|
||||
color_out[GTK_SYMBOLIC_COLOR_FOREGROUND] = *gtk_css_color_value_get_rgba (color);
|
||||
|
||||
for (gsize i = 1; i < 4; i++)
|
||||
{
|
||||
const GdkRGBA *lookup;
|
||||
|
||||
lookup = gtk_css_palette_value_get_color (palette, names[i]);
|
||||
if (lookup)
|
||||
color_out[i] = *lookup;
|
||||
else
|
||||
color_out[i] = color_out[GTK_SYMBOLIC_COLOR_FOREGROUND];
|
||||
}
|
||||
}
|
||||
|
||||
/* Refcounted value structs */
|
||||
|
||||
static const int values_size[] = {
|
||||
|
||||
@@ -268,9 +268,6 @@ char * gtk_css_style_compute_font_features (GtkCssStyle
|
||||
PangoAttrList * gtk_css_style_get_pango_attributes (GtkCssStyle *style);
|
||||
PangoFontDescription * gtk_css_style_get_pango_font (GtkCssStyle *style);
|
||||
|
||||
void gtk_css_style_lookup_symbolic_colors (GtkCssStyle *style,
|
||||
GdkRGBA color_out[4]);
|
||||
|
||||
GtkCssValues *gtk_css_values_new (GtkCssValuesType type);
|
||||
GtkCssValues *gtk_css_values_ref (GtkCssValues *values);
|
||||
void gtk_css_values_unref (GtkCssValues *values);
|
||||
|
||||
@@ -1632,15 +1632,6 @@ typedef enum {
|
||||
*
|
||||
* The possible accessible properties of a [iface@Accessible].
|
||||
*/
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_PROPERTY_HELP_TEXT:
|
||||
*
|
||||
* Defines a string value that provides a description of non-standard keyboard
|
||||
* interactions of the current element. Value type: string
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE,
|
||||
GTK_ACCESSIBLE_PROPERTY_DESCRIPTION,
|
||||
@@ -1660,8 +1651,7 @@ typedef enum {
|
||||
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX,
|
||||
GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
|
||||
GTK_ACCESSIBLE_PROPERTY_VALUE_NOW,
|
||||
GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
|
||||
GTK_ACCESSIBLE_PROPERTY_HELP_TEXT
|
||||
GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT
|
||||
} GtkAccessibleProperty;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1109,8 +1109,6 @@ gtk_grid_view_class_init (GtkGridViewClass *klass)
|
||||
* GtkGridView:factory: (attributes org.gtk.Property.get=gtk_grid_view_get_factory org.gtk.Property.set=gtk_grid_view_set_factory)
|
||||
*
|
||||
* Factory for populating list items.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ListItem] objects.
|
||||
*/
|
||||
properties[PROP_FACTORY] =
|
||||
g_param_spec_object ("factory", NULL, NULL,
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gdk/gdkprofilerprivate.h"
|
||||
#include "gtksymbolicpaintable.h"
|
||||
#include "gtkiconprovider.h"
|
||||
|
||||
struct _GtkIconHelper
|
||||
{
|
||||
@@ -112,25 +111,13 @@ ensure_paintable_for_gicon (GtkIconHelper *self,
|
||||
return GDK_PAINTABLE (icon);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
ensure_paintable_for_icon_name (GtkIconHelper *self,
|
||||
const char *name)
|
||||
{
|
||||
int size;
|
||||
float scale;
|
||||
|
||||
size = gtk_icon_helper_get_size (self);
|
||||
scale = gtk_widget_get_scale_factor (self->owner);
|
||||
|
||||
return gtk_lookup_icon (gtk_widget_get_display (self->owner), name, size, scale);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_icon_helper_load_paintable (GtkIconHelper *self,
|
||||
gboolean preload,
|
||||
gboolean *out_symbolic)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
GIcon *gicon;
|
||||
gboolean symbolic;
|
||||
|
||||
switch (gtk_image_definition_get_storage_type (self->def))
|
||||
@@ -141,12 +128,18 @@ gtk_icon_helper_load_paintable (GtkIconHelper *self,
|
||||
break;
|
||||
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
paintable = ensure_paintable_for_icon_name (self,
|
||||
gtk_image_definition_get_icon_name (self->def));
|
||||
if (GTK_IS_ICON_PAINTABLE (paintable))
|
||||
symbolic = gtk_icon_paintable_is_symbolic (GTK_ICON_PAINTABLE (paintable));
|
||||
if (self->use_fallback)
|
||||
gicon = g_themed_icon_new_with_default_fallbacks (gtk_image_definition_get_icon_name (self->def));
|
||||
else
|
||||
symbolic = GTK_IS_SYMBOLIC_PAINTABLE (paintable);
|
||||
gicon = g_themed_icon_new (gtk_image_definition_get_icon_name (self->def));
|
||||
paintable = ensure_paintable_for_gicon (self,
|
||||
gtk_css_node_get_style (self->node),
|
||||
gtk_widget_get_scale_factor (self->owner),
|
||||
gtk_widget_get_direction (self->owner),
|
||||
preload,
|
||||
gicon,
|
||||
&symbolic);
|
||||
g_object_unref (gicon);
|
||||
break;
|
||||
|
||||
case GTK_IMAGE_GICON:
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2024 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkiconprovider.h"
|
||||
#include "gtkicontheme.h"
|
||||
#include "gtkenums.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
|
||||
G_DEFINE_INTERFACE (GtkIconProvider, gtk_icon_provider, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gtk_icon_provider_default_init (GtkIconProviderInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gtk_icon_provider_set_for_display (GdkDisplay *display,
|
||||
GtkIconProvider *provider)
|
||||
{
|
||||
g_object_set_data_full (G_OBJECT (display), "--gtk-icon-provider",
|
||||
g_object_ref (provider), g_object_unref);
|
||||
|
||||
gtk_system_setting_changed (display, GTK_SYSTEM_SETTING_ICON_THEME);
|
||||
}
|
||||
|
||||
GtkIconProvider *
|
||||
gtk_icon_provider_get_for_display (GdkDisplay *display)
|
||||
{
|
||||
GtkIconProvider *provider;
|
||||
|
||||
provider = g_object_get_data (G_OBJECT (display), "--gtk-icon-provider");
|
||||
|
||||
if (provider)
|
||||
return provider;
|
||||
|
||||
return GTK_ICON_PROVIDER (gtk_icon_theme_get_for_display (display));
|
||||
}
|
||||
|
||||
static GdkPaintable *gtk_lookup_builtin_icon (GdkDisplay *display,
|
||||
const char *name,
|
||||
int size,
|
||||
float scale);
|
||||
|
||||
GdkPaintable *
|
||||
gtk_lookup_icon (GdkDisplay *display,
|
||||
const char *name,
|
||||
int size,
|
||||
float scale)
|
||||
{
|
||||
GtkIconProvider *provider;
|
||||
GdkPaintable *icon;
|
||||
|
||||
provider = gtk_icon_provider_get_for_display (display);
|
||||
|
||||
icon = GTK_ICON_PROVIDER_GET_IFACE (provider)->lookup_icon (provider, name, size, scale);
|
||||
|
||||
if (!icon)
|
||||
{
|
||||
GTK_DISPLAY_DEBUG (display, ICONTHEME,
|
||||
"%s: Looking up icon %s size %d@%f: not found",
|
||||
G_OBJECT_TYPE_NAME (provider), name, size, scale);
|
||||
|
||||
icon = gtk_lookup_builtin_icon (display, name, size, scale);
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_lookup_builtin_icon (GdkDisplay *display,
|
||||
const char *name,
|
||||
int size,
|
||||
float scale)
|
||||
{
|
||||
int sizes[] = { 16, 32, 64 };
|
||||
char pixel_size[24] = { 0, };
|
||||
const char *contexts[] = {
|
||||
"actions",
|
||||
"categories",
|
||||
"devices",
|
||||
"emblems",
|
||||
"emotes",
|
||||
"mimetypes",
|
||||
"places",
|
||||
"status",
|
||||
};
|
||||
const char *extension;
|
||||
GdkPaintable *icon = NULL;
|
||||
|
||||
for (int i = 0; i < G_N_ELEMENTS (sizes); i++)
|
||||
{
|
||||
if (sizes[i] >= size * scale)
|
||||
{
|
||||
size = sizes[i];
|
||||
g_snprintf (pixel_size, sizeof (pixel_size), "%dx%d", size, size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pixel_size[0] == '\0')
|
||||
{
|
||||
g_snprintf (pixel_size, sizeof (pixel_size), "64x64");
|
||||
size = 64;
|
||||
}
|
||||
|
||||
if (g_str_has_suffix (name, "-symbolic"))
|
||||
extension = ".symbolic.png";
|
||||
else
|
||||
extension = ".png";
|
||||
|
||||
for (int i = 0; i < G_N_ELEMENTS (contexts); i++)
|
||||
{
|
||||
char *uri;
|
||||
GFile *file;
|
||||
|
||||
uri = g_strconcat ("resource:///org/gtk/libgtk/icons/", pixel_size, "/", contexts[i], "/", name, extension, NULL);
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
if (g_file_query_exists (file, NULL))
|
||||
{
|
||||
GTK_DISPLAY_DEBUG (display, ICONTHEME,
|
||||
"Looking up builtin icon %s size %d@%f: %s",
|
||||
name, size, scale, uri);
|
||||
|
||||
icon = GDK_PAINTABLE (gtk_icon_paintable_new_for_file (file, size, 1));
|
||||
}
|
||||
|
||||
g_object_unref (file);
|
||||
g_free (uri);
|
||||
|
||||
if (icon)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!icon)
|
||||
{
|
||||
GTK_DISPLAY_DEBUG (display, ICONTHEME,
|
||||
"Looking up builtin icon %s size %d@%f: not found",
|
||||
name, size, scale);
|
||||
|
||||
icon = GDK_PAINTABLE (gdk_texture_new_from_resource ("/org/gtk/libgtk/icons/16x16/status/image-missing.png"));
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright © 2024 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtktypes.h>
|
||||
#include <gdk/gdkpaintable.h>
|
||||
#include <gdk/gdkdisplay.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_ICON_PROVIDER (gtk_icon_provider_get_type ())
|
||||
|
||||
GDK_AVAILABLE_IN_4_16
|
||||
G_DECLARE_INTERFACE (GtkIconProvider, gtk_icon_provider, GTK, ICON_PROVIDER, GObject)
|
||||
|
||||
struct _GtkIconProviderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
GdkPaintable * (* lookup_icon) (GtkIconProvider *provider,
|
||||
const char *icon_name,
|
||||
int size,
|
||||
float scale);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_4_16
|
||||
void gtk_icon_provider_set_for_display (GdkDisplay *display,
|
||||
GtkIconProvider *provider);
|
||||
|
||||
GDK_AVAILABLE_IN_4_16
|
||||
GtkIconProvider * gtk_icon_provider_get_for_display (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_4_16
|
||||
GdkPaintable * gtk_lookup_icon (GdkDisplay *display,
|
||||
const char *icon_name,
|
||||
int size,
|
||||
float scale);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
#include "gdktextureutilsprivate.h"
|
||||
#include "gdk/gdktextureprivate.h"
|
||||
#include "gdk/gdkprofilerprivate.h"
|
||||
#include "gtkiconprovider.h"
|
||||
|
||||
#define GDK_ARRAY_ELEMENT_TYPE char *
|
||||
#define GDK_ARRAY_NULL_TERMINATED 1
|
||||
@@ -813,25 +812,7 @@ icon_cache_clear (GtkIconTheme *theme)
|
||||
|
||||
/****************** End of icon cache ***********************/
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_icon_theme_lookup_icon_as_provider (GtkIconProvider *provider,
|
||||
const char *name,
|
||||
int size,
|
||||
float scale)
|
||||
{
|
||||
GtkIconTheme *self = GTK_ICON_THEME (provider);
|
||||
|
||||
return GDK_PAINTABLE (gtk_icon_theme_lookup_icon (self, name, NULL, size, (int) ceilf (scale), GTK_TEXT_DIR_LTR, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_provider_init (GtkIconProviderInterface *iface)
|
||||
{
|
||||
iface->lookup_icon = gtk_icon_theme_lookup_icon_as_provider;
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkIconTheme, gtk_icon_theme, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ICON_PROVIDER, gtk_icon_provider_init))
|
||||
G_DEFINE_TYPE (GtkIconTheme, gtk_icon_theme, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
* gtk_icon_theme_new:
|
||||
@@ -2453,7 +2434,7 @@ load_icon_thread (GTask *task,
|
||||
* @self: a `GtkIconTheme`
|
||||
* @icon_name: the name of the icon to lookup
|
||||
* @fallbacks: (nullable) (array zero-terminated=1):
|
||||
* @size: desired icon size, in application pixels
|
||||
* @size: desired icon size.
|
||||
* @scale: the window scale this will be displayed on
|
||||
* @direction: text direction the icon will be displayed in
|
||||
* @flags: flags modifying the behavior of the icon lookup
|
||||
@@ -2552,6 +2533,34 @@ gtk_icon_theme_error_quark (void)
|
||||
return g_quark_from_static_string ("gtk-icon-theme-error-quark");
|
||||
}
|
||||
|
||||
void
|
||||
gtk_icon_theme_lookup_symbolic_colors (GtkCssStyle *style,
|
||||
GdkRGBA color_out[4])
|
||||
{
|
||||
GtkCssValue *palette, *color;
|
||||
const char *names[4] = {
|
||||
[GTK_SYMBOLIC_COLOR_ERROR] = "error",
|
||||
[GTK_SYMBOLIC_COLOR_WARNING] = "warning",
|
||||
[GTK_SYMBOLIC_COLOR_SUCCESS] = "success"
|
||||
};
|
||||
const GdkRGBA *lookup;
|
||||
gsize i;
|
||||
|
||||
color = style->core->color;
|
||||
palette = style->core->icon_palette;
|
||||
color_out[GTK_SYMBOLIC_COLOR_FOREGROUND] = *gtk_css_color_value_get_rgba (color);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
lookup = gtk_css_palette_value_get_color (palette, names[i]);
|
||||
if (lookup)
|
||||
color_out[i] = *lookup;
|
||||
else
|
||||
color_out[i] = color_out[GTK_SYMBOLIC_COLOR_FOREGROUND];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_icon_theme_has_icon:
|
||||
* @self: a `GtkIconTheme`
|
||||
@@ -3994,7 +4003,7 @@ icon_symbolic_paintable_init (GtkSymbolicPaintableInterface *iface)
|
||||
/**
|
||||
* gtk_icon_paintable_new_for_file:
|
||||
* @file: a `GFile`
|
||||
* @size: desired icon size, in application pixels
|
||||
* @size: desired icon size
|
||||
* @scale: the desired scale
|
||||
*
|
||||
* Creates a `GtkIconPaintable` for a file with a given size and scale.
|
||||
@@ -4038,7 +4047,7 @@ gtk_icon_paintable_new_for_file (GFile *file,
|
||||
* gtk_icon_theme_lookup_by_gicon:
|
||||
* @self: a `GtkIconTheme`
|
||||
* @icon: the `GIcon` to look up
|
||||
* @size: desired icon size, in application pixels
|
||||
* @size: desired icon size
|
||||
* @scale: the desired scale
|
||||
* @direction: text direction the icon will be displayed in
|
||||
* @flags: flags modifying the behavior of the icon lookup
|
||||
|
||||
@@ -26,5 +26,8 @@ const char *gtk_string_set_add (GtkStringSet *set,
|
||||
|
||||
#define IMAGE_MISSING_RESOURCE_PATH "/org/gtk/libgtk/icons/16x16/status/image-missing.png"
|
||||
|
||||
void gtk_icon_theme_lookup_symbolic_colors (GtkCssStyle *style,
|
||||
GdkRGBA color_out[4]);
|
||||
|
||||
int gtk_icon_theme_get_serial (GtkIconTheme *self);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ static inline void
|
||||
istring_prepend (IString *str,
|
||||
IString *other)
|
||||
{
|
||||
if G_LIKELY (str->n_bytes + other->n_bytes <= (sizeof str->u.buf - 1))
|
||||
if G_LIKELY (str->n_bytes + other->n_bytes < sizeof str->u.buf - 1)
|
||||
{
|
||||
memmove (str->u.buf + other->n_bytes, str->u.buf, str->n_bytes);
|
||||
memcpy (str->u.buf, other->u.buf, other->n_bytes);
|
||||
|
||||
@@ -881,8 +881,6 @@ gtk_list_view_class_init (GtkListViewClass *klass)
|
||||
* GtkListView:factory: (attributes org.gtk.Property.get=gtk_list_view_get_factory org.gtk.Property.set=gtk_list_view_set_factory)
|
||||
*
|
||||
* Factory for populating list items.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ListItem] objects.
|
||||
*/
|
||||
properties[PROP_FACTORY] =
|
||||
g_param_spec_object ("factory", NULL, NULL,
|
||||
@@ -894,8 +892,6 @@ gtk_list_view_class_init (GtkListViewClass *klass)
|
||||
*
|
||||
* Factory for creating header widgets.
|
||||
*
|
||||
* The factory must be for configuring [class@Gtk.ListHeader] objects.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
properties[PROP_HEADER_FACTORY] =
|
||||
@@ -1359,7 +1355,7 @@ gtk_list_view_get_tab_behavior (GtkListView *self)
|
||||
* @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
|
||||
* the scroll operation or %NULL to scroll into view
|
||||
*
|
||||
* Scrolls to the item at the given position and performs the actions
|
||||
* specified in @flags.
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "gtkrendericonprivate.h"
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssfiltervalueprivate.h"
|
||||
#include "gtkcssimagevalueprivate.h"
|
||||
#include "gtkcssshadowvalueprivate.h"
|
||||
@@ -117,7 +116,7 @@ gtk_css_style_snapshot_icon_paintable (GtkCssStyle *style,
|
||||
is_symbolic_paintable = GTK_IS_SYMBOLIC_PAINTABLE (paintable);
|
||||
if (is_symbolic_paintable)
|
||||
{
|
||||
gtk_css_style_lookup_symbolic_colors (style, colors);
|
||||
gtk_icon_theme_lookup_symbolic_colors (style, colors);
|
||||
|
||||
if (gdk_rgba_is_clear (&colors[0]))
|
||||
goto transparent;
|
||||
|
||||
@@ -1774,10 +1774,6 @@ populate_event_properties (GListStore *store,
|
||||
case GDK_KEY_RELEASE:
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
tmp = modifier_names (gdk_key_event_get_consumed_modifiers (event));
|
||||
add_text_row (store, "Consumed modifiers", "%s", tmp);
|
||||
g_free (tmp);
|
||||
add_int_row (store, "Keycode", gdk_key_event_get_keycode (event));
|
||||
add_int_row (store, "Keyval", gdk_key_event_get_keyval (event));
|
||||
tmp = key_event_string (event);
|
||||
|
||||
@@ -258,7 +258,6 @@ gtk_public_sources = files([
|
||||
'gtkgridview.c',
|
||||
'gtkheaderbar.c',
|
||||
'gtkicontheme.c',
|
||||
'gtkiconprovider.c',
|
||||
'gtkimage.c',
|
||||
'gtkimagedefinition.c',
|
||||
'gtkimcontext.c',
|
||||
@@ -512,7 +511,6 @@ gtk_public_headers = files([
|
||||
'gtkgridview.h',
|
||||
'gtkheaderbar.h',
|
||||
'gtkicontheme.h',
|
||||
'gtkiconprovider.h',
|
||||
'gtkimage.h',
|
||||
'gtkimcontext.h',
|
||||
'gtkimcontextsimple.h',
|
||||
|
||||
@@ -649,7 +649,6 @@ main (int argc, char *argv[])
|
||||
g_test_add_data_func ("/a11y/property/value-min", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_MIN), test_number_property);
|
||||
g_test_add_data_func ("/a11y/property/value-now", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_NOW), test_number_property);
|
||||
g_test_add_data_func ("/a11y/property/value-text", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT), test_string_property);
|
||||
g_test_add_data_func ("/a11y/property/help-text", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_HELP_TEXT), test_string_property);
|
||||
|
||||
g_test_add_func ("/a11y/property/update-multiple", test_update_multiple_properties);
|
||||
|
||||
|
||||
@@ -52,3 +52,31 @@ test('transition', transition,
|
||||
suite: 'css'
|
||||
)
|
||||
|
||||
if false and get_option ('profiler')
|
||||
|
||||
adwaita_env = csstest_env
|
||||
adwaita_env.set('GTK_THEME', 'Adwaita')
|
||||
test('performance-adwaita', test_performance,
|
||||
args: [
|
||||
'--mark', 'css validation',
|
||||
'--name', 'performance-adwaita',
|
||||
'--output', join_paths(meson.current_build_dir(), 'output'),
|
||||
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
||||
],
|
||||
env: adwaita_env,
|
||||
suite: [ 'css' ],
|
||||
)
|
||||
|
||||
empty_env = csstest_env
|
||||
empty_env.set('GTK_THEME', 'Empty')
|
||||
test('performance-empty', test_performance,
|
||||
args: [
|
||||
'--mark', 'css validation',
|
||||
'--name', 'performance-empty',
|
||||
'--output', join_paths(meson.current_build_dir(), 'output'),
|
||||
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
||||
],
|
||||
env: empty_env,
|
||||
suite: [ 'css' ],
|
||||
)
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
text {
|
||||
font: "text-mixed-color 10px" url("data:font/ttf;base64,\
|
||||
AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
|
||||
font: "text-mixed-color 10px" url("data:font/ttf;base64,AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
|
||||
AAA0Z2x5Zu8g4kAAAAGEAAAA0mhlYWQmofyJAAAArAAAADZoaGVhDAEEAgAAAOQAAAAkaG10eAQA\
|
||||
AQAAAAEoAAAAFGxvY2EAyAD5AAABcAAAABRtYXhwAAwACQAAAQgAAAAgbmFtZX7VdrQAAAJYAAAA\
|
||||
IgABAAAAARmajs74k18PPPUAAggAAAAAAOHCPQAAAAAA4cpY+QAAAAAEAAgAAAAAAQACAAAAAAAA\
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
text {
|
||||
font: "text-mixed-color 10px" url("data:font/ttf;base64,\
|
||||
AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
|
||||
font: "text-mixed-color 10px" url("data:font/ttf;base64,AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\
|
||||
AAA0Z2x5Zu8g4kAAAAGEAAAA0mhlYWQmofyJAAAArAAAADZoaGVhDAEEAgAAAOQAAAAkaG10eAQA\
|
||||
AQAAAAEoAAAAFGxvY2EAyAD5AAABcAAAABRtYXhwAAwACQAAAQgAAAAgbmFtZX7VdrQAAAJYAAAA\
|
||||
IgABAAAAARmajs74k18PPPUAAggAAAAAAOHCPQAAAAAA4cpY+QAAAAAEAAgAAAAAAQACAAAAAAAA\
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
texture {
|
||||
bounds: 0 0 1 1;
|
||||
texture: "texture1" url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4z8DwHwAFAAH/q842\
|
||||
texture: "texture1" url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4z8DwHwAFAAH/q842\
|
||||
iQAAAABJRU5ErkJggg==\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -1,30 +1,26 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
|
||||
");
|
||||
}
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
|
||||
");
|
||||
}
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
filter: nearest;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
|
||||
");
|
||||
}
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
filter: trilinear;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
|
||||
1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
texture-scale {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:image/png;base64,\
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQX\
|
||||
Y0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=\
|
||||
");
|
||||
}
|
||||
|
||||
@@ -277,3 +277,27 @@ make_pot = find_program ('make-pot', dirs: meson.project_source_root())
|
||||
test('potfiles', make_pot,
|
||||
workdir: meson.project_source_root(),
|
||||
suite: ['gtk', 'translations' ])
|
||||
|
||||
if false and get_option ('profiler')
|
||||
|
||||
performance_env = test_env
|
||||
performance_env.set('GTK_THEME', 'Empty')
|
||||
|
||||
test('performance-layout', test_performance,
|
||||
args: [
|
||||
'--mark', 'size allocation',
|
||||
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
||||
],
|
||||
env: performance_env,
|
||||
suite: [ 'gtk' ],
|
||||
)
|
||||
|
||||
test('performance-snapshot', test_performance,
|
||||
args: [
|
||||
'--mark', 'widget snapshot',
|
||||
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
||||
],
|
||||
env: performance_env,
|
||||
suite: [ 'gtk' ],
|
||||
)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user