Compare commits

...

42 Commits

Author SHA1 Message Date
Nelson Benítez León
79c2fab4e6 Fix segmentation fault when running GTK4
Trying to run any GTK4 app with current GTK main branch results
in a segmentation fault in my system. Caused by code assuming
a GError must be present, but it is not because the functions
supposed to return a GError hit first a g_return_val_if_fail()
which makes them return FALSE without filling the GError out
parameter.

When the fix in here I can run GTK4 apps again, with some
g_critical() messages printed to the console because of
the g_return_val_if_fail() hit, but that seems to not affect
the execution, they are related to some renderers not being
found.
2023-09-30 21:42:07 +01:00
Matthias Clasen
68755c0fd2 Post-release version bump 2023-09-28 10:49:46 -04:00
Matthias Clasen
9090c28125 4.13.1 2023-09-28 09:50:16 -04:00
Matthias Clasen
3a3244891e Merge branch 'wip-print-dialog' into 'main'
wip: print dialog api

See merge request GNOME/gtk!5484
2023-09-28 01:18:26 +00:00
Matthias Clasen
b55117334c gtk-demo: Add a print dialog 2023-09-27 20:50:52 -04:00
Matthias Clasen
02e5c7b9ad Add a print dialog
Add a simplified print api that only supports
printing preexisting pdf content. For now, it
only has a portal implementation.
2023-09-27 20:50:52 -04:00
Matthias Clasen
7268167f4c Merge branch 'matthiasc/for-main' into 'main'
print portal: Report errors properly

See merge request GNOME/gtk!6441
2023-09-27 21:52:13 +00:00
Matthias Clasen
93c7502cf7 printer: Add private search api 2023-09-27 17:37:11 -04:00
Matthias Clasen
789705cfe4 print portal: Report errors properly
The portal printoperation inmplementation
relies on the file printbackend to be available.
If it isn't, we should report a proper error
status insetad of running into assertions deep
inside the printoperation code.
2023-09-27 17:33:34 -04:00
Emmanuele Bassi
741471a1f8 Merge branch 'michaelweghorn/a11y_add_paragraph_role' into 'main'
a11y: Add paragraph role

See merge request GNOME/gtk!6432
2023-09-27 12:20:19 +00:00
Matthias Clasen
f8da751cc2 Merge branch 'wip/chergert/rendernode-type-checks-for-refcount' into 'main'
gsk: remove excessive type checking within GSK

See merge request GNOME/gtk!6439
2023-09-27 12:12:18 +00:00
Matthias Clasen
8174842d9f Merge branch 'wip/chergert/rendernode-type-check' into 'main'
gsk/gl: remove TypeNode conformity checking for renderjob

See merge request GNOME/gtk!6438
2023-09-27 12:10:52 +00:00
Matthias Clasen
e872952f36 Merge branch 'mcatanzaro/#6122' into 'main'
printoperation: fix case where operation may complete multiple twice

Closes #6122

See merge request GNOME/gtk!6437
2023-09-27 10:37:23 +00:00
Christian Hergert
b010e46d13 gsk/gl: remove TypeNode conformity checking for renderjob
We don't need to be calling type node conformity checking from the tight
loop of the renderjob. Hoist that into the private header and use that
intead through via the Class pointer.
2023-09-26 18:36:56 -07:00
Christian Hergert
eb646a8e8b gsk: remove excessive type checking within GSK
Anything that includes gskrendernodeprivate.h will get an alternate form
of ref/unref for render nodes which does not need to do type checking on
the parameter. We can expect that things are correct within GTK itself and
this saves excessive amounts of TypeNode conformities checking.
2023-09-26 18:28:34 -07:00
Michael Catanzaro
1e2975147d printoperation: fix some strange line spacing 2023-09-26 19:28:12 -05:00
Michael Catanzaro
653c10e8b6 printoperation: add some assertions
Let's assert that we schedule the idle callback exactly once.

These assertions are not perfect because if the callback executes before
we schedule it, then the assertion itself would be a use-after-free,
since I'm using the PrinterFinder to track whether the callback that
frees it has been scheduled. But in practice when using loupe's print
dialog, I was noticing the callback scheduled twice before it was
executed. The assertion would have caught this problem.
2023-09-26 19:25:41 -05:00
Michael Catanzaro
dfbafdf047 printoperation: fix another case where operation may complete twice
This is a little tricky. At first, I thought we had a codepath where we
fail to schedule the idle that completes the print operation: if we take
the gtk_print_backend_printer_list_is_done path for each printer
backend, then printer_list_done_cb() is never executed and we never
schedule the idle. But in fact, in this case, then backends == NULL at
the bottom of find_printer(), and we'll schedule the idle there, so it's
OK. Except it's not really OK, because we'll schedule it even if a
printer was already found, resulting in the callback completing twice
and a double free.

Simplify this. Schedule the idle in find_printer() only if there are
*initially* no backends, not also if all backends are immediately ready
and already removed from consideration. Instead, always call
printer_list_done_cb() for every backend in find_printer_init(). After
the previous commit, printer_list_done_cb() will schedule the idle when
appropriate.

printer_list_done_cb() additionally disconnects signals that we did not
connect in this codepath, but it does so using
g_signal_handlers_disconnect_by_func, which is harmless. Otherwise, the
only extra work it's doing is scheduling the idle, and that's exactly
what find_printer_init() is missing.
2023-09-26 19:08:46 -05:00
Michael Catanzaro
d8c821a851 printoperation: fix case where operation may complete multiple twice
If we are the final backend, then after removing ourselves there is no
backend remaining. We will schedule the idle even if it has already been
scheduled. This idle is required to run exactly once and executing it
twices results in a double free that crashes loupe when printing. It
also causes the user callback to execute twice, which could cause
similar problems.

Fixes #6122
2023-09-26 18:47:01 -05:00
Matthias Clasen
83376648d7 Merge branch 'wip/chergert/fix-clips-uaf' into 'main'
Fix potential UAF in renderjob clipping

See merge request GNOME/gtk!6436
2023-09-26 21:59:56 +00:00
Christian Hergert
089c34fa03 gsk/gl: use GdkArrayImpl for tracking modelview
Like the previous change, this uses GdkArrayImpl instead of GArray for
tracking modelview changes. This is less important than clip tracking
simple due to being used less, but it keeps the implementation synchronous
with the Clip tracking code.
2023-09-26 13:58:38 -07:00
Christian Hergert
c846f8d745 gsk/gl: use GdkArrayImpl for Clip tracking
We can end up spending a lot of time in g_array_maybe_expand() through the
use of g_array_set_size() for clip tracking. That is somewhat due to the
simple nature of GArray being size-dynamic. Instead, we can use
GdkArrayImpl and let the compiler do what it does best to elide some
work and hoist other work into the calling function.

This also fixes a potential UAF in gsk_gl_render_job_push_contained_clip().
2023-09-26 13:58:35 -07:00
Emmanuele Bassi
79ebd76ac8 Merge branch 'wip/chergert/fix-gdkarrayimpl-from-c++' into 'main'
gdk: add missing G_END_DECLS to gdkarrayimpl.c

See merge request GNOME/gtk!6435
2023-09-26 18:48:02 +00:00
Christian Hergert
6eb9836eb0 gdk: add missing G_END_DECLS to gdkarrayimpl.c 2023-09-26 10:46:21 -07:00
Matthias Clasen
4a8f8a6eea Merge branch 'broadway-renderer-leak' into 'main'
broadway: Plug a leak in the GSK renderer

Closes #6120

See merge request GNOME/gtk!6434
2023-09-26 15:13:38 +00:00
Emmanuele Bassi
3ea723730b broadway: Do not add an extra reference when caching textures
We just created a GdkTexture, so we don't need to acquire a reference if
we're transferring the ownership to the node cache.
2023-09-26 14:44:05 +01:00
Emmanuele Bassi
90be2baf8b broadway: Plug another leak
When getting a colorized texture we're downloading the texture as a
Cairo surface, and then feeding it to another texture, but we never drop
the reference of the new surface.
2023-09-26 14:40:37 +01:00
Emmanuele Bassi
0b64fa88a1 docs: Clarify the behaviour of gdk_texture_new_for_surface()
Cairo surfaces are not GObject instances, so we should be more explicit
in the behaviour of the memory management, to avoid leaks.
2023-09-26 12:57:52 +01:00
Emmanuele Bassi
c6cc446e63 broadway: Plug a leak in the GSK renderer
We are leaking the Cairo image surface when creating a new node.

Fixes: #6120
2023-09-26 12:49:32 +01:00
Benjamin Otte
0cad37760e Merge branch 'wip/otte/for-main' into 'main'
treeview: Fix crash in assertion

Closes #6114

See merge request GNOME/gtk!6433
2023-09-26 09:29:08 +00:00
Benjamin Otte
e720008dca glcontext: Add gdk_gl_context_get_glsl_version_string()
This is in preparation for the new renderer.
2023-09-26 11:08:59 +02:00
Benjamin Otte
9c636a6136 array: Compute new size properly
Using "1 << x" means that we are shifting a signed 32bit integer, but we
want a gsize, which is an unsigned 64bit integer.

So now we don't overflow anymore if the array reaches a size of 2GB.
2023-09-26 11:08:59 +02:00
Benjamin Otte
1e24aa425e gdk: Fix compiler warning
gcc's -Wlto-type-mismatch found the hack, where we copied the wrong
prototype.
2023-09-26 11:08:59 +02:00
Benjamin Otte
a8c597005a treeview: Fix crash in assertion
The fix in commit a267dfac5d is wrong.
The function can return FALSE in normal operation.

Instead do a check for node == NULL that gracefully returns FALSE instead.

Fixes: #6114
2023-09-26 11:08:32 +02:00
Aurimas Černius
97a781b380 Update Lithuanian translation
(cherry picked from commit 61276e9a76)
2023-09-25 19:58:12 +00:00
Rafael Fontenelle
313cadefe6 Update Brazilian Portuguese translation
(cherry picked from commit 90b8dcdf33)
2023-09-25 12:58:47 +00:00
Michael Weghorn
9f078bd5c9 a11y: Add paragraph role
Add new GTK_ACCESSIBLE_ROLE_PARAGRAPH role
for paragraphs.

ARIA has a paragraph role as well.

