Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Clasen 937ccf152b Cut down on type-checking overhead
We *know* what the parent class is. There is
no point in checking every time we want to
chain up. We only do this because the
foo_parent_class that the G_DEFINE_TYPE macro
provides for us is a generic pointer. And that
is just because we don't have the C name for
the parent type available there.

Just cast things, and avoid taking type system
locks.
2022-05-17 07:55:13 -04:00
86 changed files with 5078 additions and 5398 deletions
+1 -2
View File
@@ -58,7 +58,6 @@ style-check-diff:
- "${CI_PROJECT_DIR}/_build/report*.xml"
- "${CI_PROJECT_DIR}/_build/report*.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
@@ -173,7 +172,7 @@ macos:
needs: []
before_script:
- bash .gitlab-ci/show-info-osx.sh
- pip3 install --user meson==0.60.3
- pip3 install --user meson==0.59
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1
-4
View File
@@ -185,8 +185,6 @@ ul.images li {
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
<li><a href="{{ failure.image_data.refnode }}">ref node</a></li>
<li><a href="{{ failure.image_data.outnode }}">out node</a></li>
</ul>
{% endif %}
</li>
@@ -313,8 +311,6 @@ for line in args.infile:
image_data = {
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
'refnode': os.path.join(args.reftest_output_dir, '{}.ref.node'.format(basename)),
'outnode': os.path.join(args.reftest_output_dir, '{}.out.node'.format(basename)),
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
}
+1 -1
View File
@@ -5,7 +5,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
@echo on
:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.60.3 || goto :error
pip3 install --upgrade --user meson==0.59 || goto :error
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error
+1 -2
View File
@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_widget)
{
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Welcome to the Hotel California");
gtk_window_set_title (GTK_WINDOW (window), "Welcome to Facebook - Log in, sign up or learn more");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
@@ -31,7 +31,6 @@ do_headerbar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
gtk_widget_set_tooltip_text (button, "Check out");
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+5 -3
View File
@@ -66,9 +66,11 @@ do_links (GtkWidget *do_widget)
"as hyperlinks, which can be clicked "
"or activated via <a href=\"keynav\">keynav</a> "
"and they work fine with other markup, like when "
"linking to <a href=\"http://www.flathub.org/\"><b>"
"<span letter_spacing=\"1024\" underline=\"none\" color=\"pink\" background=\"darkslategray\">Flathub</span>"
"</b></a>.");
"searching on <a href=\"http://www.google.com/\">"
"<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
"<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
"</a>.");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
-23
View File
@@ -57,7 +57,6 @@ struct _NodeEditorWindow
GtkWidget *testcase_cairo_checkbutton;
GtkWidget *testcase_name_entry;
GtkWidget *testcase_save_button;
GtkWidget *scale_scale;
GtkWidget *renderer_listbox;
GListStore *renderers;
@@ -172,7 +171,6 @@ text_changed (GtkTextBuffer *buffer,
GBytes *bytes;
GtkTextIter iter;
GtkTextIter start, end;
float scale;
g_array_remove_range (self->errors, 0, self->errors->len);
text = get_current_text (self->text_buffer);
@@ -183,17 +181,6 @@ text_changed (GtkTextBuffer *buffer,
/* If this is too slow, go fix the parser performance */
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
scale = gtk_scale_button_get_value (GTK_SCALE_BUTTON (self->scale_scale));
if (self->node && scale != 1.0)
{
GskRenderNode *node;
node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
gsk_render_node_unref (self->node);
self->node = node;
}
g_bytes_unref (bytes);
if (self->node)
{
@@ -290,14 +277,6 @@ text_changed (GtkTextBuffer *buffer,
&start, &end);
}
static void
scale_changed (GObject *object,
GParamSpec *pspec,
NodeEditorWindow *self)
{
text_changed (self->text_buffer, self);
}
static gboolean
text_view_query_tooltip_cb (GtkWidget *widget,
int x,
@@ -983,7 +962,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, scale_scale);
gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb);
gtk_widget_class_bind_template_callback (widget_class, open_cb);
@@ -1090,7 +1068,6 @@ node_editor_window_init (NodeEditorWindow *self)
self->text_buffer = gtk_text_buffer_new (self->tag_table);
g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self);
g_signal_connect (self->scale_scale, "notify::value", G_CALLBACK (scale_changed), self);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer);
/* Default */
-17
View File
@@ -157,23 +157,6 @@
<signal name="notify::active" handler="dark_mode_cb" swapped="0"/>
</object>
</child>
<child type="end">
<object class="GtkScaleButton" id="scale_scale">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">1</property>
<property name="value">1</property>
<property name="upper">10</property>
<property name="step-increment">0.1</property>
<property name="page-increment">0.5</property>
</object>
</property>
<property name="icons">zoom-in-symbolic</property>
<property name="tooltip-text" translatable="yes">Scale the image</property>
</object>
</child>
</object>
</child>
<child>
+1 -1
View File
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
devhelp = true
+1 -1
View File
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = ["Gdk-4.0"]
devhelp = true
+2 -1
View File
@@ -189,7 +189,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
message->pointer.state,
message->scroll.dir == 0
? GDK_SCROLL_UP
: GDK_SCROLL_DOWN);
: GDK_SCROLL_DOWN,
FALSE);
node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial);
+2 -7
View File
@@ -66,15 +66,10 @@ typedef enum
/**
* GdkTimeCoord:
* @time: The timestamp for this event
* @flags: Flags indicating what axes are present, see [flags@Gdk.AxisFlags]
* @axes: (array fixed-size=12): axis values, indexed by [enum@Gdk.AxisUse]
* @flags: Flags indicating what axes are present
* @axes: (array fixed-size=12): axis values
*
* A `GdkTimeCoord` stores a single event in a motion history.
*
* To check whether an axis is present, check whether the corresponding
* flag from the [flags@Gdk.AxisFlags] enumeration is set in the @flags
* To access individual axis values, use the values of the values of
* the [enum@Gdk.AxisUse] enumerations as indices.
*/
struct _GdkTimeCoord
{
+11 -1
View File
@@ -920,6 +920,14 @@ gdk_event_get_pointer_emulated (GdkEvent *event)
return tevent->pointer_emulated;
}
case GDK_SCROLL:
case GDK_SCROLL_SMOOTH:
{
GdkScrollEvent *sevent = (GdkScrollEvent *) event;
return sevent->pointer_emulated;
}
default:
break;
}
@@ -2365,13 +2373,15 @@ gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
GdkScrollDirection direction)
GdkScrollDirection direction,
gboolean emulated)
{
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
self->state = state;
self->direction = direction;
self->pointer_emulated = emulated;
self->unit = GDK_SCROLL_UNIT_WHEEL;
return (GdkEvent *) self;
+5 -1
View File
@@ -206,6 +206,8 @@ struct _GdkTouchEvent
* %GDK_SCROLL_SMOOTH).
* @delta_x: the x coordinate of the scroll delta
* @delta_y: the y coordinate of the scroll delta
* @pointer_emulated: whether the scroll event was the result of
* a pointer emulation
* @tool: a `GdkDeviceTool`
* @history: (element-type GdkTimeCoord): array of times and deltas
* for other scroll events that were compressed before delivering the
@@ -229,6 +231,7 @@ struct _GdkScrollEvent
GdkScrollDirection direction;
double delta_x;
double delta_y;
gboolean pointer_emulated;
gboolean is_stop;
GdkDeviceTool *tool;
GArray *history; /* <GdkTimeCoord> */
@@ -493,7 +496,8 @@ GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
GdkScrollDirection direction);
GdkScrollDirection direction,
gboolean emulated);
GdkEvent * gdk_touch_event_new (GdkEventType type,
GdkEventSequence *sequence,
+238 -242
View File
@@ -256,179 +256,181 @@ gdk_gl_context_get_property (GObject *object,
}
}
#define N_EGL_ATTRS 16
#ifdef HAVE_EGL
static inline EGLenum
gdk_api_to_egl_api (GdkGLAPI api)
{
switch (api)
{
case GDK_GL_API_GLES:
return EGL_OPENGL_ES_API;
case GDK_GL_API_GL:
default:
return EGL_OPENGL_API;
}
}
#define N_EGL_ATTRS 16
static GdkGLAPI
gdk_gl_context_create_egl_context (GdkGLContext *context,
GdkGLAPI api,
gboolean legacy)
gdk_gl_context_real_realize (GdkGLContext *context,
GError **error)
{
#ifdef HAVE_EGL
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
EGLDisplay egl_display = gdk_display_get_egl_display (display);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
EGLConfig egl_config;
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;
gboolean debug_bit, forward_bit;
int min_major, min_minor, major = 0, minor = 0;
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
return 0;
/* We will use the default version matching the context status
* unless the user requested a version which makes sense */
gdk_gl_context_get_matching_version (api, legacy,
display->have_egl_win32_libangle,
&min_major, &min_minor);
gdk_gl_context_get_clipped_version (context,
min_major, min_minor,
&major, &minor);
if (!eglBindAPI (gdk_api_to_egl_api (api)))
return 0;
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
if (display->have_egl_no_config_context)
egl_config = NULL;
else
egl_config = gdk_display_get_egl_config (display);
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (forward_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
if (api == GDK_GL_API_GL)
if (egl_display)
{
/* We want a core profile, unless in legacy mode */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK;
context_attribs[i++] = legacy
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT;
EGLConfig egl_config;
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS];
int major, minor, flags;
gboolean debug_bit, forward_bit, legacy_bit;
GdkGLAPI api;
int i = 0;
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
if (share != NULL)
gdk_gl_context_get_required_version (share, &major, &minor);
else
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share));
if (display->have_egl_no_config_context)
egl_config = NULL;
else
egl_config = gdk_display_get_egl_config (display);
flags = 0;
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (forward_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) &&
eglBindAPI (EGL_OPENGL_API))
{
/* We want a core profile, unless in legacy mode */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = legacy_bit
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
/* Specify the version */
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
context_attribs[i++] = legacy_bit ? 3 : major;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
context_attribs[i++] = legacy_bit ? 0 : minor;
api = GDK_GL_API_GL;
}
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) &&
eglBindAPI (EGL_OPENGL_ES_API))
{
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
if (major == 3)
context_attribs[i++] = 3;
else
context_attribs[i++] = 2;
api = GDK_GL_API_GLES;
}
else
{
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
_("The EGL implementation does not support any allowed APIs"));
return 0;
}
/* Specify the flags */
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy_bit ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
/* If context creation failed without the ES bit, let's try again with it */
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) && eglBindAPI (EGL_OPENGL_ES_API))
{
i = 0;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = 2;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = 0;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
legacy_bit = FALSE;
api = GDK_GL_API_GLES;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("eglCreateContext failed, switching to OpenGL ES"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
}
/* If context creation failed without the legacy bit, let's try again with it */
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) && eglBindAPI (EGL_OPENGL_API))
{
i = 0;
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = 3;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = 0;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
legacy_bit = TRUE;
api = GDK_GL_API_GL;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("eglCreateContext failed, switching to legacy"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
}
if (ctx == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy_bit);
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
return api;
}
if (legacy || api == GDK_GL_API_GLES)
flags &= ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = major;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = minor;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
ctx = eglCreateContext (egl_display,
egl_config,
share ? share_priv->egl_context : EGL_NO_CONTEXT,
context_attribs);
if (ctx == NULL)
return 0;
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
return api;
}
static GdkGLAPI
gdk_gl_context_realize_egl (GdkGLContext *context,
GError **error)
{
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLAPI api, preferred_api;
gboolean prefer_legacy;
if (share && gdk_gl_context_is_api_allowed (context,
gdk_gl_context_get_api (share),
NULL))
preferred_api = gdk_gl_context_get_api (share);
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
preferred_api = GDK_GL_API_GL;
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
preferred_api = GDK_GL_API_GLES;
else
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL API allowed."));
return 0;
}
prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share)));
if (preferred_api == GDK_GL_API_GL)
{
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
else
{
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
#endif /* HAVE_EGL */
static GdkGLAPI
gdk_gl_context_default_realize (GdkGLContext *context,
GError **error)
{
#ifdef HAVE_EGL
GdkDisplay *display = gdk_gl_context_get_display (context);
if (gdk_display_get_egl_display (display))
return gdk_gl_context_realize_egl (context, error);
#endif
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
@@ -665,7 +667,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
klass->realize = gdk_gl_context_default_realize;
klass->realize = gdk_gl_context_real_realize;
klass->get_damage = gdk_gl_context_real_get_damage;
klass->is_shared = gdk_gl_context_real_is_shared;
klass->make_current = gdk_gl_context_real_make_current;
@@ -952,48 +954,6 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
return priv->forward_compatible;
}
void
gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor)
{
int maj, min;
if (api == GDK_GL_API_GL)
{
if (legacy)
{
maj = GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR;
min = GDK_GL_MIN_GL_LEGACY_VERSION_MINOR;
}
else
{
maj = GDK_GL_MIN_GL_VERSION_MAJOR;
min = GDK_GL_MIN_GL_VERSION_MINOR;
}
}
else
{
if (win32_libangle)
{
maj = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR;
min = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR;
}
else
{
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
min = GDK_GL_MIN_GLES_VERSION_MINOR;
}
}
if (major != NULL)
*major = maj;
if (minor != NULL)
*minor = min;
}
/**
* gdk_gl_context_set_required_version:
* @context: a `GdkGLContext`
@@ -1004,10 +964,7 @@ gdk_gl_context_get_matching_version (GdkGLAPI api,
*
* Setting @major and @minor to zero will use the default values.
*
* Setting @major and @minor lower than the minimum versions required
* by GTK will result in the context choosing the minimum version.
*
* The @context must not be realized or made current prior to calling
* The `GdkGLContext` must not be realized or made current prior to calling
* this function.
*/
void
@@ -1016,12 +973,44 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean force_gles = FALSE;
int version, min_ver;
#ifdef G_ENABLE_DEBUG
GdkDisplay *display;
#endif
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!gdk_gl_context_is_realized (context));
priv->major = major;
priv->minor = minor;
/* this will take care of the default */
if (major == 0 && minor == 0)
{
priv->major = 0;
priv->minor = 0;
return;
}
version = (major * 100) + minor;
#ifdef G_ENABLE_DEBUG
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
#endif
/* Enforce a minimum context version number of 3.2 for desktop GL,
* and 2.0 for GLES
*/
if (gdk_gl_context_get_use_es (context) || force_gles)
min_ver = 200;
else
min_ver = 302;
if (version < min_ver)
{
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
version = min_ver;
}
priv->major = version / 100;
priv->minor = version % 100;
}
gboolean
@@ -1060,10 +1049,7 @@ gdk_gl_context_check_version (GdkGLContext *self,
* @major: (out) (nullable): return location for the major version to request
* @minor: (out) (nullable): return location for the minor version to request
*
* Retrieves required OpenGL version set as a requirement for the @context
* realization. It will not change even if a greater OpenGL version is supported
* and used after the @context is realized. See
* [method@Gdk.GLContext.get_version] for the real version in use.
* Retrieves required OpenGL version.
*
* See [method@Gdk.GLContext.set_required_version].
*/
@@ -1073,32 +1059,47 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean force_gles = FALSE;
GdkDisplay *display;
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
if (major != NULL)
*major = priv->major;
if (minor != NULL)
*minor = priv->minor;
}
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
void
gdk_gl_context_get_clipped_version (GdkGLContext *context,
int min_major,
int min_minor,
int *major,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
int maj = min_major, min = min_minor;
#ifdef G_ENABLE_DEBUG
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
#endif
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
/* libANGLE on Windows at least requires GLES 3.0+ */
if (display->have_egl_win32_libangle)
force_gles = TRUE;
if (priv->major > maj || (priv->major == maj && priv->minor > min))
/* Default fallback values for uninitialised contexts; we
* enforce a context version number of 3.2 for desktop GL,
* and 2.0 for GLES
*/
if (gdk_gl_context_get_use_es (context) || force_gles)
{
maj = priv->major;
min = priv->minor;
default_major = display->have_egl_win32_libangle ? 3 : 2;
default_minor = 0;
}
else
{
default_major = 3;
default_minor = 2;
}
if (priv->major > 0)
maj = priv->major;
else
maj = default_major;
if (priv->minor > 0)
min = priv->minor;
else
min = default_minor;
if (major != NULL)
*major = maj;
@@ -1335,9 +1336,7 @@ gdk_gl_context_set_use_es (GdkGLContext *context,
*
* Checks whether the @context is using an OpenGL or OpenGL ES profile.
*
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile;
* %FALSE if other profile is in use of if the @context has not yet
* been realized.
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile
*/
gboolean
gdk_gl_context_get_use_es (GdkGLContext *context)
@@ -1668,10 +1667,6 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
* Retrieves the OpenGL version of the @context.
*
* The @context must be realized prior to calling this function.
*
* If the @context has never been made current, the version cannot
* be known and it will return 0 for both @major and @minor.
*
*/
void
gdk_gl_context_get_version (GdkGLContext *context,
@@ -1850,3 +1845,4 @@ gdk_gl_backend_use (GdkGLBackend backend_type)
g_assert (the_gl_backend_type == backend_type);
}
-26
View File
@@ -33,22 +33,6 @@ G_BEGIN_DECLS
#define GDK_EGL_MIN_VERSION_MAJOR (1)
#define GDK_EGL_MIN_VERSION_MINOR (4)
/* Minimum OpenGL versions supported by GTK.
* Backends should make sure to never create a context of a previous version.
*
* The macros refer to OpenGL; OpenGL with OPENGL_COMPATIBILITY_PROFILE_BIT as
* OPENGL_PROFILE_MASK; OpenGL ES; and OpenGL ES win32 Angle implementation,
* respectively
*/
#define GDK_GL_MIN_GL_VERSION_MAJOR (3)
#define GDK_GL_MIN_GL_VERSION_MINOR (2)
#define GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR (3)
#define GDK_GL_MIN_GL_LEGACY_VERSION_MINOR (0)
#define GDK_GL_MIN_GLES_VERSION_MAJOR (2)
#define GDK_GL_MIN_GLES_VERSION_MINOR (0)
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR (3)
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR (0)
typedef enum {
GDK_GL_NONE = 0,
GDK_GL_EGL,
@@ -133,16 +117,6 @@ gboolean gdk_gl_context_check_version (GdkGLContext
int required_gl_minor,
int required_gles_major,
int required_gles_minor);
void gdk_gl_context_get_clipped_version (GdkGLContext *context,
int min_major,
int min_minor,
int *major,
int *minor);
void gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor);
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
void gdk_gl_context_push_debug_group (GdkGLContext *context,
+2 -1
View File
@@ -700,7 +700,8 @@ fill_scroll_event (GdkMacosDisplay *self,
NULL,
get_time_from_ns_event (nsevent),
state,
direction);
direction,
FALSE);
}
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled)
+1 -4
View File
@@ -378,10 +378,7 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context,
existing = CGLGetCurrentContext ();
gdk_gl_context_get_clipped_version (context,
GDK_GL_MIN_GL_VERSION_MAJOR,
GDK_GL_MIN_GL_VERSION_MINOR,
&major, &minor);
gdk_gl_context_get_required_version (context, &major, &minor);
display = gdk_gl_context_get_display (context);
shared = gdk_display_get_gl_context (display);
+28 -66
View File
@@ -200,51 +200,23 @@ wl_cursor_destroy(struct wl_cursor *cursor)
}
static struct wl_cursor *
wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
wl_cursor_create_from_xcursor_images(XcursorImages *images,
struct wl_cursor_theme *theme,
const char *name,
unsigned int size,
unsigned int scale)
unsigned int load_size)
{
char *path;
XcursorImages *images;
struct cursor *cursor;
struct cursor_image *image;
int i, nbytes;
unsigned int load_size;
int load_scale = 1;
load_size = size * scale;
path = g_strconcat (theme->path, "/", name, NULL);
images = xcursor_load_images (path, load_size);
if (!images)
{
g_free (path);
return NULL;
}
if (images->images[0]->width != load_size ||
images->images[0]->height != load_size)
{
xcursor_images_destroy (images);
images = xcursor_load_images (path, size);
load_scale = scale;
}
g_free (path);
int i, size;
cursor = malloc(sizeof *cursor);
if (!cursor) {
xcursor_images_destroy (images);
if (!cursor)
return NULL;
}
cursor->cursor.images =
malloc(images->nimage * sizeof cursor->cursor.images[0]);
if (!cursor->cursor.images) {
free(cursor);
xcursor_images_destroy (images);
return NULL;
}
@@ -260,37 +232,22 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
image->theme = theme;
image->buffer = NULL;
image->image.width = images->images[i]->width * load_scale;
image->image.height = images->images[i]->height * load_scale;
image->image.hotspot_x = images->images[i]->xhot * load_scale;
image->image.hotspot_y = images->images[i]->yhot * load_scale;
image->image.width = images->images[i]->width;
image->image.height = images->images[i]->height;
image->image.hotspot_x = images->images[i]->xhot;
image->image.hotspot_y = images->images[i]->yhot;
image->image.delay = images->images[i]->delay;
nbytes = image->image.width * image->image.height * 4;
image->offset = shm_pool_allocate(theme->pool, nbytes);
size = image->image.width * image->image.height * 4;
image->offset = shm_pool_allocate(theme->pool, size);
if (image->offset < 0) {
free(image);
break;
}
if (load_scale == 1) {
/* copy pixels to shm pool */
memcpy(theme->pool->data + image->offset,
images->images[i]->pixels, nbytes);
}
else {
/* scale image up while copying it */
for (int y = 0; y < image->image.height; y++) {
char *p = theme->pool->data + image->offset + y * image->image.width * 4;
char *q = ((char *)images->images[i]->pixels) + (y / load_scale) * images->images[i]->width * 4;
for (int x = 0; x < image->image.width; x++) {
p[4 * x] = q[4 * (x/load_scale)];
p[4 * x + 1] = q[4 * (x/load_scale) + 1];
p[4 * x + 2] = q[4 * (x/load_scale) + 2];
p[4 * x + 3] = q[4 * (x/load_scale) + 3];
}
}
}
/* copy pixels to shm pool */
memcpy(theme->pool->data + image->offset,
images->images[i]->pixels, size);
cursor->total_delay += image->image.delay;
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
}
@@ -300,24 +257,27 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
free(cursor->cursor.name);
free(cursor->cursor.images);
free(cursor);
xcursor_images_destroy (images);
return NULL;
}
xcursor_images_destroy (images);
return &cursor->cursor;
}
static void
load_cursor(struct wl_cursor_theme *theme,
const char *name,
unsigned int size,
unsigned int scale)
load_cursor(struct wl_cursor_theme *theme, const char *name, unsigned int size)
{
XcursorImages *images;
struct wl_cursor *cursor;
char *path;
cursor = wl_cursor_create_from_xcursor_images(theme, name, size, scale);
path = g_strconcat (theme->path, "/", name, NULL);
images = xcursor_load_images (path, size);
g_free (path);
if (!images)
return;
cursor = wl_cursor_create_from_xcursor_images(images, theme, name, size);
if (cursor) {
theme->cursor_count++;
@@ -332,6 +292,8 @@ load_cursor(struct wl_cursor_theme *theme,
theme->cursors[theme->cursor_count - 1] = cursor;
}
}
xcursor_images_destroy (images);
}
/** Load a cursor theme to memory shared with the compositor
@@ -411,7 +373,7 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
return theme->cursors[i];
}
load_cursor (theme, name, theme->size, scale);
load_cursor (theme, name, size);
if (i < theme->cursor_count) {
if (size == theme->cursors[i]->size &&
+4 -13
View File
@@ -59,17 +59,13 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
if (display->xdg_activation)
{
struct xdg_activation_token_v1 *token;
struct wl_event_queue *event_queue;
struct wl_surface *wl_surface = NULL;
GdkWaylandSeat *seat;
GdkSurface *focus_surface;
AppLaunchData app_launch_data = { 0 };
event_queue = wl_display_create_queue (display->wl_display);
seat = GDK_WAYLAND_SEAT (gdk_display_get_default_seat (GDK_DISPLAY (display)));
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
token = xdg_activation_v1_get_activation_token (display->xdg_activation);
wl_proxy_set_queue ((struct wl_proxy *) token, event_queue);
xdg_activation_token_v1_add_listener (token,
&token_listener,
@@ -77,21 +73,16 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
xdg_activation_token_v1_set_serial (token,
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
if (focus_surface)
wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
if (wl_surface)
xdg_activation_token_v1_set_surface (token, wl_surface);
xdg_activation_token_v1_set_surface (token,
gdk_wayland_surface_get_wl_surface (focus_surface));
xdg_activation_token_v1_commit (token);
while (app_launch_data.token == NULL)
wl_display_dispatch_queue (display->wl_display, event_queue);
wl_display_roundtrip (display->wl_display);
xdg_activation_token_v1_destroy (token);
id = app_launch_data.token;
wl_event_queue_destroy (event_queue);
}
else if (display->gtk_shell_version >= 3)
{
+5 -16
View File
@@ -178,7 +178,6 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
if (c)
{
struct wl_cursor_image *image;
int cursor_scale;
if (image_index >= c->image_count)
{
@@ -190,22 +189,12 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
image = c->images[image_index];
cursor_scale = desired_scale;
if ((image->width % cursor_scale != 0) ||
(image->height % cursor_scale != 0))
{
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 / desired_scale;
*hotspot_y = image->hotspot_y / desired_scale;
*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;
*width = image->width / desired_scale;
*height = image->height / desired_scale;
*scale = desired_scale;
return wl_cursor_image_get_buffer (image);
}
+13 -1
View File
@@ -1394,7 +1394,8 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
NULL,
seat->pointer_info.time,
device_get_modifiers (seat->logical_pointer),
direction);
direction,
TRUE);
_gdk_wayland_display_deliver_event (seat->display, event);
}
@@ -3998,6 +3999,17 @@ tablet_tool_handle_wheel (void *data,
GDK_SCROLL_UNIT_WHEEL);
_gdk_wayland_display_deliver_event (seat->display, event);
/* Send discrete event */
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
clicks > 0 ? GDK_SCROLL_DOWN : GDK_SCROLL_UP,
TRUE);
_gdk_wayland_display_deliver_event (seat->display, event);
}
static void
+11 -5
View File
@@ -548,12 +548,17 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
* wglCreateContextAttribsARB() may only give us the GL context version
* that we ask for here, and nothing more. So, improve things here by
* asking for the GL version that is reported to us via epoxy_gl_version(),
* rather than the default GL core 3.2 context.
* rather than the default GL core 3.2 context. Save this up in our
* GdkGLContext so that subsequent contexts that are shared with this
* context are created likewise too.
*/
gdk_gl_context_get_clipped_version (context,
display_win32->gl_version / 10,
display_win32->gl_version % 10,
&major, &minor);
if (share != NULL)
gdk_gl_context_get_required_version (share, &major, &minor);
else
{
major = display_win32->gl_version / 10;
minor = display_win32->gl_version % 10;
}
if (surface != NULL)
hdc = GDK_WIN32_SURFACE (surface)->hdc;
@@ -621,6 +626,7 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
gdk_gl_context_set_required_version (context, major, minor);
return GDK_GL_API_GL;
}
+2 -8
View File
@@ -167,10 +167,8 @@ DManipEventHandler_OnContentUpdated (IDirectManipulationViewportEventHandler *se
{
case GESTURE_PAN:
{
GdkWin32Surface *surface_win32;
GdkModifierType state;
uint32_t time;
int scale;
float pan_x;
float pan_y;
GdkEvent *event;
@@ -178,16 +176,14 @@ DManipEventHandler_OnContentUpdated (IDirectManipulationViewportEventHandler *se
pan_x = transform[4];
pan_y = transform[5];
surface_win32 = GDK_WIN32_SURFACE (self->surface);
scale = surface_win32->surface_scale;
state = util_get_modifier_state ();
time = (uint32_t) GetMessageTime ();
event = gdk_scroll_event_new (self->surface,
self->device,
NULL, time, state,
(self->pan_x - pan_x) / scale,
(self->pan_y - pan_y) / scale,
self->pan_x - pan_x,
self->pan_y - pan_y,
FALSE,
GDK_SCROLL_UNIT_SURFACE);
_gdk_win32_append_event (event);
@@ -359,8 +355,6 @@ reset_viewport (IDirectManipulationViewport *viewport)
hr = IDirectManipulationContent_SyncContentTransform (content, identity,
G_N_ELEMENTS (identity));
HR_CHECK (hr);
IUnknown_Release (content);
}
static void
+4 -2
View File
@@ -1655,7 +1655,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
NULL,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
direction);
direction,
FALSE);
}
else
@@ -1757,7 +1758,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
NULL,
xev->time,
state,
direction);
direction,
FALSE);
}
else
{
+168 -143
View File
@@ -213,7 +213,7 @@ gdk_x11_gl_context_glx_clear_current (GdkGLContext *context)
static gboolean
gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
gboolean surfaceless)
{
GdkX11GLContextGLX *self = GDK_X11_GL_CONTEXT_GLX (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
@@ -302,6 +302,68 @@ gdk_x11_gl_context_glx_get_damage (GdkGLContext *context)
return GDK_GL_CONTEXT_CLASS (gdk_x11_gl_context_glx_parent_class)->get_damage (context);
}
static GLXContext
create_gl3_context (GdkDisplay *display,
GLXFBConfig config,
GdkGLContext *share,
int profile,
int flags,
int major,
int minor)
{
int attrib_list[] = {
GLX_CONTEXT_PROFILE_MASK_ARB, profile,
GLX_CONTEXT_MAJOR_VERSION_ARB, major,
GLX_CONTEXT_MINOR_VERSION_ARB, minor,
GLX_CONTEXT_FLAGS_ARB, flags,
None,
};
GLXContext res;
GdkX11GLContextGLX *share_glx = NULL;
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
res = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
config,
share_glx != NULL ? share_glx->glx_context : NULL,
True,
attrib_list);
if (gdk_x11_display_error_trap_pop (display))
return NULL;
return res;
}
static GLXContext
create_legacy_context (GdkDisplay *display,
GLXFBConfig config,
GdkGLContext *share)
{
GdkX11GLContextGLX *share_glx = NULL;
GLXContext res;
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
res = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
config,
GLX_RGBA_TYPE,
share_glx != NULL ? share_glx->glx_context : NULL,
TRUE);
if (gdk_x11_display_error_trap_pop (display))
return NULL;
return res;
}
#ifdef HAVE_XDAMAGE
static void
bind_context_for_frame_fence (GdkX11GLContextGLX *self)
@@ -445,111 +507,134 @@ on_surface_state_changed (GdkGLContext *context)
*/
finish_frame (context);
}
#endif /* HAVE_XDAMAGE */
#define N_GLX_ATTRS 16
#endif
static GdkGLAPI
gdk_x11_context_create_glx_context (GdkGLContext *context,
GdkGLAPI api,
gboolean legacy)
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
GError **error)
{
GdkX11GLContextGLX *context_glx = GDK_X11_GL_CONTEXT_GLX (context);;
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
Display *dpy = gdk_x11_display_get_xdisplay (display);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkX11GLContextGLX *share_glx = NULL;
GdkSurface *surface = gdk_gl_context_get_surface (context);
GLXContext ctx;
int context_attribs[N_GLX_ATTRS], i = 0, flags = 0;
int min_major, min_minor, major, minor;
gboolean debug_bit, compat_bit;
GdkX11Display *display_x11;
GdkDisplay *display;
GdkX11GLContextGLX *context_glx;
Display *dpy;
GdkSurface *surface;
GdkGLContext *share;
gboolean debug_bit, compat_bit, legacy_bit;
int major, minor, flags;
GdkGLAPI api = 0;
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
return 0;
if (api == GDK_GL_API_GLES && legacy)
return 0;
/* We will use the default version matching the context status
* unless the user requested a version which makes sense */
gdk_gl_context_get_matching_version (api, legacy, 0,
&min_major, &min_minor);
gdk_gl_context_get_clipped_version (context, min_major, min_minor,
&major, &minor);
display = gdk_gl_context_get_display (context);
dpy = gdk_x11_display_get_xdisplay (display);
context_glx = GDK_X11_GL_CONTEXT_GLX (context);
display_x11 = GDK_X11_DISPLAY (display);
share = gdk_display_get_gl_context (display);
surface = gdk_gl_context_get_surface (context);
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
compat_bit = gdk_gl_context_get_forward_compatible (context);
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
legacy_bit = !display_x11->has_glx_create_context || GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY);
/* We cannot share legacy contexts with core profile ones, so the
* shared context is the one that decides if we're going to create
* a legacy context or not.
*/
if (share != NULL && gdk_gl_context_is_legacy (share))
legacy_bit = TRUE;
flags = 0;
if (debug_bit)
flags |= GLX_CONTEXT_DEBUG_BIT_ARB;
if (compat_bit)
flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
context_attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
if (api == GDK_GL_API_GL)
if (legacy)
context_attribs[i++] = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
else
context_attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
else if (api == GDK_GL_API_GLES)
context_attribs[i++] = GLX_CONTEXT_ES2_PROFILE_BIT_EXT;
context_attribs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
context_attribs[i++] = major;
context_attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
context_attribs[i++] = minor;
context_attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
context_attribs[i++] = flags;
context_attribs[i++] = None;
g_assert (i < N_GLX_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating GLX context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
g_message ("Creating GLX context (GL version:%d.%d, debug:%s, forward:%s, legacy:%s, GL:%s, GLES:%s)",
major, minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no",
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) ? "yes" : "no",
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) ? "yes" : "no"));
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
/* If we don't have access to GLX_ARB_create_context_profile, then
* we have to fall back to the old GLX 1.3 API.
/* If we have access to GLX_ARB_create_context_profile then we can ask for
* a compatibility profile; if we don't, then we have to fall back to the
* old GLX 1.3 API.
*/
if (legacy && !display_x11->has_glx_create_context)
ctx = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
display_x11->glx_config,
GLX_RGBA_TYPE,
share_glx != NULL ? share_glx->glx_context : NULL,
TRUE);
if (legacy_bit && !GDK_X11_DISPLAY (display)->has_glx_create_context)
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating legacy GL context on request"));
/* do it below */
}
else
ctx = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
display_x11->glx_config,
share_glx != NULL ? share_glx->glx_context : NULL,
True,
context_attribs);
{
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
{
int profile = legacy_bit ? GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
: GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
if (gdk_x11_display_error_trap_pop (display) || ctx == NULL)
return 0;
/* We need to tweak the version, otherwise we may end up requesting
* a compatibility context with a minimum version of 3.2, which is
* an error
*/
if (legacy_bit)
{
major = 3;
minor = 0;
}
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 context"));
context_glx->glx_context = create_gl3_context (display,
display_x11->glx_config,
share,
profile,
flags, major, minor);
api = GDK_GL_API_GL;
}
if (context_glx->glx_context == NULL && !legacy_bit &&
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 GLES context"));
context_glx->glx_context = create_gl3_context (display,
display_x11->glx_config,
share,
GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
flags, major, minor);
api = GDK_GL_API_GLES;
}
}
/* Fall back to legacy in case the GL3 context creation failed */
if (context_glx->glx_context == NULL &&
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating fallback legacy context"));
context_glx->glx_context = create_legacy_context (display, display_x11->glx_config, share);
legacy_bit = TRUE;
api = GDK_GL_API_GL;
}
if (context_glx->glx_context == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Realized GLX context[%p], %s, version: %d.%d",
context_glx->glx_context,
glXIsDirect (dpy, context_glx->glx_context) ? "direct" : "indirect",
display_x11->glx_version / 10,
display_x11->glx_version % 10));
context_glx->glx_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
#ifdef HAVE_XDAMAGE
if (display_x11->have_damage &&
display_x11->has_async_glx_swap_buffers)
@@ -578,70 +663,10 @@ gdk_x11_context_create_glx_context (GdkGLContext *context,
}
}
#endif
return api;
}
static GdkGLAPI
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
GError **error)
{
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_display_get_gl_context (display);
gboolean legacy;
GdkGLAPI api, preferred_api;
if (share && gdk_gl_context_is_api_allowed (context,
gdk_gl_context_get_api (share),
NULL))
preferred_api = gdk_gl_context_get_api (share);
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
preferred_api = GDK_GL_API_GL;
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
preferred_api = GDK_GL_API_GLES;
else
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL API allowed."));
return 0;
}
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
legacy = !GDK_X11_DISPLAY (display)->has_glx_create_context;
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY))
legacy = TRUE;
/* We cannot share legacy contexts with core profile ones, so the
* shared context is the one that decides if we're going to create
* a legacy context or not.
*/
if (share != NULL && gdk_gl_context_is_legacy (share))
legacy = TRUE;
if (preferred_api == GDK_GL_API_GL)
{
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
else
{
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
#undef N_GLX_ATTRS
static void
gdk_x11_gl_context_glx_dispose (GObject *gobject)
{
@@ -795,7 +820,7 @@ gdk_x11_display_create_glx_config (GdkX11Display *self,
XFree (visinfo);
continue;
}
if (!visual_is_rgba (visinfo))
{
if (best_features < NO_ALPHA_VISUAL)
@@ -869,7 +894,7 @@ gdk_x11_display_get_glx_version (GdkDisplay *display,
/*< private >
* gdk_x11_display_init_glx:
* @display_x11: an X11 display that has not been inited yet.
* @display_x11: an X11 display that has not been inited yet.
* @out_visual: set to the Visual to be used with the returned config
* @out_depth: set to the depth to be used with the returned config
* @error: Return location for error
+1 -1
View File
@@ -280,7 +280,7 @@ compute_toplevel_size (GdkSurface *surface,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (GDK_TOPLEVEL (surface), &size);
if (size.shadow.is_valid)
if (size.shadow.is_valid && update_geometry)
{
update_shadow_size (surface,
size.shadow.left,
+6 -20
View File
@@ -68,23 +68,6 @@ parse_rect (GtkCssParser *parser,
return TRUE;
}
static gboolean
parse_vec4 (GtkCssParser *parser,
gpointer out_vec4)
{
double numbers[4];
if (!gtk_css_parser_consume_number (parser, &numbers[0]) ||
!gtk_css_parser_consume_number (parser, &numbers[1]) ||
!gtk_css_parser_consume_number (parser, &numbers[2]) ||
!gtk_css_parser_consume_number (parser, &numbers[3]))
return FALSE;
graphene_vec4_init (out_vec4, numbers[0], numbers[1], numbers[2], numbers[3]);
return TRUE;
}
static gboolean
parse_texture (GtkCssParser *parser,
gpointer out_data)
@@ -1507,20 +1490,23 @@ parse_color_matrix_node (GtkCssParser *parser)
GskRenderNode *child = NULL;
graphene_matrix_t matrix;
GskTransform *transform = NULL;
graphene_rect_t offset_rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
graphene_vec4_t offset;
const Declaration declarations[] = {
{ "matrix", parse_transform, clear_transform, &transform },
{ "offset", parse_vec4, NULL, &offset },
{ "offset", parse_rect, NULL, &offset_rect },
{ "child", parse_node, clear_node, &child }
};
GskRenderNode *result;
graphene_vec4_init (&offset, 0, 0, 0, 0);
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
if (child == NULL)
child = create_default_render_node ();
graphene_vec4_init (&offset,
offset_rect.origin.x, offset_rect.origin.y,
offset_rect.size.width, offset_rect.size.height);
gsk_transform_to_matrix (transform, &matrix);
result = gsk_color_matrix_node_new (child, &matrix, &offset);
+4 -5
View File
@@ -37,11 +37,10 @@ gsk_vulkan_command_pool_new (GdkVulkanContext *context)
static void
gsk_vulkan_command_pool_free_buffers (GskVulkanCommandPool *self)
{
if (self->buffers->len != 0)
vkFreeCommandBuffers (gdk_vulkan_context_get_device (self->vulkan),
self->vk_command_pool,
self->buffers->len,
(VkCommandBuffer *) self->buffers->pdata);
vkFreeCommandBuffers (gdk_vulkan_context_get_device (self->vulkan),
self->vk_command_pool,
self->buffers->len,
(VkCommandBuffer *) self->buffers->pdata);
g_ptr_array_set_size (self->buffers, 0);
}
+1 -1
View File
@@ -170,7 +170,7 @@ gsk_vulkan_render_pass_new (GdkVulkanContext *context,
.samples = VK_SAMPLE_COUNT_1_BIT,
.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
.finalLayout = final_layout
}
},
+1 -5
View File
@@ -436,11 +436,7 @@ get_parent_context_ref (GtkAccessible *accessible)
gtk_accessible_get_at_context (GTK_ACCESSIBLE (parent));
if (parent_context != NULL)
{
gtk_at_context_realize (parent_context);
res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context));
}
res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context));
}
if (res == NULL)
+1 -41
View File
@@ -1098,47 +1098,7 @@ text_view_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetCharacterExtents") == 0)
{
int offset = 0;
guint coords_type;
g_variant_get (parameters, "(iu)", &offset, &coords_type);
if (coords_type != ATSPI_COORD_TYPE_WINDOW)
{
g_dbus_method_invocation_return_error_literal (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_NOT_SUPPORTED,
"Unsupported coordinate space");
return;
}
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
GtkTextIter iter;
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
GdkRectangle rect = { 0, };
gtk_text_view_get_iter_location (GTK_TEXT_VIEW (widget), &iter, &rect);
int x, y;
gtk_text_view_buffer_to_window_coords (GTK_TEXT_VIEW (widget),
GTK_TEXT_WINDOW_WIDGET,
rect.x, rect.y,
&x, &y);
double dx, dy;
gtk_widget_translate_coordinates (widget,
GTK_WIDGET (gtk_widget_get_native (widget)),
(double) x, (double) y, &dx, &dy);
x = floor (dx);
y = floor (dy);
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(iiii)",
x,
y,
rect.width,
rect.height));
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
}
else if (g_strcmp0 (method_name, "GetRangeExtents") == 0)
{
+2 -2
View File
@@ -1409,13 +1409,13 @@ expression_info_construct (GtkBuilder *builder,
return NULL;
}
if (g_type_fundamental (type) == G_TYPE_OBJECT)
if (g_type_is_a (type, G_TYPE_OBJECT))
{
GObjectClass *class = g_type_class_ref (type);
pspec = g_object_class_find_property (class, info->property.property_name);
g_type_class_unref (class);
}
else if (g_type_fundamental (type) == G_TYPE_INTERFACE)
else if (g_type_is_a (type, G_TYPE_INTERFACE))
{
GTypeInterface *iface = g_type_default_interface_ref (type);
pspec = g_object_interface_find_property (iface, info->property.property_name);
+2 -2
View File
@@ -959,7 +959,7 @@ gtk_check_button_set_label (GtkCheckButton *self,
gtk_label_set_use_underline (GTK_LABEL (child), priv->use_underline);
gtk_check_button_real_set_child (self, GTK_WIDGET (child), LABEL_CHILD);
}
gtk_widget_add_css_class (GTK_WIDGET (self), "text-button");
gtk_label_set_label (GTK_LABEL (priv->child), label);
}
@@ -1099,7 +1099,7 @@ gtk_check_button_set_use_underline (GtkCheckButton *self,
return;
priv->use_underline = setting;
if (priv->child_type == LABEL_CHILD && priv->child != NULL)
if (priv->child_type == LABEL_CHILD)
gtk_label_set_use_underline (GTK_LABEL (priv->child), priv->use_underline);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_USE_UNDERLINE]);
+12 -7
View File
@@ -41,6 +41,9 @@ struct _GtkColumnListItemFactoryClass
G_DEFINE_TYPE (GtkColumnListItemFactory, gtk_column_list_item_factory, GTK_TYPE_LIST_ITEM_FACTORY)
#define ancestor_class(T_N) ((T_N##Class *)gtk_column_list_item_factory_parent_class)
#define parent_class ancestor_class(GtkListItemFactory)
static void
gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
GtkListItemWidget *widget,
@@ -54,7 +57,7 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
gtk_widget_set_layout_manager (GTK_WIDGET (widget),
gtk_column_view_layout_new (self->view));
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->setup (factory, widget, list_item);
parent_class->setup (factory, widget, list_item);
columns = gtk_column_view_get_columns (self->view);
@@ -76,13 +79,14 @@ gtk_column_list_item_factory_teardown (GtkListItemFactory *factory,
GtkListItemWidget *widget,
GtkListItem *list_item)
{
GtkWidget *w = GTK_WIDGET (widget);
GtkWidget *child;
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->teardown (factory, widget, list_item);
parent_class->teardown (factory, widget, list_item);
while ((child = gtk_widget_get_first_child (GTK_WIDGET (widget))))
while ((child = gtk_widget_get_first_child (w)))
{
gtk_list_item_widget_remove_child (GTK_LIST_ITEM_WIDGET (widget), child);
gtk_list_item_widget_remove_child (widget, child);
}
}
@@ -94,11 +98,12 @@ gtk_column_list_item_factory_update (GtkListItemFactory *factory,
gpointer item,
gboolean selected)
{
GtkWidget *w = GTK_WIDGET (widget);
GtkWidget *child;
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->update (factory, widget, list_item, position, item, selected);
parent_class->update (factory, widget, list_item, position, item, selected);
for (child = gtk_widget_get_first_child (GTK_WIDGET (widget));
for (child = gtk_widget_get_first_child (w);
child;
child = gtk_widget_get_next_sibling (child))
{
@@ -142,7 +147,7 @@ gtk_column_list_item_factory_add_column (GtkColumnListItemFactory *factory,
GtkWidget *cell;
cell = gtk_column_view_cell_new (column);
gtk_list_item_widget_add_child (GTK_LIST_ITEM_WIDGET (list_item), GTK_WIDGET (cell));
gtk_list_item_widget_add_child (list_item, cell);
gtk_list_item_widget_update (GTK_LIST_ITEM_WIDGET (cell),
gtk_list_item_widget_get_position (list_item),
gtk_list_item_widget_get_item (list_item),
-1
View File
@@ -82,7 +82,6 @@ typedef enum {
GTK_DEBUG_BUILDER_OBJECTS = 1 << 16,
GTK_DEBUG_A11Y = 1 << 17,
GTK_DEBUG_ICONFALLBACK = 1 << 18,
GTK_DEBUG_INVERT_TEXT_DIR = 1 << 19,
} GtkDebugFlags;
#ifdef G_ENABLE_DEBUG
+1 -1
View File
@@ -411,7 +411,7 @@ gtk_gesture_click_class_init (GtkGestureClickClass *klass)
* @x: X coordinate of the event
* @y: Y coordinate of the event
* @button: Button being released
* @sequence: (nullable): Sequence being released
* @sequence: Sequence being released
*
* Emitted whenever the gesture receives a release
* event that had no previous corresponding press.
+1 -1
View File
@@ -230,7 +230,7 @@ gtk_gesture_drag_new (void)
*
* If the @gesture is active, this function returns %TRUE
* and fills in @x and @y with the drag start coordinates,
* in widget-relative coordinates.
* in surface-relative coordinates.
*
* Returns: %TRUE if the gesture is active
*/
+2 -12
View File
@@ -1709,7 +1709,7 @@ static const char builtin_hicolor_index[] =
"[Icon Theme]\n"
"Name=Hicolor\n"
"Hidden=True\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions,scalable/status,scalable/actions\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions\n"
"[16x16/actions]\n"
"Size=16\n"
"Type=Threshold\n"
@@ -1736,17 +1736,7 @@ static const char builtin_hicolor_index[] =
"Type=Threshold\n"
"[64x64/actions]\n"
"Size=64\n"
"Type=Threshold\n"
"[scalable/status]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n"
"[scalable/actions]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n";
"Type=Threshold\n";
static void
insert_theme (GtkIconTheme *self,
+1 -1
View File
@@ -813,7 +813,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
gboolean compose_match;
guint keyval, state;
while (n_compose < priv->compose_buffer_len && priv->compose_buffer[n_compose] != 0)
while (priv->compose_buffer[n_compose] != 0 && n_compose < priv->compose_buffer_len)
n_compose++;
keyval = gdk_key_event_get_keyval (event);
-6
View File
@@ -2020,12 +2020,6 @@ gtk_label_mnemonic_activate (GtkWidget *widget,
if (self->mnemonic_widget)
return gtk_widget_mnemonic_activate (self->mnemonic_widget, group_cycling);
/* Not a label for something else, but is selectable, so set focus into
* the label itself.
*/
if (gtk_label_get_selectable (self) && gtk_widget_get_focusable (widget))
return gtk_label_grab_focus (widget);
/* Try to find the widget to activate by traversing the
* widget's ancestry.
*/
+6 -25
View File
@@ -37,13 +37,6 @@
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
/* Allow shadows to overdraw without immediately culling the widget at the viewport
* boundary.
* Choose this so that roughly 1 extra widget gets drawn on each side of the viewport,
* but not more. Icons are 16px, text height is somewhere there, too.
*/
#define GTK_LIST_BASE_CHILD_MAX_OVERDRAW 10
typedef struct _RubberbandData RubberbandData;
struct _RubberbandData
@@ -1358,22 +1351,6 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
int height)
{
GtkAllocation child_allocation;
int self_width, self_height;
self_width = gtk_widget_get_width (GTK_WIDGET (self));
self_height = gtk_widget_get_height (GTK_WIDGET (self));
if (y + height + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
y - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_height ||
x + width + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
x - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_width)
{
/* child is fully outside the viewport, hide it and don't allocate it */
gtk_widget_set_child_visible (child, FALSE);
return;
}
gtk_widget_set_child_visible (child, TRUE);
if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
{
@@ -1386,7 +1363,9 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
}
else
{
child_allocation.x = self_width - x - width;
int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
child_allocation.x = mirror_point - x - width;
child_allocation.y = y;
child_allocation.width = width;
child_allocation.height = height;
@@ -1403,7 +1382,9 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
}
else
{
child_allocation.x = self_width - y - height;
int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
child_allocation.x = mirror_point - y - height;
child_allocation.y = x;
child_allocation.width = height;
child_allocation.height = width;
+3 -1
View File
@@ -62,6 +62,8 @@ enum
G_DEFINE_TYPE (GtkListItem, gtk_list_item, G_TYPE_OBJECT)
#define parent_class ((GObjectClass *)gtk_list_item_parent_class)
static GParamSpec *properties[N_PROPS] = { NULL, };
static void
@@ -72,7 +74,7 @@ gtk_list_item_dispose (GObject *object)
g_assert (self->owner == NULL); /* would hold a reference */
g_clear_object (&self->child);
G_OBJECT_CLASS (gtk_list_item_parent_class)->dispose (object);
parent_class->dispose (object);
}
static void
+1 -1
View File
@@ -96,7 +96,7 @@ gtk_list_item_factory_default_teardown (GtkListItemFactory *self,
gtk_list_item_set_child (list_item, NULL);
}
static void
static void
gtk_list_item_factory_default_update (GtkListItemFactory *self,
GtkListItemWidget *widget,
GtkListItem *list_item,
+7 -4
View File
@@ -62,6 +62,9 @@ enum
G_DEFINE_TYPE_WITH_PRIVATE (GtkListItemWidget, gtk_list_item_widget, GTK_TYPE_WIDGET)
#define ancestor_class(T_N) ((T_N##Class *)gtk_list_item_widget_parent_class)
#define parent_class ancestor_class(GtkWidget)
static GParamSpec *properties[N_PROPS] = { NULL, };
static guint signals[LAST_SIGNAL] = { 0 };
@@ -137,7 +140,7 @@ gtk_list_item_widget_grab_focus (GtkWidget *widget)
!priv->list_item->selectable)
return FALSE;
return GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->grab_focus (widget);
return parent_class->grab_focus (widget);
}
static void
@@ -146,7 +149,7 @@ gtk_list_item_widget_root (GtkWidget *widget)
GtkListItemWidget *self = GTK_LIST_ITEM_WIDGET (widget);
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->root (widget);
parent_class->root (widget);
if (priv->factory)
gtk_list_item_factory_setup (priv->factory, self);
@@ -158,7 +161,7 @@ gtk_list_item_widget_unroot (GtkWidget *widget)
GtkListItemWidget *self = GTK_LIST_ITEM_WIDGET (widget);
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->unroot (widget);
parent_class->unroot (widget);
if (priv->list_item)
gtk_list_item_factory_teardown (priv->factory, self);
@@ -199,7 +202,7 @@ gtk_list_item_widget_dispose (GObject *object)
g_clear_object (&priv->item);
g_clear_object (&priv->factory);
G_OBJECT_CLASS (gtk_list_item_widget_parent_class)->dispose (object);
ancestor_class(GObject)->dispose (object);
}
static void
+1 -12
View File
@@ -203,7 +203,6 @@ static const GdkDebugKey gtk_debug_keys[] = {
{ "snapshot", GTK_DEBUG_SNAPSHOT, "Generate debug render nodes" },
{ "accessibility", GTK_DEBUG_A11Y, "Information about accessibility state changes" },
{ "iconfallback", GTK_DEBUG_ICONFALLBACK, "Information about icon fallback" },
{ "invert-text-dir", GTK_DEBUG_INVERT_TEXT_DIR, "Invert the default text direction" },
};
/* This checks to see if the process is running suid or sgid
@@ -524,7 +523,6 @@ static void
do_post_parse_initialization (void)
{
GdkDisplayManager *display_manager;
GtkTextDirection text_dir;
gint64 before G_GNUC_UNUSED;
if (gtk_initialized)
@@ -538,16 +536,7 @@ do_post_parse_initialization (void)
signal (SIGPIPE, SIG_IGN);
#endif
text_dir = gtk_get_locale_direction ();
/* We always allow inverting the text direction, even in
* production builds, as SDK/IDE tooling may provide the
* ability for developers to test rtl/ltr inverted.
*/
if (gtk_get_debug_flags () & GTK_DEBUG_INVERT_TEXT_DIR)
text_dir = (text_dir == GTK_TEXT_DIR_LTR) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR;
gtk_widget_set_default_direction (text_dir);
gtk_widget_set_default_direction (gtk_get_locale_direction ());
gdk_event_init_types ();
+1 -1
View File
@@ -871,7 +871,7 @@ gtk_shortcut_controller_get_scope (GtkShortcutController *self)
}
/**
* gtk_shortcut_controller_set_mnemonics_modifiers: (attributes org.gtk.Method.set_property=mnemonic-modifiers)
* gtk_shortcut_controller_set_mnemonics_modifiers: (attributes org.gtk.MEthod.set_property=mnemonic-modifiers)
* @self: a `GtkShortcutController`
* @modifiers: the new mnemonics_modifiers to use
*
+1 -7
View File
@@ -6535,13 +6535,7 @@ blink_cb (GtkWidget *widget,
return G_SOURCE_REMOVE;
}
if (priv->selection_bound != priv->current_pos)
{
g_warning ("GtkText - unexpected blinking selection. Removing");
gtk_text_check_cursor_blink (self);
return G_SOURCE_REMOVE;
}
g_assert (priv->selection_bound == priv->current_pos);
blink_timeout = get_cursor_blink_timeout (self);
blink_time = get_cursor_time (self);
+4 -4
View File
@@ -59,7 +59,7 @@
<child>
<object class="GtkStackPage">
<property name="name">main</property>
<property name="title" translatable="yes">About</property>
<property name="title" translatable="1">About</property>
<property name="child">
<object class="GtkBox" id="page_vbox">
<property name="orientation">1</property>
@@ -120,7 +120,7 @@
<object class="GtkStackPage">
<property name="name">credits</property>
<property name="visible">0</property>
<property name="title" translatable="yes">Credits</property>
<property name="title" translatable="1">Credits</property>
<property name="child">
<object class="GtkBox" id="credits_page">
<property name="orientation">1</property>
@@ -160,7 +160,7 @@
<object class="GtkStackPage">
<property name="name">license</property>
<property name="visible">0</property>
<property name="title" translatable="yes">License</property>
<property name="title" translatable="1">License</property>
<property name="child">
<object class="GtkBox" id="license_page">
<property name="orientation">1</property>
@@ -203,7 +203,7 @@
<object class="GtkStackPage">
<property name="name">system</property>
<property name="visible">0</property>
<property name="title" translatable="yes">System</property>
<property name="title" translatable="1">System</property>
<property name="child">
<object class="GtkBox" id="system_page">
<property name="orientation">1</property>
+5 -5
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkAppChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select Application</property>
<property name="title" translatable="1">Select Application</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -42,12 +42,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="label" translatable="1">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="ok_button">
<property name="label" translatable="yes">_Select</property>
<property name="label" translatable="1">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
@@ -57,13 +57,13 @@
</action-widgets>
</template>
<object class="GtkButton" id="show_more_button">
<property name="label" translatable="yes">_View All Applications</property>
<property name="label" translatable="1">_View All Applications</property>
<property name="use-underline">1</property>
<property name="receives-default">1</property>
<signal name="clicked" handler="show_more_button_clicked_cb" swapped="no"/>
</object>
<object class="GtkButton" id="software_button">
<property name="label" translatable="yes">_Find New Applications</property>
<property name="label" translatable="1">_Find New Applications</property>
<property name="use-underline">1</property>
<property name="receives-default">1</property>
<signal name="clicked" handler="software_button_clicked_cb" swapped="no"/>
+1 -1
View File
@@ -97,7 +97,7 @@
</child>
<child>
<object class="GtkLabel" id="no_apps_label">
<property name="label" translatable="yes">No applications found.</property>
<property name="label" translatable="1">No applications found.</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="wrap">1</property>
+6 -6
View File
@@ -37,7 +37,7 @@
<child>
<object class="GtkButton" id="close">
<property name="visible">0</property>
<property name="label" translatable="yes">_Close</property>
<property name="label" translatable="1">_Close</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -49,7 +49,7 @@
<child>
<object class="GtkButton" id="cancel">
<property name="visible">0</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="label" translatable="1">_Cancel</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -61,7 +61,7 @@
<child>
<object class="GtkButton" id="last">
<property name="visible">0</property>
<property name="label" translatable="yes">_Finish</property>
<property name="label" translatable="1">_Finish</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -72,7 +72,7 @@
</child>
<child>
<object class="GtkButton" id="back">
<property name="label" translatable="yes">_Back</property>
<property name="label" translatable="1">_Back</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -83,7 +83,7 @@
</child>
<child>
<object class="GtkButton" id="forward">
<property name="label" translatable="yes">_Next</property>
<property name="label" translatable="1">_Next</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -95,7 +95,7 @@
<child>
<object class="GtkButton" id="apply">
<property name="visible">0</property>
<property name="label" translatable="yes">_Apply</property>
<property name="label" translatable="1">_Apply</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkColorChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select a Color</property>
<property name="title" translatable="1">Select a Color</property>
<property name="resizable">0</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
@@ -30,12 +30,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="label" translatable="1">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="ok_button">
<property name="label" translatable="yes">_Select</property>
<property name="label" translatable="1">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
+10 -10
View File
@@ -40,7 +40,7 @@
<property name="icon-name">color-select-symbolic</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="tooltip-text" translatable="yes">Pick a color from the screen</property>
<property name="tooltip-text" translatable="1">Pick a color from the screen</property>
<signal name="clicked" handler="pick_color"/>
<style>
<class name="circular"/>
@@ -50,7 +50,7 @@
<property name="row">0</property>
</layout>
<accessibility>
<property name="label" translatable="yes">Pick a color from the screen</property>
<property name="label" translatable="1">Pick a color from the screen</property>
</accessibility>
</object>
</child>
@@ -77,7 +77,7 @@
<property name="row">0</property>
</layout>
<accessibility>
<property name="label" translatable="yes">Hexadecimal color or color name</property>
<property name="label" translatable="1">Hexadecimal color or color name</property>
</accessibility>
</object>
</child>
@@ -92,7 +92,7 @@
<property name="row">1</property>
</layout>
<accessibility>
<property name="label" translatable="yes">Hue</property>
<property name="label" translatable="1">Hue</property>
</accessibility>
</object>
</child>
@@ -108,7 +108,7 @@
<property name="column-span">2</property>
</layout>
<accessibility>
<property name="label" translatable="yes">Alpha value</property>
<property name="label" translatable="1">Alpha value</property>
</accessibility>
</object>
</child>
@@ -126,7 +126,7 @@
<property name="column-span">2</property>
</layout>
<accessibility>
<property name="label" translatable="yes">Saturation and value</property>
<property name="label" translatable="1">Saturation and value</property>
</accessibility>
</object>
</child>
@@ -150,7 +150,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label4">
<property name="label" translatable="yes" context="Color channel">A</property>
<property name="label" translatable="1" context="Color channel">A</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -186,7 +186,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes" context="Color channel">H</property>
<property name="label" translatable="1" context="Color channel">H</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -223,7 +223,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes" context="Color Channel">S</property>
<property name="label" translatable="1" context="Color Channel">S</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -232,7 +232,7 @@
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="label" translatable="yes" context="Color Channel">V</property>
<property name="label" translatable="1" context="Color Channel">V</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
+2 -2
View File
@@ -16,7 +16,7 @@
<property name="name">empty</property>
<property name="child">
<object class="GtkLabel">
<property name="label" translatable="yes">(None)</property>
<property name="label" translatable="1">(None)</property>
<property name="xalign">0</property>
</object>
</property>
@@ -65,7 +65,7 @@
<property name="hexpand">1</property>
<property name="max-width-chars">6</property>
<property name="width-chars">6</property>
<property name="placeholder-text" translatable="yes">Search…</property>
<property name="placeholder-text" translatable="1">Search…</property>
</object>
</child>
</object>
+21 -21
View File
@@ -66,7 +66,7 @@
</child>
<child>
<object class="GtkLabel" id="people.heading">
<property name="label" translatable="yes" context="emoji category">Smileys &amp; People</property>
<property name="label" translatable="1" context="emoji category">Smileys &amp; People</property>
<property name="xalign">0</property>
</object>
</child>
@@ -91,7 +91,7 @@
</child>
<child>
<object class="GtkLabel" id="body.heading">
<property name="label" translatable="yes" context="emoji category">Body &amp; Clothing</property>
<property name="label" translatable="1" context="emoji category">Body &amp; Clothing</property>
<property name="xalign">0</property>
</object>
</child>
@@ -116,7 +116,7 @@
</child>
<child>
<object class="GtkLabel" id="nature.heading">
<property name="label" translatable="yes" context="emoji category">Animals &amp; Nature</property>
<property name="label" translatable="1" context="emoji category">Animals &amp; Nature</property>
<property name="xalign">0</property>
</object>
</child>
@@ -130,7 +130,7 @@
</child>
<child>
<object class="GtkLabel" id="food.heading">
<property name="label" translatable="yes" context="emoji category">Food &amp; Drink</property>
<property name="label" translatable="1" context="emoji category">Food &amp; Drink</property>
<property name="xalign">0</property>
</object>
</child>
@@ -144,7 +144,7 @@
</child>
<child>
<object class="GtkLabel" id="travel.heading">
<property name="label" translatable="yes" context="emoji category">Travel &amp; Places</property>
<property name="label" translatable="1" context="emoji category">Travel &amp; Places</property>
<property name="xalign">0</property>
</object>
</child>
@@ -158,7 +158,7 @@
</child>
<child>
<object class="GtkLabel" id="activities.heading">
<property name="label" translatable="yes" context="emoji category">Activities</property>
<property name="label" translatable="1" context="emoji category">Activities</property>
<property name="xalign">0</property>
</object>
</child>
@@ -172,7 +172,7 @@
</child>
<child>
<object class="GtkLabel" id="objects.heading">
<property name="label" translatable="yes" context="emoji category">Objects</property>
<property name="label" translatable="1" context="emoji category">Objects</property>
<property name="xalign">0</property>
</object>
</child>
@@ -186,7 +186,7 @@
</child>
<child>
<object class="GtkLabel" id="symbols.heading">
<property name="label" translatable="yes" context="emoji category">Symbols</property>
<property name="label" translatable="1" context="emoji category">Symbols</property>
<property name="xalign">0</property>
</object>
</child>
@@ -200,7 +200,7 @@
</child>
<child>
<object class="GtkLabel" id="flags.heading">
<property name="label" translatable="yes" context="emoji category">Flags</property>
<property name="label" translatable="1" context="emoji category">Flags</property>
<property name="xalign">0</property>
</object>
</child>
@@ -227,7 +227,7 @@
<child>
<object class="GtkButton" id="recent.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Recent</property>
<property name="tooltip-text" translatable="1" context="emoji category">Recent</property>
<style>
<class name="emoji-section"/>
</style>
@@ -236,7 +236,7 @@
<child>
<object class="GtkButton" id="people.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Smileys &amp; People</property>
<property name="tooltip-text" translatable="1" context="emoji category">Smileys &amp; People</property>
<style>
<class name="emoji-section"/>
</style>
@@ -245,7 +245,7 @@
<child>
<object class="GtkButton" id="body.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Body &amp; Clothing</property>
<property name="tooltip-text" translatable="1" context="emoji category">Body &amp; Clothing</property>
<style>
<class name="emoji-section"/>
</style>
@@ -254,7 +254,7 @@
<child>
<object class="GtkButton" id="nature.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Animals &amp; Nature</property>
<property name="tooltip-text" translatable="1" context="emoji category">Animals &amp; Nature</property>
<style>
<class name="emoji-section"/>
</style>
@@ -263,7 +263,7 @@
<child>
<object class="GtkButton" id="food.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Food &amp; Drink</property>
<property name="tooltip-text" translatable="1" context="emoji category">Food &amp; Drink</property>
<style>
<class name="emoji-section"/>
</style>
@@ -272,7 +272,7 @@
<child>
<object class="GtkButton" id="travel.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Travel &amp; Places</property>
<property name="tooltip-text" translatable="1" context="emoji category">Travel &amp; Places</property>
<style>
<class name="emoji-section"/>
</style>
@@ -281,7 +281,7 @@
<child>
<object class="GtkButton" id="activities.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Activities</property>
<property name="tooltip-text" translatable="1" context="emoji category">Activities</property>
<style>
<class name="emoji-section"/>
</style>
@@ -290,7 +290,7 @@
<child>
<object class="GtkButton" id="objects.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Objects</property>
<property name="tooltip-text" translatable="1" context="emoji category">Objects</property>
<style>
<class name="emoji-section"/>
</style>
@@ -299,7 +299,7 @@
<child>
<object class="GtkButton" id="symbols.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Symbols</property>
<property name="tooltip-text" translatable="1" context="emoji category">Symbols</property>
<style>
<class name="emoji-section"/>
</style>
@@ -308,7 +308,7 @@
<child>
<object class="GtkButton" id="flags.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Flags</property>
<property name="tooltip-text" translatable="1" context="emoji category">Flags</property>
<style>
<class name="emoji-section"/>
</style>
@@ -346,7 +346,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">No Results Found</property>
<property name="label" translatable="1">No Results Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -359,7 +359,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Try a different search</property>
<property name="label" translatable="1">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
+14 -14
View File
@@ -61,7 +61,7 @@
</child>
<child>
<object class="GtkMenuButton" id="browse_new_folder_button">
<property name="tooltip-text" translatable="yes">Create Folder</property>
<property name="tooltip-text" translatable="1">Create Folder</property>
<property name="popover">new_folder_popover</property>
<property name="icon-name">folder-new-symbolic</property>
</object>
@@ -165,7 +165,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_name_column">
<property name="title" translatable="yes">Name</property>
<property name="title" translatable="1">Name</property>
<property name="resizable">1</property>
<property name="expand">1</property>
<child>
@@ -183,7 +183,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_location_column">
<property name="title" translatable="yes">Location</property>
<property name="title" translatable="1">Location</property>
<property name="resizable">1</property>
<property name="visible">0</property>
<property name="expand">1</property>
@@ -199,7 +199,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_size_column">
<property name="title" translatable="yes">Size</property>
<property name="title" translatable="1">Size</property>
<property name="sizing">2</property>
<child>
<object class="GtkCellRendererText" id="list_size_renderer">
@@ -211,7 +211,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_type_column">
<property name="title" translatable="yes">Type</property>
<property name="title" translatable="1">Type</property>
<property name="resizable">1</property>
<child>
<object class="GtkCellRendererText" id="list_type_renderer">
@@ -223,7 +223,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_time_column">
<property name="title" translatable="yes">Modified</property>
<property name="title" translatable="1">Modified</property>
<property name="sizing">2</property>
<child>
<object class="GtkCellRendererText" id="list_date_renderer">
@@ -246,7 +246,7 @@
<property name="visible">0</property>
<child type="center">
<object class="GtkLabel">
<property name="label" translatable="yes">Remote location — only searching the current folder</property>
<property name="label" translatable="1">Remote location — only searching the current folder</property>
</object>
</child>
</object>
@@ -294,7 +294,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">No Results Found</property>
<property name="label" translatable="1">No Results Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -307,7 +307,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Try a different search</property>
<property name="label" translatable="1">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
@@ -343,7 +343,7 @@
<object class="GtkBox" id="filter_combo_hbox">
<child>
<object class="GtkDropDown" id="filter_combo">
<property name="tooltip-text" translatable="yes">Select which types of files are shown</property>
<property name="tooltip-text" translatable="1">Select which types of files are shown</property>
<property name="focus-on-click">0</property>
<property name="valign">1</property>
<signal name="notify::selected" handler="filter_combo_changed" swapped="no"/>
@@ -375,7 +375,7 @@
<property name="row-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Folder Name</property>
<property name="label" translatable="1">Folder Name</property>
<property name="halign">1</property>
<property name="mnemonic-widget">new_folder_name_entry</property>
<attributes>
@@ -401,7 +401,7 @@
<child>
<object class="GtkButton" id="new_folder_create_button">
<property name="sensitive">0</property>
<property name="label" translatable="yes">_Create</property>
<property name="label" translatable="1">_Create</property>
<property name="use-underline">1</property>
<signal name="clicked" handler="new_folder_create_clicked"/>
<style>
@@ -437,7 +437,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Name</property>
<property name="label" translatable="1">Name</property>
<property name="halign">1</property>
<property name="mnemonic-widget">rename_file_name_entry</property>
<attributes>
@@ -462,7 +462,7 @@
<child>
<object class="GtkButton" id="rename_file_rename_button">
<property name="sensitive">0</property>
<property name="label" translatable="yes">_Rename</property>
<property name="label" translatable="1">_Rename</property>
<property name="use-underline">1</property>
<signal name="clicked" handler="rename_file_rename_clicked"/>
<style>
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkFontChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select Font</property>
<property name="title" translatable="1">Select Font</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -21,12 +21,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="label" translatable="1">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="select_button">
<property name="label" translatable="yes">_Select</property>
<property name="label" translatable="1">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
+11 -11
View File
@@ -61,7 +61,7 @@
<object class="GtkSearchEntry" id="search_entry">
<property name="hexpand">1</property>
<property name="activates-default">1</property>
<property name="placeholder-text" translatable="yes">Search font name</property>
<property name="placeholder-text" translatable="1">Search font name</property>
<signal name="stop-search" handler="stop_search_cb" swapped="no"/>
</object>
</child>
@@ -76,7 +76,7 @@
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Filter by</property>
<property name="label" translatable="1">Filter by</property>
<property name="width-chars">20</property>
<property name="margin-bottom">10</property>
<style>
@@ -86,13 +86,13 @@
</child>
<child>
<object class="GtkCheckButton" id="monospace_button">
<property name="label" translatable="yes">Monospace</property>
<property name="label" translatable="1">Monospace</property>
<signal name="notify::active" handler="monospace_check_changed"/>
</object>
</child>
<child>
<object class="GtkCheckButton" id="language_button">
<property name="label" translatable="yes">Language</property>
<property name="label" translatable="1">Language</property>
<signal name="notify::active" handler="language_check_changed"/>
</object>
</child>
@@ -185,10 +185,10 @@
</child>
<child>
<object class="GtkEntry" id="preview">
<property name="placeholder-text" translatable="yes">Preview text</property>
<property name="placeholder-text" translatable="1">Preview text</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="yes">horizontal</property>
<property name="flags" translatable="1">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>
@@ -201,7 +201,7 @@
</child>
<child>
<object class="GtkLabel" id="size_label">
<property name="label" translatable="yes">Size</property>
<property name="label" translatable="1">Size</property>
<property name="xalign">0</property>
<property name="valign">4</property>
<layout>
@@ -217,7 +217,7 @@
<property name="round-digits">0</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="yes">horizontal</property>
<property name="flags" translatable="1">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>
@@ -267,7 +267,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">No Fonts Found</property>
<property name="label" translatable="1">No Fonts Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.2"></attribute>
@@ -321,7 +321,7 @@
</child>
<child>
<object class="GtkEntry" id="preview2">
<property name="placeholder-text" translatable="yes">Preview text</property>
<property name="placeholder-text" translatable="1">Preview text</property>
<property name="text" bind-source="preview" bind-property="text" bind-flags="bidirectional"/>
<property name="attributes" bind-source="preview" bind-property="attributes" bind-flags="bidirectional"/>
</object>
@@ -348,7 +348,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="size_label2">
<property name="label" translatable="yes">Size</property>
<property name="label" translatable="1">Size</property>
<property name="xalign">0</property>
<property name="valign">4</property>
<layout>
+2 -2
View File
@@ -17,13 +17,13 @@
<child>
<object class="GtkLabel" id="label_lock">
<property name="xalign">0</property>
<property name="label" translatable="yes">Lock</property>
<property name="label" translatable="1">Lock</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label_unlock">
<property name="xalign">0</property>
<property name="label" translatable="yes">Unlock</property>
<property name="label" translatable="1">Unlock</property>
</object>
</child>
</object>
+8 -8
View File
@@ -2,7 +2,7 @@
<interface domain="gtk40">
<template class="GtkPageSetupUnixDialog" parent="GtkDialog">
<property name="resizable">0</property>
<property name="title" translatable="yes">Page Setup</property>
<property name="title" translatable="1">Page Setup</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -24,7 +24,7 @@
<object class="GtkLabel" id="printer_combo_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">_Format for:</property>
<property name="label" translatable="1">_Format for:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">printer_combo</property>
<layout>
@@ -48,7 +48,7 @@
<object class="GtkLabel" id="paper_size_combo_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">_Paper size:</property>
<property name="label" translatable="1">_Paper size:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_size_combo</property>
<layout>
@@ -83,7 +83,7 @@
<object class="GtkLabel" id="orientation_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">_Orientation:</property>
<property name="label" translatable="1">_Orientation:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">portrait_radio</property>
<layout>
@@ -95,7 +95,7 @@
<child>
<object class="GtkCheckButton" id="portrait_radio">
<property name="active">1</property>
<property name="label" translatable="yes">Portrait</property>
<property name="label" translatable="1">Portrait</property>
<layout>
<property name="column">1</property>
<property name="row">3</property>
@@ -106,7 +106,7 @@
<object class="GtkCheckButton" id="reverse_portrait_radio">
<property name="active">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="yes">Reverse portrait</property>
<property name="label" translatable="1">Reverse portrait</property>
<layout>
<property name="column">2</property>
<property name="row">3</property>
@@ -118,7 +118,7 @@
<property name="hexpand">1</property>
<property name="active">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="yes">Landscape</property>
<property name="label" translatable="1">Landscape</property>
<layout>
<property name="column">1</property>
<property name="row">4</property>
@@ -129,7 +129,7 @@
<object class="GtkCheckButton" id="reverse_landscape_radio">
<property name="hexpand">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="yes">Reverse landscape</property>
<property name="label" translatable="1">Reverse landscape</property>
<layout>
<property name="column">2</property>
<property name="row">4</property>
+11 -11
View File
@@ -25,7 +25,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="yes">Server Addresses</property>
<property name="label" translatable="1">Server Addresses</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -37,7 +37,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="yes">Server addresses are made up of a protocol prefix and an address. Examples:</property>
<property name="label" translatable="1">Server addresses are made up of a protocol prefix and an address. Examples:</property>
<property name="wrap">1</property>
<property name="width-chars">40</property>
<property name="max-width-chars">40</property>
@@ -63,7 +63,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="yes">Available Protocols</property>
<property name="label" translatable="1">Available Protocols</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
@@ -76,7 +76,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Prefix</property>
<property name="label" translatable="1">Prefix</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
@@ -115,7 +115,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes" comments="Translators: Server as any successfully connected network address">No recent servers found</property>
<property name="label" translatable="1" comments="Translators: Server as any successfully connected network address">No recent servers found</property>
<style>
<class name="dim-label"/>
</style>
@@ -138,7 +138,7 @@
<property name="margin-bottom">12</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Recent Servers</property>
<property name="label" translatable="1">Recent Servers</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -218,7 +218,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">No results found</property>
<property name="label" translatable="1">No results found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -227,7 +227,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Try a different search</property>
<property name="label" translatable="1">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
@@ -249,7 +249,7 @@
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Connect to _Server</property>
<property name="label" translatable="1">Connect to _Server</property>
<property name="mnemonic-widget">address_entry</property>
<property name="use-underline">1</property>
<attributes>
@@ -259,7 +259,7 @@
</child>
<child type="end">
<object class="GtkButton" id="connect_button">
<property name="label" translatable="yes">Con_nect</property>
<property name="label" translatable="1">Con_nect</property>
<property name="use-underline">1</property>
<property name="sensitive">0</property>
<property name="receives-default">1</property>
@@ -274,7 +274,7 @@
<object class="GtkEntry" id="address_entry">
<property name="hexpand">1</property>
<property name="width-chars">20</property>
<property name="placeholder-text" translatable="yes">Enter server address…</property>
<property name="placeholder-text" translatable="1">Enter server address…</property>
<property name="secondary-icon-name">dialog-question-symbolic</property>
<property name="completion">address_entry_completion</property>
<signal name="notify::text" handler="on_address_entry_text_changed" object="GtkPlacesView" swapped="yes"/>
+1 -1
View File
@@ -50,7 +50,7 @@
<property name="visible">0</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<property name="tooltip-text" translatable="1">Unmount</property>
<child>
<object class="GtkImage" id="eject_icon">
<property name="icon-name">media-eject-symbolic</property>
+50 -50
View File
@@ -80,7 +80,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="yes">Name</property>
<property name="title" translatable="1">Name</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
@@ -111,7 +111,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="yes" comments="this is the header for the location column in the print dialog">Location</property>
<property name="title" translatable="1" comments="this is the header for the location column in the print dialog">Location</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
@@ -142,7 +142,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="yes" comments="this is the header for the printer status column in the print dialog">Status</property>
<property name="title" translatable="1" comments="this is the header for the printer status column in the print dialog">Status</property>
<property name="expand">1</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
@@ -196,7 +196,7 @@
<object class="GtkLabel" id="label_widget1">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Range</property>
<property name="label" translatable="1">Range</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -209,7 +209,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkCheckButton" id="all_pages_radio">
<property name="label" translatable="yes">_All Pages</property>
<property name="label" translatable="1">_All Pages</property>
<property name="use-underline">1</property>
<property name="active">1</property>
<layout>
@@ -221,7 +221,7 @@
</child>
<child>
<object class="GtkCheckButton" id="current_page_radio">
<property name="label" translatable="yes">C_urrent Page</property>
<property name="label" translatable="1">C_urrent Page</property>
<property name="sensitive">0</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -234,7 +234,7 @@
</child>
<child>
<object class="GtkCheckButton" id="selection_radio">
<property name="label" translatable="yes">Se_lection</property>
<property name="label" translatable="1">Se_lection</property>
<property name="sensitive">0</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -247,8 +247,8 @@
</child>
<child>
<object class="GtkCheckButton" id="page_range_radio">
<property name="label" translatable="yes">Pag_es:</property>
<property name="tooltip-text" translatable="yes">Specify one or more page ranges,
<property name="label" translatable="1">Pag_es:</property>
<property name="tooltip-text" translatable="1">Specify one or more page ranges,
e.g. 13, 7, 11</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -261,7 +261,7 @@
</child>
<child>
<object class="GtkEntry" id="page_range_entry">
<property name="tooltip-text" translatable="yes">Specify one or more page ranges,
<property name="tooltip-text" translatable="1">Specify one or more page ranges,
e.g. 13, 7, 11</property>
<property name="activates-default">1</property>
<signal name="notify::has-focus" handler="page_range_entry_focus_changed" swapped="no"/>
@@ -284,7 +284,7 @@
<object class="GtkLabel" id="label_widget2">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Copies</property>
<property name="label" translatable="1">Copies</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -299,7 +299,7 @@
<object class="GtkLabel" id="label4">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Copie_s:</property>
<property name="label" translatable="1">Copie_s:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">copies_spin</property>
<layout>
@@ -322,7 +322,7 @@
</child>
<child>
<object class="GtkCheckButton" id="collate_check">
<property name="label" translatable="yes">C_ollate</property>
<property name="label" translatable="1">C_ollate</property>
<property name="use-underline">1</property>
<signal name="toggled" handler="update_collate_icon" swapped="no"/>
<layout>
@@ -333,7 +333,7 @@
</child>
<child>
<object class="GtkCheckButton" id="reverse_check">
<property name="label" translatable="yes">_Reverse</property>
<property name="label" translatable="1">_Reverse</property>
<property name="use-underline">1</property>
<signal name="toggled" handler="update_collate_icon" swapped="no"/>
<layout>
@@ -363,7 +363,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">General</property>
<property name="label" translatable="1">General</property>
</object>
</property>
</object>
@@ -390,7 +390,7 @@
<object class="GtkLabel" id="label_widget3">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Layout</property>
<property name="label" translatable="1">Layout</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -405,7 +405,7 @@
<object class="GtkLabel" id="label5">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">T_wo-sided:</property>
<property name="label" translatable="1">T_wo-sided:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">duplex</property>
<layout>
@@ -427,7 +427,7 @@
<object class="GtkLabel" id="label6">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Pages per _side:</property>
<property name="label" translatable="1">Pages per _side:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">pages_per_sheet</property>
<layout>
@@ -451,7 +451,7 @@
<object class="GtkLabel" id="label7">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Page or_dering:</property>
<property name="label" translatable="1">Page or_dering:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">number_up_layout</property>
<layout>
@@ -474,7 +474,7 @@
<object class="GtkLabel" id="label8">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">_Only print:</property>
<property name="label" translatable="1">_Only print:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">page_set_combo</property>
<layout>
@@ -506,7 +506,7 @@
<object class="GtkLabel" id="label9">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Sc_ale:</property>
<property name="label" translatable="1">Sc_ale:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">scale_spin</property>
<layout>
@@ -551,7 +551,7 @@
<object class="GtkLabel" id="label_widget4">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Paper</property>
<property name="label" translatable="1">Paper</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -566,7 +566,7 @@
<object class="GtkLabel" id="label11">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Paper _type:</property>
<property name="label" translatable="1">Paper _type:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_type</property>
<layout>
@@ -588,7 +588,7 @@
<object class="GtkLabel" id="label12">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Paper _source:</property>
<property name="label" translatable="1">Paper _source:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_source</property>
<layout>
@@ -610,7 +610,7 @@
<object class="GtkLabel" id="label13">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Output t_ray:</property>
<property name="label" translatable="1">Output t_ray:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">output_tray</property>
<layout>
@@ -632,7 +632,7 @@
<object class="GtkLabel" id="paper_size_combo_label">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">_Paper size:</property>
<property name="label" translatable="1">_Paper size:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_size_combo</property>
<layout>
@@ -655,7 +655,7 @@
<object class="GtkLabel" id="orientation_combo_label">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="yes">Or_ientation:</property>
<property name="label" translatable="1">Or_ientation:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">orientation_combo</property>
<layout>
@@ -706,7 +706,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label2">
<property name="label" translatable="yes">Page Setup</property>
<property name="label" translatable="1">Page Setup</property>
</object>
</property>
</object>
@@ -729,7 +729,7 @@
<object class="GtkLabel" id="label_widget5">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Job Details</property>
<property name="label" translatable="1">Job Details</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -744,7 +744,7 @@
<object class="GtkLabel" id="label16">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Pri_ority:</property>
<property name="label" translatable="1">Pri_ority:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">job_prio</property>
<layout>
@@ -765,7 +765,7 @@
<object class="GtkLabel" id="label17">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">_Billing info:</property>
<property name="label" translatable="1">_Billing info:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">billing_info</property>
<layout>
@@ -798,7 +798,7 @@
<object class="GtkLabel" id="label_widget6">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Print Document</property>
<property name="label" translatable="1">Print Document</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -811,7 +811,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkCheckButton" id="print_now_radio">
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog">_Now</property>
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog">_Now</property>
<property name="use-underline">1</property>
<property name="active">1</property>
<signal name="toggled" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
@@ -825,11 +825,11 @@
<child>
<object class="GtkCheckButton" id="print_at_radio">
<property name="sensitive">0</property>
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog. It also serves as the label for an entry that allows the user to enter a time.">A_t:</property>
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog. It also serves as the label for an entry that allows the user to enter a time.">A_t:</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="yes">Specify the time of print,
<property name="tooltip-markup" translatable="1">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="tooltip-text" translatable="yes" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
<property name="tooltip-text" translatable="1" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="use-underline">1</property>
<property name="group">print_now_radio</property>
@@ -845,9 +845,9 @@
<object class="GtkEntry" id="print_at_entry">
<property name="sensitive">0</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="yes">Specify the time of print,
<property name="tooltip-markup" translatable="1">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="tooltip-text" translatable="yes" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
<property name="tooltip-text" translatable="1" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<signal name="changed" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
<layout>
@@ -859,10 +859,10 @@
<child>
<object class="GtkCheckButton" id="print_hold_radio">
<property name="sensitive">0</property>
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog. It means that the print job will not be printed until it explicitly gets &apos;released&apos;.">On _hold</property>
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog. It means that the print job will not be printed until it explicitly gets &apos;released&apos;.">On _hold</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="yes">Hold the job until it is explicitly released</property>
<property name="tooltip-text" translatable="yes">Hold the job until it is explicitly released</property>
<property name="tooltip-markup" translatable="1">Hold the job until it is explicitly released</property>
<property name="tooltip-text" translatable="1">Hold the job until it is explicitly released</property>
<property name="use-underline">1</property>
<property name="group">print_now_radio</property>
<signal name="toggled" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
@@ -889,7 +889,7 @@
<object class="GtkLabel" id="label_widget7">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes">Add Cover Page</property>
<property name="label" translatable="1">Add Cover Page</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -904,7 +904,7 @@
<object class="GtkLabel" id="label18">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes" comments="this is the label used for the option in the print dialog that controls the front cover page.">Be_fore:</property>
<property name="label" translatable="1" comments="this is the label used for the option in the print dialog that controls the front cover page.">Be_fore:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">cover_before</property>
<layout>
@@ -925,7 +925,7 @@
<object class="GtkLabel" id="label19">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="yes" comments="this is the label used for the option in the print dialog that controls the back cover page.">_After:</property>
<property name="label" translatable="1" comments="this is the label used for the option in the print dialog that controls the back cover page.">_After:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">cover_after</property>
<layout>
@@ -954,7 +954,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">Job</property>
<property name="label" translatable="1">Job</property>
</object>
</property>
</object>
@@ -984,7 +984,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label20">
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog.">Image Quality</property>
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog.">Image Quality</property>
</object>
</property>
</object>
@@ -1013,7 +1013,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label21">
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog.">Color</property>
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog.">Color</property>
</object>
</property>
</object>
@@ -1042,7 +1042,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label22">
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog. It&apos;s a typographical term, as in &quot;Binding and finishing&quot;">Finishing</property>
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog. It&apos;s a typographical term, as in &quot;Binding and finishing&quot;">Finishing</property>
</object>
</property>
</object>
@@ -1071,7 +1071,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label23">
<property name="label" translatable="yes">Advanced</property>
<property name="label" translatable="1">Advanced</property>
</object>
</property>
</object>
@@ -1087,7 +1087,7 @@
</child>
<child>
<object class="GtkLabel" id="label24">
<property name="label" translatable="yes">Some of the settings in the dialog conflict</property>
<property name="label" translatable="1">Some of the settings in the dialog conflict</property>
</object>
</child>
</object>
+1 -1
View File
@@ -47,7 +47,7 @@
<property name="valign">3</property>
<property name="margin-start">4px</property>
<property name="icon-name">media-eject-symbolic</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<property name="tooltip-text" translatable="1">Unmount</property>
<style>
<class name="sidebar-button"/>
</style>
+43 -24
View File
@@ -471,6 +471,9 @@ if not os_win32
endif
endif
pc_gdk_extra_libs = []
cairo_backends = []
foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled],
['cairo-win32', cairo_req, win32_enabled],
@@ -601,14 +604,26 @@ if x11_enabled
cdata.set('HAVE_RANDR15', xrandr15_dep.found())
endif
if broadway_enabled
pc_gdk_extra_libs += ['-lz']
endif
if macos_enabled
pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon']
endif
extra_demo_ldflags = []
if win32_enabled
pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32']
if cc.get_id() == 'msvc'
# Since the demo programs are now built as pure GUI programs, we
# need to pass in /entry:mainCRTStartup so that they will properly
# link on Visual Studio builds
extra_demo_ldflags = ['/entry:mainCRTStartup']
else
pc_gdk_extra_libs += ['-Wl,-luuid']
endif
pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32', '-lhid']
# Check whether libepoxy is built with EGL support on Windows
endif
@@ -670,12 +685,12 @@ if not get_option('sysprof').disabled()
libsysprof_capture_dep = dependency('sysprof-capture-4', version: sysprof_req,
required: get_option('sysprof'),
default_options: [
'examples=false',
'gtk=false',
'tests=false',
'tools=false',
'enable_examples=false',
'enable_gtk=false',
'enable_tests=false',
'enable_tools=false',
'libsysprof=true',
'sysprofd=none',
'with_sysprofd=none',
'help=false',
],
fallback: ['sysprof', 'libsysprof_capture_dep'],
@@ -684,12 +699,12 @@ if not get_option('sysprof').disabled()
libsysprof_dep = dependency('sysprof-4',
required: false,
default_options: [
'examples=false',
'gtk=false',
'tests=false',
'tools=false',
'enable_examples=false',
'enable_gtk=false',
'enable_tests=false',
'enable_tools=false',
'libsysprof=true',
'sysprofd=none',
'with_sysprofd=none',
'help=false',
],
fallback: ['sysprof', 'libsysprof_dep'],
@@ -826,7 +841,16 @@ gsk_private_packages = [] # all already in gdk_private_packages
pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : []
gtk_private_packages = pangoft2_pkgs
pkgs = []
gdk_extra_libs = pc_gdk_extra_libs
gsk_extra_libs = []
gtk_extra_libs = []
gdk_extra_cflags = []
gsk_extra_cflags = []
gtk_extra_cflags = []
pkgs = [ 'gtk4' ]
pkg_targets = []
display_backends = []
foreach backend: [ 'broadway', 'macos', 'wayland', 'win32', 'x11', ]
@@ -843,23 +867,18 @@ common_pc_variables = [
'gtk_host=@0@-@1@'.format(host_machine.cpu_family(), host_machine.system()), # FIXME
]
pkg_config.generate(libgtk,
filebase: 'gtk4',
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Graphical UI Library',
requires: gdk_packages + gsk_packages + gtk_packages,
subdirs: ['gtk-@0@'.format(gtk_api_version)],
)
meson.override_dependency('gtk4', libgtk_dep)
foreach pkg: pkgs
pkg_config.generate(
filebase: pkg,
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Graphical UI Library',
requires: 'gtk4',
requires: gdk_packages + gsk_packages + gtk_packages,
requires_private: gdk_private_packages + gsk_private_packages + gtk_private_packages,
libraries: ['-L${libdir}', '-lgtk-4'],
libraries_private: gdk_extra_libs + gsk_extra_libs + gtk_extra_libs,
subdirs: ['gtk-@0@'.format(gtk_api_version)],
extra_cflags: gdk_extra_cflags + gsk_extra_cflags + gtk_extra_cflags,
)
meson.override_dependency(pkg, libgtk_dep)
endforeach
@@ -870,10 +889,10 @@ if os_unix
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Unix print support',
requires: 'gtk4',
requires: ['gtk4'] + gtk_packages,
libraries: [],
subdirs: ['gtk-@0@/unix-print'.format(gtk_api_version)],
)
meson.override_dependency('gtk4-unix-print', libgtk_dep)
endif
subdir('po')
+1493 -488
View File
File diff suppressed because it is too large Load Diff
+190 -191
View File
File diff suppressed because it is too large Load Diff
+23 -26
View File
@@ -12,8 +12,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.6\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-06-05 12:35+0000\n"
"PO-Revision-Date: 2022-06-06 12:42+0430\n"
"POT-Creation-Date: 2022-05-15 06:30+0000\n"
"PO-Revision-Date: 2022-05-16 12:06+0430\n"
"Last-Translator: Danial Behzadi <dani.behzi@ubuntu.com>\n"
"Language-Team: Persian <>\n"
"Language: fa\n"
@@ -53,7 +53,7 @@ msgstr "نمی‌توان محتوا را به شکل «%s» فراهم کرد"
msgid "Cannot provide contents as %s"
msgstr "نمی‌توان محتوا را به شکل %s فراهم کرد"
#: gdk/gdkdisplay.c:154 gdk/gdkglcontext.c:435
#: gdk/gdkdisplay.c:154 gdk/gdkglcontext.c:437
msgid "The current backend does not support OpenGL"
msgstr "پسانه در حال حاضر از OpenGL پشتیبانی نمی‌کند"
@@ -112,27 +112,27 @@ msgstr "کشیدن و رها کردن از دیگر برنامه‌ها پشتی
msgid "No compatible formats to transfer contents."
msgstr "هیچ قالب سازگاری برای انتقال محتویات وجود ندارد."
#: gdk/gdkglcontext.c:394 gdk/x11/gdkglcontext-glx.c:605
msgid "No GL API allowed."
msgstr "هیچ رابط برنامه‌نویسی GLای مجاز نیست."
#: gdk/gdkglcontext.c:334
msgid "The EGL implementation does not support any allowed APIs"
msgstr "پشتیبانی EGL از هیچ API مجازی پیشتیبانی نمی‌کند"
#: gdk/gdkglcontext.c:418 gdk/win32/gdkglcontext-win32-wgl.c:611
#: gdk/x11/gdkglcontext-glx.c:639
#: gdk/gdkglcontext.c:415 gdk/win32/gdkglcontext-win32-wgl.c:616
#: gdk/x11/gdkglcontext-glx.c:624
msgid "Unable to create a GL context"
msgstr "امکان ساخت زمینه مناسب برای GL نبود"
#: gdk/gdkglcontext.c:1273
#: gdk/gdkglcontext.c:1274
msgid "Anything but OpenGL ES disabled via GDK_DEBUG"
msgstr "هر چیزی جز OpenGL Es به دست GDK_DEBUG از کار افتاده"
#: gdk/gdkglcontext.c:1282
#: gdk/gdkglcontext.c:1283
#, c-format
msgid "Application does not support %s API"
msgstr "برنامه از API مربوط به %s پشتبانی نمی‌کند"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:1822
#: gdk/gdkglcontext.c:1817
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "تلاش شد از %s استفاده شود، ولی %s از پیش در حال استفاده است"
@@ -698,7 +698,7 @@ msgstr "شکست در تغییر شکل قالب W32 دادهٔ ک‌ور 0x%x
msgid "No GL implementation is available"
msgstr "هیچ پیاده‌سازی GLای پیدا نشد"
#: gdk/win32/gdkglcontext-win32-wgl.c:577
#: gdk/win32/gdkglcontext-win32-wgl.c:582
msgid "No available configurations for the given pixel format"
msgstr "هیچ پیکربندی برای قالب نقطه‌ای ارائه شده موجود نیست"
@@ -760,15 +760,15 @@ msgstr "مدیر تخته‌گیره نتوانست گزینش را ذخیره
msgid "Cannot store clipboard. No clipboard manager is active."
msgstr "نتوانست تخته‌گیره را ذخیره کند. هیچ مدیر تخته‌گیره‌ای فعّال نیست."
#: gdk/x11/gdkglcontext-glx.c:755
#: gdk/x11/gdkglcontext-glx.c:780
msgid "No GLX configurations available"
msgstr "هیچ پیکربندی‌ای برای GLX موجود نیست"
#: gdk/x11/gdkglcontext-glx.c:828
#: gdk/x11/gdkglcontext-glx.c:853
msgid "No GLX configuration with required features found"
msgstr "هیچ پیکربندی‌ای با ویژگی‌های موردنیاز برای GLX موجود نیست"
#: gdk/x11/gdkglcontext-glx.c:902
#: gdk/x11/gdkglcontext-glx.c:927
msgid "GLX is not supported"
msgstr "GLX پشتیبانی نمی‌شود"
@@ -2169,7 +2169,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "اگر موردی را پاک کنید، برای همیشه از دست خواهد رفت."
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827
#: gtk/gtklabel.c:5627 gtk/gtktext.c:6041 gtk/gtktextview.c:8914
#: gtk/gtklabel.c:5621 gtk/gtktext.c:6041 gtk/gtktextview.c:8914
msgid "_Delete"
msgstr "_حذف"
@@ -2441,27 +2441,27 @@ msgstr "دگرگونه‌های نویسه"
msgid "OpenGL context creation failed"
msgstr "ساخت زمینه OpenGL شکست خورد"
#: gtk/gtklabel.c:5624 gtk/gtktext.c:6029 gtk/gtktextview.c:8902
#: gtk/gtklabel.c:5618 gtk/gtktext.c:6029 gtk/gtktextview.c:8902
msgid "Cu_t"
msgstr "_برش"
#: gtk/gtklabel.c:5625 gtk/gtktext.c:6033 gtk/gtktextview.c:8906
#: gtk/gtklabel.c:5619 gtk/gtktext.c:6033 gtk/gtktextview.c:8906
msgid "_Copy"
msgstr "_رونوشت"
#: gtk/gtklabel.c:5626 gtk/gtktext.c:6037 gtk/gtktextview.c:8910
#: gtk/gtklabel.c:5620 gtk/gtktext.c:6037 gtk/gtktextview.c:8910
msgid "_Paste"
msgstr "_چسباندن"
#: gtk/gtklabel.c:5632 gtk/gtktext.c:6050 gtk/gtktextview.c:8935
#: gtk/gtklabel.c:5626 gtk/gtktext.c:6050 gtk/gtktextview.c:8935
msgid "Select _All"
msgstr "انتخاب _همه"
#: gtk/gtklabel.c:5637
#: gtk/gtklabel.c:5631
msgid "_Open Link"
msgstr "_گشودن پیوند"
#: gtk/gtklabel.c:5641
#: gtk/gtklabel.c:5635
msgid "Copy _Link Address"
msgstr "_رونوشت از نشانی پیوند"
@@ -2510,7 +2510,7 @@ msgstr ""
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: gtk/gtkmain.c:786
#: gtk/gtkmain.c:775
msgid "default:LTR"
msgstr "default:RTL"
@@ -6906,9 +6906,6 @@ msgstr ""
"اگر به‌راستی می‌خواهید این‌جا انبارهٔ نقشکی ایجاد کنید، از --ignore-theme-index "
"استفاده کنید.\n"
#~ msgid "The EGL implementation does not support any allowed APIs"
#~ msgstr "پشتیبانی EGL از هیچ API مجازی پیشتیبانی نمی‌کند"
#~ msgctxt "Script"
#~ msgid "Arabic"
#~ msgstr "عربی"
+445 -514
View File
File diff suppressed because it is too large Load Diff
+771 -945
View File
File diff suppressed because it is too large Load Diff
+448 -502
View File
File diff suppressed because it is too large Load Diff
+363 -486
View File
File diff suppressed because it is too large Load Diff
+439 -484
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

+1 -4
View File
@@ -1,6 +1,5 @@
gtk_tests = [
# testname, optional extra sources
['subsurface'],
['input'],
['testpopup'],
['testupload'],
@@ -128,8 +127,6 @@ if x11_enabled
gtk_tests += [['testerrors']]
endif
libpixman = cc.find_library('pixman-1', required: true)
# Pass the source dir here so programs can change into the source directory
# and find .ui files and .png files and such that they load at runtime
test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())]
@@ -141,7 +138,7 @@ foreach t: gtk_tests
sources: test_srcs,
include_directories: [confinc, gdkinc],
c_args: test_args + common_cflags,
dependencies: [libgtk_dep, libm, libpixman],
dependencies: [libgtk_dep, libm],
)
endforeach
-606
View File
@@ -1,606 +0,0 @@
/* simple.c
* Copyright (C) 2017 Red Hat, Inc
* Author: Benjamin Otte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include <gdk/wayland/gdkwayland.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <pixman.h>
#include <drm/drm_fourcc.h>
static struct wl_compositor *wl_compositor;
static struct wl_subcompositor *wl_subcompositor;
static struct wl_shm *wl_shm;
struct yuv_buffer {
void *data;
size_t bytes;
struct wl_buffer *proxy;
int width;
int height;
};
static struct yuv_buffer *
yuv_buffer_create(size_t bytes,
int width,
int height,
int stride_bytes,
uint32_t drm_format)
{
struct wl_shm_pool *pool;
struct yuv_buffer *buf;
int fd;
const char *xdg_runtime_dir;
buf = g_malloc(sizeof *buf);
buf->bytes = bytes;
buf->width = width;
buf->height = height;
xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR");
fd = open (xdg_runtime_dir, O_TMPFILE|O_RDWR|O_EXCL, 0600);
ftruncate (fd, buf->bytes);
g_assert(fd >= 0);
buf->data = mmap(NULL, buf->bytes,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (buf->data == MAP_FAILED) {
close(fd);
g_assert(buf->data != MAP_FAILED);
}
pool = wl_shm_create_pool(wl_shm, fd, buf->bytes);
buf->proxy = wl_shm_pool_create_buffer(pool, 0, buf->width, buf->height,
stride_bytes, drm_format);
wl_shm_pool_destroy(pool);
close(fd);
return buf;
}
/*
* Based on Rec. ITU-R BT.601-7
*
* This is intended to be obvious and accurate, not fast.
*/
static void
x8r8g8b8_to_ycbcr8_bt601(uint32_t xrgb,
uint8_t *y_out, uint8_t *cb_out, uint8_t *cr_out)
{
double y, cb, cr;
double r = (xrgb >> 16) & 0xff;
double g = (xrgb >> 8) & 0xff;
double b = (xrgb >> 0) & 0xff;
/* normalize to [0.0, 1.0] */
r /= 255.0;
g /= 255.0;
b /= 255.0;
/* Y normalized to [0.0, 1.0], Cb and Cr [-0.5, 0.5] */
y = 0.299 * r + 0.587 * g + 0.114 * b;
cr = (r - y) / 1.402;
cb = (b - y) / 1.772;
/* limited range quantization to 8 bit */
*y_out = round(219.0 * y + 16.0);
if (cr_out)
*cr_out = round(224.0 * cr + 128.0);
if (cb_out)
*cb_out = round(224.0 * cb + 128.0);
}
static struct yuv_buffer *
yuv420_create_buffer(pixman_image_t *rgb_image)
{
struct yuv_buffer *buf;
size_t bytes;
int width;
int height;
int x, y;
void *rgb_pixels;
int rgb_stride_bytes;
uint32_t *rgb_row;
uint8_t *y_base;
uint8_t *u_base;
uint8_t *v_base;
uint8_t *y_row;
uint8_t *u_row;
uint8_t *v_row;
uint32_t argb;
uint32_t drm_format = DRM_FORMAT_YUV420;
g_assert(drm_format == DRM_FORMAT_YUV420);
width = pixman_image_get_width(rgb_image);
height = pixman_image_get_height(rgb_image);
rgb_pixels = pixman_image_get_data(rgb_image);
rgb_stride_bytes = pixman_image_get_stride(rgb_image);
/* Full size Y, quarter U and V */
bytes = width * height + (width / 2) * (height / 2) * 2;
buf = yuv_buffer_create(bytes, width, height, width, drm_format);
y_base = buf->data;
u_base = y_base + width * height;
v_base = u_base + (width / 2) * (height / 2);
for (y = 0; y < height; y++) {
rgb_row = rgb_pixels + (y / 2 * 2) * rgb_stride_bytes;
y_row = y_base + y * width;
u_row = u_base + (y / 2) * (width / 2);
v_row = v_base + (y / 2) * (width / 2);
for (x = 0; x < width; x++) {
/*
* Sub-sample the source image instead, so that U and V
* sub-sampling does not require proper
* filtering/averaging/siting.
*/
argb = *(rgb_row + x / 2 * 2);
/*
* A stupid way of "sub-sampling" chroma. This does not
* do the necessary filtering/averaging/siting or
* alternate Cb/Cr rows.
*/
if ((y & 1) == 0 && (x & 1) == 0) {
x8r8g8b8_to_ycbcr8_bt601(argb, y_row + x,
u_row + x / 2,
v_row + x / 2);
} else {
x8r8g8b8_to_ycbcr8_bt601(argb, y_row + x,
NULL, NULL);
}
}
}
return buf;
}
static void
destroy_cairo_surface(pixman_image_t *image, void *data)
{
cairo_surface_t *surface = data;
cairo_surface_destroy(surface);
}
struct format_map_entry {
cairo_format_t cairo;
pixman_format_code_t pixman;
};
static const struct format_map_entry format_map[] = {
{ CAIRO_FORMAT_ARGB32, PIXMAN_a8r8g8b8 },
{ CAIRO_FORMAT_RGB24, PIXMAN_x8r8g8b8 },
{ CAIRO_FORMAT_A8, PIXMAN_a8 },
{ CAIRO_FORMAT_RGB16_565, PIXMAN_r5g6b5 },
};
static pixman_format_code_t
format_cairo2pixman(cairo_format_t fmt)
{
unsigned i;
for (i = 0; i < G_N_ELEMENTS(format_map); i++)
if (format_map[i].cairo == fmt)
return format_map[i].pixman;
g_assert_not_reached ();
}
static pixman_image_t *
image_convert_to_a8r8g8b8(pixman_image_t *image)
{
pixman_image_t *ret;
int width;
int height;
if (pixman_image_get_format(image) == PIXMAN_a8r8g8b8)
return pixman_image_ref(image);
width = pixman_image_get_width(image);
height = pixman_image_get_height(image);
ret = pixman_image_create_bits_no_clear(PIXMAN_a8r8g8b8, width, height,
NULL, 0);
g_assert(ret);
pixman_image_composite32(PIXMAN_OP_SRC, image, NULL, ret,
0, 0, 0, 0, 0, 0, width, height);
return ret;
}
static pixman_image_t *
load_image_from_png(const char *fname)
{
pixman_image_t *image;
pixman_image_t *converted;
cairo_format_t cairo_fmt;
pixman_format_code_t pixman_fmt;
cairo_surface_t *reference_cairo_surface;
cairo_status_t status;
int width;
int height;
int stride;
void *data;
reference_cairo_surface = cairo_image_surface_create_from_png(fname);
cairo_surface_flush(reference_cairo_surface);
status = cairo_surface_status(reference_cairo_surface);
if (status != CAIRO_STATUS_SUCCESS) {
g_error ("Could not open %s: %s\n", fname,
cairo_status_to_string(status));
cairo_surface_destroy(reference_cairo_surface);
return NULL;
}
cairo_fmt = cairo_image_surface_get_format(reference_cairo_surface);
pixman_fmt = format_cairo2pixman(cairo_fmt);
width = cairo_image_surface_get_width(reference_cairo_surface);
height = cairo_image_surface_get_height(reference_cairo_surface);
stride = cairo_image_surface_get_stride(reference_cairo_surface);
data = cairo_image_surface_get_data(reference_cairo_surface);
/* The Cairo surface will own the data, so we keep it around. */
image = pixman_image_create_bits_no_clear(pixman_fmt,
width, height, data, stride);
g_assert(image);
pixman_image_set_destroy_function(image, destroy_cairo_surface,
reference_cairo_surface);
converted = image_convert_to_a8r8g8b8(image);
pixman_image_unref(image);
return converted;
}
static void
gdk_registry_handle_global (void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version)
{
//g_print ("global: %s %u, id %u\n", interface, version, id);
if (strcmp (interface, "wl_compositor") == 0)
wl_compositor = wl_registry_bind (registry, id, &wl_compositor_interface, version);
if (strcmp (interface, "wl_subcompositor") == 0)
wl_subcompositor = wl_registry_bind (registry, id, &wl_subcompositor_interface, version);
if (strcmp (interface, "wl_shm") == 0)
wl_shm = wl_registry_bind (registry, id, &wl_shm_interface, version);
}
static void
gdk_registry_handle_global_remove (void *data,
struct wl_registry *registry,
uint32_t id)
{
}
static const struct wl_registry_listener registry_listener = {
gdk_registry_handle_global,
gdk_registry_handle_global_remove
};
static void
set_up_registry (struct wl_display *wl_display)
{
struct wl_registry *wl_registry;
wl_registry = wl_display_get_registry (wl_display);
wl_registry_add_listener (wl_registry, &registry_listener, NULL);
if (wl_display_roundtrip (wl_display) < 0)
exit (1);
g_assert (wl_compositor != NULL);
g_assert (wl_subcompositor != NULL);
g_assert (wl_shm != NULL);
}
static void
create_subsurface (struct wl_surface *parent,
struct wl_surface **child,
struct wl_subsurface **subsurface)
{
struct wl_region *region;
*child = wl_compositor_create_surface (wl_compositor);
*subsurface = wl_subcompositor_get_subsurface (wl_subcompositor, *child, parent);
wl_subsurface_set_desync (*subsurface);
region = wl_compositor_create_region (wl_compositor);
wl_surface_set_input_region (*child, region);
wl_region_destroy (region);
}
static void
surface_fill (struct wl_surface *surface,
int width,
int height,
const GdkRGBA *c)
{
size_t size;
const char *xdg_runtime_dir;
int fd;
guint32 *data;
guint32 pixel;
struct wl_shm_pool *pool;
struct wl_buffer *buffer;
#if 0
size = width * height * 4;
xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR");
fd = open (xdg_runtime_dir, O_TMPFILE|O_RDWR|O_EXCL, 0600);
ftruncate (fd, size);
data = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
pixel = 0xff000000 | ((int)(c->red * 255) << 16) | ((int)(c->green * 255) << 8) | ((int)c->blue * 255);
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++)
data[i * width + j] = pixel;
pool = wl_shm_create_pool (wl_shm, fd, size);
buffer = wl_shm_pool_create_buffer (pool, 0, width, height, width * 4, WL_SHM_FORMAT_XRGB8888);
wl_shm_pool_destroy (pool);
close (fd);
#else
pixman_image_t *img = load_image_from_png ("tests/chocolate-cake.png");
struct yuv_buffer *buf = yuv420_create_buffer (img);
buffer = buf->proxy;
#endif
wl_surface_attach (surface, buffer, 0, 0);
wl_surface_commit (surface);
}
#define DEMO_TYPE_WIDGET (demo_widget_get_type ())
G_DECLARE_FINAL_TYPE (DemoWidget, demo_widget, DEMO, WIDGET, GtkWidget)
GtkWidget * demo_widget_new (void);
void demo_widget_add_child (DemoWidget *self,
GtkWidget *child);
struct _DemoWidget
{
GtkWidget parent_instance;
struct wl_display *wl_display;
struct wl_surface *parent;
struct wl_surface *child;
struct wl_subsurface *subsurface;
GdkRGBA color1;
GdkRGBA color2;
guint64 time2;
float t;
guint tick_cb;
GtkPopover *popover;
};
struct _DemoWidgetClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE (DemoWidget, demo_widget, GTK_TYPE_WIDGET)
#define TIME_SPAN (3.0 * G_TIME_SPAN_SECOND)
static gboolean
change_color (GtkWidget *widget,
GdkFrameClock *frame_clock,
gpointer data)
{
DemoWidget *demo = DEMO_WIDGET (widget);
gint64 time;
time = gdk_frame_clock_get_frame_time (frame_clock);
if (time >= demo->time2)
{
demo->time2 = time + TIME_SPAN;
demo->color1 = demo->color2;
demo->color2.red = g_random_double_range (0, 1);
demo->color2.green = g_random_double_range (0, 1);
demo->color2.blue = g_random_double_range (0, 1);
demo->color2.alpha = 1;
}
demo->t = 1 - (demo->time2 - time) / TIME_SPAN;
gtk_widget_queue_draw (widget);
return G_SOURCE_CONTINUE;
}
static void
pressed_cb (GtkGesture *gesture,
int n_press,
double x,
double y,
gpointer data)
{
DemoWidget *demo = data;
gtk_popover_set_pointing_to (demo->popover, &(GdkRectangle){ x, y, 1, 1 });
gtk_popover_popup (demo->popover);
}
static void
clicked_cb (GtkButton *button,
gpointer data)
{
DemoWidget *demo = data;
gtk_popover_popdown (demo->popover);
}
static void
demo_widget_init (DemoWidget *demo)
{
GtkWidget *button;
GtkGesture *controller;
gtk_widget_add_tick_callback (GTK_WIDGET (demo), change_color, NULL, NULL);
demo->popover = GTK_POPOVER (gtk_popover_new ());
gtk_widget_set_parent (GTK_WIDGET (demo->popover), GTK_WIDGET (demo));
button = gtk_button_new_with_label ("OK");
g_signal_connect (button, "clicked", G_CALLBACK (clicked_cb), demo);
gtk_popover_set_child (demo->popover, button);
controller = gtk_gesture_click_new ();
g_signal_connect (controller, "pressed", G_CALLBACK (pressed_cb), demo);
gtk_widget_add_controller (GTK_WIDGET (demo), GTK_EVENT_CONTROLLER (controller));
}
static void
demo_widget_dispose (GObject *object)
{
//DemoWidget *demo = DEMO_WIDGET (object);
G_OBJECT_CLASS (demo_widget_parent_class)->dispose (object);
}
static void
demo_widget_realize (GtkWidget *widget)
{
DemoWidget *demo = DEMO_WIDGET (widget);
GdkSurface *surface;
GTK_WIDGET_CLASS (demo_widget_parent_class)->realize (widget);
demo->wl_display = gdk_wayland_display_get_wl_display (gtk_widget_get_display (widget));
surface = gtk_native_get_surface (gtk_widget_get_native (widget));
demo->parent = gdk_wayland_surface_get_wl_surface (surface);
set_up_registry (demo->wl_display);
create_subsurface (demo->parent, &demo->child, &demo->subsurface);
}
static void
demo_widget_unrealize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (demo_widget_parent_class)->unrealize (widget);
/* FIXME */
}
static void
demo_widget_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum_size,
int *natural_size,
int *minimum_baseline,
int *natural_baseline)
{
*minimum_size = 100;
*natural_size = 200;
}
static void
demo_widget_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
DemoWidget *demo = DEMO_WIDGET (widget);
GtkNative *native;
double x0, y0, x, y;
native = gtk_widget_get_native (widget);
gtk_native_get_surface_transform (native, &x0, &y0);
gtk_widget_translate_coordinates (widget,
GTK_WIDGET (native),
0, 0,
&x, &y);
wl_subsurface_set_position (demo->subsurface, x0 + x + 40, y0 + y + 40);
gtk_popover_present (demo->popover);
}
static void
demo_widget_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
DemoWidget *demo = DEMO_WIDGET (widget);
int width, height;
GdkRGBA c;
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
c.red = (1 - demo->t) * demo->color1.red + demo->t * demo->color2.red;
c.green = (1 - demo->t) * demo->color1.green + demo->t * demo->color2.green;
c.blue = (1 - demo->t) * demo->color1.blue + demo->t * demo->color2.blue;
c.alpha = 1;
surface_fill (demo->child, width - 80, height - 80, &c);
}
static void
demo_widget_class_init (DemoWidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = demo_widget_dispose;
widget_class->realize = demo_widget_realize;
widget_class->unrealize = demo_widget_unrealize;
widget_class->measure = demo_widget_measure;
widget_class->size_allocate = demo_widget_size_allocate;
widget_class->snapshot = demo_widget_snapshot;
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *child;
gtk_init ();
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "hello subsurface");
child = g_object_new (demo_widget_get_type (), NULL);
gtk_window_set_child (GTK_WINDOW (window), child);
gtk_widget_show (window);
while (TRUE)
g_main_context_iteration (NULL, TRUE);
return 0;
}
@@ -1,10 +0,0 @@
color-matrix {
matrix: matrix3d(255, 0, 0, 0,
0, 255, 0, 0,
0, 0, 255, 0,
0, 0, 0, 1);
offset: -127 -127 -127 0;
child: color {
color: #80007f;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 B

-1
View File
@@ -36,7 +36,6 @@ compare_render_tests = [
'clip-nested1',
'color-blur0',
'color-matrix-identity',
'color-matrix-parsing',
'cross-fade-in-opacity',
'css-background',
'empty-blend',
+131 -139
View File
@@ -136,7 +136,6 @@ assert_icon_lookup_fails (const char *icon_name,
}
static GList *lookups = NULL;
static gboolean collecting_lookups = FALSE;
static GLogWriterOutput
log_writer (GLogLevelFlags log_level,
@@ -148,9 +147,6 @@ log_writer (GLogLevelFlags log_level,
const char *msg = NULL;
int i;
if (!collecting_lookups)
return g_log_writer_default (log_level, fields, n_fields, user_data);
for (i = 0; i < n_fields; i++)
{
if (strcmp (fields[i].key, "GLIB_DOMAIN") == 0)
@@ -181,13 +177,22 @@ assert_lookup_order (const char *icon_name,
const char *first,
...)
{
guint debug_flags;
va_list args;
const char *s;
GtkIconPaintable *info;
GList *l;
/* this hack is only usable in debug builds */
#ifndef G_ENABLE_DEBUG
g_assert_not_reached ();
#endif
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
g_log_set_writer_func (log_writer, NULL, NULL);
g_assert_null (lookups);
collecting_lookups = TRUE;
if (fallbacks)
{
@@ -203,9 +208,7 @@ assert_lookup_order (const char *icon_name,
if (info)
g_object_unref (info);
collecting_lookups = FALSE;
va_start (args, first);
s = first;
l = lookups;
@@ -221,6 +224,9 @@ assert_lookup_order (const char *icon_name,
g_list_free_full (lookups, g_free);
lookups = NULL;
g_log_set_writer_func (g_log_writer_default, NULL, NULL);
gtk_set_debug_flags (debug_flags);
}
#ifdef G_ENABLE_DEBUG
@@ -231,136 +237,6 @@ assert_lookup_order (const char *icon_name,
return;
#endif
static void
test_lookup_order (void)
{
require_debug ();
if (g_test_subprocess ())
{
guint debug_flags;
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
g_log_set_writer_func (log_writer, NULL, NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz",
"foo-bar",
"foo",
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
"foo-bar-baz-rtl",
"foo-bar-baz",
"foo-bar-rtl",
"foo-bar",
"foo-rtl",
"foo",
"foo-bar-baz-symbolic-rtl",
"foo-bar-baz-symbolic",
"foo-bar-symbolic-rtl",
"foo-bar-symbolic",
"foo-symbolic-rtl",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
"foo-bar-baz-rtl",
"foo-bar-baz",
NULL);
assert_lookup_order ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
"foo-bar-baz",
"foo-bar",
"foo",
NULL);
assert_lookup_order ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
return;
}
g_test_trap_subprocess (NULL, 0, 0);
g_test_trap_has_passed ();
}
static void
test_basics (void)
@@ -369,6 +245,122 @@ test_basics (void)
assert_icon_lookup ("simple", 16, GTK_TEXT_DIR_NONE, 0, FALSE, "/icons/16x16/simple.png");
}
static void
test_lookup_order (void)
{
require_debug ();
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz",
"foo-bar",
"foo",
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
"foo-bar-baz-rtl",
"foo-bar-baz",
"foo-bar-rtl",
"foo-bar",
"foo-rtl",
"foo",
"foo-bar-baz-symbolic-rtl",
"foo-bar-baz-symbolic",
"foo-bar-symbolic-rtl",
"foo-bar-symbolic",
"foo-symbolic-rtl",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
"foo-bar-baz-rtl",
"foo-bar-baz",
NULL);
assert_lookup_order ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
"foo-bar-baz",
"foo-bar",
"foo",
NULL);
assert_lookup_order ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
}
static void
test_generic_fallback (void)
{
@@ -812,6 +804,7 @@ main (int argc, char *argv[])
gtk_test_init (&argc, &argv);
g_test_add_func ("/icontheme/basics", test_basics);
g_test_add_func ("/icontheme/lookup-order", test_lookup_order);
g_test_add_func ("/icontheme/generic-fallback", test_generic_fallback);
g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic);
g_test_add_func ("/icontheme/force-regular", test_force_regular);
@@ -822,7 +815,6 @@ main (int argc, char *argv[])
g_test_add_func ("/icontheme/list", test_list);
g_test_add_func ("/icontheme/inherit", test_inherit);
g_test_add_func ("/icontheme/nonsquare-symbolic", test_nonsquare_symbolic);
g_test_add_func ("/icontheme/lookup-order", test_lookup_order);
return g_test_run();
}
+17 -13
View File
@@ -1049,26 +1049,30 @@ specific_bug_77977 (void)
g_object_unref (tree_store);
}
static GLogWriterOutput
log_writer_drop_warnings (GLogLevelFlags log_level,
const GLogField *fields,
gsize n_fields,
gpointer user_data)
{
return G_LOG_WRITER_HANDLED;
}
static void
specific_bug_698396 (void)
{
GtkTreeStore *tree_store;
int new_order[1] = { 0 };
/*http://bugzilla.gnome.org/show_bug.cgi?id=698396 */
if (g_test_subprocess ())
{
GtkTreeStore *tree_store;
int new_order[1] = { 0 };
tree_store = gtk_tree_store_new (1, G_TYPE_STRING);
tree_store = gtk_tree_store_new (1, G_TYPE_STRING);
gtk_tree_store_reorder (tree_store, NULL, new_order);
g_object_unref (tree_store);
g_log_set_writer_func (log_writer_drop_warnings, NULL, NULL);
gtk_tree_store_reorder (tree_store, NULL, new_order);
g_log_set_writer_func (g_log_writer_default, NULL, NULL);
return;
}
g_test_trap_subprocess (NULL, 0, 0);
g_test_trap_assert_stderr ("*Cannot reorder, parent has no children*");
g_test_trap_assert_failed ();
g_object_unref (tree_store);
}
/* main */
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="width-request">100</property>
<child>
<object class="GtkLabel">
<property name="label">letter is off</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic" start="0" end="-1"></attribute>
</attributes>
</object>
</child>
</object>
</interface>
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="width-request">100</property>
<child>
<object class="GtkLabel">
<property name="label">letter is off</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic" start="0" end="-1"></attribute>
</attributes>
</object>
</child>
</object>
</interface>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="height-request">100</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">T̰̰̰hree tildes below
</property>
<property name="valign">start</property>
</object>
</child>
</object>
</interface>
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="height-request">100</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">T̰̰̰hree tildes below</property>
<property name="valign">start</property>
</object>
</child>
</object>
</interface>
-4
View File
@@ -392,10 +392,6 @@ testdata = [
'label-huge-max-width-chars.ui',
'label-max-width-chars-and-halign-and-infinite-width.ui',
'label-max-width-chars-and-halign-and-infinite-width.ref.ui',
'label-overdraw-horizontal.ref.ui',
'label-overdraw-horizontal.ui',
'label-overdraw-vertical.ref.ui',
'label-overdraw-vertical.ui',
'label-shadows.css',
'label-shadows.ref.ui',
'label-shadows.ui',