The paragraph role is used e.g. in document editors
like LibreOffice or web browsers like Firefox.

According to the ARIA spec [1], naming paragraphs
is forbidden (§ 5.2.8.6), and the superclass role
is section.

This role will be more useful once a way to expose
the textual data via the AT-SPI Text interface is
also available (s. issue #5912 [2]).

[1] https://www.w3.org/TR/wai-aria-1.2/
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912
2023-09-25 11:30:14 +02:00
Matthias Clasen
8ff4e27103 Merge branch 'wip/alice/dialog-crash' into 'main'
dialog: Check header bar type before calling track_default_decoration()

Closes #6116

See merge request GNOME/gtk!6430
2023-09-24 13:24:49 +00:00
Matthias Clasen
8389ca633d Merge branch 'matthiasc/for-main' into 'main'
tests: Split off some path utilities

See merge request GNOME/gtk!6431
2023-09-24 13:07:45 +00:00
Matthias Clasen
18fbec0fe1 Improve FOO_DEBUG=help output
Explain the all value a bit better.
2023-09-24 08:33:22 -04:00
Alice Mikhaylenko
eb0a00067d dialog: Check header bar type before calling track_default_decoration()
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6116
2023-09-24 15:38:19 +04:00
Alice Mikhaylenko
91216408e5 header-bar: Add a precondition to track_default_decoration() 2023-09-24 15:21:55 +04:00
31 changed files with 2007 additions and 218 deletions

33
NEWS
View File

@@ -1,4 +1,7 @@
Overview of Changes in 4.13.1, xx-xx-xxxx
Overview of Changes in 4.13.2, xx-xx-xxxx
=========================================
Overview of Changes in 4.13.1, 28-09-2023
=========================================
* GtkTooltip:
@@ -7,20 +10,32 @@ Overview of Changes in 4.13.1, xx-xx-xxxx
* GtkCenterLayout, GtkEntry, GtkSearchEntry:
- Fix some issues with baseline handling
* GtkColorButton, GtkFontButton:
- Propagate focus-on-click
* GtkFileChooser:
- Make "Visit file" scroll to the file
* GtkSwitch:
- Respect text direction
* GtkWindow:
- Don't assume titlebars are GtkHeaderBars
* Printing:
- Fix some problems with the portal implementation
- Add a new simple print API: GtkPrintDialog
* Paths:
- GskPathMeasure performance has been improved
- Add custom contours for circles, rounded rectangles and rectangles
- Simplify GskPathPoint handling
- gsk_path_point_get_closest_point now returns the distance as well
- Make GskPathBuilder simplify curves
* Input:
- Handle (some) single-key compose sequences
- Fix active state tracking with sensitivity changes and grabs
* GSK:
- Make the repeated gradients match between GL and cairo
@@ -29,6 +44,13 @@ Overview of Changes in 4.13.1, xx-xx-xxxx
- Restrict an optimization to the cases where it is crrect
- Fix rendering of shadows with opacity
- The Vulkan renderer now requires Vulkan 1.2
- GL: Transition gradients unpremultiplied
- GL: Fix clipping of shadows
- GL: Some optimizations
- Broadway: Fix memory leaks in the renderer
* Wayland:
- Make activation more reliable
* macOS:
- Clamp damage regions to the surface size
@@ -43,20 +65,29 @@ Overview of Changes in 4.13.1, xx-xx-xxxx
* Build:
- Fix build problems with C++ compilers
* Deprecations:
- gtk_window_present_with_time
* Translation updates
Brazilian Portuguese
British English
Catalan
Chinese (China)
Czech
Danish
Dutch
Esperanto
Galician
Georgian
Italian
Korean
Latvian
Lithuanian
Persian
Polish
Punjabi
Slovenian
Turkish
Overview of Changes in 4.13.0, 25-08-2023

View File

@@ -11,11 +11,13 @@
#include <gtk/gtk.h>
static GtkWidget *app_picker;
static GtkWidget *print_button;
static void
set_file (GFile *file,
gpointer data)
{
GFileInfo *info;
char *name;
if (!file)
@@ -31,6 +33,13 @@ set_file (GFile *file,
gtk_widget_set_sensitive (app_picker, TRUE);
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
info = g_file_query_info (file, "standard::content-type", 0, NULL, NULL);
if (strcmp (g_file_info_get_content_type (info), "application/pdf") == 0)
{
gtk_widget_set_sensitive (print_button, TRUE);
g_object_set_data_full (G_OBJECT (print_button), "file", g_object_ref (file), g_object_unref);
}
}
static void
@@ -47,6 +56,10 @@ file_opened (GObject *source,
{
g_print ("%s\n", error->message);
g_error_free (error);
gtk_widget_set_sensitive (app_picker, FALSE);
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
gtk_widget_set_sensitive (print_button, FALSE);
g_object_set_data (G_OBJECT (print_button), "file", NULL);
}
set_file (file, data);
@@ -114,6 +127,53 @@ open_app (GtkButton *picker)
g_object_unref (launcher);
}
static void
print_file_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
GtkPrintDialog *dialog = GTK_PRINT_DIALOG (source);
GError *error = NULL;
GCancellable *cancellable;
unsigned int id;
cancellable = g_task_get_cancellable (G_TASK (result));
id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (cancellable), "timeout"));
if (id)
g_source_remove (id);
if (!gtk_print_dialog_print_file_finish (dialog, result, &error))
{
g_print ("%s\n", error->message);
g_error_free (error);
}
}
static void
print_file (GtkButton *picker)
{
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
GtkPrintDialog *dialog;
GCancellable *cancellable;
GFile *file;
unsigned int id;
file = G_FILE (g_object_get_data (G_OBJECT (picker), "file"));
dialog = gtk_print_dialog_new ();
cancellable = g_cancellable_new ();
id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
20,
abort_mission, g_object_ref (cancellable), g_object_unref);
g_object_set_data (G_OBJECT (cancellable), "timeout", GUINT_TO_POINTER (id));
gtk_print_dialog_print_file (dialog, parent, file, cancellable, print_file_done, NULL);
g_object_unref (cancellable);
g_object_unref (dialog);
}
static void
open_uri_done (GObject *source,
GAsyncResult *result,
@@ -234,8 +294,14 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_sensitive (app_picker, FALSE);
g_signal_connect (app_picker, "clicked", G_CALLBACK (open_app), NULL);
gtk_box_append (GTK_BOX (picker), app_picker);
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
print_button = gtk_button_new_from_icon_name ("printer-symbolic");
gtk_widget_set_tooltip_text (print_button, "Print file");
gtk_widget_set_sensitive (print_button, FALSE);
g_signal_connect (print_button, "clicked", G_CALLBACK (print_file), NULL);
gtk_box_append (GTK_BOX (picker), print_button);
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
label = gtk_label_new ("URI:");
gtk_widget_set_halign (label, GTK_ALIGN_START);

View File

@@ -263,7 +263,7 @@ gdk_parse_debug_var (const char *variable,
if (debug_enabled || keys[i].always_enabled)
fprintf (stderr, " %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
}
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values. Other given values are subtracted");
fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
}

View File

@@ -183,7 +183,7 @@ gdk_array(reserve) (GdkArray *self,
return;
size = gdk_array(get_size) (self);
new_size = 1 << g_bit_storage (MAX (GDK_ARRAY_REAL_SIZE (n), 16) - 1);
new_size = ((gsize) 1) << g_bit_storage (MAX (GDK_ARRAY_REAL_SIZE (n), 16) - 1);
#ifdef GDK_ARRAY_PREALLOC
if (self->start == self->preallocated)
@@ -318,3 +318,5 @@ gdk_array(get) (const GdkArray *self,
#undef GDK_ARRAY_TYPE_NAME
#undef GDK_ARRAY_NO_MEMSET
#endif
G_END_DECLS

View File

@@ -1715,6 +1715,56 @@ gdk_gl_context_get_version (GdkGLContext *context,
*minor = gdk_gl_version_get_minor (&priv->gl_version);
}
const char *
gdk_gl_context_get_glsl_version_string (GdkGLContext *self)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
if (priv->api == GDK_GL_API_GL)
{
if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 6)))
return "#version 460";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 5)))
return "#version 450";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 4)))
return "#version 440";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 3)))
return "#version 430";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 2)))
return "#version 420";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 1)))
return "#version 410";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (4, 0)))
return "#version 400";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 3)))
return "#version 330";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 2)))
return "#version 150";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 1)))
return "#version 140";
else
return "#version 130";
}
else if (priv->api == GDK_GL_API_GLES)
{
if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 2)))
return "#version 320 es";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 1)))
return "#version 310 es";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
return "#version 300 es";
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
return "#version 300 es";
else
return "#version 100";
}
else
{
/* must be realized to be called */
g_assert_not_reached ();
}
}
/**
* gdk_gl_context_clear_current:
*

View File

@@ -147,6 +147,8 @@ void gdk_gl_context_label_object_printf (GdkGLContext
const char *format,
...) G_GNUC_PRINTF (4, 5);
const char * gdk_gl_context_get_glsl_version_string (GdkGLContext *self);
gboolean gdk_gl_context_has_debug (GdkGLContext *self) G_GNUC_PURE;
gboolean gdk_gl_context_use_es_bgra (GdkGLContext *context);

View File

@@ -24,13 +24,16 @@
#include "gdksnapshotprivate.h"
#include "gdkprivate.h"
#include <graphene.h>
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
GdkSnapshot * gtk_snapshot_new (void);
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
const char *message,
...) G_GNUC_PRINTF (2, 3);
void gtk_snapshot_pop (GdkSnapshot *snapshot);
GdkPaintable * gtk_snapshot_free_to_paintable (GdkSnapshot *snapshot);
GdkPaintable * gtk_snapshot_free_to_paintable (GdkSnapshot *snapshot,
const graphene_size_t *size);
/**
* GdkPaintable:
@@ -118,7 +121,7 @@ gdk_paintable_default_get_current_image (GdkPaintable *paintable)
snapshot = gtk_snapshot_new ();
gdk_paintable_snapshot (paintable, snapshot, width, height);
return gtk_snapshot_free_to_paintable (snapshot);
return gtk_snapshot_free_to_paintable (snapshot, NULL);
}
static GdkPaintableFlags

View File

@@ -345,7 +345,9 @@ gdk_texture_init (GdkTexture *self)
*
* Creates a new texture object representing the surface.
*
* @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`.
* The @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`.
*
* The newly created texture will acquire a reference on the @surface.
*
* Returns: a new `GdkTexture`
*/
@@ -364,7 +366,7 @@ gdk_texture_new_for_surface (cairo_surface_t *surface)
* cairo_image_surface_get_stride (surface),
(GDestroyNotify) cairo_surface_destroy,
cairo_surface_reference (surface));
texture = gdk_memory_texture_new (cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface),
GDK_MEMORY_DEFAULT,
@@ -819,7 +821,7 @@ gdk_texture_set_render_data (GdkTexture *self,
GDestroyNotify notify)
{
g_return_val_if_fail (data != NULL, FALSE);
if (self->render_key != NULL)
return FALSE;

View File

@@ -453,7 +453,7 @@ get_colorized_texture (GdkTexture *texture,
const graphene_matrix_t *color_matrix,
const graphene_vec4_t *color_offset)
{
cairo_surface_t *surface = gdk_texture_download_surface (texture);
cairo_surface_t *surface;
cairo_surface_t *image_surface;
graphene_vec4_t pixel;
guint32* pixel_data;
@@ -475,6 +475,7 @@ get_colorized_texture (GdkTexture *texture,
return g_object_ref (colorized->texture);
}
surface = gdk_texture_download_surface (texture);
image_surface = cairo_surface_map_to_image (surface, NULL);
data = cairo_image_surface_get_data (image_surface);
width = cairo_image_surface_get_width (image_surface);
@@ -536,6 +537,8 @@ get_colorized_texture (GdkTexture *texture,
colorized_list, (GDestroyNotify)colorized_texture_free_list);
}
cairo_surface_destroy (surface);
return colorized_texture;
}
@@ -611,7 +614,7 @@ gsk_broadway_renderer_add_node (GskRenderer *renderer,
}
texture = gdk_texture_new_for_surface (image_surface);
g_ptr_array_add (self->node_textures, g_object_ref (texture)); /* Transfers ownership to node_textures */
g_ptr_array_add (self->node_textures, texture); /* Transfers ownership to node_textures */
texture_id = gdk_broadway_display_ensure_texture (display, texture);
add_rect (nodes, &node->bounds, offset_x, offset_y);
@@ -902,6 +905,8 @@ gsk_broadway_renderer_add_node (GskRenderer *renderer,
add_float (nodes, width);
add_float (nodes, height);
add_uint32 (nodes, texture_id);
cairo_surface_destroy (surface);
}
}

View File

@@ -65,6 +65,14 @@ typedef struct _GskGLRenderClip
guint is_fully_contained : 1;
} GskGLRenderClip;
#define GDK_ARRAY_NAME clips
#define GDK_ARRAY_TYPE_NAME Clips
#define GDK_ARRAY_ELEMENT_TYPE GskGLRenderClip
#define GDK_ARRAY_BY_VALUE 1
#define GDK_ARRAY_PREALLOC 16
#define GDK_ARRAY_NO_MEMSET
#include "gdk/gdkarrayimpl.c"
typedef struct _GskGLRenderModelview
{
GskTransform *transform;
@@ -77,6 +85,14 @@ typedef struct _GskGLRenderModelview
graphene_matrix_t matrix;
} GskGLRenderModelview;
#define GDK_ARRAY_NAME modelviews
#define GDK_ARRAY_TYPE_NAME Modelviews
#define GDK_ARRAY_ELEMENT_TYPE GskGLRenderModelview
#define GDK_ARRAY_BY_VALUE 1
#define GDK_ARRAY_PREALLOC 16
#define GDK_ARRAY_NO_MEMSET
#include "gdk/gdkarrayimpl.c"
struct _GskGLRenderJob
{
/* The context containing the framebuffer we are drawing to. Generally this
@@ -117,12 +133,12 @@ struct _GskGLRenderJob
/* An array of GskGLRenderModelview updated as nodes are processed. The
* current modelview is the last element.
*/
GArray *modelview;
Modelviews modelview;
/* An array of GskGLRenderClip updated as nodes are processed. The
* current clip is the last element.
*/
GArray *clip;
Clips clip;
/* Our current alpha state as we process nodes */
float alpha;
@@ -193,6 +209,22 @@ static gboolean gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob
const GskRenderNode *node,
GskGLRenderOffscreen *offscreen);
static inline GskGLRenderClip *
clips_grow_one (Clips *clips)
{
guint len = clips_get_size (clips);
clips_set_size (clips, len + 1);
return clips_get (clips, len);
}
static inline GskGLRenderModelview *
modelviews_grow_one (Modelviews *modelviews)
{
guint len = modelviews_get_size (modelviews);
modelviews_set_size (modelviews, len + 1);
return modelviews_get (modelviews, len);
}
static inline int
get_target_format (GskGLRenderJob *job,
const GskRenderNode *node)
@@ -238,7 +270,7 @@ gsk_rounded_rect_shrink_to_minimum (GskRoundedRect *self)
static inline gboolean G_GNUC_PURE
node_supports_2d_transform (const GskRenderNode *node)
{
switch (gsk_render_node_get_node_type (node))
switch (GSK_RENDER_NODE_TYPE (node))
{
case GSK_COLOR_NODE:
case GSK_OPACITY_NODE:
@@ -300,7 +332,7 @@ node_supports_transform (const GskRenderNode *node)
* opacity or color matrix.
*/
switch (gsk_render_node_get_node_type (node))
switch (GSK_RENDER_NODE_TYPE (node))
{
case GSK_COLOR_NODE:
case GSK_OPACITY_NODE:
@@ -466,15 +498,10 @@ gsk_gl_render_job_set_modelview (GskGLRenderJob *job,
GskGLRenderModelview *modelview;
g_assert (job != NULL);
g_assert (job->modelview != NULL);
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
g_array_set_size (job->modelview, job->modelview->len + 1);
modelview = &g_array_index (job->modelview,
GskGLRenderModelview,
job->modelview->len - 1);
modelview = modelviews_grow_one (&job->modelview);
modelview->transform = transform;
@@ -499,26 +526,17 @@ gsk_gl_render_job_push_modelview (GskGLRenderJob *job,
GskGLRenderModelview *modelview;
g_assert (job != NULL);
g_assert (job->modelview != NULL);
g_assert (transform != NULL);
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
g_array_set_size (job->modelview, job->modelview->len + 1);
modelview = modelviews_grow_one (&job->modelview);
modelview = &g_array_index (job->modelview,
GskGLRenderModelview,
job->modelview->len - 1);
if G_LIKELY (job->modelview->len > 1)
if G_LIKELY (modelviews_get_size (&job->modelview) > 1)
{
GskGLRenderModelview *last;
GskGLRenderModelview *last = job->modelview.end - 2;
GskTransform *t = NULL;
last = &g_array_index (job->modelview,
GskGLRenderModelview,
job->modelview->len - 2);
/* Multiply given matrix with our previous modelview */
t = gsk_transform_translate (gsk_transform_ref (last->transform),
&(graphene_point_t) {
@@ -552,8 +570,7 @@ gsk_gl_render_job_pop_modelview (GskGLRenderJob *job)
const GskGLRenderModelview *head;
g_assert (job != NULL);
g_assert (job->modelview);
g_assert (job->modelview->len > 0);
g_assert (modelviews_get_size (&job->modelview) > 0);
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
@@ -564,11 +581,11 @@ gsk_gl_render_job_pop_modelview (GskGLRenderJob *job)
gsk_transform_unref (head->transform);
job->modelview->len--;
job->modelview.end--;
if (job->modelview->len >= 1)
if (modelviews_get_size (&job->modelview) >= 1)
{
head = &g_array_index (job->modelview, GskGLRenderModelview, job->modelview->len - 1);
head = job->modelview.end - 1;
job->scale_x = head->scale_x;
job->scale_y = head->scale_y;
@@ -588,14 +605,12 @@ gsk_gl_render_job_push_clip (GskGLRenderJob *job,
GskGLRenderClip *clip;
g_assert (job != NULL);
g_assert (job->clip != NULL);
g_assert (rect != NULL);
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
g_array_set_size (job->clip, job->clip->len + 1);
clip = clips_grow_one (&job->clip);
clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
memcpy (&clip->rect, rect, sizeof *rect);
clip->is_rectilinear = gsk_rounded_rect_is_rectilinear (rect);
clip->is_fully_contained = FALSE;
@@ -610,16 +625,13 @@ gsk_gl_render_job_push_contained_clip (GskGLRenderJob *job)
GskGLRenderClip *old_clip;
g_assert (job != NULL);
g_assert (job->clip != NULL);
g_assert (job->clip->len > 0);
g_assert (clips_get_size (&job->clip) > 0);
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
old_clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
clip = clips_grow_one (&job->clip);
old_clip = clips_get (&job->clip, clips_get_size (&job->clip) - 2);
g_array_set_size (job->clip, job->clip->len + 1);
clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
memcpy (&clip->rect.bounds, &old_clip->rect.bounds, sizeof (graphene_rect_t));
memset (clip->rect.corner, 0, sizeof clip->rect.corner);
clip->is_rectilinear = TRUE;
@@ -632,12 +644,11 @@ static void
gsk_gl_render_job_pop_clip (GskGLRenderJob *job)
{
g_assert (job != NULL);
g_assert (job->clip != NULL);
g_assert (job->clip->len > 0);
g_assert (clips_get_size (&job->clip) > 0);
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
job->current_clip--;
job->clip->len--;
job->clip.end--;
}
static inline void
@@ -719,7 +730,7 @@ gsk_gl_render_job_transform_bounds (GskGLRenderJob *job,
GskTransformCategory category;
g_assert (job != NULL);
g_assert (job->modelview->len > 0);
g_assert (modelviews_get_size (&job->modelview) > 0);
g_assert (rect != NULL);
g_assert (out_rect != NULL);
@@ -1214,12 +1225,12 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
{
cairo_move_to (cr, 0, 0);
cairo_rectangle (cr, 0, 0, node->bounds.size.width, node->bounds.size.height);
if (gsk_render_node_get_node_type (node) == GSK_CAIRO_NODE)
if (GSK_RENDER_NODE_TYPE (node) == GSK_CAIRO_NODE)
cairo_set_source_rgba (cr, 0.3, 0, 1, 0.25);
else
cairo_set_source_rgba (cr, 1, 0, 0, 0.25);
cairo_fill_preserve (cr);
if (gsk_render_node_get_node_type (node) == GSK_CAIRO_NODE)
if (GSK_RENDER_NODE_TYPE (node) == GSK_CAIRO_NODE)
cairo_set_source_rgba (cr, 0.3, 0, 1, 1);
else
cairo_set_source_rgba (cr, 1, 0, 0, 1);
@@ -1512,7 +1523,7 @@ gsk_gl_render_job_visit_linear_gradient_node (GskGLRenderJob *job,
const graphene_point_t *start = gsk_linear_gradient_node_get_start (node);
const graphene_point_t *end = gsk_linear_gradient_node_get_end (node);
int n_color_stops = gsk_linear_gradient_node_get_n_color_stops (node);
gboolean repeat = gsk_render_node_get_node_type (node) == GSK_REPEATING_LINEAR_GRADIENT_NODE;
gboolean repeat = GSK_RENDER_NODE_TYPE (node) == GSK_REPEATING_LINEAR_GRADIENT_NODE;
float x1 = job->offset_x + start->x;
float x2 = job->offset_x + end->x;
float y1 = job->offset_y + start->y;
@@ -1585,7 +1596,7 @@ gsk_gl_render_job_visit_radial_gradient_node (GskGLRenderJob *job,
float end = gsk_radial_gradient_node_get_end (node);
float hradius = gsk_radial_gradient_node_get_hradius (node);
float vradius = gsk_radial_gradient_node_get_vradius (node);
gboolean repeat = gsk_render_node_get_node_type (node) == GSK_REPEATING_RADIAL_GRADIENT_NODE;
gboolean repeat = GSK_RENDER_NODE_TYPE (node) == GSK_REPEATING_RADIAL_GRADIENT_NODE;
float scale = 1.0f / (end - start);
float bias = -start * scale;
@@ -1730,7 +1741,7 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
* which both have rounded corners.
*/
if (job->clip->len <= 1)
if (clips_get_size (&job->clip) <= 1)
need_offscreen = FALSE;
else if (gsk_rounded_rect_contains_rect (&job->current_clip->rect, &transformed_clip.bounds))
need_offscreen = FALSE;
@@ -2799,8 +2810,8 @@ static inline gboolean G_GNUC_PURE
equal_texture_nodes (const GskRenderNode *node1,
const GskRenderNode *node2)
{
if (gsk_render_node_get_node_type (node1) != GSK_TEXTURE_NODE ||
gsk_render_node_get_node_type (node2) != GSK_TEXTURE_NODE)
if (GSK_RENDER_NODE_TYPE (node1) != GSK_TEXTURE_NODE ||
GSK_RENDER_NODE_TYPE (node2) != GSK_TEXTURE_NODE)
return FALSE;
if (gsk_texture_node_get_texture (node1) !=
@@ -3103,7 +3114,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
/* Shadow nodes recolor every pixel of the source texture, but leave the alpha in tact.
* If the child is a color matrix node that doesn't touch the alpha, we can throw that away. */
if (gsk_render_node_get_node_type (shadow_child) == GSK_COLOR_MATRIX_NODE &&
if (GSK_RENDER_NODE_TYPE (shadow_child) == GSK_COLOR_MATRIX_NODE &&
!color_matrix_modifies_alpha (shadow_child))
shadow_child = gsk_color_matrix_node_get_child (shadow_child);
@@ -3123,7 +3134,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
continue;
if (shadow->radius == 0 &&
gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE)
GSK_RENDER_NODE_TYPE (shadow_child) == GSK_TEXT_NODE)
{
if (dx != 0 || dy != 0)
{
@@ -3946,7 +3957,7 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
if (!gsk_gl_render_job_update_clip (job, &node->bounds, &has_clip))
return;
switch (gsk_render_node_get_node_type (node))
switch (GSK_RENDER_NODE_TYPE (node))
{
case GSK_BLEND_NODE:
gsk_gl_render_job_visit_blend_node (job, node);
@@ -3999,12 +4010,12 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
if (i + 1 < n_children &&
job->current_clip->is_fully_contained &&
gsk_render_node_get_node_type (child) == GSK_ROUNDED_CLIP_NODE)
GSK_RENDER_NODE_TYPE (child) == GSK_ROUNDED_CLIP_NODE)
{
const GskRenderNode *grandchild = gsk_rounded_clip_node_get_child (child);
const GskRenderNode *child2 = children[i + 1];
if (gsk_render_node_get_node_type (grandchild) == GSK_COLOR_NODE &&
gsk_render_node_get_node_type (child2) == GSK_BORDER_NODE &&
if (GSK_RENDER_NODE_TYPE (grandchild) == GSK_COLOR_NODE &&
GSK_RENDER_NODE_TYPE (child2) == GSK_BORDER_NODE &&
gsk_border_node_get_uniform_color (child2) &&
rounded_rect_equal (gsk_rounded_clip_node_get_clip (child),
gsk_border_node_get_outline (child2)))
@@ -4158,7 +4169,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
return FALSE;
}
if (gsk_render_node_get_node_type (node) == GSK_TEXTURE_NODE &&
if (GSK_RENDER_NODE_TYPE (node) == GSK_TEXTURE_NODE &&
!offscreen->force_offscreen)
{
GdkTexture *texture = gsk_texture_node_get_texture (node);
@@ -4531,8 +4542,8 @@ gsk_gl_render_job_new (GskGLDriver *driver,
job = g_new0 (GskGLRenderJob, 1);
job->driver = g_object_ref (driver);
job->command_queue = job->driver->command_queue;
job->clip = g_array_sized_new (FALSE, FALSE, sizeof (GskGLRenderClip), 16);
job->modelview = g_array_sized_new (FALSE, FALSE, sizeof (GskGLRenderModelview), 16);
clips_init (&job->clip);
modelviews_init (&job->modelview);
job->framebuffer = framebuffer;
job->clear_framebuffer = !!clear_framebuffer;
job->default_framebuffer = default_framebuffer;
@@ -4582,16 +4593,16 @@ gsk_gl_render_job_free (GskGLRenderJob *job)
job->current_modelview = NULL;
job->current_clip = NULL;
while (job->modelview->len > 0)
while (job->modelview.end > job->modelview.start)
{
GskGLRenderModelview *modelview = &g_array_index (job->modelview, GskGLRenderModelview, job->modelview->len-1);
GskGLRenderModelview *modelview = job->modelview.end-1;
g_clear_pointer (&modelview->transform, gsk_transform_unref);
job->modelview->len--;
job->modelview.end--;
}
g_clear_object (&job->driver);
g_clear_pointer (&job->region, cairo_region_destroy);
g_clear_pointer (&job->modelview, g_array_unref);
g_clear_pointer (&job->clip, g_array_unref);
modelviews_clear (&job->modelview);
clips_clear (&job->clip);
g_free (job);
}

View File

@@ -655,7 +655,7 @@ gsk_renderer_new_for_surface (GdkSurface *surface)
g_message ("Failed to realize renderer of type '%s' for surface '%s': %s\n",
G_OBJECT_TYPE_NAME (renderer),
G_OBJECT_TYPE_NAME (surface),
error->message);
error ? error->message : "");
g_object_unref (renderer);
g_clear_error (&error);
}

View File

@@ -287,15 +287,21 @@ gsk_render_node_alloc (GskRenderNodeType node_type)
* Returns: (transfer full): the `GskRenderNode` with an additional reference
*/
GskRenderNode *
gsk_render_node_ref (GskRenderNode *node)
(gsk_render_node_ref) (GskRenderNode *node)
{
g_return_val_if_fail (GSK_IS_RENDER_NODE (node), NULL);
g_atomic_ref_count_inc (&node->ref_count);
return node;
return _gsk_render_node_ref (node);
}
void
_gsk_render_node_unref (GskRenderNode *node)
{
if G_UNLIKELY (g_atomic_ref_count_dec (&node->ref_count))
GSK_RENDER_NODE_GET_CLASS (node)->finalize (node);
}
/**
* gsk_render_node_unref:
* @node: (transfer full): a `GskRenderNode`
@@ -306,12 +312,11 @@ gsk_render_node_ref (GskRenderNode *node)
* freed.
*/
void
gsk_render_node_unref (GskRenderNode *node)
(gsk_render_node_unref) (GskRenderNode *node)
{
g_return_if_fail (GSK_IS_RENDER_NODE (node));
if (g_atomic_ref_count_dec (&node->ref_count))
GSK_RENDER_NODE_GET_CLASS (node)->finalize (node);
_gsk_render_node_unref (node);
}

View File

@@ -21,6 +21,9 @@ extern GType gsk_render_node_types[];
#define GSK_IS_RENDER_NODE_TYPE(node,type) \
(G_TYPE_INSTANCE_GET_CLASS ((node), GSK_TYPE_RENDER_NODE, GskRenderNodeClass)->node_type == (type))
#define GSK_RENDER_NODE_TYPE(node) \
(G_TYPE_INSTANCE_GET_CLASS ((node), GSK_TYPE_RENDER_NODE, GskRenderNodeClass)->node_type)
struct _GskRenderNode
{
GTypeInstance parent_instance;
@@ -57,6 +60,8 @@ GType gsk_render_node_type_register_static (const char
gpointer gsk_render_node_alloc (GskRenderNodeType node_type);
void _gsk_render_node_unref (GskRenderNode *node);
gboolean gsk_render_node_can_diff (const GskRenderNode *node1,
const GskRenderNode *node2) G_GNUC_PURE;
void gsk_render_node_diff (GskRenderNode *node1,
@@ -87,6 +92,15 @@ gboolean gsk_container_node_is_disjoint (const GskRenderNode
gboolean gsk_render_node_use_offscreen_for_opacity (const GskRenderNode *node);
#define gsk_render_node_ref(node) _gsk_render_node_ref(node)
#define gsk_render_node_unref(node) _gsk_render_node_unref(node)
static inline GskRenderNode *
_gsk_render_node_ref (GskRenderNode *node)
{
g_atomic_ref_count_inc (&node->ref_count);
return node;
}
G_END_DECLS

View File

@@ -171,6 +171,9 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
case GTK_ACCESSIBLE_ROLE_OPTION:
return ATSPI_ROLE_OPTION_PANE;
case GTK_ACCESSIBLE_ROLE_PARAGRAPH:
return ATSPI_ROLE_PARAGRAPH;
case GTK_ACCESSIBLE_ROLE_PRESENTATION:
return ATSPI_ROLE_INVALID;

View File

@@ -454,7 +454,8 @@ gtk_dialog_constructed (GObject *object)
}
g_list_free (children);
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
if (GTK_IS_HEADER_BAR (priv->headerbar))
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
}
else
{
@@ -1397,7 +1398,8 @@ gtk_dialog_buildable_add_child (GtkBuildable *buildable,
else if (g_str_equal (type, "titlebar"))
{
priv->headerbar = GTK_WIDGET (child);
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
if (GTK_IS_HEADER_BAR (priv->headerbar))
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
gtk_window_set_titlebar (GTK_WINDOW (buildable), priv->headerbar);
}
else if (g_str_equal (type, "action"))

View File

@@ -12833,9 +12833,12 @@ gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view,
*column = real_column;
gtk_tree_model_get_iter (priv->model, &iter, real_path);
if (!_gtk_tree_view_find_node (tree_view, real_path, &tree, &node))
_gtk_tree_view_find_node (tree_view, real_path, &tree, &node);
if (node == NULL)
{
g_assert_not_reached ();
if (!path)
gtk_tree_path_free (real_path);
return TRUE;
}
/* Check if there's an expander arrow at (x, y) */

View File

@@ -209,6 +209,7 @@
#include <gtk/gtkpopover.h>
#include <gtk/gtkpopovermenu.h>
#include <gtk/gtkpopovermenubar.h>
#include <gtk/gtkprintdialog.h>
#include <gtk/print/gtkprintcontext.h>
#include <gtk/print/gtkprintoperation.h>
#include <gtk/print/gtkprintoperationpreview.h>

View File

@@ -832,6 +832,7 @@ static const char *role_names[] = {
[GTK_ACCESSIBLE_ROLE_WINDOW] = NC_("accessibility", "window"),
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NC_("accessibility", "toggle button"),
[GTK_ACCESSIBLE_ROLE_APPLICATION] = NC_("accessibility", "application"),
[GTK_ACCESSIBLE_ROLE_PARAGRAPH] = NC_("accessibility", "paragraph"),
};
/*< private >
@@ -912,6 +913,7 @@ static struct {
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_APPLICATION },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_DOCUMENT },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_GENERIC },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_PARAGRAPH },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_PRESENTATION },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_RANGE },
{ GTK_ACCESSIBLE_ROLE_STRUCTURE, GTK_ACCESSIBLE_ROLE_ROW_GROUP },

View File

@@ -1103,6 +1103,7 @@ static guint8 naming[] = {
[GTK_ACCESSIBLE_ROLE_WINDOW] = NAME_FROM_AUTHOR,
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NAME_FROM_AUTHOR|GTK_ACCESSIBLE_NAME_REQUIRED,
[GTK_ACCESSIBLE_ROLE_APPLICATION] = NAME_FROM_AUTHOR|GTK_ACCESSIBLE_NAME_REQUIRED,
[GTK_ACCESSIBLE_ROLE_PARAGRAPH] = GTK_ACCESSIBLE_NAME_PROHIBITED,
};
/* < private >

View File

@@ -1362,6 +1362,8 @@ typedef enum {
* @GTK_ACCESSIBLE_ROLE_APPLICATION: A toplevel element of a graphical user interface.
* This is the role that GTK uses by default for windows.
* Since: 4.12
* @GTK_ACCESSIBLE_ROLE_PARAGRAPH: A paragraph of content.
* Since: 4.14
*
* The accessible role for a [iface@Accessible] implementation.
*
@@ -1448,7 +1450,8 @@ typedef enum {
GTK_ACCESSIBLE_ROLE_WIDGET,
GTK_ACCESSIBLE_ROLE_WINDOW,
GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON GDK_AVAILABLE_ENUMERATOR_IN_4_10,
GTK_ACCESSIBLE_ROLE_APPLICATION GDK_AVAILABLE_ENUMERATOR_IN_4_12
GTK_ACCESSIBLE_ROLE_APPLICATION GDK_AVAILABLE_ENUMERATOR_IN_4_12,
GTK_ACCESSIBLE_ROLE_PARAGRAPH GDK_AVAILABLE_ENUMERATOR_IN_4_14
} GtkAccessibleRole;
/**

View File

@@ -229,6 +229,8 @@ update_default_decoration (GtkHeaderBar *bar)
void
_gtk_header_bar_track_default_decoration (GtkHeaderBar *bar)
{
g_assert (GTK_IS_HEADER_BAR (bar));
bar->track_default_decoration = TRUE;
update_default_decoration (bar);

1407
gtk/gtkprintdialog.c Normal file

File diff suppressed because it is too large Load Diff

113
gtk/gtkprintdialog.h Normal file
View File

@@ -0,0 +1,113 @@
/* GTK - The GIMP Toolkit
*
* Copyright (C) 2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
#include <gtk/print/gtkprintsettings.h>
#include <gtk/print/gtkpagesetup.h>
G_BEGIN_DECLS
#define GTK_TYPE_PRINT_DIALOG (gtk_print_dialog_get_type ())
GDK_AVAILABLE_IN_4_14
G_DECLARE_FINAL_TYPE (GtkPrintDialog, gtk_print_dialog, GTK, PRINT_DIALOG, GObject)
GDK_AVAILABLE_IN_4_14
GtkPrintDialog *gtk_print_dialog_new (void);
GDK_AVAILABLE_IN_4_14
const char * gtk_print_dialog_get_title (GtkPrintDialog *self);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_set_title (GtkPrintDialog *self,
const char *title);
GDK_AVAILABLE_IN_4_14
const char * gtk_print_dialog_get_accept_label (GtkPrintDialog *self);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_set_accept_label (GtkPrintDialog *self,
const char *accept_label);
GDK_AVAILABLE_IN_4_14
gboolean gtk_print_dialog_get_modal (GtkPrintDialog *self);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_set_modal (GtkPrintDialog *self,
gboolean modal);
GDK_AVAILABLE_IN_4_14
GtkPageSetup * gtk_print_dialog_get_default_page_setup (GtkPrintDialog *self);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_set_default_page_setup (GtkPrintDialog *self,
GtkPageSetup *default_page_setup);
GDK_AVAILABLE_IN_4_14
GtkPrintSettings * gtk_print_dialog_get_print_settings (GtkPrintDialog *self);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_set_print_settings (GtkPrintDialog *self,
GtkPrintSettings *print_settings);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_prepare_print (GtkPrintDialog *self,
GtkWindow *parent,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_4_14
gboolean gtk_print_dialog_prepare_print_finish (GtkPrintDialog *self,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_print_stream (GtkPrintDialog *self,
GtkWindow *parent,
GInputStream *content,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_4_14
gboolean gtk_print_dialog_print_stream_finish (GtkPrintDialog *self,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_4_14
void gtk_print_dialog_print_file (GtkPrintDialog *self,
GtkWindow *parent,
GFile *file,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_4_14
gboolean gtk_print_dialog_print_file_finish (GtkPrintDialog *self,
GAsyncResult *result,
GError **error);
G_END_DECLS

View File

@@ -310,6 +310,7 @@ gtk_public_sources = files([
'gtkpopover.c',
'gtkpopovermenu.c',
'gtkpopovermenubar.c',
'gtkprintdialog.c',
'gtkprogressbar.c',
'gtkpropertylookuplistmodel.c',
'gtkrange.c',
@@ -549,6 +550,7 @@ gtk_public_headers = files([
'gtkpopover.h',
'gtkpopovermenu.h',
'gtkpopovermenubar.h',
'gtkprintdialog.h',
'gtkprogressbar.h',
'gtkrange.h',
'gtkrecentmanager.h',

View File

@@ -1338,6 +1338,30 @@ gtk_enumerate_printers (GtkPrinterFunc func,
}
}
static GtkPrinter *found_printer;
static gboolean
match_printer_name (GtkPrinter *printer,
gpointer data)
{
if (strcmp (gtk_printer_get_name (printer), (const char *)data) == 0)
{
found_printer = g_object_ref (printer);
return TRUE;
}
return FALSE;
}
GtkPrinter *
gtk_printer_find (const char *name)
{
found_printer = NULL;
gtk_enumerate_printers (match_printer_name, (gpointer) name, NULL, TRUE);
return g_steal_pointer (&found_printer);
}
GType
gtk_print_capabilities_get_type (void)
{

View File

@@ -69,4 +69,6 @@ GDK_AVAILABLE_IN_ALL
void gtk_print_job_set_status (GtkPrintJob *job,
GtkPrintStatus status);
GtkPrinter * gtk_printer_find (const char *name);
G_END_DECLS

View File

@@ -384,6 +384,8 @@ find_file_printer (void)
for (l = backends; l; l = l->next)
{
GtkPrintBackend *backend = l->data;
/* FIXME: this needs changes for cpdb */
if (strcmp (G_OBJECT_TYPE_NAME (backend), "GtkPrintBackendFile") == 0)
{
printers = gtk_print_backend_get_printer_list (backend);
@@ -427,11 +429,6 @@ prepare_print_response (GDBusConnection *connection,
GtkPrintSettings *settings;
GtkPageSetup *page_setup;
GtkPrinter *printer;
char *filename;
char *uri;
int fd;
portal->result = GTK_PRINT_OPERATION_RESULT_APPLY;
v = g_variant_lookup_value (options, "settings", G_VARIANT_TYPE_VARDICT);
settings = gtk_print_settings_new_from_gvariant (v);
@@ -444,15 +441,28 @@ prepare_print_response (GDBusConnection *connection,
g_variant_lookup (options, "token", "u", &portal->token);
printer = find_file_printer ();
if (printer)
{
char *filename;
int fd;
char *uri;
fd = g_file_open_tmp ("gtkprintXXXXXX", &filename, NULL);
uri = g_filename_to_uri (filename, NULL, NULL);
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
g_free (uri);
close (fd);
fd = g_file_open_tmp ("gtkprintXXXXXX", &filename, NULL);
uri = g_filename_to_uri (filename, NULL, NULL);
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
g_free (uri);
close (fd);
finish_print (portal, printer, page_setup, settings);
g_free (filename);
finish_print (portal, printer, page_setup, settings);
g_free (filename);
portal->result = GTK_PRINT_OPERATION_RESULT_APPLY;
}
else
{
portal->do_print = FALSE;
portal->result = GTK_PRINT_OPERATION_RESULT_ERROR;
}
}
else
{

View File

@@ -1056,6 +1056,7 @@ gtk_print_run_page_setup_dialog_async (GtkWindow *parent,
struct _PrinterFinder
{
gboolean found_printer;
gboolean scheduled_callback;
GFunc func;
gpointer data;
char *printer_name;
@@ -1088,6 +1089,14 @@ find_printer_idle (gpointer data)
return G_SOURCE_REMOVE;
}
static void
schedule_finder_callback (PrinterFinder *finder)
{
g_assert (!finder->scheduled_callback);
g_idle_add (find_printer_idle, finder);
finder->scheduled_callback = TRUE;
}
static void
printer_added_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
@@ -1120,7 +1129,7 @@ printer_added_cb (GtkPrintBackend *backend,
}
if (finder->found_printer)
g_idle_add (find_printer_idle, finder);
schedule_finder_callback (finder);
}
static void
@@ -1135,8 +1144,11 @@ printer_list_done_cb (GtkPrintBackend *backend,
gtk_print_backend_destroy (backend);
g_object_unref (backend);
if (finder->backends == NULL)
g_idle_add (find_printer_idle, finder);
/* If there are no more backends left after removing ourselves from the list
* above, then we're finished.
*/
if (finder->backends == NULL && !finder->found_printer)
schedule_finder_callback (finder);
}
static void
@@ -1162,9 +1174,7 @@ find_printer_init (PrinterFinder *finder,
if (gtk_print_backend_printer_list_is_done (backend))
{
finder->backends = g_list_remove (finder->backends, backend);
gtk_print_backend_destroy (backend);
g_object_unref (backend);
printer_list_done_cb (backend, finder);
}
else
{
@@ -1226,17 +1236,19 @@ find_printer (const char *printer,
if (g_module_supported ())
finder->backends = gtk_print_backend_load_modules ();
if (finder->backends == NULL)
{
schedule_finder_callback (finder);
return;
}
for (node = finder->backends; !finder->found_printer && node != NULL; node = next)
{
next = node->next;
find_printer_init (finder, GTK_PRINT_BACKEND (node->data));
}
if (finder->backends == NULL)
g_idle_add (find_printer_idle, finder);
}
GtkPrintOperationResult
_gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op,
gboolean show_dialog,
@@ -1248,6 +1260,7 @@ _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op,
else
return gtk_print_operation_unix_run_dialog (op, show_dialog, parent, do_print);
}
void
_gtk_print_operation_platform_backend_run_dialog_async (GtkPrintOperation *op,
gboolean show_dialog,

View File

@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.13.1',
version: '4.13.2',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',

115
po/lt.po
View File

@@ -15,8 +15,8 @@ msgid ""
msgstr ""
"Project-Id-Version: lt\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2023-09-03 14:34+0000\n"
"PO-Revision-Date: 2023-09-03 21:19+0300\n"
"POT-Creation-Date: 2023-09-25 12:58+0000\n"
"PO-Revision-Date: 2023-09-25 22:57+0300\n"
"Last-Translator: Aurimas Černius <aurisc4@gmail.com>\n"
"Language-Team: Lietuvių <gnome-lt@lists.akl.lt>\n"
"Language: lt\n"
@@ -59,31 +59,31 @@ msgstr "Nepavyko pateikti turinio kaip %s"
msgid "The current backend does not support OpenGL"
msgstr "Dabartinė realizacija nepalaiko OpenGL"
#: gdk/gdkdisplay.c:1245 gdk/gdksurface.c:1252
#: gdk/gdkdisplay.c:1244 gdk/gdksurface.c:1252
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Vulkan palaikymas išjungtas naudojant GDK_DEBUG"
#: gdk/gdkdisplay.c:1277
#: gdk/gdkdisplay.c:1276
msgid "GL support disabled via GDK_DEBUG"
msgstr "GL palaikymas išjungtas naudojant GDK_DEBUG"
#: gdk/gdkdisplay.c:1575
#: gdk/gdkdisplay.c:1574
msgid "No EGL configuration available"
msgstr "Nėra prieinamos EGL konfigūracijos"
#: gdk/gdkdisplay.c:1583
#: gdk/gdkdisplay.c:1582
msgid "Failed to get EGL configurations"
msgstr "Nepavyko gauti EGL konfigūracijų"
#: gdk/gdkdisplay.c:1613
#: gdk/gdkdisplay.c:1612
msgid "No EGL configuration with required features found"
msgstr "Nerasta EGL konfigūracija su reikiamomis savybėmis"
#: gdk/gdkdisplay.c:1620
#: gdk/gdkdisplay.c:1619
msgid "No perfect EGL configuration found"
msgstr "Nerasta puikiai tinkanti EGL konfigūracija"
#: gdk/gdkdisplay.c:1662
#: gdk/gdkdisplay.c:1661
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
@@ -91,23 +91,23 @@ msgstr[0] "EGL realizacijai trūksta %2$d plėtinio: %1$s"
msgstr[1] "EGL realizacijai trūksta %2$d plėtinių: %1$s"
msgstr[2] "EGL realizacijai trūksta %2$d plėtinių: %1$s"
#: gdk/gdkdisplay.c:1695
#: gdk/gdkdisplay.c:1694
msgid "libEGL not available in this sandbox"
msgstr "libEGL šioje apribotoje veiksenoje neprieinama"
#: gdk/gdkdisplay.c:1696
#: gdk/gdkdisplay.c:1695
msgid "libEGL not available"
msgstr "libEGL neprieinama"
#: gdk/gdkdisplay.c:1706
#: gdk/gdkdisplay.c:1705
msgid "Failed to create EGL display"
msgstr "Nepavyko sukurti EGL vaizduoklio"
#: gdk/gdkdisplay.c:1716
#: gdk/gdkdisplay.c:1715
msgid "Could not initialize EGL display"
msgstr "Nepavyko inicializuoti EGL vaizduoklio"
#: gdk/gdkdisplay.c:1727
#: gdk/gdkdisplay.c:1726
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL versija %d.%d yra per sena. GTK reikalauja %d.%d"
@@ -1039,18 +1039,18 @@ msgctxt "progress bar label"
msgid "%d%%"
msgstr "%d%%"
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:311
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:314
#: gtk/gtkcolordialog.c:411
msgid "Pick a Color"
msgstr "Pasirinkite spalvą"
#: gtk/deprecated/gtkcolorbutton.c:502 gtk/gtkcolorchooserwidget.c:313
#: gtk/deprecated/gtkcolorbutton.c:505 gtk/gtkcolorchooserwidget.c:313
#: gtk/gtkcolordialogbutton.c:335
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%, Alpha %d%%"
msgstr "Raudona %d%%, Žalia %d%%, Mėlyna %d%%, Alfa %d%%"
#: gtk/deprecated/gtkcolorbutton.c:508 gtk/gtkcolorchooserwidget.c:319
#: gtk/deprecated/gtkcolorbutton.c:511 gtk/gtkcolorchooserwidget.c:319
#: gtk/gtkcolordialogbutton.c:341
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%"
@@ -1060,17 +1060,17 @@ msgstr "Raudona %d%%, Žalia %d%%, Mėlyna %d%%"
msgid "Sans 12"
msgstr "Sans 12"
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:621
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:624
#: gtk/gtkfontdialog.c:596
msgid "Pick a Font"
msgstr "Pasirinkite šriftą"
#: gtk/deprecated/gtkfontbutton.c:597 gtk/gtkfilechooserwidget.c:3871
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3871
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
msgid "Font"
msgstr "Šriftas"
#: gtk/deprecated/gtkfontbutton.c:1152 gtk/gtkfontdialogbutton.c:652
#: gtk/deprecated/gtkfontbutton.c:1155 gtk/gtkfontdialogbutton.c:652
msgctxt "font"
msgid "None"
msgstr "Nėra"
@@ -2134,7 +2134,7 @@ msgstr "_Dešinė:"
msgid "Paper Margins"
msgstr "Popieriaus paraštės"
#: gtk/gtkentry.c:3673
#: gtk/gtkentry.c:3685
msgid "Insert Emoji"
msgstr "Įterpti emoji"
@@ -2292,7 +2292,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Jei ištrinsite elementą, jis bus negrįžtamai prarastas."
#: gtk/gtkfilechooserwidget.c:1185 gtk/gtkfilechooserwidget.c:1815
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6145 gtk/gtktextview.c:9018
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
msgid "_Delete"
msgstr "Iš_trinti"
@@ -2630,19 +2630,19 @@ msgstr "Užverti"
msgid "Close the infobar"
msgstr "Užverti informacijos juostą"
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6133 gtk/gtktextview.c:9006
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
msgid "Cu_t"
msgstr "_Iškirpti"
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6137 gtk/gtktextview.c:9010
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
msgid "_Copy"
msgstr "_Kopijuoti"
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6141 gtk/gtktextview.c:9014
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
msgid "_Paste"
msgstr "Į_dėti"
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6154 gtk/gtktextview.c:9039
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
msgid "Select _All"
msgstr "P_ažymėti viską"
@@ -3498,7 +3498,7 @@ msgstr "Nepavyko perkelti elemento su URI „%s“ į „%s“"
msgid "No registered application with name “%s” for item with URI “%s” found"
msgstr "Nerasta registruota programa pavadinimu „%s“ elementui su URI „%s“"
#: gtk/gtksearchentry.c:758
#: gtk/gtksearchentry.c:767
msgid "Clear Entry"
msgstr "Išvalyti lauką"
@@ -3589,7 +3589,7 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Šoninė juosta"
#: gtk/gtktext.c:6159 gtk/gtktextview.c:9044
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
msgid "Insert _Emoji"
msgstr "Įterpti _emoji"
@@ -3967,8 +3967,8 @@ msgid "Surface"
msgstr "Paviršius"
#: gtk/inspector/misc-info.ui:365 gtk/inspector/misc-info.ui:400
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1150
#: gtk/inspector/prop-editor.c:1533 gtk/inspector/window.ui:396
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1153
#: gtk/inspector/prop-editor.c:1536 gtk/inspector/window.ui:396
msgid "Properties"
msgstr "Savybės"
@@ -4020,7 +4020,7 @@ msgstr "Rodyklė: %p"
#. Translators: %s is a type name, for example
#. * GtkPropertyExpression with value \"2.5\"
#.
#: gtk/inspector/prop-editor.c:824
#: gtk/inspector/prop-editor.c:827
#, c-format
msgid "%s with value \"%s\""
msgstr "%s su verte „%s“"
@@ -4028,7 +4028,7 @@ msgstr "%s su verte „%s“"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with type GObject
#.
#: gtk/inspector/prop-editor.c:835
#: gtk/inspector/prop-editor.c:838
#, c-format
msgid "%s with type %s"
msgstr "%s su tipu %s"
@@ -4036,7 +4036,7 @@ msgstr "%s su tipu %s"
#. Translators: Both %s are type names, for example
#. * GtkObjectExpression for GtkStringObject 0x23456789
#.
#: gtk/inspector/prop-editor.c:848
#: gtk/inspector/prop-editor.c:851
#, c-format
msgid "%s for %s %p"
msgstr "%s %s %p"
@@ -4044,71 +4044,71 @@ msgstr "%s %s %p"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with value type: gchararray
#.
#: gtk/inspector/prop-editor.c:878
#: gtk/inspector/prop-editor.c:881
#, c-format
msgid "%s with value type %s"
msgstr "%s su %s tipo verte"
#: gtk/inspector/prop-editor.c:1227
#: gtk/inspector/prop-editor.c:1230
#, c-format
msgid "Uneditable property type: %s"
msgstr "Neredaguojamas savybės tipas: %s"
#: gtk/inspector/prop-editor.c:1385
#: gtk/inspector/prop-editor.c:1388
msgctxt "column number"
msgid "None"
msgstr "Nėra"
#: gtk/inspector/prop-editor.c:1422
#: gtk/inspector/prop-editor.c:1425
msgid "Attribute:"
msgstr "Atributas:"
#: gtk/inspector/prop-editor.c:1425
#: gtk/inspector/prop-editor.c:1428
msgid "Model"
msgstr "Modelis"
#: gtk/inspector/prop-editor.c:1430
#: gtk/inspector/prop-editor.c:1433
msgid "Column:"
msgstr "Stulpelis:"
#. Translators: %s is a type name, for example
#. * Action from 0x2345678 (GtkApplicationWindow)
#.
#: gtk/inspector/prop-editor.c:1529
#: gtk/inspector/prop-editor.c:1532
#, c-format
msgid "Action from: %p (%s)"
msgstr "Veiksmas iš: %p (%s)"
#: gtk/inspector/prop-editor.c:1584
#: gtk/inspector/prop-editor.c:1587
msgid "Reset"
msgstr "Atstatyti"
#: gtk/inspector/prop-editor.c:1592
#: gtk/inspector/prop-editor.c:1595
msgctxt "GtkSettings source"
msgid "Default"
msgstr "Numatyta"
#: gtk/inspector/prop-editor.c:1595
#: gtk/inspector/prop-editor.c:1598
msgctxt "GtkSettings source"
msgid "Theme"
msgstr "Tema"
#: gtk/inspector/prop-editor.c:1598
#: gtk/inspector/prop-editor.c:1601
msgctxt "GtkSettings source"
msgid "XSettings"
msgstr "XSettings"
#: gtk/inspector/prop-editor.c:1602
#: gtk/inspector/prop-editor.c:1605
msgctxt "GtkSettings source"
msgid "Application"
msgstr "Programa"
#: gtk/inspector/prop-editor.c:1605
#: gtk/inspector/prop-editor.c:1608
msgctxt "GtkSettings source"
msgid "Unknown"
msgstr "Nežinoma"
#: gtk/inspector/prop-editor.c:1608
#: gtk/inspector/prop-editor.c:1611
msgid "Source:"
msgstr "Šaltinis:"
@@ -7162,7 +7162,7 @@ msgstr ""
#: tools/gtk-builder-tool-enumerate.c:56 tools/gtk-builder-tool-preview.c:179
#: tools/gtk-builder-tool-preview.c:180 tools/gtk-builder-tool-screenshot.c:360
#: tools/gtk-builder-tool-simplify.c:2529 tools/gtk-builder-tool-validate.c:261
#: tools/gtk-rendernode-tool-info.c:200 tools/gtk-rendernode-tool-show.c:102
#: tools/gtk-rendernode-tool-info.c:202 tools/gtk-rendernode-tool-show.c:102
msgid "FILE"
msgstr "FAILAS"
@@ -7445,37 +7445,37 @@ msgstr ""
" render Padaryti viršūnės atvaizdą\n"
"\n"
#: tools/gtk-rendernode-tool-info.c:177
#: tools/gtk-rendernode-tool-info.c:179
#, c-format
msgid "Number of nodes: %u\n"
msgstr "Viršūnių skaičius: %u\n"
#: tools/gtk-rendernode-tool-info.c:184
#: tools/gtk-rendernode-tool-info.c:186
#, c-format
msgid "Depth: %u\n"
msgstr "Gylis: %u\n"
#: tools/gtk-rendernode-tool-info.c:187
#: tools/gtk-rendernode-tool-info.c:189
#, c-format
msgid "Bounds: %g x %g\n"
msgstr "Paraštės: %g x %g\n"
#: tools/gtk-rendernode-tool-info.c:188
#: tools/gtk-rendernode-tool-info.c:190
#, c-format
msgid "Origin: %g %g\n"
msgstr "Pradinė koordinatė: %g %g\n"
#: tools/gtk-rendernode-tool-info.c:209
#: tools/gtk-rendernode-tool-info.c:211
msgid "Provide information about the render node."
msgstr "Pateikti informaciją apie piešimo viršūnę."
#: tools/gtk-rendernode-tool-info.c:222 tools/gtk-rendernode-tool-show.c:130
#: tools/gtk-rendernode-tool-info.c:224 tools/gtk-rendernode-tool-show.c:130
#: tools/gtk-rendernode-tool-render.c:225
#, c-format
msgid "No .node file specified\n"
msgstr "Nenurodytas .node failas\n"
#: tools/gtk-rendernode-tool-info.c:228
#: tools/gtk-rendernode-tool-info.c:230
#, c-format
msgid "Can only accept a single .node file\n"
msgstr "Galima pateikti tik vieną .node failą\n"
@@ -7525,6 +7525,11 @@ msgstr "Galima piešti vienintelį .node failą į vienintelį išvesties failą
msgid "Error at %s: %s\n"
msgstr "Klaida ties %s: %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "Nepavyko įkelti viršūnių failo: %s\n"
#: tools/updateiconcache.c:1391
#, c-format
msgid "Failed to write header\n"

View File

@@ -29,8 +29,8 @@ msgid ""
msgstr ""
"Project-Id-Version: GTK\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2023-09-05 19:13+0000\n"
"PO-Revision-Date: 2023-09-12 13:31-0300\n"
"POT-Creation-Date: 2023-09-21 10:15+0000\n"
"PO-Revision-Date: 2023-09-25 09:58-0300\n"
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
"Language-Team: Brazilian Portuguese <https://br.gnome.org/traducao>\n"
"Language: pt_BR\n"
@@ -79,55 +79,55 @@ msgstr "Não foi possível fornecer o conteúdo como %s"
msgid "The current backend does not support OpenGL"
msgstr "O backend não oferece suporte a OpenGL"
#: gdk/gdkdisplay.c:1245 gdk/gdksurface.c:1252
#: gdk/gdkdisplay.c:1244 gdk/gdksurface.c:1252
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Suporte a Vulkan desabilitado via GDK_DEBUG"
#: gdk/gdkdisplay.c:1277
#: gdk/gdkdisplay.c:1276
msgid "GL support disabled via GDK_DEBUG"
msgstr "Suporte a GL desabilitado via GDK_DEBUG"
#: gdk/gdkdisplay.c:1575
#: gdk/gdkdisplay.c:1574
msgid "No EGL configuration available"
msgstr "Nenhuma configuração EGL está disponível"
#: gdk/gdkdisplay.c:1583
#: gdk/gdkdisplay.c:1582
msgid "Failed to get EGL configurations"
msgstr "Falha ao obter configurações EGL"
#: gdk/gdkdisplay.c:1613
#: gdk/gdkdisplay.c:1612
msgid "No EGL configuration with required features found"
msgstr ""
"Não foi localizada nenhuma configuração EGL com os recursos necessários"
#: gdk/gdkdisplay.c:1620
#: gdk/gdkdisplay.c:1619
msgid "No perfect EGL configuration found"
msgstr "Nenhum configuração EGL perfeita localizada"
#: gdk/gdkdisplay.c:1662
#: gdk/gdkdisplay.c:1661
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "A implementação de EGL não contém a extensão %s"
msgstr[1] "A implementação de EGL não contém %2$d extensões: %1$s"
#: gdk/gdkdisplay.c:1695
#: gdk/gdkdisplay.c:1694
msgid "libEGL not available in this sandbox"
msgstr "libEGL não disponível nesta caixa de proteção"
#: gdk/gdkdisplay.c:1696
#: gdk/gdkdisplay.c:1695
msgid "libEGL not available"
msgstr "libEGL não disponível"
#: gdk/gdkdisplay.c:1706
#: gdk/gdkdisplay.c:1705
msgid "Failed to create EGL display"
msgstr "Falha ao criar tela EGL"
#: gdk/gdkdisplay.c:1716
#: gdk/gdkdisplay.c:1715
msgid "Could not initialize EGL display"
msgstr "Não foi possível inicializar a tela EGL"
#: gdk/gdkdisplay.c:1727
#: gdk/gdkdisplay.c:1726
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL versão %d.%d é muito velha. GTK requer %d.%d"
@@ -1092,18 +1092,18 @@ msgctxt "progress bar label"
msgid "%d%%"
msgstr "%d%%"
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:311
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:314
#: gtk/gtkcolordialog.c:411
msgid "Pick a Color"
msgstr "Escolha uma cor"
#: gtk/deprecated/gtkcolorbutton.c:502 gtk/gtkcolorchooserwidget.c:313
#: gtk/deprecated/gtkcolorbutton.c:505 gtk/gtkcolorchooserwidget.c:313
#: gtk/gtkcolordialogbutton.c:335
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%, Alpha %d%%"
msgstr "Vermelho %d%%, Verde %d%%, Azul %d%%, Alfa %d%%"
#: gtk/deprecated/gtkcolorbutton.c:508 gtk/gtkcolorchooserwidget.c:319
#: gtk/deprecated/gtkcolorbutton.c:511 gtk/gtkcolorchooserwidget.c:319
#: gtk/gtkcolordialogbutton.c:341
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%"
@@ -1113,17 +1113,17 @@ msgstr "Vermelho %d%%, Verde %d%%, Azul %d%%"
msgid "Sans 12"
msgstr "Sans 12"
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:621
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:624
#: gtk/gtkfontdialog.c:596
msgid "Pick a Font"
msgstr "Selecione uma fonte"
#: gtk/deprecated/gtkfontbutton.c:597 gtk/gtkfilechooserwidget.c:3871
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3871
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
msgid "Font"
msgstr "Fonte"
#: gtk/deprecated/gtkfontbutton.c:1152 gtk/gtkfontdialogbutton.c:652
#: gtk/deprecated/gtkfontbutton.c:1155 gtk/gtkfontdialogbutton.c:652
msgctxt "font"
msgid "None"
msgstr "Nenhuma"
@@ -2191,7 +2191,7 @@ msgstr "_Direita:"
msgid "Paper Margins"
msgstr "Margens do papel"
#: gtk/gtkentry.c:3673
#: gtk/gtkentry.c:3685
msgid "Insert Emoji"
msgstr "Inserir emoji"
@@ -2350,7 +2350,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Se você excluir um item, ele será permanentemente perdido."
#: gtk/gtkfilechooserwidget.c:1185 gtk/gtkfilechooserwidget.c:1815
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6145 gtk/gtktextview.c:9018
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
msgid "_Delete"
msgstr "E_xcluir"
@@ -2693,19 +2693,19 @@ msgstr "Fechar"
msgid "Close the infobar"
msgstr "Fecha a barra de informações"
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6133 gtk/gtktextview.c:9006
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
msgid "Cu_t"
msgstr "Recor_tar"
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6137 gtk/gtktextview.c:9010
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
msgid "_Copy"
msgstr "_Copiar"
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6141 gtk/gtktextview.c:9014
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
msgid "_Paste"
msgstr "C_olar"
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6154 gtk/gtktextview.c:9039
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
msgid "Select _All"
msgstr "_Selecionar tudo"
@@ -3569,7 +3569,7 @@ msgstr ""
"Não foi encontrado nenhum aplicativo registrado com o nome “%s” para o item "
"com URI “%s”"
#: gtk/gtksearchentry.c:758
#: gtk/gtksearchentry.c:767
msgid "Clear Entry"
msgstr "Limpar entrada"
@@ -3682,7 +3682,7 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Barra lateral"
#: gtk/gtktext.c:6159 gtk/gtktextview.c:9044
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
msgid "Insert _Emoji"
msgstr "Inserir _emoji"
@@ -4075,8 +4075,8 @@ msgid "Surface"
msgstr "Superfície"
#: gtk/inspector/misc-info.ui:365 gtk/inspector/misc-info.ui:400
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1150
#: gtk/inspector/prop-editor.c:1533 gtk/inspector/window.ui:396
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1153
#: gtk/inspector/prop-editor.c:1536 gtk/inspector/window.ui:396
msgid "Properties"
msgstr "Propriedades"
@@ -4128,7 +4128,7 @@ msgstr "Ponteiro: %p"
#. Translators: %s is a type name, for example
#. * GtkPropertyExpression with value \"2.5\"
#.
#: gtk/inspector/prop-editor.c:824
#: gtk/inspector/prop-editor.c:827
#, c-format
msgid "%s with value \"%s\""
msgstr "%s com valor “%s”"
@@ -4136,7 +4136,7 @@ msgstr "%s com valor “%s”"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with type GObject
#.
#: gtk/inspector/prop-editor.c:835
#: gtk/inspector/prop-editor.c:838
#, c-format
msgid "%s with type %s"
msgstr "%s com tipo %s"
@@ -4144,7 +4144,7 @@ msgstr "%s com tipo %s"
#. Translators: Both %s are type names, for example
#. * GtkObjectExpression for GtkStringObject 0x23456789
#.
#: gtk/inspector/prop-editor.c:848
#: gtk/inspector/prop-editor.c:851
#, c-format
msgid "%s for %s %p"
msgstr "%s para %s %p"
@@ -4152,71 +4152,71 @@ msgstr "%s para %s %p"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with value type: gchararray
#.
#: gtk/inspector/prop-editor.c:878
#: gtk/inspector/prop-editor.c:881
#, c-format
msgid "%s with value type %s"
msgstr "%s com tipo de valor %s"
#: gtk/inspector/prop-editor.c:1227
#: gtk/inspector/prop-editor.c:1230
#, c-format
msgid "Uneditable property type: %s"
msgstr "Tipo de propriedade não editável: %s"
#: gtk/inspector/prop-editor.c:1385
#: gtk/inspector/prop-editor.c:1388
msgctxt "column number"
msgid "None"
msgstr "Nenhum"
#: gtk/inspector/prop-editor.c:1422
#: gtk/inspector/prop-editor.c:1425
msgid "Attribute:"
msgstr "Atributo:"
#: gtk/inspector/prop-editor.c:1425
#: gtk/inspector/prop-editor.c:1428
msgid "Model"
msgstr "Modelo"
#: gtk/inspector/prop-editor.c:1430
#: gtk/inspector/prop-editor.c:1433
msgid "Column:"
msgstr "Coluna:"
#. Translators: %s is a type name, for example
#. * Action from 0x2345678 (GtkApplicationWindow)
#.
#: gtk/inspector/prop-editor.c:1529
#: gtk/inspector/prop-editor.c:1532
#, c-format
msgid "Action from: %p (%s)"
msgstr "Ação de: %p (%s)"
#: gtk/inspector/prop-editor.c:1584
#: gtk/inspector/prop-editor.c:1587
msgid "Reset"
msgstr "Redefinir"
#: gtk/inspector/prop-editor.c:1592
#: gtk/inspector/prop-editor.c:1595
msgctxt "GtkSettings source"
msgid "Default"
msgstr "Padrão"
#: gtk/inspector/prop-editor.c:1595
#: gtk/inspector/prop-editor.c:1598
msgctxt "GtkSettings source"
msgid "Theme"
msgstr "Tema"
#: gtk/inspector/prop-editor.c:1598
#: gtk/inspector/prop-editor.c:1601
msgctxt "GtkSettings source"
msgid "XSettings"
msgstr "XSettings"
#: gtk/inspector/prop-editor.c:1602
#: gtk/inspector/prop-editor.c:1605
msgctxt "GtkSettings source"
msgid "Application"
msgstr "Aplicativo"
#: gtk/inspector/prop-editor.c:1605
#: gtk/inspector/prop-editor.c:1608
msgctxt "GtkSettings source"
msgid "Unknown"
msgstr "Desconhecido"
#: gtk/inspector/prop-editor.c:1608
#: gtk/inspector/prop-editor.c:1611
msgid "Source:"
msgstr "Fonte:"
@@ -7294,7 +7294,7 @@ msgstr ""
#: tools/gtk-builder-tool-enumerate.c:56 tools/gtk-builder-tool-preview.c:179
#: tools/gtk-builder-tool-preview.c:180 tools/gtk-builder-tool-screenshot.c:360
#: tools/gtk-builder-tool-simplify.c:2529 tools/gtk-builder-tool-validate.c:261
#: tools/gtk-rendernode-tool-info.c:200 tools/gtk-rendernode-tool-show.c:102
#: tools/gtk-rendernode-tool-info.c:202 tools/gtk-rendernode-tool-show.c:102
msgid "FILE"
msgstr "ARQUIVO"
@@ -7580,37 +7580,37 @@ msgstr ""
" show Mostra o nó\n"
" render Faz uma captura de tela do nó\n"
#: tools/gtk-rendernode-tool-info.c:177
#: tools/gtk-rendernode-tool-info.c:179
#, c-format
msgid "Number of nodes: %u\n"
msgstr "Número de nós: %u\n"
#: tools/gtk-rendernode-tool-info.c:184
#: tools/gtk-rendernode-tool-info.c:186
#, c-format
msgid "Depth: %u\n"
msgstr "Profundidade: %u\n"
#: tools/gtk-rendernode-tool-info.c:187
#: tools/gtk-rendernode-tool-info.c:189
#, c-format
msgid "Bounds: %g x %g\n"
msgstr "Limites: %g x %g\n"
#: tools/gtk-rendernode-tool-info.c:188
#: tools/gtk-rendernode-tool-info.c:190
#, c-format
msgid "Origin: %g %g\n"
msgstr "Origem: %g %g\n"
#: tools/gtk-rendernode-tool-info.c:209
#: tools/gtk-rendernode-tool-info.c:211
msgid "Provide information about the render node."
msgstr "Fornece informações sobre o nó de renderização."
#: tools/gtk-rendernode-tool-info.c:222 tools/gtk-rendernode-tool-show.c:130
#: tools/gtk-rendernode-tool-info.c:224 tools/gtk-rendernode-tool-show.c:130
#: tools/gtk-rendernode-tool-render.c:225
#, c-format
msgid "No .node file specified\n"
msgstr "Nenhum arquivo .node especificado\n"
#: tools/gtk-rendernode-tool-info.c:228
#: tools/gtk-rendernode-tool-info.c:230
#, c-format
msgid "Can only accept a single .node file\n"
msgstr "Pode aceitar apenas um único arquivo .node\n"
@@ -7661,6 +7661,11 @@ msgstr ""
msgid "Error at %s: %s\n"
msgstr "Erro em %s: %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "Falha ao carregar o arquivo de nó: %s\n"
#: tools/updateiconcache.c:1391
#, c-format
msgid "Failed to write header\n"