Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87c4262bd9 | |||
| 460eaac1f4 | |||
| 02d7817632 | |||
| 3080e2974d | |||
| be9d98ed38 | |||
| 944274bc58 | |||
| b555e909c4 | |||
| 9fe9ea34fd | |||
| f36f1b9829 | |||
| 2b09f5ea1e | |||
| f51c82a2aa | |||
| 11d3be278d | |||
| cc98282caa | |||
| 85f2e1ccd8 | |||
| 91b98bc9e2 | |||
| 704ee6a9d0 | |||
| 72e9f30937 | |||
| aadaf4adf2 | |||
| d83ad6b505 | |||
| b647d1a58c | |||
| 68cff3b108 | |||
| 84846aace7 | |||
| 7bd93730d1 | |||
| c5d05fdc88 | |||
| f6ff2cd1cb | |||
| 9b0060e84d | |||
| 8d5633cb88 | |||
| f74b1d48b6 | |||
| 27ebf756fe | |||
| 631da2e723 | |||
| b5531d3d6f | |||
| 5e6bc41fdd | |||
| d0581af2af | |||
| cec746804d | |||
| ade1aaa8be | |||
| 345d23898d | |||
| 415717276a | |||
| cebe640bce | |||
| 73084b761f | |||
| eb13ecfbe7 | |||
| 85c4507609 | |||
| fcb6c8e447 | |||
| 0b27f39c2b | |||
| 2101f880af | |||
| 2cc241732d | |||
| c01782b0a9 | |||
| a62831562f | |||
| 40dd81e1a4 | |||
| a9f3a52c18 | |||
| 0978912922 | |||
| 3c9923d395 | |||
| 0296f49eb0 | |||
| 4b7a550366 | |||
| 37e18b784e | |||
| 1275a2cb8d | |||
| 67a6f343a0 | |||
| a98e6bff85 | |||
| d0f5644771 | |||
| b1a3ac8330 | |||
| 80811069ac | |||
| 6e3dc1e669 | |||
| d1aa0a74e4 | |||
| 7a6fb09179 | |||
| 5732c5e3d0 | |||
| 79fb3d9b0c | |||
| 17455054f1 | |||
| 763f51cb98 | |||
| 9fb78603ec | |||
| f802be88e9 | |||
| b9d2049991 | |||
| cfe3558610 | |||
| 35d15de3b6 | |||
| 23a336df0e | |||
| bacdc735a4 | |||
| 19a168446e | |||
| 47ec7bc66d | |||
| b4178870dd | |||
| 03ef792802 | |||
| 7955efef6c | |||
| 3134003376 | |||
| a508860d1f | |||
| c835ca41e0 | |||
| 2d5eafd014 | |||
| 9b34878208 | |||
| 4b1b956d27 | |||
| 0dd58c4d1b | |||
| 4b2b6d6212 | |||
| 2cdb53d524 | |||
| 4f7721e742 | |||
| 29c29b0e64 | |||
| 3d7fc0a598 | |||
| 9e3e0052dc | |||
| 5ecfcaec0d | |||
| cc24401dfb | |||
| f445d8b518 | |||
| af4c9ea61e | |||
| 4a75c288b2 | |||
| 89fca57e68 | |||
| d50b780551 | |||
| f4a8787219 | |||
| 979d0f4b1d | |||
| 5af7c7d0f2 | |||
| 90aff59826 | |||
| f0f3ea1b3e | |||
| f4b7f5de2f | |||
| ca5af396b0 | |||
| 9f56be3551 | |||
| 389f41ead7 | |||
| 62108f8c30 | |||
| d3206f9b67 | |||
| 9b81f4cc31 | |||
| a864084a4e | |||
| ba44464d2a | |||
| 9509876f10 | |||
| f79549f5fc | |||
| bfb451ff4d | |||
| edfbfb2ba7 | |||
| 6aa37a116d | |||
| a34c018592 | |||
| 710d8b948b | |||
| 3df85581d5 | |||
| 91e3bc4496 | |||
| 1f5df481a5 | |||
| 768522ce7f | |||
| 5f4e5db91b | |||
| c5f73cb406 | |||
| 86c4a9b3bd | |||
| fb915dc8da | |||
| 7a2569be14 | |||
| b1eed1c153 | |||
| fac6f6c712 | |||
| 3f1fc798f0 | |||
| e6a86f61dc | |||
| 2799632c02 | |||
| 8ffa681e02 | |||
| 154035e76f | |||
| 1d4c664bfa | |||
| 85a650afce | |||
| f6c4d3731c | |||
| 5e9070145e | |||
| 81ced841dd | |||
| 9837a9dcfd | |||
| 1704ec3c7d | |||
| c70a326055 | |||
| 53616a73e9 | |||
| 2d3a3d6a78 | |||
| 6ca9e5987b | |||
| 2c1590001f | |||
| 34028ea31e | |||
| 4244314a40 | |||
| e6046e9493 | |||
| e5ffbb19c0 |
@@ -19,7 +19,6 @@ flatpak build ${builddir} meson \
|
||||
--buildtype=debugoptimized \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dvulkan=disabled \
|
||||
-Dbuild-tests=false \
|
||||
-Dbuild-testsuite=false \
|
||||
-Dbuild-examples=false \
|
||||
|
||||
@@ -34,7 +34,8 @@ pacman --noconfirm -S --needed \
|
||||
mingw-w64-$MSYS2_ARCH-shared-mime-info \
|
||||
mingw-w64-$MSYS2_ARCH-python-gobject \
|
||||
mingw-w64-$MSYS2_ARCH-shaderc \
|
||||
mingw-w64-$MSYS2_ARCH-vulkan
|
||||
mingw-w64-$MSYS2_ARCH-vulkan \
|
||||
mingw-w64-$MSYS2_ARCH-vulkan-headers
|
||||
|
||||
mkdir -p _ccache
|
||||
export CCACHE_BASEDIR="$(pwd)"
|
||||
@@ -44,7 +45,7 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||
ccache --zero-stats
|
||||
ccache --show-stats
|
||||
export CCACHE_DISABLE=true
|
||||
meson \
|
||||
meson setup \
|
||||
-Dx11-backend=false \
|
||||
-Dwayland-backend=false \
|
||||
-Dwin32-backend=true \
|
||||
|
||||
@@ -1,6 +1,58 @@
|
||||
Overview of Changes in 4.14.2, xx-xx-xxxx
|
||||
Overview of Changes in 4.15.0, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
Overview of Changes in 4.14.2, 03-04-2024
|
||||
=========================================
|
||||
|
||||
* GtkScale:
|
||||
- Improve positioning of values in some cases
|
||||
|
||||
* Theme:
|
||||
- Make progress in entries visible
|
||||
|
||||
* Accessibility:
|
||||
- Fix text insertion handling
|
||||
|
||||
* GDK:
|
||||
- dnd: Use the default cursor durion motion
|
||||
- dnd: Use a better cursor for indicating the move action
|
||||
|
||||
* GSK:
|
||||
- gl: Handle offloads in offscreen context better
|
||||
- Fix text rendering problems with some fonts
|
||||
|
||||
* Wayland:
|
||||
- Tighten up some protocol version checks
|
||||
- Use the presentation time protocol
|
||||
- Fix a crash with subsurfaces
|
||||
- Improve settings portal handling
|
||||
|
||||
* macOS:
|
||||
- Fix up the app menu support
|
||||
|
||||
* Windows:
|
||||
- Fix problems with minimization
|
||||
- Fix build without fontconfig
|
||||
|
||||
* Debugging:
|
||||
- Add font settings in the inspector
|
||||
|
||||
* Demos:
|
||||
- Clean up the application demo
|
||||
- Update cursor images for the cursor demo
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Czech
|
||||
French
|
||||
Georgian
|
||||
Hebrew
|
||||
Persian
|
||||
Slovenian
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.14.1, 16-03-2024
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ version, for example `gtk-4-10`.
|
||||
How to report bugs
|
||||
------------------
|
||||
|
||||
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
||||
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||
|
||||
In the bug report please include:
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -15,12 +15,54 @@ on_destroy (gpointer data)
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
static GdkTexture *
|
||||
cursor_callback (GdkCursor *cursor,
|
||||
int cursor_size,
|
||||
double scale,
|
||||
int *width,
|
||||
int *height,
|
||||
int *hotspot_x,
|
||||
int *hotspot_y,
|
||||
gpointer data)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkTexture *texture;
|
||||
GError *error = NULL;
|
||||
int scaled_size;
|
||||
|
||||
scaled_size = ceil (cursor_size * scale);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/cursors/images/gtk-logo.svg",
|
||||
scaled_size, scaled_size,
|
||||
TRUE,
|
||||
&error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
texture = gdk_texture_new_for_pixbuf (pixbuf);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
*width = cursor_size;
|
||||
*height = cursor_size;
|
||||
*hotspot_x = 18 * cursor_size / 32.0;
|
||||
*hotspot_y = 2 * cursor_size / 32.0;
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_cursors (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *logo_callback;
|
||||
GdkCursor *cursor;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/cursors/cursors.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
@@ -29,6 +71,10 @@ do_cursors (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (on_destroy), NULL);
|
||||
logo_callback = GTK_WIDGET (gtk_builder_get_object (builder, "logo_callback"));
|
||||
cursor = gdk_cursor_new_from_callback (cursor_callback, NULL, NULL, NULL);
|
||||
gtk_widget_set_cursor (logo_callback, cursor);
|
||||
g_object_unref (cursor);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
<file>w_resize_cursor.png</file>
|
||||
<file>zoom_in_cursor.png</file>
|
||||
<file>zoom_out_cursor.png</file>
|
||||
<file>gtk-logo.svg</file>
|
||||
</gresource>
|
||||
<gresource prefix="/dnd">
|
||||
<file>dnd.css</file>
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg6843"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
version="1.0"
|
||||
sodipodi:docname="gtk-logo.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
|
||||
inkscape:export-xdpi="192"
|
||||
inkscape:export-ydpi="192">
|
||||
<defs
|
||||
id="defs6845">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="-50 : 600 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="700 : 600 : 1"
|
||||
inkscape:persp3d-origin="300 : 400 : 1"
|
||||
id="perspective13" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.8284271"
|
||||
inkscape:cx="69.874353"
|
||||
inkscape:cy="64.313526"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
width="128px"
|
||||
height="128px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid7947" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata6848">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:date />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier />
|
||||
<dc:source />
|
||||
<dc:relation />
|
||||
<dc:language />
|
||||
<dc:subject>
|
||||
<rdf:Bag />
|
||||
</dc:subject>
|
||||
<dc:coverage />
|
||||
<dc:description />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<cc:license
|
||||
rdf:resource="" />
|
||||
</cc:Work>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
id="path6976"
|
||||
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
|
||||
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||
<path
|
||||
id="path6978"
|
||||
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
|
||||
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||
<path
|
||||
id="path6980"
|
||||
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
|
||||
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccc"
|
||||
id="path6982"
|
||||
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
|
||||
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
id="path6984"
|
||||
d="M 70.434539,17.875593 L 70.434539,66.984877"
|
||||
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -456,43 +456,33 @@ gtk_fishbowl_do_update (GtkFishbowl *fishbowl)
|
||||
{
|
||||
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
|
||||
GdkFrameClock *frame_clock;
|
||||
GdkFrameTimings *start, *end;
|
||||
gint64 start_counter, end_counter;
|
||||
gint64 n_frames, expected_frames;
|
||||
gint64 start_timestamp, end_timestamp;
|
||||
GdkFrameTimings *end;
|
||||
gint64 end_counter;
|
||||
double fps, expected_fps;
|
||||
gint64 interval;
|
||||
|
||||
frame_clock = gtk_widget_get_frame_clock (GTK_WIDGET (fishbowl));
|
||||
if (frame_clock == NULL)
|
||||
return;
|
||||
|
||||
start_counter = gdk_frame_clock_get_history_start (frame_clock);
|
||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
start = gdk_frame_clock_get_timings (frame_clock, start_counter);
|
||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||
end_counter > start_counter && end != NULL && !gdk_frame_timings_get_complete (end);
|
||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||
end_counter--;
|
||||
if (end_counter - start_counter < 4)
|
||||
fps = gdk_frame_clock_get_fps (frame_clock);
|
||||
if (fps <= 0.0)
|
||||
return;
|
||||
|
||||
start_timestamp = gdk_frame_timings_get_presentation_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_presentation_time (end);
|
||||
if (start_timestamp == 0 || end_timestamp == 0)
|
||||
{
|
||||
start_timestamp = gdk_frame_timings_get_frame_time (start);
|
||||
end_timestamp = gdk_frame_timings_get_frame_time (end);
|
||||
}
|
||||
|
||||
n_frames = end_counter - start_counter;
|
||||
priv->framerate = ((double) n_frames) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
||||
priv->framerate = ((int)(priv->framerate * 100))/100.0;
|
||||
|
||||
priv->framerate = fps;
|
||||
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_FRAMERATE]);
|
||||
|
||||
if (!priv->benchmark)
|
||||
return;
|
||||
|
||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||
end != NULL && !gdk_frame_timings_get_complete (end);
|
||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||
end_counter--;
|
||||
if (end == NULL)
|
||||
return;
|
||||
|
||||
interval = gdk_frame_timings_get_refresh_interval (end);
|
||||
if (interval == 0)
|
||||
{
|
||||
@@ -500,16 +490,16 @@ gtk_fishbowl_do_update (GtkFishbowl *fishbowl)
|
||||
if (interval == 0)
|
||||
return;
|
||||
}
|
||||
expected_frames = round ((double) (end_timestamp - start_timestamp) / interval);
|
||||
expected_fps = (double) G_USEC_PER_SEC / interval;
|
||||
|
||||
if (n_frames >= expected_frames)
|
||||
if (fps > (expected_fps - 1))
|
||||
{
|
||||
if (priv->last_benchmark_change > 0)
|
||||
priv->last_benchmark_change *= 2;
|
||||
else
|
||||
priv->last_benchmark_change = 1;
|
||||
}
|
||||
else if (n_frames + 1 < expected_frames)
|
||||
else if (0.95 * fps < expected_fps)
|
||||
{
|
||||
if (priv->last_benchmark_change < 0)
|
||||
priv->last_benchmark_change--;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -120,7 +120,7 @@ create_shadertoy_window (GtkWidget *do_widget)
|
||||
gtk_box_append (GTK_BOX (box), aspect);
|
||||
|
||||
shadertoy = new_shadertoy ("/shadertoy/alienplanet.glsl");
|
||||
gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (aspect), shadertoy);
|
||||
gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (aspect), gtk_graphics_offload_new (shadertoy));
|
||||
|
||||
sw = gtk_scrolled_window_new ();
|
||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 250);
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -27,7 +27,7 @@ the question you have, this list is a good place to start.
|
||||
Every major version of GTK comes with a [migration guide](#migrating). You may also
|
||||
find useful information in the documentation for specific widgets and functions. If
|
||||
you have a question not covered in the manual, feel free to ask, and please
|
||||
[file a bug report](https://gitlab.gnome.org/GNOME/gtk/issues/new) against the
|
||||
[file a bug report](https://gitlab.gnome.org/GNOME/gtk/issues/) against the
|
||||
documentation.
|
||||
|
||||
* Should I maintain parallel versions of my UI in GTK x and GTK y?
|
||||
@@ -54,7 +54,7 @@ the question you have, this list is a good place to start.
|
||||
For strings returned from functions, they will be declared "const" if they should
|
||||
not be freed. Non-const strings should be freed with `g_free()`. Arrays follow the
|
||||
same rule. If you find an undocumented exception to the rules, please
|
||||
[file a bug report.](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
||||
[file a bug report.](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||
|
||||
The transfer annotations for gobject-introspection that are part of the
|
||||
documentation can provide useful hints for memory handling semantics as well.
|
||||
|
||||
@@ -4,7 +4,7 @@ Slug: gtk-resources
|
||||
## Opening a bug or feature request
|
||||
|
||||
If you encounter a bug, misfeature, or missing feature in GTK, please
|
||||
file a bug report on our [GitLab project](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
||||
file a bug report on our [GitLab project](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||
You should also file issues if the documentation is out of date with the
|
||||
existing API, or unclear.
|
||||
|
||||
|
||||
@@ -30,14 +30,11 @@
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkcursorprivate.h"
|
||||
#include "gdktexture.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <graphene.h>
|
||||
|
||||
/**
|
||||
* GdkCursor:
|
||||
*
|
||||
@@ -84,11 +81,8 @@ enum {
|
||||
PROP_HOTSPOT_Y,
|
||||
PROP_NAME,
|
||||
PROP_TEXTURE,
|
||||
PROP_PAINTABLE,
|
||||
};
|
||||
|
||||
static guint invalidate_signal;
|
||||
|
||||
G_DEFINE_TYPE (GdkCursor, gdk_cursor, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
@@ -116,9 +110,6 @@ gdk_cursor_get_property (GObject *object,
|
||||
case PROP_TEXTURE:
|
||||
g_value_set_object (value, cursor->texture);
|
||||
break;
|
||||
case PROP_PAINTABLE:
|
||||
g_value_set_object (value, cursor->paintable);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -150,9 +141,6 @@ gdk_cursor_set_property (GObject *object,
|
||||
case PROP_TEXTURE:
|
||||
cursor->texture = g_value_dup_object (value);
|
||||
break;
|
||||
case PROP_PAINTABLE:
|
||||
cursor->paintable = g_value_dup_object (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -167,7 +155,6 @@ gdk_cursor_finalize (GObject *object)
|
||||
g_free (cursor->name);
|
||||
g_clear_object (&cursor->texture);
|
||||
g_clear_object (&cursor->fallback);
|
||||
g_clear_object (&cursor->paintable);
|
||||
|
||||
if (cursor->destroy)
|
||||
cursor->destroy (cursor->data);
|
||||
@@ -247,37 +234,6 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
GDK_TYPE_TEXTURE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GdkCursor:paintable:
|
||||
*
|
||||
* The paintable displayed by this cursor.
|
||||
*
|
||||
* The intrinsic size of the paintable determines
|
||||
* the size of the cursor.
|
||||
*
|
||||
* If the GDK backend has the capability, non-static paintables
|
||||
* may create animated cursors.
|
||||
*
|
||||
* The paintable will be %NULL if the cursor was created
|
||||
* from a name or texture.
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_PAINTABLE,
|
||||
g_param_spec_object ("paintable", NULL, NULL,
|
||||
GDK_TYPE_PAINTABLE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
invalidate_signal = g_signal_new ("invalidate",
|
||||
GDK_TYPE_CURSOR,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -300,8 +256,11 @@ gdk_cursor_hash (gconstpointer pointer)
|
||||
hash ^= g_str_hash (cursor->name);
|
||||
else if (cursor->texture)
|
||||
hash ^= g_direct_hash (cursor->texture);
|
||||
else if (cursor->paintable)
|
||||
hash ^= g_direct_hash (cursor->paintable);
|
||||
else if (cursor->callback)
|
||||
{
|
||||
hash ^= g_direct_hash (cursor->callback);
|
||||
hash ^= g_direct_hash (cursor->data);
|
||||
}
|
||||
|
||||
hash ^= (cursor->hotspot_x << 8) | cursor->hotspot_y;
|
||||
|
||||
@@ -326,13 +285,14 @@ gdk_cursor_equal (gconstpointer a,
|
||||
if (ca->texture != cb->texture)
|
||||
return FALSE;
|
||||
|
||||
if (ca->paintable != cb->paintable)
|
||||
return FALSE;
|
||||
|
||||
if (ca->hotspot_x != cb->hotspot_x ||
|
||||
ca->hotspot_y != cb->hotspot_y)
|
||||
return FALSE;
|
||||
|
||||
if (ca->callback != cb->callback ||
|
||||
ca->data != cb->data)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -408,42 +368,42 @@ gdk_cursor_new_from_texture (GdkTexture *texture,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cursor_new_from_paintable:
|
||||
* @paintable: the paintable providing the pixel data
|
||||
* @hotspot_x: the horizontal offset of the “hotspot” of the cursor
|
||||
* @hotspot_y: the vertical offset of the “hotspot” of the cursor
|
||||
* gdk_cursor_new_from_callback:
|
||||
* @callback: the `GdkCursorGetTextureCallback`
|
||||
* @data: data to pass to @callback
|
||||
* @destroy: destroy notify for @data
|
||||
* @fallback: (nullable): the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
*
|
||||
* Creates a new cursor from a `GdkPaintable`.
|
||||
* Creates a new callback-based cursor object.
|
||||
*
|
||||
* The intrinsic size of the paintable determines
|
||||
* the size of the cursor.
|
||||
* Cursors of this kind produce textures for the cursor
|
||||
* image on demand, when the @callback is called.
|
||||
*
|
||||
* If the GDK backend has the capability, non-static paintables
|
||||
* may create animated cursors.
|
||||
*
|
||||
* Returns: a new `GdkCursor`
|
||||
* Returns: (nullable): a new `GdkCursor`
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
GdkCursor *
|
||||
gdk_cursor_new_from_paintable (GdkPaintable *paintable,
|
||||
int hotspot_x,
|
||||
int hotspot_y,
|
||||
GdkCursor *fallback)
|
||||
gdk_cursor_new_from_callback (GdkCursorGetTextureCallback callback,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy,
|
||||
GdkCursor *fallback)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_PAINTABLE (paintable), NULL);
|
||||
g_return_val_if_fail (0 <= hotspot_x && hotspot_x < gdk_paintable_get_intrinsic_width (paintable), NULL);
|
||||
g_return_val_if_fail (0 <= hotspot_y && hotspot_y < gdk_paintable_get_intrinsic_height (paintable), NULL);
|
||||
GdkCursor *cursor;
|
||||
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
g_return_val_if_fail (fallback == NULL || GDK_IS_CURSOR (fallback), NULL);
|
||||
|
||||
return g_object_new (GDK_TYPE_CURSOR,
|
||||
"paintable", paintable,
|
||||
"hotspot-x", hotspot_x,
|
||||
"hotspot-y", hotspot_y,
|
||||
"fallback", fallback,
|
||||
NULL);
|
||||
cursor = g_object_new (GDK_TYPE_CURSOR,
|
||||
"fallback", fallback,
|
||||
NULL);
|
||||
|
||||
cursor->callback = callback;
|
||||
cursor->data = data;
|
||||
cursor->destroy = destroy;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -507,27 +467,6 @@ gdk_cursor_get_texture (GdkCursor *cursor)
|
||||
return cursor->texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cursor_get_paintable:
|
||||
* @cursor: a `GdkCursor`
|
||||
*
|
||||
* Returns the paintable for the cursor.
|
||||
*
|
||||
* If the cursor is a named or texture cursor, %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): the paintable for @cursor
|
||||
* or %NULL if it is a named or texture cursor
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
GdkPaintable *
|
||||
gdk_cursor_get_paintable (GdkCursor *cursor)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_CURSOR (cursor), NULL);
|
||||
|
||||
return cursor->paintable;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cursor_get_hotspot_x: (attributes org.gtk.Method.get_property=hotspot-x)
|
||||
* @cursor: a `GdkCursor`
|
||||
@@ -572,211 +511,14 @@ gdk_cursor_get_hotspot_y (GdkCursor *cursor)
|
||||
return cursor->hotspot_y;
|
||||
}
|
||||
|
||||
/* Hack. We don't include gsk/gsk.h here to avoid a build order problem
|
||||
* with the generated header gskenumtypes.h, so we need to hack around
|
||||
* a bit to access the gsk and gtk api we need.
|
||||
*/
|
||||
|
||||
typedef struct _GskRenderer GskRenderer;
|
||||
typedef struct _GskRenderNode GskRenderNode;
|
||||
typedef struct _GdkSnapshot GtkSnapshot;
|
||||
|
||||
extern GskRenderer * gsk_cairo_renderer_new (void);
|
||||
extern gboolean gsk_renderer_realize_for_display (GskRenderer *renderer,
|
||||
GdkDisplay *display,
|
||||
GError **error);
|
||||
extern void gsk_renderer_unrealize (GskRenderer *renderer);
|
||||
extern GdkTexture * gsk_renderer_render_texture (GskRenderer *renderer,
|
||||
GskRenderNode *root,
|
||||
const graphene_rect_t *viewport);
|
||||
|
||||
extern void gsk_render_node_get_bounds (GskRenderNode *node,
|
||||
graphene_rect_t *bounds);
|
||||
|
||||
extern void gsk_render_node_unref (GskRenderNode *node);
|
||||
|
||||
extern GtkSnapshot * gtk_snapshot_new (void);
|
||||
extern GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot *snapshot);
|
||||
|
||||
static GdkTexture *
|
||||
paintable_to_texture (GdkPaintable *paintable,
|
||||
double scale)
|
||||
{
|
||||
GtkSnapshot *snapshot;
|
||||
GskRenderNode *node;
|
||||
GskRenderer *renderer;
|
||||
int width, height;
|
||||
GdkTexture *texture;
|
||||
graphene_rect_t bounds;
|
||||
|
||||
width = gdk_paintable_get_intrinsic_width (paintable);
|
||||
height = gdk_paintable_get_intrinsic_height (paintable);
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
gdk_paintable_snapshot (paintable, snapshot, width * scale, height * scale);
|
||||
node = gtk_snapshot_free_to_node (snapshot);
|
||||
|
||||
/* FIXME: use a proper renderer, and cache it */
|
||||
renderer = gsk_cairo_renderer_new ();
|
||||
gsk_renderer_realize_for_display (renderer, gdk_display_get_default (), NULL);
|
||||
|
||||
gsk_render_node_get_bounds (node, &bounds);
|
||||
texture = gsk_renderer_render_texture (renderer, node, &bounds);
|
||||
|
||||
gsk_renderer_unrealize (renderer);
|
||||
g_object_unref (renderer);
|
||||
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
GdkTexture *
|
||||
gdk_cursor_create_texture (GdkCursor *cursor,
|
||||
double scale)
|
||||
{
|
||||
if (cursor->texture)
|
||||
return g_object_ref (cursor->texture);
|
||||
else if (cursor->paintable)
|
||||
return paintable_to_texture (cursor->paintable, scale);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* GdkCursorGetTestureCallback:
|
||||
* @cursor: the `GdkCursor`
|
||||
* @cursor_size: the nominal cursor size, in application pixels
|
||||
* @scale: the device scale
|
||||
* @width: (out): return location for the actual cursor width,
|
||||
* in application pixels
|
||||
* @height: (out): return location for the actual cursor height,
|
||||
* in application pixels
|
||||
* @hotspot_x: (out): return location for the hotspot X position,
|
||||
* in application pixels
|
||||
* @hotspot_y: (out): return location for the hotspot Y position,
|
||||
* in application pixels
|
||||
* @data: User data for the callback
|
||||
*
|
||||
* The type of callback used by a dynamic `GdkCursor` to generate
|
||||
* a texture for the cursor image at the given @cursor_size
|
||||
* and @scale.
|
||||
*
|
||||
* The actual cursor size in application pixels may be different
|
||||
* from @cursor_size x @cursor_size, and will be returned in
|
||||
* @width, @height.
|
||||
*
|
||||
* The returned texture should have a size that corresponds to
|
||||
* the actual cursor size, in device pixels.
|
||||
*
|
||||
* This function may fail and return `NULL`, in which case
|
||||
* the backend should use the fallback cursor.
|
||||
*
|
||||
* Returns: (nullable) (transfer full): the cursor image, or
|
||||
* `NULL` if none could be produced.
|
||||
*/
|
||||
|
||||
/**
|
||||
* gdk_cursor_new_dynamic:
|
||||
* @callback: the `GdkCursorGetTextureCallback`
|
||||
* @data: data to pass to @callback
|
||||
* @destroy: destroy notify for @data
|
||||
* @fallback: (nullable): the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
*
|
||||
* Creates a new dynamic cursor object.
|
||||
*
|
||||
* Dynamic cursors produce textures for the cursor image
|
||||
* on demand, when the @callback is called.
|
||||
*
|
||||
* Returns: (nullable): a new `GdkCursor`
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
GdkCursor *
|
||||
gdk_cursor_new_dynamic (GdkCursorGetTextureCallback callback,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy,
|
||||
GdkCursor *fallback)
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
g_return_val_if_fail (fallback == NULL || GDK_IS_CURSOR (fallback), NULL);
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_CURSOR,
|
||||
"fallback", fallback,
|
||||
NULL);
|
||||
|
||||
cursor->callback = callback;
|
||||
cursor->data = data;
|
||||
cursor->destroy = destroy;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cursor_invalidate:
|
||||
* @cursor: a `GdkCursor`
|
||||
*
|
||||
* Emits the invalidate signal to indicate that the cursor
|
||||
* has changed and backends should recreate their cursor
|
||||
* image.
|
||||
*
|
||||
* This function does nothing unless the cursor has been
|
||||
* created with [constructor@Gdk.Cursor.new_dynamic].
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
void
|
||||
gdk_cursor_invalidate (GdkCursor *cursor)
|
||||
{
|
||||
if (cursor->callback == NULL)
|
||||
return;
|
||||
|
||||
g_signal_emit (cursor, invalidate_signal, 0);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_cursor_get_dynamic_texture:
|
||||
* @cursor: a dynamic `GdkCursor`
|
||||
* @cursor_size: the nominal size of the cursor image
|
||||
* to produce, in application pixels
|
||||
* @scale: the device scale to use
|
||||
* @width: return location for the cursor width,
|
||||
* in application pixels
|
||||
* @height : return location for the cursor height,
|
||||
* in application pixels
|
||||
* @hotspot_x: return location for the hotspot X position,
|
||||
* in application pixels
|
||||
* @hotspot_y: return location for the hotspot X position,
|
||||
* in application pixels
|
||||
*
|
||||
* Call the callback of a dynamic cursor to generate
|
||||
* a texture for the cursor image at the given @cursor_size
|
||||
* and @scale.
|
||||
*
|
||||
* The actual cursor size in application pixels may be different
|
||||
* from @cursor_size x @cursor_size, and will be returned in
|
||||
* @width, @height.
|
||||
*
|
||||
* The returned texture should have a size that corresponds to
|
||||
* the actual cursor size, in device pixels.
|
||||
*
|
||||
* This function may fail and return `NULL`, in which case
|
||||
* the backend should use the fallback cursor.
|
||||
*
|
||||
* Returns: (nullable) (transfer full): the cursor image, or
|
||||
* `NULL` if none could be produced.
|
||||
*/
|
||||
GdkTexture *
|
||||
gdk_cursor_get_dynamic_texture (GdkCursor *cursor,
|
||||
int cursor_size,
|
||||
double scale,
|
||||
int *width,
|
||||
int *height,
|
||||
int *hotspot_x,
|
||||
int *hotspot_y)
|
||||
gdk_cursor_get_texture_for_size (GdkCursor *cursor,
|
||||
int cursor_size,
|
||||
double scale,
|
||||
int *width,
|
||||
int *height,
|
||||
int *hotspot_x,
|
||||
int *hotspot_y)
|
||||
{
|
||||
if (cursor->callback == NULL)
|
||||
return NULL;
|
||||
@@ -787,4 +529,3 @@ gdk_cursor_get_dynamic_texture (GdkCursor *cursor,
|
||||
hotspot_x, hotspot_y,
|
||||
cursor->data);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#endif
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkpaintable.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -48,31 +47,41 @@ GdkCursor* gdk_cursor_new_from_texture (GdkTexture *texture,
|
||||
int hotspot_x,
|
||||
int hotspot_y,
|
||||
GdkCursor *fallback);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GdkCursor * gdk_cursor_new_from_paintable (GdkPaintable *paintable,
|
||||
int hotspot_x,
|
||||
int hotspot_y,
|
||||
GdkCursor *fallback);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new_from_name (const char *name,
|
||||
GdkCursor *fallback);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor * gdk_cursor_get_fallback (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
const char *gdk_cursor_get_name (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkTexture *gdk_cursor_get_texture (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GdkPaintable *
|
||||
gdk_cursor_get_paintable (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_cursor_get_hotspot_x (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_cursor_get_hotspot_y (GdkCursor *cursor);
|
||||
|
||||
/**
|
||||
* GdkCursorGetTestureCallback:
|
||||
* @cursor: the `GdkCursor`
|
||||
* @cursor_size: the nominal cursor size, in application pixels
|
||||
* @scale: the device scale
|
||||
* @width: (out): return location for the actual cursor width,
|
||||
* in application pixels
|
||||
* @height: (out): return location for the actual cursor height,
|
||||
* in application pixels
|
||||
* @hotspot_x: (out): return location for the hotspot X position,
|
||||
* in application pixels
|
||||
* @hotspot_y: (out): return location for the hotspot Y position,
|
||||
* in application pixels
|
||||
* @data: User data for the callback
|
||||
*
|
||||
* The type of callback used by a dynamic `GdkCursor` to generate
|
||||
* a texture for the cursor image at the given @cursor_size
|
||||
* and @scale.
|
||||
*
|
||||
* The actual cursor size in application pixels may be different
|
||||
* from @cursor_size x @cursor_size, and will be returned in
|
||||
* @width, @height. The returned texture should have a size that
|
||||
* corresponds to the actual cursor size, in device pixels (i.e.
|
||||
* application pixels, multiplied by @scale).
|
||||
*
|
||||
* This function may fail and return `NULL`, in which case
|
||||
* the fallback cursor will be used.
|
||||
*
|
||||
* Returns: (nullable) (transfer full): the cursor image, or
|
||||
* `NULL` if none could be produced.
|
||||
*/
|
||||
typedef GdkTexture * (* GdkCursorGetTextureCallback) (GdkCursor *cursor,
|
||||
int cursor_size,
|
||||
double scale,
|
||||
@@ -82,14 +91,22 @@ typedef GdkTexture * (* GdkCursorGetTextureCallback) (GdkCursor *cursor,
|
||||
int *hotspot_y,
|
||||
gpointer data);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GdkCursor * gdk_cursor_new_dynamic (GdkCursorGetTextureCallback callback,
|
||||
GDK_AVAILABLE_IN_4_16
|
||||
GdkCursor * gdk_cursor_new_from_callback (GdkCursorGetTextureCallback callback,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy,
|
||||
GdkCursor *fallback);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gdk_cursor_invalidate (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor * gdk_cursor_get_fallback (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
const char *gdk_cursor_get_name (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkTexture *gdk_cursor_get_texture (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_cursor_get_hotspot_x (GdkCursor *cursor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gdk_cursor_get_hotspot_y (GdkCursor *cursor);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ struct _GdkCursor
|
||||
GdkCursor *fallback;
|
||||
char *name;
|
||||
GdkTexture *texture;
|
||||
GdkPaintable *paintable;
|
||||
int hotspot_x;
|
||||
int hotspot_y;
|
||||
|
||||
@@ -60,10 +59,7 @@ guint gdk_cursor_hash (gconstpointer
|
||||
gboolean gdk_cursor_equal (gconstpointer a,
|
||||
gconstpointer b);
|
||||
|
||||
GdkTexture * gdk_cursor_create_texture (GdkCursor *cursor,
|
||||
double scale);
|
||||
|
||||
GdkTexture * gdk_cursor_get_dynamic_texture (GdkCursor *cursor,
|
||||
GdkTexture * gdk_cursor_get_texture_for_size (GdkCursor *cursor,
|
||||
int cursor_size,
|
||||
double scale,
|
||||
int *width,
|
||||
|
||||
@@ -1559,13 +1559,14 @@ describe_egl_config (EGLDisplay egl_display,
|
||||
|
||||
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_DEPTH_SIZE, &depth))
|
||||
depth = 0;
|
||||
|
||||
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_STENCIL_SIZE, &stencil))
|
||||
stencil = 0;
|
||||
|
||||
return g_strdup_printf ("R%dG%dB%dA%d%s%s%s", red, green, blue, alpha,
|
||||
return g_strdup_printf ("R%dG%dB%dA%d%s, depth %d, stencil %d", red, green, blue, alpha,
|
||||
type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float",
|
||||
depth > 0 ? ", depth buffer" : "",
|
||||
stencil > 0 ? ", stencil buffer" : "");
|
||||
depth,
|
||||
stencil);
|
||||
}
|
||||
|
||||
gpointer
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "gdkdmabufformatsbuilderprivate.h"
|
||||
#include "gdkdmabuffourccprivate.h"
|
||||
#include "gdkdmabufprivate.h"
|
||||
#include "gdkdmabuftexturebuilderprivate.h"
|
||||
#include "gdktextureprivate.h"
|
||||
#include <gdk/gdkglcontext.h>
|
||||
#include <gdk/gdkgltexturebuilder.h>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkenumtypes.h"
|
||||
#include "gdkdmabuftextureprivate.h"
|
||||
#include "gdkdmabuftexturebuilderprivate.h"
|
||||
|
||||
#include <cairo-gobject.h>
|
||||
|
||||
@@ -948,22 +949,20 @@ gdk_dmabuf_texture_builder_set_update_region (GdkDmabufTextureBuilder *self,
|
||||
*
|
||||
* Builds a new `GdkTexture` with the values set up in the builder.
|
||||
*
|
||||
* It is a programming error to call this function if any mandatory
|
||||
* property has not been set.
|
||||
* It is a programming error to call this function if any mandatory property has not been set.
|
||||
*
|
||||
* If the dmabuf is not supported by GTK, %NULL will be returned and @error will be set.
|
||||
* Not all formats defined in the `drm_fourcc.h` header are supported. You can use
|
||||
* [method@Gdk.Display.get_dmabuf_formats] to get a list of supported formats. If the
|
||||
* format is not supported by GTK, %NULL will be returned and @error will be set.
|
||||
*
|
||||
* The `destroy` function gets called when the returned texture gets released.
|
||||
*
|
||||
* It is possible to call this function multiple times to create multiple textures,
|
||||
* possibly with changing properties in between.
|
||||
*
|
||||
* It is the responsibility of the caller to keep the file descriptors for the planes
|
||||
* open until the created texture is no longer used, and close them afterwards (possibly
|
||||
* using the @destroy notify).
|
||||
*
|
||||
* Not all formats defined in the `drm_fourcc.h` header are supported. You can use
|
||||
* [method@Gdk.Display.get_dmabuf_formats] to get a list of supported formats.
|
||||
* It is possible to call this function multiple times to create multiple textures,
|
||||
* possibly with changing properties in between.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): a newly built `GdkTexture` or `NULL`
|
||||
* if the format is not supported
|
||||
@@ -1004,3 +1003,19 @@ gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *self)
|
||||
{
|
||||
return &self->dmabuf;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *self,
|
||||
const GdkDmabuf *dmabuf)
|
||||
{
|
||||
gdk_dmabuf_texture_builder_set_fourcc (self, dmabuf->fourcc);
|
||||
gdk_dmabuf_texture_builder_set_modifier (self, dmabuf->modifier);
|
||||
gdk_dmabuf_texture_builder_set_n_planes (self, dmabuf->n_planes);
|
||||
|
||||
for (unsigned int i = 0; i < dmabuf->n_planes; i++)
|
||||
{
|
||||
gdk_dmabuf_texture_builder_set_fd (self, i, dmabuf->planes[i].fd);
|
||||
gdk_dmabuf_texture_builder_set_stride (self, i, dmabuf->planes[i].stride);
|
||||
gdk_dmabuf_texture_builder_set_offset (self, i, dmabuf->planes[i].offset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "gdkdmabuftexturebuilder.h"
|
||||
#include "gdkdmabufprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *builder);
|
||||
|
||||
void gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *builder,
|
||||
const GdkDmabuf *dmabuf);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *builder);
|
||||
|
||||
GdkTexture * gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
|
||||
GDestroyNotify destroy,
|
||||
gpointer data,
|
||||
|
||||
@@ -779,11 +779,13 @@ static struct {
|
||||
const char *name;
|
||||
GdkCursor *cursor;
|
||||
} drag_cursors[] = {
|
||||
{ 0, "default", NULL },
|
||||
{ GDK_ACTION_ASK, "dnd-ask", NULL },
|
||||
{ GDK_ACTION_COPY, "copy", NULL },
|
||||
{ GDK_ACTION_MOVE, "move", NULL },
|
||||
{ GDK_ACTION_LINK, "alias", NULL },
|
||||
{ 0, "default", NULL },
|
||||
{ GDK_ACTION_ASK, "dnd-ask", NULL },
|
||||
{ GDK_ACTION_COPY, "copy", NULL },
|
||||
{ GDK_ACTION_MOVE, "dnd-move", NULL }, /* Not using move here, since move is stuck using
|
||||
* a mismatched visual metaphor in Adwaita
|
||||
*/
|
||||
{ GDK_ACTION_LINK, "alias", NULL },
|
||||
};
|
||||
|
||||
GdkCursor *
|
||||
|
||||
@@ -59,7 +59,7 @@ typedef enum {
|
||||
* @get_current_image: return a `GdkPaintable` that does not change over
|
||||
* time. This means the `GDK_PAINTABLE_STATIC_SIZE` and
|
||||
* `GDK_PAINTABLE_STATIC_CONTENTS` flag are set.
|
||||
* @get_flags: Get the flags for this instance. See [enum@Gdk.PaintableFlags]
|
||||
* @get_flags: Get the flags for this instance. See [flags@Gdk.PaintableFlags]
|
||||
* for details.
|
||||
* @get_intrinsic_width: The preferred width for this object to be
|
||||
* snapshot at or 0 if none. This is purely a hint. The object must still
|
||||
|
||||
@@ -113,6 +113,8 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||
GdkTexture *texture,
|
||||
const graphene_rect_t *source,
|
||||
const graphene_rect_t *dest,
|
||||
GdkTextureTransform transform,
|
||||
gboolean lightbox,
|
||||
gboolean above,
|
||||
GdkSubsurface *sibling)
|
||||
{
|
||||
@@ -155,7 +157,7 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||
}
|
||||
}
|
||||
|
||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, source, dest, above, sibling);
|
||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, source, dest, transform, lightbox, above, sibling);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -203,3 +205,19 @@ gdk_subsurface_is_above_parent (GdkSubsurface *subsurface)
|
||||
|
||||
return subsurface->above_parent;
|
||||
}
|
||||
|
||||
GdkTextureTransform
|
||||
gdk_subsurface_get_transform (GdkSubsurface *subsurface)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), GDK_TEXTURE_TRANSFORM_NORMAL);
|
||||
|
||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_transform (subsurface);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_subsurface_get_lightbox (GdkSubsurface *subsurface)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
||||
|
||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_lightbox (subsurface);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,16 @@ struct _GdkSubsurface
|
||||
GdkSubsurface *sibling_below;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
GDK_TEXTURE_TRANSFORM_NORMAL,
|
||||
GDK_TEXTURE_TRANSFORM_90,
|
||||
GDK_TEXTURE_TRANSFORM_180,
|
||||
GDK_TEXTURE_TRANSFORM_270,
|
||||
GDK_TEXTURE_TRANSFORM_FLIPPED,
|
||||
GDK_TEXTURE_TRANSFORM_FLIPPED_90,
|
||||
GDK_TEXTURE_TRANSFORM_FLIPPED_180,
|
||||
GDK_TEXTURE_TRANSFORM_FLIPPED_270,
|
||||
} GdkTextureTransform;
|
||||
|
||||
struct _GdkSubsurfaceClass
|
||||
{
|
||||
@@ -56,6 +66,8 @@ struct _GdkSubsurfaceClass
|
||||
GdkTexture *texture,
|
||||
const graphene_rect_t *source,
|
||||
const graphene_rect_t *dest,
|
||||
GdkTextureTransform transform,
|
||||
gboolean lightbox,
|
||||
gboolean above,
|
||||
GdkSubsurface *sibling);
|
||||
void (* detach) (GdkSubsurface *subsurface);
|
||||
@@ -64,15 +76,21 @@ struct _GdkSubsurfaceClass
|
||||
graphene_rect_t *source);
|
||||
void (* get_dest) (GdkSubsurface *subsurface,
|
||||
graphene_rect_t *dest);
|
||||
GdkTextureTransform
|
||||
(* get_transform) (GdkSubsurface *subsurface);
|
||||
gboolean (* get_lightbox) (GdkSubsurface *subsurface);
|
||||
};
|
||||
|
||||
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
|
||||
|
||||
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||
GdkTexture *texture,
|
||||
const graphene_rect_t *source,
|
||||
const graphene_rect_t *dest,
|
||||
GdkTextureTransform transform,
|
||||
gboolean lightbox,
|
||||
gboolean above,
|
||||
GdkSubsurface *sibling);
|
||||
void gdk_subsurface_detach (GdkSubsurface *subsurface);
|
||||
@@ -82,6 +100,9 @@ void gdk_subsurface_get_source (GdkSubsurface *subsurfac
|
||||
void gdk_subsurface_get_dest (GdkSubsurface *subsurface,
|
||||
graphene_rect_t *dest);
|
||||
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
|
||||
GdkTextureTransform
|
||||
gdk_subsurface_get_transform (GdkSubsurface *subsurface);
|
||||
gboolean gdk_subsurface_get_lightbox (GdkSubsurface *subsurface);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkmacoscursor-private.h"
|
||||
#include "gdkcursorprivate.h"
|
||||
|
||||
@interface NSCursor()
|
||||
-(long long)_coreCursorType;
|
||||
@@ -217,11 +218,25 @@ _gdk_macos_cursor_get_ns_cursor (GdkCursor *cursor)
|
||||
|
||||
if (name == NULL)
|
||||
{
|
||||
GdkTexture *texture = gdk_cursor_create_texture (cursor, 1);
|
||||
nscursor = create_cursor_from_texture (texture,
|
||||
gdk_cursor_get_hotspot_x (cursor),
|
||||
gdk_cursor_get_hotspot_y (cursor));
|
||||
g_object_unref (texture);
|
||||
GdkTexture *texture;
|
||||
int hotspot_x, hotspot_y;
|
||||
|
||||
texture = gdk_cursor_get_texture (cursor);
|
||||
hotspot_x = gdk_cursor_get_hotspot_x (cursor);
|
||||
hotspot_y = gdk_cursor_get_hotspot_y (cursor);
|
||||
|
||||
if (texture == NULL)
|
||||
{
|
||||
int size = 32; // FIXME
|
||||
int width, height;
|
||||
|
||||
texture = gdk_cursor_get_texture_for_size (cursor, size, 1,
|
||||
&width, &height,
|
||||
&hotspot_x, &hotspot_y);
|
||||
}
|
||||
|
||||
nscursor = create_cursor_from_texture (texture, hotspot_x, hotspot_y);
|
||||
|
||||
return nscursor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include "cursor/wayland-cursor.h"
|
||||
|
||||
#include "gtk/gtksnapshot.h"
|
||||
#include "gsk/gskrenderer.h"
|
||||
#include "gsk/gskrendernodeprivate.h"
|
||||
|
||||
static void
|
||||
gdk_wayland_cursor_remove_from_cache (gpointer data, GObject *cursor)
|
||||
{
|
||||
@@ -83,6 +79,7 @@ static const struct {
|
||||
{ "move", "dnd-move" },
|
||||
{ "no-drop", "dnd-none" },
|
||||
{ "dnd-ask", "dnd-copy" }, /* not CSS, but we want to guarantee it anyway */
|
||||
{ "dnd-move", "default" },
|
||||
{ "not-allowed", "crossed_circle" },
|
||||
{ "grab", "hand2" },
|
||||
{ "grabbing", "hand2" },
|
||||
@@ -169,7 +166,6 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
{
|
||||
GdkTexture *texture;
|
||||
int desired_scale_factor;
|
||||
gboolean can_cache = TRUE;
|
||||
|
||||
desired_scale_factor = (int) ceil (desired_scale);
|
||||
|
||||
@@ -221,23 +217,13 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
}
|
||||
else if (gdk_cursor_get_texture (cursor))
|
||||
{
|
||||
cairo_surface_t *surface = NULL;
|
||||
cairo_surface_t *surface;
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
texture = g_object_ref (gdk_cursor_get_texture (cursor));
|
||||
|
||||
from_texture:
|
||||
*width = gdk_texture_get_width (texture);
|
||||
*height = gdk_texture_get_height (texture);
|
||||
*scale = 1;
|
||||
|
||||
from_texture2:
|
||||
*hotspot_x = gdk_cursor_get_hotspot_x (cursor);
|
||||
*hotspot_y = gdk_cursor_get_hotspot_y (cursor);
|
||||
|
||||
if (can_cache)
|
||||
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
|
||||
|
||||
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
|
||||
if (surface == NULL)
|
||||
{
|
||||
surface = gdk_wayland_display_create_shm_surface (display,
|
||||
@@ -250,14 +236,16 @@ from_texture2:
|
||||
cairo_image_surface_get_stride (surface));
|
||||
cairo_surface_mark_dirty (surface);
|
||||
|
||||
if (can_cache)
|
||||
{
|
||||
g_object_weak_ref (G_OBJECT (cursor), gdk_wayland_cursor_remove_from_cache, display);
|
||||
|
||||
g_hash_table_insert (display->cursor_surface_cache, cursor, surface);
|
||||
}
|
||||
g_object_weak_ref (G_OBJECT (cursor), gdk_wayland_cursor_remove_from_cache, display);
|
||||
g_hash_table_insert (display->cursor_surface_cache, cursor, surface);
|
||||
}
|
||||
|
||||
*hotspot_x = gdk_cursor_get_hotspot_x (cursor);
|
||||
*hotspot_y = gdk_cursor_get_hotspot_y (cursor);
|
||||
*width = gdk_texture_get_width (texture);
|
||||
*height = gdk_texture_get_height (texture);
|
||||
*scale = 1;
|
||||
|
||||
cairo_surface_reference (surface);
|
||||
buffer = _gdk_wayland_shm_surface_get_wl_buffer (surface);
|
||||
wl_buffer_add_listener (buffer, &buffer_listener, surface);
|
||||
@@ -268,24 +256,41 @@ from_texture2:
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
|
||||
paintable = gdk_cursor_get_paintable (cursor);
|
||||
|
||||
*width = gdk_paintable_get_intrinsic_width (paintable);
|
||||
*height = gdk_paintable_get_intrinsic_height (paintable);
|
||||
if (!use_viewporter)
|
||||
*scale = desired_scale_factor;
|
||||
else
|
||||
*scale = desired_scale;
|
||||
|
||||
texture = gdk_cursor_create_texture (cursor, *scale);
|
||||
texture = gdk_cursor_get_texture_for_size (cursor,
|
||||
display->cursor_theme_size,
|
||||
*scale,
|
||||
width,
|
||||
height,
|
||||
hotspot_x,
|
||||
hotspot_y);
|
||||
|
||||
can_cache = (gdk_paintable_get_flags (paintable) & GDK_PAINTABLE_STATIC_CONTENTS) != 0;
|
||||
if (texture)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
can_cache = (gdk_paintable_get_flags (paintable) & GDK_PAINTABLE_STATIC_CONTENTS) != 0;
|
||||
surface = gdk_wayland_display_create_shm_surface (display,
|
||||
gdk_texture_get_width (texture),
|
||||
gdk_texture_get_height (texture),
|
||||
&GDK_FRACTIONAL_SCALE_INIT_INT (1));
|
||||
|
||||
goto from_texture2;
|
||||
gdk_texture_download (texture,
|
||||
cairo_image_surface_get_data (surface),
|
||||
cairo_image_surface_get_stride (surface));
|
||||
cairo_surface_mark_dirty (surface);
|
||||
|
||||
buffer = _gdk_wayland_shm_surface_get_wl_buffer (surface);
|
||||
wl_buffer_add_listener (buffer, &buffer_listener, surface);
|
||||
|
||||
g_object_unref (texture);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
if (gdk_cursor_get_fallback (cursor))
|
||||
|
||||
@@ -68,7 +68,6 @@ struct _GdkWaylandPointerData {
|
||||
guint cursor_timeout_id;
|
||||
guint cursor_image_index;
|
||||
guint cursor_image_delay;
|
||||
gulong cursor_invalidated_handler;
|
||||
guint touchpad_event_sequence;
|
||||
|
||||
double current_output_scale;
|
||||
@@ -184,6 +183,8 @@ struct _GdkWaylandSeat
|
||||
GdkWaylandPointerData pointer_info;
|
||||
GdkWaylandPointerData touch_info;
|
||||
|
||||
uint32_t latest_touch_down_serial;
|
||||
|
||||
GdkModifierType key_modifiers;
|
||||
GdkSurface *keyboard_focus;
|
||||
GdkSurface *grab_surface;
|
||||
|
||||
@@ -58,12 +58,11 @@ gdk_wayland_device_set_surface_cursor (GdkDevice *device,
|
||||
{
|
||||
if (!pointer->cursor_is_default)
|
||||
{
|
||||
gdk_wayland_seat_stop_cursor_animation (seat, pointer);
|
||||
|
||||
g_clear_object (&pointer->cursor);
|
||||
pointer->cursor = gdk_cursor_new_from_name ("default", NULL);
|
||||
pointer->cursor_is_default = TRUE;
|
||||
|
||||
gdk_wayland_seat_stop_cursor_animation (seat, pointer);
|
||||
gdk_wayland_device_update_surface_cursor (device);
|
||||
}
|
||||
else
|
||||
@@ -73,11 +72,10 @@ gdk_wayland_device_set_surface_cursor (GdkDevice *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_wayland_seat_stop_cursor_animation (seat, pointer);
|
||||
|
||||
g_set_object (&pointer->cursor, cursor);
|
||||
pointer->cursor_is_default = FALSE;
|
||||
|
||||
gdk_wayland_seat_stop_cursor_animation (seat, pointer);
|
||||
gdk_wayland_device_update_surface_cursor (device);
|
||||
}
|
||||
}
|
||||
@@ -267,15 +265,20 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
guint next_image_index, next_image_delay;
|
||||
gboolean retval = G_SOURCE_REMOVE;
|
||||
GdkWaylandTabletData *tablet;
|
||||
gboolean use_viewport;
|
||||
|
||||
tablet = gdk_wayland_seat_find_tablet (seat, device);
|
||||
|
||||
use_viewport = pointer->pointer_surface_viewport != NULL;
|
||||
if (g_getenv ("NO_POINTER_VIEWPORT"))
|
||||
use_viewport = FALSE;
|
||||
|
||||
if (pointer->cursor)
|
||||
{
|
||||
buffer = _gdk_wayland_cursor_get_buffer (GDK_WAYLAND_DISPLAY (seat->display),
|
||||
pointer->cursor,
|
||||
pointer->current_output_scale,
|
||||
pointer->pointer_surface_viewport != NULL,
|
||||
use_viewport,
|
||||
pointer->cursor_image_index,
|
||||
&x, &y, &w, &h, &scale);
|
||||
}
|
||||
@@ -314,7 +317,7 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
if (buffer)
|
||||
{
|
||||
wl_surface_attach (pointer->pointer_surface, buffer, 0, 0);
|
||||
if (pointer->pointer_surface_viewport)
|
||||
if (use_viewport)
|
||||
{
|
||||
wp_viewport_set_source (pointer->pointer_surface_viewport,
|
||||
wl_fixed_from_int (0),
|
||||
@@ -334,23 +337,6 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
wl_surface_commit (pointer->pointer_surface);
|
||||
}
|
||||
|
||||
GdkPaintable *paintable = gdk_cursor_get_paintable (pointer->cursor);
|
||||
|
||||
if (paintable)
|
||||
{
|
||||
if ((gdk_paintable_get_flags (paintable) & GDK_PAINTABLE_STATIC_CONTENTS) == 0)
|
||||
{
|
||||
if (pointer->cursor_invalidated_handler == 0)
|
||||
{
|
||||
pointer->cursor_invalidated_handler =
|
||||
g_signal_connect_swapped (paintable, "invalidate-contents",
|
||||
G_CALLBACK (gdk_wayland_device_update_surface_cursor), device);
|
||||
}
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
next_image_index =
|
||||
_gdk_wayland_cursor_get_next_image_index (GDK_WAYLAND_DISPLAY (seat->display),
|
||||
pointer->cursor,
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#include <wayland/xdg-foreign-unstable-v2-client-protocol.h>
|
||||
#include <wayland/server-decoration-client-protocol.h>
|
||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||
#include "presentation-time-client-protocol.h"
|
||||
|
||||
#include "wm-button-layout-translation.h"
|
||||
|
||||
@@ -598,6 +599,13 @@ gdk_registry_handle_global (void *data,
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&wp_viewporter_interface, 1);
|
||||
}
|
||||
else if (strcmp (interface, "wp_presentation") == 0)
|
||||
{
|
||||
display_wayland->presentation =
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&wp_presentation_interface,
|
||||
MIN (version, 1));
|
||||
}
|
||||
|
||||
|
||||
g_hash_table_insert (display_wayland->known_globals,
|
||||
@@ -808,6 +816,7 @@ gdk_wayland_display_dispose (GObject *object)
|
||||
g_clear_pointer (&display_wayland->xdg_activation, xdg_activation_v1_destroy);
|
||||
g_clear_pointer (&display_wayland->fractional_scale, wp_fractional_scale_manager_v1_destroy);
|
||||
g_clear_pointer (&display_wayland->viewporter, wp_viewporter_destroy);
|
||||
g_clear_pointer (&display_wayland->presentation, wp_presentation_destroy);
|
||||
g_clear_pointer (&display_wayland->linux_dmabuf, zwp_linux_dmabuf_v1_destroy);
|
||||
g_clear_pointer (&display_wayland->linux_dmabuf_feedback, zwp_linux_dmabuf_feedback_v1_destroy);
|
||||
if (display_wayland->linux_dmabuf_formats)
|
||||
@@ -2005,9 +2014,10 @@ init_settings (GdkDisplay *display)
|
||||
|
||||
g_variant_get (ret, "(a{sa{sv}})", &iter);
|
||||
|
||||
if (g_variant_n_children (ret) == 0)
|
||||
if (g_variant_iter_n_children (iter) == 0)
|
||||
{
|
||||
g_debug ("Received no portal settings");
|
||||
g_clear_pointer (&iter, g_variant_iter_free);
|
||||
g_clear_pointer (&ret, g_variant_unref);
|
||||
|
||||
goto fallback;
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <gdk/wayland/xdg-activation-v1-client-protocol.h>
|
||||
#include <gdk/wayland/fractional-scale-v1-client-protocol.h>
|
||||
#include <gdk/wayland/viewporter-client-protocol.h>
|
||||
#include <gdk/wayland/presentation-time-client-protocol.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
@@ -125,6 +126,7 @@ struct _GdkWaylandDisplay
|
||||
struct xdg_activation_v1 *xdg_activation;
|
||||
struct wp_fractional_scale_manager_v1 *fractional_scale;
|
||||
struct wp_viewporter *viewporter;
|
||||
struct wp_presentation *presentation;
|
||||
|
||||
GList *async_roundtrips;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <gdk/wayland/gdkwayland.h>
|
||||
#include <gdk/wayland/gdkdisplay-wayland.h>
|
||||
#include <gdk/wayland/gdkseat-wayland.h>
|
||||
#include <gdk/wayland/gdkwaylandpresentationtime-private.h>
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
|
||||
@@ -117,15 +117,6 @@ gdk_wayland_seat_stop_cursor_animation (GdkWaylandSeat *seat,
|
||||
}
|
||||
|
||||
pointer->cursor_image_index = 0;
|
||||
|
||||
if (pointer->cursor_invalidated_handler != 0)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
|
||||
paintable = gdk_cursor_get_paintable (pointer->cursor);
|
||||
g_signal_handler_disconnect (paintable, pointer->cursor_invalidated_handler);
|
||||
pointer->cursor_invalidated_handler = 0;
|
||||
}
|
||||
}
|
||||
|
||||
GdkWaylandTabletData *
|
||||
@@ -1649,6 +1640,7 @@ touch_handle_down (void *data,
|
||||
touch->x = wl_fixed_to_double (x);
|
||||
touch->y = wl_fixed_to_double (y);
|
||||
touch->touch_down_serial = serial;
|
||||
seat->latest_touch_down_serial = serial;
|
||||
|
||||
event = gdk_touch_event_new (GDK_TOUCH_BEGIN,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
@@ -4251,7 +4243,7 @@ init_pointer_data (GdkWaylandPointerData *pointer_data,
|
||||
&pointer_surface_listener,
|
||||
logical_device);
|
||||
|
||||
if (display_wayland->viewporter && g_getenv ("POINTER_USE_VIEWPORT"))
|
||||
if (display_wayland->viewporter)
|
||||
pointer_data->pointer_surface_viewport = wp_viewporter_get_viewport (display_wayland->viewporter, pointer_data->pointer_surface);
|
||||
}
|
||||
|
||||
@@ -4402,15 +4394,24 @@ _gdk_wayland_seat_get_last_implicit_grab_serial (GdkWaylandSeat *seat,
|
||||
serial = tablet->pointer_info.press_serial;
|
||||
}
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
|
||||
if (g_hash_table_size (seat->touches) > 0)
|
||||
{
|
||||
if (touch->touch_down_serial > serial)
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
|
||||
{
|
||||
if (sequence)
|
||||
*sequence = GDK_SLOT_TO_EVENT_SEQUENCE (touch->id);
|
||||
serial = touch->touch_down_serial;
|
||||
if (touch->touch_down_serial > serial)
|
||||
{
|
||||
if (sequence)
|
||||
*sequence = GDK_SLOT_TO_EVENT_SEQUENCE (touch->id);
|
||||
serial = touch->touch_down_serial;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (seat->latest_touch_down_serial > serial)
|
||||
serial = seat->latest_touch_down_serial;
|
||||
}
|
||||
|
||||
return serial;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "gdksubsurfaceprivate.h"
|
||||
|
||||
#include "wayland-client-protocol.h"
|
||||
|
||||
typedef struct _GdkWaylandSubsurface GdkWaylandSubsurface;
|
||||
typedef struct _GdkWaylandSubsurfaceClass GdkWaylandSubsurfaceClass;
|
||||
@@ -23,6 +24,8 @@ struct _GdkWaylandSubsurface
|
||||
GdkTexture *texture;
|
||||
cairo_rectangle_int_t dest;
|
||||
graphene_rect_t source;
|
||||
enum wl_output_transform transform;
|
||||
gboolean lightbox;
|
||||
|
||||
struct wl_region *opaque_region;
|
||||
|
||||
|
||||
@@ -149,12 +149,26 @@ get_wl_buffer (GdkWaylandSubsurface *self,
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static inline enum wl_output_transform
|
||||
gdk_texture_transform_to_wl (GdkTextureTransform transform)
|
||||
{
|
||||
return (enum wl_output_transform) transform;
|
||||
}
|
||||
|
||||
static inline GdkTextureTransform
|
||||
wl_output_transform_to_gdk (enum wl_output_transform transform)
|
||||
{
|
||||
return (GdkTextureTransform) transform;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
||||
GdkTexture *texture,
|
||||
const graphene_rect_t *source,
|
||||
const graphene_rect_t *dest,
|
||||
GdkTextureTransform transform,
|
||||
gboolean above,
|
||||
gboolean lightbox,
|
||||
GdkSubsurface *sibling)
|
||||
{
|
||||
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
||||
@@ -188,6 +202,9 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
||||
self->source.size.width = source->size.width;
|
||||
self->source.size.height = source->size.height;
|
||||
|
||||
self->transform = gdk_texture_transform_to_wl (transform);
|
||||
self->lightbox = lightbox;
|
||||
|
||||
scale = gdk_fractional_scale_to_double (&parent->scale);
|
||||
|
||||
device_rect.origin.x = dest->origin.x * scale;
|
||||
@@ -302,6 +319,7 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
||||
|
||||
if (result)
|
||||
{
|
||||
wl_surface_set_buffer_transform (self->surface, self->transform);
|
||||
wl_subsurface_set_position (self->subsurface, self->dest.x, self->dest.y);
|
||||
wp_viewport_set_destination (self->viewport, self->dest.width, self->dest.height);
|
||||
wp_viewport_set_source (self->viewport,
|
||||
@@ -406,6 +424,22 @@ gdk_wayland_subsurface_get_source (GdkSubsurface *sub,
|
||||
source->size.height = self->source.size.height;
|
||||
}
|
||||
|
||||
static GdkTextureTransform
|
||||
gdk_wayland_subsurface_get_transform (GdkSubsurface *sub)
|
||||
{
|
||||
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
||||
|
||||
return wl_output_transform_to_gdk (self->transform);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_subsurface_get_lightbox (GdkSubsurface *sub)
|
||||
{
|
||||
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
||||
|
||||
return self->lightbox;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
|
||||
{
|
||||
@@ -419,6 +453,8 @@ gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
|
||||
subsurface_class->get_texture = gdk_wayland_subsurface_get_texture;
|
||||
subsurface_class->get_source = gdk_wayland_subsurface_get_source;
|
||||
subsurface_class->get_dest = gdk_wayland_subsurface_get_dest;
|
||||
subsurface_class->get_transform = gdk_wayland_subsurface_get_transform;
|
||||
subsurface_class->get_lightbox = gdk_wayland_subsurface_get_lightbox;
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
@@ -44,6 +44,8 @@ struct _GdkWaylandSurface
|
||||
struct wl_event_queue *event_queue;
|
||||
struct wl_callback *frame_callback;
|
||||
|
||||
GdkWaylandPresentationTime *presentation_time;
|
||||
|
||||
unsigned int initial_configure_received : 1;
|
||||
unsigned int has_uncommitted_ack_configure : 1;
|
||||
unsigned int has_pending_subsurface_commits : 1;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "gdktoplevel-wayland-private.h"
|
||||
|
||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||
#include "presentation-time-client-protocol.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -270,6 +271,20 @@ gdk_wayland_surface_update_size (GdkSurface *surface,
|
||||
_gdk_surface_update_size (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_surface_clear_frame_callback (GdkWaylandSurface *self)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (self);
|
||||
|
||||
g_clear_pointer (&self->frame_callback, wl_callback_destroy);
|
||||
|
||||
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
|
||||
{
|
||||
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
|
||||
gdk_wayland_subsurface_clear_frame_callback (subsurface);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_surface_frame_callback (GdkSurface *surface,
|
||||
uint32_t time)
|
||||
@@ -283,13 +298,7 @@ gdk_wayland_surface_frame_callback (GdkSurface *surface,
|
||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland frame event", NULL);
|
||||
GDK_DISPLAY_DEBUG (GDK_DISPLAY (display_wayland), EVENTS, "frame %p", surface);
|
||||
|
||||
g_clear_pointer (&impl->frame_callback, wl_callback_destroy);
|
||||
|
||||
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
|
||||
{
|
||||
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
|
||||
gdk_wayland_subsurface_clear_frame_callback (subsurface);
|
||||
}
|
||||
gdk_wayland_surface_clear_frame_callback (impl);
|
||||
|
||||
GDK_WAYLAND_SURFACE_GET_CLASS (impl)->handle_frame (impl);
|
||||
|
||||
@@ -403,6 +412,17 @@ gdk_wayland_surface_request_frame (GdkSurface *surface)
|
||||
wl_proxy_set_queue ((struct wl_proxy *) self->frame_callback, NULL);
|
||||
wl_callback_add_listener (self->frame_callback, &frame_listener, surface);
|
||||
|
||||
if (self->presentation_time == NULL)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
self->presentation_time = gdk_wayland_presentation_time_new (wayland_display);
|
||||
}
|
||||
|
||||
gdk_wayland_presentation_time_track (self->presentation_time,
|
||||
clock,
|
||||
self->display_server.wl_surface,
|
||||
gdk_frame_clock_get_frame_counter (clock));
|
||||
|
||||
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
|
||||
{
|
||||
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
|
||||
@@ -1048,7 +1068,8 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
|
||||
|
||||
unmap_popups_for_surface (surface);
|
||||
|
||||
g_clear_pointer (&impl->frame_callback, wl_callback_destroy);
|
||||
g_clear_pointer (&impl->presentation_time, gdk_wayland_presentation_time_free);
|
||||
gdk_wayland_surface_clear_frame_callback (impl);
|
||||
if (impl->awaiting_frame_frozen)
|
||||
{
|
||||
impl->awaiting_frame_frozen = FALSE;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "gdktoplevelprivate.h"
|
||||
#include "gdkdevice-wayland-private.h"
|
||||
|
||||
#include <wayland/presentation-time-client-protocol.h>
|
||||
#include <wayland/xdg-shell-unstable-v6-client-protocol.h>
|
||||
#include <wayland/xdg-foreign-unstable-v2-client-protocol.h>
|
||||
|
||||
@@ -122,6 +123,8 @@ struct _GdkWaylandToplevel
|
||||
|
||||
struct wl_output *initial_fullscreen_output;
|
||||
|
||||
struct wp_presentation_feedback *feedback;
|
||||
|
||||
struct {
|
||||
GdkToplevelState unset_flags;
|
||||
GdkToplevelState set_flags;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <gdk/gdkframeclock.h>
|
||||
#include <gdk/wayland/gdkdisplay-wayland.h>
|
||||
#include <gdk/wayland/gdksurface-wayland.h>
|
||||
#include <gdk/wayland/gdkwaylanddisplay.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkWaylandPresentationTime GdkWaylandPresentationTime;
|
||||
|
||||
GdkWaylandPresentationTime *gdk_wayland_presentation_time_new (GdkWaylandDisplay *display);
|
||||
void gdk_wayland_presentation_time_track (GdkWaylandPresentationTime *self,
|
||||
GdkFrameClock *frame_clock,
|
||||
struct wl_surface *surface,
|
||||
gint64 frame_number);
|
||||
void gdk_wayland_presentation_time_free (GdkWaylandPresentationTime *self);
|
||||
|
||||
G_END_DECLS
|
||||
@@ -0,0 +1,152 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk/gdkframeclockprivate.h>
|
||||
|
||||
#include "gdkwaylandpresentationtime-private.h"
|
||||
|
||||
typedef struct _GdkWaylandPresentationFrame
|
||||
{
|
||||
GdkWaylandPresentationTime *self;
|
||||
struct wp_presentation_feedback *feedback;
|
||||
GdkFrameClock *frame_clock;
|
||||
gint64 frame_number;
|
||||
} GdkWaylandPresentationFrame;
|
||||
|
||||
static void
|
||||
gdk_wayland_presentation_frame_free (GdkWaylandPresentationFrame *frame)
|
||||
{
|
||||
g_clear_pointer (&frame->feedback, wp_presentation_feedback_destroy);
|
||||
g_clear_object (&frame->frame_clock);
|
||||
frame->self = NULL;
|
||||
g_free (frame);
|
||||
}
|
||||
|
||||
struct _GdkWaylandPresentationTime
|
||||
{
|
||||
GdkWaylandDisplay *display;
|
||||
GPtrArray *frames;
|
||||
};
|
||||
|
||||
GdkWaylandPresentationTime *
|
||||
gdk_wayland_presentation_time_new (GdkWaylandDisplay *display)
|
||||
{
|
||||
GdkWaylandPresentationTime *self;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
self = g_new0 (GdkWaylandPresentationTime, 1);
|
||||
self->display = g_object_ref (display);
|
||||
self->frames = g_ptr_array_new_with_free_func ((GDestroyNotify)gdk_wayland_presentation_frame_free);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_presentation_time_free (GdkWaylandPresentationTime *self)
|
||||
{
|
||||
g_clear_pointer (&self->frames, g_ptr_array_unref);
|
||||
g_clear_object (&self->display);
|
||||
g_free (self);
|
||||
}
|
||||
|
||||
static gint64
|
||||
time_from_wayland (uint32_t tv_sec_hi,
|
||||
uint32_t tv_sec_lo,
|
||||
uint32_t tv_nsec)
|
||||
{
|
||||
guint64 t = tv_sec_hi;
|
||||
t <<= 32;
|
||||
t |= tv_sec_lo;
|
||||
t *= G_USEC_PER_SEC;
|
||||
t += tv_nsec / 1000L;
|
||||
return (gint64)t;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_presentation_feedback_sync_output (void *data,
|
||||
struct wp_presentation_feedback *feedback,
|
||||
struct wl_output *output)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_presentation_feedback_presented (void *data,
|
||||
struct wp_presentation_feedback *feedback,
|
||||
uint32_t tv_sec_hi,
|
||||
uint32_t tv_sec_lo,
|
||||
uint32_t tv_nsec,
|
||||
uint32_t refresh,
|
||||
uint32_t seq_hi,
|
||||
uint32_t seq_lo,
|
||||
uint32_t flags)
|
||||
{
|
||||
GdkWaylandPresentationFrame *frame = data;
|
||||
GdkWaylandPresentationTime *self;
|
||||
GdkFrameTimings *timings;
|
||||
guint pos;
|
||||
|
||||
g_assert (frame != NULL);
|
||||
g_assert (frame->self != NULL);
|
||||
|
||||
self = frame->self;
|
||||
|
||||
if ((timings = gdk_frame_clock_get_timings (frame->frame_clock, frame->frame_number)))
|
||||
{
|
||||
timings->presentation_time = time_from_wayland (tv_sec_hi, tv_sec_lo, tv_nsec);
|
||||
timings->complete = TRUE;
|
||||
}
|
||||
|
||||
if (g_ptr_array_find (self->frames, frame, &pos))
|
||||
g_ptr_array_remove_index_fast (self->frames, pos);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_presentation_feedback_discarded (void *data,
|
||||
struct wp_presentation_feedback *feedback)
|
||||
{
|
||||
GdkWaylandPresentationFrame *frame = data;
|
||||
guint pos;
|
||||
|
||||
g_assert (frame != NULL);
|
||||
g_assert (frame->self != NULL);
|
||||
|
||||
if (g_ptr_array_find (frame->self->frames, frame, &pos))
|
||||
g_ptr_array_remove_index_fast (frame->self->frames, pos);
|
||||
}
|
||||
|
||||
static const struct wp_presentation_feedback_listener gdk_wayland_presentation_feedback_listener = {
|
||||
gdk_wayland_presentation_feedback_sync_output,
|
||||
gdk_wayland_presentation_feedback_presented,
|
||||
gdk_wayland_presentation_feedback_discarded,
|
||||
};
|
||||
|
||||
void
|
||||
gdk_wayland_presentation_time_track (GdkWaylandPresentationTime *self,
|
||||
GdkFrameClock *frame_clock,
|
||||
struct wl_surface *surface,
|
||||
gint64 frame_number)
|
||||
{
|
||||
struct wp_presentation_feedback *feedback;
|
||||
GdkWaylandPresentationFrame *frame;
|
||||
|
||||
g_return_if_fail (self != NULL);
|
||||
g_return_if_fail (surface != NULL);
|
||||
|
||||
if (self->display->presentation == NULL)
|
||||
return;
|
||||
|
||||
if (!(feedback = wp_presentation_feedback (self->display->presentation, surface)))
|
||||
return;
|
||||
|
||||
frame = g_new0 (GdkWaylandPresentationFrame, 1);
|
||||
frame->self = self;
|
||||
frame->frame_clock = g_object_ref (frame_clock);
|
||||
frame->frame_number = frame_number;
|
||||
frame->feedback = g_steal_pointer (&feedback);
|
||||
|
||||
g_ptr_array_add (self->frames, frame);
|
||||
|
||||
wp_presentation_feedback_add_listener (frame->feedback,
|
||||
&gdk_wayland_presentation_feedback_listener,
|
||||
frame);
|
||||
}
|
||||
@@ -22,6 +22,7 @@ gdk_wayland_sources = files([
|
||||
'gdktoplevel-wayland.c',
|
||||
'gdkpopup-wayland.c',
|
||||
'gdkvulkancontext-wayland.c',
|
||||
'gdkwaylandpresentationtime.c',
|
||||
'wm-button-layout-translation.c',
|
||||
])
|
||||
|
||||
@@ -69,6 +70,7 @@ proto_sources = [
|
||||
['xdg-activation', 'staging', 'v1', ],
|
||||
['fractional-scale', 'staging', 'v1', ],
|
||||
['linux-dmabuf', 'unstable', 'v1', ],
|
||||
['presentation-time', 'stable', 'v1', ],
|
||||
]
|
||||
|
||||
gdk_wayland_gen_headers = []
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkwin32.h"
|
||||
#include "gdktextureprivate.h"
|
||||
#include "gdkcursorprivate.h"
|
||||
|
||||
#include "gdkdisplay-win32.h"
|
||||
|
||||
@@ -1481,6 +1482,7 @@ gdk_win32_display_get_win32hcursor (GdkWin32Display *display,
|
||||
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
|
||||
GdkWin32HCursor *win32hcursor;
|
||||
const char *cursor_name;
|
||||
GdkTexture *texture;
|
||||
GdkCursor *fallback;
|
||||
|
||||
g_return_val_if_fail (cursor != NULL, NULL);
|
||||
@@ -1494,17 +1496,31 @@ gdk_win32_display_get_win32hcursor (GdkWin32Display *display,
|
||||
return win32hcursor;
|
||||
|
||||
cursor_name = gdk_cursor_get_name (cursor);
|
||||
texture = gdk_cursor_get_texture (cursor);
|
||||
|
||||
if (cursor_name)
|
||||
win32hcursor = gdk_win32hcursor_create_for_name (display, cursor_name);
|
||||
else if (texture)
|
||||
win32hcursor = gdk_win32hcursor_create_for_texture (display,
|
||||
texture,
|
||||
gdk_cursor_get_hotspot_x (cursor),
|
||||
gdk_cursor_get_hotspot_y (cursor));
|
||||
else
|
||||
{
|
||||
GdkTexture *texture = gdk_cursor_create_texture (cursor, 1);
|
||||
win32hcursor = gdk_win32hcursor_create_for_texture (display,
|
||||
texture,
|
||||
gdk_cursor_get_hotspot_x (cursor),
|
||||
gdk_cursor_get_hotspot_y (cursor));
|
||||
g_object_unref (texture);
|
||||
int size = display->cursor_theme_size;
|
||||
int width, height, hotspot_x, hotspot_y;
|
||||
|
||||
texture = gdk_cursor_get_texture_for_size (cursor, size, 1,
|
||||
&width, &height,
|
||||
&hotspot_x, &hotspot_y);
|
||||
if (texture)
|
||||
{
|
||||
win32hcursor = gdk_win32hcursor_create_for_texture (display,
|
||||
texture,
|
||||
hotspot_x,
|
||||
hotspot_y);
|
||||
g_object_unref (texture);
|
||||
}
|
||||
}
|
||||
|
||||
if (win32hcursor != NULL)
|
||||
|
||||
@@ -1627,7 +1627,7 @@ _gdk_win32_surface_lacks_wm_decorations (GdkSurface *window)
|
||||
has_any_decorations = FALSE;
|
||||
|
||||
if (style & (WS_BORDER | WS_THICKFRAME | WS_CAPTION |
|
||||
WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX))
|
||||
WS_SYSMENU | WS_MAXIMIZEBOX))
|
||||
has_any_decorations = TRUE;
|
||||
else
|
||||
GDK_NOTE (MISC, g_print ("Window %p (handle %p): has no decorations (style %lx)\n",
|
||||
@@ -1696,7 +1696,6 @@ _gdk_win32_surface_update_style_bits (GdkSurface *window)
|
||||
update_single_bit (&new_style, all, decorations & GDK_DECOR_RESIZEH, WS_THICKFRAME);
|
||||
update_single_bit (&new_style, all, decorations & GDK_DECOR_TITLE, WS_CAPTION);
|
||||
update_single_bit (&new_style, all, decorations & GDK_DECOR_MENU, WS_SYSMENU);
|
||||
update_single_bit (&new_style, all, decorations & GDK_DECOR_MINIMIZE, WS_MINIMIZEBOX);
|
||||
update_single_bit (&new_style, all, decorations & GDK_DECOR_MAXIMIZE, WS_MAXIMIZEBOX);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "gtk/gtksnapshot.h"
|
||||
#include "gsk/gskrenderer.h"
|
||||
#include "gsk/gskrendernodeprivate.h"
|
||||
|
||||
static void
|
||||
gdk_x11_cursor_remove_from_cache (gpointer data, GObject *cursor)
|
||||
{
|
||||
@@ -374,15 +370,32 @@ gdk_x11_display_get_xcursor (GdkDisplay *display,
|
||||
|
||||
if (gdk_cursor_get_name (cursor))
|
||||
xcursor = gdk_x11_cursor_create_for_name (display, gdk_cursor_get_name (cursor));
|
||||
else if (gdk_cursor_get_texture (cursor))
|
||||
xcursor = gdk_x11_cursor_create_for_texture (display,
|
||||
gdk_cursor_get_texture (cursor),
|
||||
gdk_cursor_get_hotspot_x (cursor),
|
||||
gdk_cursor_get_hotspot_y (cursor));
|
||||
else
|
||||
{
|
||||
GdkTexture *texture = gdk_cursor_create_texture (cursor, 1);
|
||||
int size;
|
||||
GdkTexture *texture;
|
||||
int width, height;
|
||||
int hotspot_x, hotspot_y;
|
||||
|
||||
xcursor = gdk_x11_cursor_create_for_texture (display,
|
||||
texture,
|
||||
gdk_cursor_get_hotspot_x (cursor),
|
||||
gdk_cursor_get_hotspot_y (cursor));
|
||||
g_object_unref (texture);
|
||||
size = XcursorGetDefaultSize (GDK_DISPLAY_XDISPLAY (display));
|
||||
|
||||
texture = gdk_cursor_get_texture_for_size (cursor, size, 1,
|
||||
&width, &height,
|
||||
&hotspot_x, &hotspot_y);
|
||||
|
||||
if (texture)
|
||||
{
|
||||
xcursor = gdk_x11_cursor_create_for_texture (display,
|
||||
texture,
|
||||
hotspot_x,
|
||||
hotspot_y);
|
||||
g_object_unref (texture);
|
||||
}
|
||||
}
|
||||
|
||||
if (xcursor != None)
|
||||
|
||||
@@ -918,12 +918,7 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
return cache->image;
|
||||
}
|
||||
|
||||
/* Note: we want to scale the font to the required size *and* ensure that
|
||||
* metrics hinting is off. The latter is necessary since pango lets metrics
|
||||
* hinting influence the rendering of hexboxes, and we get bad outcomes if
|
||||
* that happens.
|
||||
*/
|
||||
scaled_font = gsk_reload_font (font, scale, CAIRO_HINT_METRICS_OFF, CAIRO_HINT_STYLE_DEFAULT, CAIRO_ANTIALIAS_DEFAULT);
|
||||
scaled_font = gsk_reload_font (font, scale, CAIRO_HINT_METRICS_DEFAULT, CAIRO_HINT_STYLE_DEFAULT, CAIRO_ANTIALIAS_DEFAULT);
|
||||
|
||||
subpixel_x = (flags & 3) / 4.f;
|
||||
subpixel_y = ((flags >> 2) & 3) / 4.f;
|
||||
|
||||
@@ -2077,6 +2077,8 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self,
|
||||
/* now intersect with actual node bounds */
|
||||
if (!gsk_rect_intersection (&clip_bounds, &node->bounds, &clip_bounds))
|
||||
return;
|
||||
clip_bounds.size.width = ceilf (clip_bounds.size.width);
|
||||
clip_bounds.size.height = ceilf (clip_bounds.size.height);
|
||||
offscreen = gsk_gpu_node_processor_create_offscreen (self->frame,
|
||||
graphene_vec2_one (),
|
||||
&clip_bounds,
|
||||
|
||||
@@ -245,7 +245,9 @@ gsk_gpu_render_pass_end_op_vk_command (GskGpuOp *op,
|
||||
|
||||
vkCmdEndRenderPass (state->vk_command_buffer);
|
||||
|
||||
if (gsk_gpu_image_get_flags (self->target) & GSK_GPU_IMAGE_CAN_MIPMAP)
|
||||
if ((gsk_gpu_image_get_flags (self->target) & GSK_GPU_IMAGE_CAN_MIPMAP) &&
|
||||
(gsk_gpu_image_get_width (self->target) > 1 ||
|
||||
gsk_gpu_image_get_height (self->target) > 1))
|
||||
{
|
||||
vkCmdPipelineBarrier (state->vk_command_buffer,
|
||||
gsk_vulkan_image_get_vk_pipeline_stage (GSK_VULKAN_IMAGE (self->target)),
|
||||
|
||||
@@ -71,7 +71,7 @@ static inline guint
|
||||
gsk_vulkan_mipmap_levels (gsize width,
|
||||
gsize height)
|
||||
{
|
||||
return g_bit_nth_msf (MAX (width, height) - 1, -1) + 1;
|
||||
return g_bit_nth_msf (MAX (MAX (width, height) - 1, 1), -1) + 1;
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -55,33 +55,86 @@ struct _GskOffload
|
||||
GskOffloadInfo *last_info;
|
||||
};
|
||||
|
||||
static GdkTextureTransform
|
||||
find_texture_transform (GskTransform *transform)
|
||||
{
|
||||
float sx, sy, dx, dy;
|
||||
|
||||
g_assert (gsk_transform_get_category (transform) >= GSK_TRANSFORM_CATEGORY_2D_AFFINE);
|
||||
|
||||
gsk_transform_to_affine (transform, &sx, &sy, &dx, &dy);
|
||||
|
||||
if (sx > 0)
|
||||
{
|
||||
if (sy > 0)
|
||||
return GDK_TEXTURE_TRANSFORM_NORMAL;
|
||||
else
|
||||
return GDK_TEXTURE_TRANSFORM_FLIPPED_180;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sy > 0)
|
||||
return GDK_TEXTURE_TRANSFORM_FLIPPED;
|
||||
else
|
||||
return GDK_TEXTURE_TRANSFORM_180;
|
||||
}
|
||||
}
|
||||
|
||||
static GdkTexture *
|
||||
find_texture_to_attach (GskOffload *self,
|
||||
GdkSubsurface *subsurface,
|
||||
const GskRenderNode *node,
|
||||
graphene_rect_t *out_clip)
|
||||
const GskRenderNode *subsurface_node,
|
||||
graphene_rect_t *out_clip,
|
||||
GdkTextureTransform *out_texture_transform,
|
||||
gboolean *out_lightbox)
|
||||
{
|
||||
GdkSubsurface *subsurface;
|
||||
const GskRenderNode *node;
|
||||
gboolean has_clip = FALSE;
|
||||
graphene_rect_t clip;
|
||||
GskTransform *transform = NULL;
|
||||
GdkTexture *ret = NULL;
|
||||
|
||||
*out_texture_transform = GDK_TEXTURE_TRANSFORM_NORMAL;
|
||||
*out_lightbox = FALSE;
|
||||
|
||||
subsurface = gsk_subsurface_node_get_subsurface (subsurface_node);
|
||||
node = subsurface_node;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
switch ((int)GSK_RENDER_NODE_TYPE (node))
|
||||
switch ((int) GSK_RENDER_NODE_TYPE (node))
|
||||
{
|
||||
case GSK_DEBUG_NODE:
|
||||
case GSK_SUBSURFACE_NODE:
|
||||
node = gsk_debug_node_get_child (node);
|
||||
break;
|
||||
|
||||
case GSK_CONTAINER_NODE:
|
||||
if (gsk_container_node_get_n_children (node) != 1)
|
||||
if (gsk_container_node_get_n_children (node) == 1)
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
"Can't offload subsurface %p: too much content, container with %d children",
|
||||
subsurface, gsk_container_node_get_n_children (node));
|
||||
return NULL;
|
||||
node = gsk_container_node_get_child (node, 0);
|
||||
break;
|
||||
}
|
||||
node = gsk_container_node_get_child (node, 0);
|
||||
break;
|
||||
else if (gsk_container_node_get_n_children (node) == 2)
|
||||
{
|
||||
GskRenderNode *child;
|
||||
|
||||
child = gsk_container_node_get_child (node, 0);
|
||||
if (GSK_RENDER_NODE_TYPE (child) == GSK_COLOR_NODE &&
|
||||
gsk_rect_equal (&child->bounds, &subsurface_node->bounds) &&
|
||||
gdk_rgba_equal (gsk_color_node_get_color (child), &(GdkRGBA) { 0, 0, 0, 1 }))
|
||||
{
|
||||
g_print ("found lightbox\n");
|
||||
*out_lightbox = TRUE;
|
||||
node = gsk_container_node_get_child (node, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
"Can't offload subsurface %p: too much content, container with %d children",
|
||||
subsurface, gsk_container_node_get_n_children (node));
|
||||
goto out;
|
||||
|
||||
case GSK_TRANSFORM_NODE:
|
||||
{
|
||||
@@ -94,7 +147,7 @@ find_texture_to_attach (GskOffload *self,
|
||||
"Can't offload subsurface %p: transform %s is not just scale/translate",
|
||||
subsurface, s);
|
||||
g_free (s);
|
||||
return NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (has_clip)
|
||||
@@ -104,6 +157,8 @@ find_texture_to_attach (GskOffload *self,
|
||||
gsk_transform_unref (inv);
|
||||
}
|
||||
|
||||
transform = gsk_transform_transform (transform, gsk_transform_ref (t));
|
||||
|
||||
node = gsk_transform_node_get_child (node);
|
||||
}
|
||||
break;
|
||||
@@ -118,7 +173,7 @@ find_texture_to_attach (GskOffload *self,
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
"Can't offload subsurface %p: empty clip", subsurface);
|
||||
return NULL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -135,6 +190,8 @@ find_texture_to_attach (GskOffload *self,
|
||||
{
|
||||
GdkTexture *texture = gsk_texture_node_get_texture (node);
|
||||
|
||||
*out_texture_transform = find_texture_transform (transform);
|
||||
|
||||
if (has_clip)
|
||||
{
|
||||
float dx = node->bounds.origin.x;
|
||||
@@ -157,16 +214,22 @@ find_texture_to_attach (GskOffload *self,
|
||||
out_clip->size.height = gdk_texture_get_height (texture);
|
||||
}
|
||||
|
||||
return texture;
|
||||
ret = texture;
|
||||
goto out;
|
||||
}
|
||||
|
||||
default:
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
"Can't offload subsurface %p: Only textures supported but found %s",
|
||||
subsurface, g_type_name_from_instance ((GTypeInstance *) node));
|
||||
return NULL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
g_clear_pointer (&transform, gsk_transform_unref);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -551,9 +614,12 @@ complex_clip:
|
||||
case GSK_SUBSURFACE_NODE:
|
||||
{
|
||||
GdkSubsurface *subsurface = gsk_subsurface_node_get_subsurface (node);
|
||||
GskTransform *transform;
|
||||
|
||||
GskOffloadInfo *info = find_subsurface_info (self, subsurface);
|
||||
|
||||
transform = self->transforms ? (GskTransform *) self->transforms->data : NULL;
|
||||
|
||||
if (info == NULL)
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
@@ -566,8 +632,7 @@ complex_clip:
|
||||
"Can't offload subsurface %p: clipped",
|
||||
subsurface);
|
||||
}
|
||||
else if (self->transforms &&
|
||||
gsk_transform_get_category ((GskTransform *)self->transforms->data) < GSK_TRANSFORM_CATEGORY_2D_AFFINE)
|
||||
else if (gsk_transform_get_category (transform) < GSK_TRANSFORM_CATEGORY_2D_AFFINE)
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
|
||||
"Can't offload subsurface %p: non-affine transform",
|
||||
@@ -575,14 +640,11 @@ complex_clip:
|
||||
}
|
||||
else
|
||||
{
|
||||
graphene_rect_t clip;
|
||||
|
||||
info->texture = find_texture_to_attach (self, subsurface, gsk_subsurface_node_get_child (node), &clip);
|
||||
info->texture = find_texture_to_attach (self, node, &info->source, &info->transform, &info->lightbox);
|
||||
if (info->texture)
|
||||
{
|
||||
info->can_offload = TRUE;
|
||||
info->can_raise = TRUE;
|
||||
info->source = clip;
|
||||
transform_bounds (self, &node->bounds, &info->dest);
|
||||
info->place_above = self->last_info ? self->last_info->subsurface : NULL;
|
||||
self->last_info = info;
|
||||
@@ -653,12 +715,16 @@ gsk_offload_new (GdkSurface *surface,
|
||||
info->texture,
|
||||
&info->source,
|
||||
&info->dest,
|
||||
info->transform,
|
||||
info->lightbox,
|
||||
TRUE, NULL);
|
||||
else
|
||||
info->is_offloaded = gdk_subsurface_attach (info->subsurface,
|
||||
info->texture,
|
||||
&info->source,
|
||||
&info->dest,
|
||||
info->transform,
|
||||
info->lightbox,
|
||||
info->place_above != NULL,
|
||||
info->place_above);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ typedef struct
|
||||
GdkSubsurface *place_above;
|
||||
graphene_rect_t dest;
|
||||
graphene_rect_t source;
|
||||
GdkTextureTransform transform;
|
||||
gboolean lightbox;
|
||||
|
||||
guint was_offloaded : 1;
|
||||
guint can_offload : 1;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gskresources.h"
|
||||
#include "gskprivate.h"
|
||||
|
||||
#include <cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#ifdef HAVE_PANGOFT
|
||||
#include <pango/pangoft2.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
static gpointer
|
||||
@@ -47,12 +51,6 @@ gsk_reload_font (PangoFont *font,
|
||||
static cairo_font_options_t *options = NULL;
|
||||
static PangoContext *context = NULL;
|
||||
cairo_scaled_font_t *sf;
|
||||
#if !PANGO_VERSION_CHECK (1, 52, 0)
|
||||
PangoFontDescription *desc;
|
||||
FcPattern *pattern;
|
||||
double dpi;
|
||||
int size;
|
||||
#endif
|
||||
|
||||
/* These requests often come in sequentially so keep the result
|
||||
* around and re-use it if everything matches.
|
||||
@@ -115,53 +113,11 @@ gsk_reload_font (PangoFont *font,
|
||||
|
||||
pango_cairo_context_set_font_options (context, options);
|
||||
|
||||
#if PANGO_VERSION_CHECK (1, 52, 0)
|
||||
last_result = pango_font_map_reload_font (pango_font_get_font_map (font), font, scale, context, NULL);
|
||||
#else
|
||||
|
||||
pattern = pango_fc_font_get_pattern (PANGO_FC_FONT (font));
|
||||
if (FcPatternGetDouble (pattern, FC_DPI, 0, &dpi) == FcResultMatch)
|
||||
pango_cairo_context_set_resolution (context, dpi);
|
||||
|
||||
desc = pango_font_describe_with_absolute_size (font);
|
||||
size = pango_font_description_get_size (desc);
|
||||
pango_font_description_set_absolute_size (desc, size * scale);
|
||||
last_result = pango_font_map_load_font (pango_font_get_font_map (font), context, desc);
|
||||
pango_font_description_free (desc);
|
||||
#endif
|
||||
|
||||
return g_object_ref (last_result);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gsk_get_unhinted_glyph_string_extents:
|
||||
* @glyphs: a `PangoGlyphString`
|
||||
* @font: a `PangoFont`
|
||||
* @ink_rect: (out): rectangle used to store the extents of the glyph string as drawn
|
||||
*
|
||||
* Compute the ink extents of a glyph string.
|
||||
*
|
||||
* This is like [method@Pango.GlyphString.extents], but it
|
||||
* ignores hinting of the font.
|
||||
*/
|
||||
void
|
||||
gsk_get_unhinted_glyph_string_extents (PangoGlyphString *glyphs,
|
||||
PangoFont *font,
|
||||
PangoRectangle *ink_rect)
|
||||
{
|
||||
PangoFont *unhinted;
|
||||
|
||||
unhinted = gsk_reload_font (font,
|
||||
1.0,
|
||||
CAIRO_HINT_METRICS_OFF,
|
||||
CAIRO_HINT_STYLE_NONE,
|
||||
CAIRO_ANTIALIAS_DEFAULT);
|
||||
|
||||
pango_glyph_string_extents (glyphs, unhinted, ink_rect, NULL);
|
||||
|
||||
g_object_unref (unhinted);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gsk_font_get_hint_style:
|
||||
* @font: a `PangoFont`
|
||||
|
||||
@@ -14,10 +14,6 @@ PangoFont *gsk_reload_font (PangoFont *font,
|
||||
cairo_hint_style_t hint_style,
|
||||
cairo_antialias_t antialias);
|
||||
|
||||
void gsk_get_unhinted_glyph_string_extents (PangoGlyphString *glyphs,
|
||||
PangoFont *font,
|
||||
PangoRectangle *ink_rect);
|
||||
|
||||
cairo_hint_style_t gsk_font_get_hint_style (PangoFont *font);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -5824,7 +5824,7 @@ gsk_text_node_new (PangoFont *font,
|
||||
PangoGlyphInfo *glyph_infos;
|
||||
int n;
|
||||
|
||||
gsk_get_unhinted_glyph_string_extents (glyphs, font, &ink_rect);
|
||||
pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
|
||||
|
||||
/* Don't create nodes with empty bounds */
|
||||
if (ink_rect.width == 0 || ink_rect.height == 0)
|
||||
|
||||
@@ -962,16 +962,12 @@ create_ascii_glyphs (PangoFont *font)
|
||||
for (i = MIN_ASCII_GLYPH; i < MAX_ASCII_GLYPH; i++)
|
||||
{
|
||||
const char text[2] = { i, 0 };
|
||||
PangoShapeFlags flags = 0;
|
||||
|
||||
if (cairo_version () < CAIRO_VERSION_ENCODE (1, 17, 4))
|
||||
flags = PANGO_SHAPE_ROUND_POSITIONS;
|
||||
|
||||
pango_shape_with_flags (text, 1,
|
||||
text, 1,
|
||||
¬_a_hack,
|
||||
glyph_string,
|
||||
flags);
|
||||
PANGO_SHAPE_NONE);
|
||||
|
||||
if (glyph_string->num_glyphs != 1)
|
||||
{
|
||||
|
||||
@@ -48,114 +48,6 @@ find_first_accessible_non_socket (GtkAccessible *accessible)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
translate_coordinates_to_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo)
|
||||
{
|
||||
GtkAccessible *parent;
|
||||
int x, y, width, height;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_SCREEN)
|
||||
{
|
||||
*xo = 0;
|
||||
*yo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gtk_accessible_get_bounds (accessible, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = xi;
|
||||
*yo = yi;
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform coords to our parent, we will need that in any case
|
||||
*xo = xi - x;
|
||||
*yo = yi - y;
|
||||
|
||||
// If that's what the caller requested, we're done
|
||||
if (coordtype == ATSPI_COORD_TYPE_PARENT)
|
||||
return;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_WINDOW)
|
||||
{
|
||||
parent = gtk_accessible_get_accessible_parent (accessible);
|
||||
while (parent != NULL)
|
||||
{
|
||||
g_object_unref (parent);
|
||||
|
||||
if (gtk_accessible_get_bounds (parent, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = *xo - x;
|
||||
*yo = *yo - y;
|
||||
parent = gtk_accessible_get_accessible_parent (parent);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static void
|
||||
translate_coordinates_from_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo)
|
||||
{
|
||||
GtkAccessible *parent;
|
||||
int x, y, width, height;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_SCREEN)
|
||||
{
|
||||
*xo = 0;
|
||||
*yo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gtk_accessible_get_bounds (accessible, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = xi;
|
||||
*yo = yi;
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform coords to our parent, we will need that in any case
|
||||
*xo = xi + x;
|
||||
*yo = yi + y;
|
||||
|
||||
// If that's what the caller requested, we're done
|
||||
if (coordtype == ATSPI_COORD_TYPE_PARENT)
|
||||
return;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_WINDOW)
|
||||
{
|
||||
parent = gtk_accessible_get_accessible_parent (accessible);
|
||||
while (parent != NULL)
|
||||
{
|
||||
g_object_unref (parent);
|
||||
|
||||
if (gtk_accessible_get_bounds (parent, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = *xo + x;
|
||||
*yo = *yo + y;
|
||||
parent = gtk_accessible_get_accessible_parent (parent);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static GtkAccessible *
|
||||
accessible_at_point (GtkAccessible *parent,
|
||||
int x,
|
||||
@@ -209,7 +101,7 @@ component_handle_method (GDBusConnection *connection,
|
||||
|
||||
g_variant_get (parameters, "(iiu)", &x, &y, &coordtype);
|
||||
|
||||
translate_coordinates_to_accessible (accessible, coordtype, x, y, &x, &y);
|
||||
gtk_at_spi_translate_coordinates_to_accessible (accessible, coordtype, x, y, &x, &y);
|
||||
|
||||
if (gtk_accessible_get_bounds (accessible, &bounds_x, &bounds_y, &width, &height))
|
||||
ret = x >= 0 && x <= bounds_x && y >= 0 && y <= bounds_y;
|
||||
@@ -225,8 +117,7 @@ component_handle_method (GDBusConnection *connection,
|
||||
GtkAccessible *child;
|
||||
|
||||
g_variant_get (parameters, "(iiu)", &x, &y, &coordtype);
|
||||
|
||||
translate_coordinates_to_accessible (accessible, coordtype, x, y, &x, &y);
|
||||
gtk_at_spi_translate_coordinates_to_accessible (accessible, coordtype, x, y, &x, &y);
|
||||
|
||||
child = accessible_at_point (accessible, x, y, TRUE);
|
||||
if (!child)
|
||||
@@ -255,7 +146,7 @@ component_handle_method (GDBusConnection *connection,
|
||||
|
||||
g_variant_get (parameters, "(u)", &coordtype);
|
||||
|
||||
translate_coordinates_from_accessible (accessible, coordtype, 0, 0, &x, &y);
|
||||
gtk_at_spi_translate_coordinates_from_accessible (accessible, coordtype, 0, 0, &x, &y);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("((iiii))", x, y, width, height));
|
||||
}
|
||||
@@ -266,7 +157,7 @@ component_handle_method (GDBusConnection *connection,
|
||||
|
||||
g_variant_get (parameters, "(u)", &coordtype);
|
||||
|
||||
translate_coordinates_from_accessible (accessible, coordtype, 0, 0, &x, &y);
|
||||
gtk_at_spi_translate_coordinates_from_accessible (accessible, coordtype, 0, 0, &x, &y);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(ii)", x, y));
|
||||
}
|
||||
|
||||
@@ -367,3 +367,112 @@ gtk_at_spi_emit_children_changed (GDBusConnection *connection,
|
||||
g_variant_new ("(siiv@(so))", change, idx, 0, child_ref, sender_ref),
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gtk_at_spi_translate_coordinates_to_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo)
|
||||
{
|
||||
GtkAccessible *parent;
|
||||
int x, y, width, height;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_SCREEN)
|
||||
{
|
||||
*xo = 0;
|
||||
*yo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gtk_accessible_get_bounds (accessible, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = xi;
|
||||
*yo = yi;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Transform coords to our parent, we will need that in any case */
|
||||
*xo = xi - x;
|
||||
*yo = yi - y;
|
||||
|
||||
/* If that's what the caller requested, we're done */
|
||||
if (coordtype == ATSPI_COORD_TYPE_PARENT)
|
||||
return;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_WINDOW)
|
||||
{
|
||||
parent = gtk_accessible_get_accessible_parent (accessible);
|
||||
while (parent != NULL)
|
||||
{
|
||||
g_object_unref (parent);
|
||||
|
||||
if (gtk_accessible_get_bounds (parent, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = *xo - x;
|
||||
*yo = *yo - y;
|
||||
parent = gtk_accessible_get_accessible_parent (parent);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
void
|
||||
gtk_at_spi_translate_coordinates_from_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo)
|
||||
{
|
||||
GtkAccessible *parent;
|
||||
int x, y, width, height;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_SCREEN)
|
||||
{
|
||||
*xo = 0;
|
||||
*yo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gtk_accessible_get_bounds (accessible, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = xi;
|
||||
*yo = yi;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Transform coords to our parent, we will need that in any case */
|
||||
*xo = xi + x;
|
||||
*yo = yi + y;
|
||||
|
||||
/* If that's what the caller requested, we're done */
|
||||
if (coordtype == ATSPI_COORD_TYPE_PARENT)
|
||||
return;
|
||||
|
||||
if (coordtype == ATSPI_COORD_TYPE_WINDOW)
|
||||
{
|
||||
parent = gtk_accessible_get_accessible_parent (accessible);
|
||||
while (parent != NULL)
|
||||
{
|
||||
g_object_unref (parent);
|
||||
|
||||
if (gtk_accessible_get_bounds (parent, &x, &y, &width, &height))
|
||||
{
|
||||
*xo = *xo + x;
|
||||
*yo = *yo + y;
|
||||
parent = gtk_accessible_get_accessible_parent (parent);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -39,4 +39,21 @@ gtk_at_spi_emit_children_changed (GDBusConnection *connection,
|
||||
GVariant *child_ref,
|
||||
GVariant *sender_ref);
|
||||
|
||||
void
|
||||
gtk_at_spi_translate_coordinates_to_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo);
|
||||
|
||||
|
||||
void
|
||||
gtk_at_spi_translate_coordinates_from_accessible (GtkAccessible *accessible,
|
||||
AtspiCoordType coordtype,
|
||||
int xi,
|
||||
int yi,
|
||||
int *xo,
|
||||
int *yo);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -426,6 +426,59 @@ gtk_accessible_text_get_attributes_run (GtkAccessibleText *self,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_extents:
|
||||
* @self: a `GtkAccessibleText`
|
||||
* @start: start offset, in characters
|
||||
* @end: end offset, in characters
|
||||
* @extents: (out caller-allocates): return location for the extents
|
||||
*
|
||||
* Obtains the extents of a range of text, in widget coordinates.
|
||||
*
|
||||
* Returns: true if the extents were filled in, false otherwise
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
gboolean
|
||||
gtk_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), FALSE);
|
||||
g_return_val_if_fail (start <= end, FALSE);
|
||||
g_return_val_if_fail (extents != NULL, FALSE);
|
||||
|
||||
if (GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_extents != NULL)
|
||||
return GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_extents (self, start, end, extents);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_get_text_offset:
|
||||
* @self: a `GtkAccessibleText`
|
||||
* @point: a point in widget coordinates
|
||||
* @offset: (out): return location for the text offset at @point
|
||||
*
|
||||
* Determines the text offset at the given position in the
|
||||
* widget.
|
||||
*
|
||||
* Returns: true if the offset was set, and false otherwise
|
||||
*/
|
||||
gboolean
|
||||
gtk_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), FALSE);
|
||||
|
||||
if (GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_offset != NULL)
|
||||
return GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_offset (self, point, offset);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_accessible_text_update_caret_position:
|
||||
* @self: the accessible object
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkaccessible.h>
|
||||
#include <graphene.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -255,6 +256,40 @@ struct _GtkAccessibleTextInterface
|
||||
void (* get_default_attributes) (GtkAccessibleText *self,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_extents:
|
||||
* @self: the accessible object
|
||||
* @start: the start offset, in characters
|
||||
* @end: the end offset, in characters,
|
||||
* @extents (out caller-allocates): return location for the extents
|
||||
*
|
||||
* Obtains the extents of a range of text, in widget coordinates.
|
||||
*
|
||||
* Returns: true if the extents were filled in, false otherwise
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
gboolean (* get_extents) (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_offset:
|
||||
* @self: the accessible object
|
||||
* @point: a point in widget coordinates of @self
|
||||
* @offset: (out): return location for the text offset at @point
|
||||
*
|
||||
* Gets the text offset at a given point.
|
||||
*
|
||||
* Returns: true if the offset was set, false otherwise
|
||||
*
|
||||
* Since: 4.16
|
||||
*/
|
||||
gboolean (* get_offset) (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
|
||||
@@ -52,4 +52,15 @@ gtk_accessible_text_get_attributes_run (GtkAccessibleText *self,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
|
||||
gboolean
|
||||
gtk_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents);
|
||||
|
||||
gboolean
|
||||
gtk_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
#include "gtkcolorpickershellprivate.h"
|
||||
#include "gtkcolorpickerkwinprivate.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "gtkcolorpickerquartzprivate.h"
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include "gtkcolorpickerwin32private.h"
|
||||
#endif
|
||||
@@ -58,13 +62,16 @@ gtk_color_picker_new (void)
|
||||
{
|
||||
GtkColorPicker *picker = NULL;
|
||||
|
||||
#if defined (G_OS_UNIX)
|
||||
#if defined (G_OS_UNIX) && !defined(__APPLE__)
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_portal_new ();
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_shell_new ();
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_kwin_new ();
|
||||
#elif defined (__APPLE__)
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_quartz_new ();
|
||||
#elif defined (G_OS_WIN32)
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_win32_new ();
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2024 the GTK team
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "gtkcolorpickerquartzprivate.h"
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
struct _GtkColorPickerQuartz
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
NSColorSampler *sampler;
|
||||
GTask *task;
|
||||
};
|
||||
|
||||
struct _GtkColorPickerQuartzClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static GInitableIface *initable_parent_iface;
|
||||
static void gtk_color_picker_quartz_initable_iface_init (GInitableIface *iface);
|
||||
static void gtk_color_picker_quartz_iface_init (GtkColorPickerInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkColorPickerQuartz, gtk_color_picker_quartz, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gtk_color_picker_quartz_initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_COLOR_PICKER, gtk_color_picker_quartz_iface_init))
|
||||
|
||||
static gboolean
|
||||
gtk_color_picker_quartz_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GtkColorPickerQuartz *picker = GTK_COLOR_PICKER_QUARTZ (initable);
|
||||
|
||||
picker->sampler = [[NSColorSampler alloc] init];
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_initable_iface_init (GInitableIface *iface)
|
||||
{
|
||||
initable_parent_iface = g_type_interface_peek_parent (iface);
|
||||
iface->init = gtk_color_picker_quartz_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_init (GtkColorPickerQuartz *picker)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_finalize (GObject *object)
|
||||
{
|
||||
GtkColorPickerQuartz *picker = GTK_COLOR_PICKER_QUARTZ (object);
|
||||
|
||||
g_clear_object (&picker->task);
|
||||
if (picker->sampler != NULL)
|
||||
{
|
||||
[picker->sampler release];
|
||||
picker->sampler = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gtk_color_picker_quartz_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_class_init (GtkColorPickerQuartzClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = gtk_color_picker_quartz_finalize;
|
||||
}
|
||||
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_quartz_new (void)
|
||||
{
|
||||
return GTK_COLOR_PICKER (g_initable_new (GTK_TYPE_COLOR_PICKER_QUARTZ, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_pick (GtkColorPicker *cp,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkColorPickerQuartz *picker = GTK_COLOR_PICKER_QUARTZ (cp);
|
||||
|
||||
if (picker->task)
|
||||
return;
|
||||
|
||||
picker->task = g_task_new (picker, NULL, callback, user_data);
|
||||
|
||||
[picker->sampler showSamplerWithSelectionHandler:^(NSColor *selectedColor) {
|
||||
if (selectedColor == NULL)
|
||||
{
|
||||
g_task_return_new_error (picker->task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"No color received");
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkRGBA rgba = (GdkRGBA){
|
||||
[selectedColor redComponent],
|
||||
[selectedColor greenComponent],
|
||||
[selectedColor blueComponent],
|
||||
[selectedColor alphaComponent],
|
||||
};
|
||||
|
||||
g_task_return_pointer (picker->task,
|
||||
gdk_rgba_copy (&rgba),
|
||||
(GDestroyNotify) gdk_rgba_free);
|
||||
}
|
||||
|
||||
g_clear_object (&picker->task);
|
||||
}];
|
||||
}
|
||||
|
||||
static GdkRGBA *
|
||||
gtk_color_picker_quartz_pick_finish (GtkColorPicker *cp,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (res, cp), NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_quartz_iface_init (GtkColorPickerInterface *iface)
|
||||
{
|
||||
iface->pick = gtk_color_picker_quartz_pick;
|
||||
iface->pick_finish = gtk_color_picker_quartz_pick_finish;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2024 the GTK team
|
||||
*
|
||||
* 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 <gtk/gtkcolorpickerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_TYPE_COLOR_PICKER_QUARTZ gtk_color_picker_quartz_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (GtkColorPickerQuartz, gtk_color_picker_quartz, GTK, COLOR_PICKER_QUARTZ, GObject)
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkColorPicker * gtk_color_picker_quartz_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
@@ -31,7 +31,7 @@
|
||||
* It presents a `GListModel` and fills it asynchronously with the `GFileInfo`s
|
||||
* returned from that function.
|
||||
*
|
||||
* Enumeration will start automatically when a the
|
||||
* Enumeration will start automatically when the
|
||||
* [property@Gtk.DirectoryList:file] property is set.
|
||||
*
|
||||
* While the `GtkDirectoryList` is being filled, the
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gdk/gdkgltextureprivate.h"
|
||||
#include "gdk/gdkglcontextprivate.h"
|
||||
#include "gdk/gdkdmabuftexturebuilderprivate.h"
|
||||
#include "gdk/gdkdmabuftextureprivate.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
@@ -715,6 +721,26 @@ release_texture (gpointer data)
|
||||
texture->holder = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
release_dmabuf (const GdkDmabuf *dmabuf)
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
for (unsigned int i = 0; i < dmabuf->n_planes; i++)
|
||||
close (dmabuf->planes[i].fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
release_dmabuf_texture (gpointer data)
|
||||
{
|
||||
Texture *texture = data;
|
||||
|
||||
release_dmabuf (gdk_dmabuf_texture_get_dmabuf (GDK_DMABUF_TEXTURE (texture->holder)));
|
||||
g_object_set_data (G_OBJECT (texture->holder), "gltexture", NULL);
|
||||
|
||||
texture->holder = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gl_area_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
@@ -758,6 +784,8 @@ gtk_gl_area_snapshot (GtkWidget *widget,
|
||||
{
|
||||
Texture *texture;
|
||||
gpointer sync = NULL;
|
||||
GdkTexture *gltexture;
|
||||
GdkDmabuf dmabuf;
|
||||
|
||||
if (priv->needs_render || priv->auto_render)
|
||||
{
|
||||
@@ -781,9 +809,33 @@ gtk_gl_area_snapshot (GtkWidget *widget,
|
||||
|
||||
gdk_gl_texture_builder_set_sync (texture->builder, sync);
|
||||
|
||||
texture->holder = gdk_gl_texture_builder_build (texture->builder,
|
||||
release_texture,
|
||||
texture);
|
||||
gltexture = gdk_gl_texture_builder_build (texture->builder,
|
||||
release_texture,
|
||||
texture);
|
||||
|
||||
if (gdk_gl_context_export_dmabuf (priv->context,
|
||||
gdk_gl_texture_builder_get_id (texture->builder),
|
||||
&dmabuf))
|
||||
{
|
||||
GdkDmabufTextureBuilder *builder = gdk_dmabuf_texture_builder_new ();
|
||||
|
||||
gdk_dmabuf_texture_builder_set_display (builder, gdk_gl_context_get_display (priv->context));
|
||||
gdk_dmabuf_texture_builder_set_width (builder, gdk_texture_get_width (gltexture));
|
||||
gdk_dmabuf_texture_builder_set_height (builder, gdk_texture_get_height (gltexture));
|
||||
gdk_dmabuf_texture_builder_set_premultiplied (builder, TRUE);
|
||||
gdk_dmabuf_texture_builder_set_dmabuf (builder, &dmabuf);
|
||||
|
||||
texture->holder = gdk_dmabuf_texture_builder_build (builder, release_dmabuf_texture, texture, NULL);
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
if (texture->holder != NULL)
|
||||
g_object_set_data_full (G_OBJECT (texture->holder), "gltexture", gltexture, g_object_unref);
|
||||
else
|
||||
release_dmabuf (&dmabuf);
|
||||
}
|
||||
else
|
||||
texture->holder = gltexture;
|
||||
|
||||
/* Our texture is rendered by OpenGL, so it is upside down,
|
||||
* compared to what GSK expects, so flip it back.
|
||||
|
||||
@@ -208,6 +208,13 @@ gtk_graphics_offload_snapshot (GtkWidget *widget,
|
||||
if (self->subsurface)
|
||||
gtk_snapshot_push_subsurface (snapshot, self->subsurface);
|
||||
|
||||
if (self->enabled == GTK_GRAPHICS_OFFLOAD_ENABLED_WITH_LIGHTBOX)
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&(GdkRGBA) { 0, 0, 0, 1 },
|
||||
&GRAPHENE_RECT_INIT (0, 0,
|
||||
gtk_widget_get_width (widget),
|
||||
gtk_widget_get_height (widget)));
|
||||
|
||||
gtk_widget_snapshot_child (widget, self->child, snapshot);
|
||||
|
||||
if (self->subsurface)
|
||||
|
||||
@@ -57,6 +57,7 @@ typedef enum
|
||||
{
|
||||
GTK_GRAPHICS_OFFLOAD_ENABLED,
|
||||
GTK_GRAPHICS_OFFLOAD_DISABLED,
|
||||
GTK_GRAPHICS_OFFLOAD_ENABLED_WITH_LIGHTBOX,
|
||||
} GtkGraphicsOffloadEnabled;
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
|
||||
@@ -4004,7 +4004,7 @@ gtk_icon_paintable_new_for_file (GFile *file,
|
||||
char *uri;
|
||||
|
||||
uri = g_file_get_uri (file);
|
||||
icon->filename = g_strdup (uri + 11); /* resource:// */
|
||||
icon->filename = g_strdup (uri + strlen ("resource://"));
|
||||
g_free (uri);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -461,6 +461,40 @@ gtk_inscription_get_layout_location (GtkInscription *self,
|
||||
*y_out = y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_inscription_get_layout_index (GtkInscription *self,
|
||||
int x,
|
||||
int y,
|
||||
int *index)
|
||||
{
|
||||
int trailing = 0;
|
||||
const char *cluster;
|
||||
const char *cluster_end;
|
||||
gboolean inside;
|
||||
float lx, ly;
|
||||
|
||||
*index = 0;
|
||||
|
||||
gtk_inscription_get_layout_location (self, &lx, &ly);
|
||||
|
||||
inside = pango_layout_xy_to_index (self->layout,
|
||||
(x - lx) * PANGO_SCALE,
|
||||
(y - ly) * PANGO_SCALE,
|
||||
index, &trailing);
|
||||
|
||||
cluster = self->text + *index;
|
||||
cluster_end = cluster;
|
||||
while (trailing)
|
||||
{
|
||||
cluster_end = g_utf8_next_char (cluster_end);
|
||||
--trailing;
|
||||
}
|
||||
|
||||
*index += (cluster_end - cluster);
|
||||
|
||||
return inside;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_inscription_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
@@ -1435,6 +1469,55 @@ gtk_inscription_accessible_text_get_default_attributes (GtkAccessibleText *sel
|
||||
*attribute_values = values;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_inscription_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents)
|
||||
{
|
||||
GtkInscription *inscription = GTK_INSCRIPTION (self);
|
||||
PangoLayout *layout;
|
||||
const char *text;
|
||||
float lx, ly;
|
||||
cairo_region_t *range_clip;
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
int range[2];
|
||||
|
||||
layout = inscription->layout;
|
||||
text = inscription->text;
|
||||
gtk_inscription_get_layout_location (inscription, &lx, &ly);
|
||||
|
||||
range[0] = g_utf8_pointer_to_offset (text, text + start);
|
||||
range[1] = g_utf8_pointer_to_offset (text, text + end);
|
||||
|
||||
range_clip = gdk_pango_layout_get_clip_region (layout, lx, ly, range, 1);
|
||||
cairo_region_get_extents (range_clip, &clip_rect);
|
||||
cairo_region_destroy (range_clip);
|
||||
|
||||
extents->origin.x = clip_rect.x;
|
||||
extents->origin.y = clip_rect.y;
|
||||
extents->size.width = clip_rect.width;
|
||||
extents->size.height = clip_rect.height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_inscription_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset)
|
||||
{
|
||||
GtkInscription *inscription = GTK_INSCRIPTION (self);
|
||||
int index;
|
||||
|
||||
if (!gtk_inscription_get_layout_index (inscription, point->x, point->y, &index))
|
||||
return FALSE;
|
||||
|
||||
*offset = (unsigned int) g_utf8_pointer_to_offset (inscription->text, inscription->text + index);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_inscription_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
@@ -1444,6 +1527,8 @@ gtk_inscription_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
iface->get_selection = gtk_inscription_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_inscription_accessible_text_get_attributes;
|
||||
iface->get_default_attributes = gtk_inscription_accessible_text_get_default_attributes;
|
||||
iface->get_extents = gtk_inscription_accessible_text_get_extents;
|
||||
iface->get_offset = gtk_inscription_accessible_text_get_offset;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -420,6 +420,7 @@ static void gtk_label_do_popup (GtkLabel *self,
|
||||
double y);
|
||||
static void gtk_label_ensure_select_info (GtkLabel *self);
|
||||
static void gtk_label_clear_select_info (GtkLabel *self);
|
||||
static void gtk_label_clear_provider_info (GtkLabel *self);
|
||||
static void gtk_label_clear_layout (GtkLabel *self);
|
||||
static void gtk_label_ensure_layout (GtkLabel *self);
|
||||
static void gtk_label_select_region_index (GtkLabel *self,
|
||||
@@ -1524,6 +1525,7 @@ gtk_label_dispose (GObject *object)
|
||||
|
||||
gtk_label_set_mnemonic_widget (self, NULL);
|
||||
gtk_label_clear_select_info (self);
|
||||
gtk_label_clear_provider_info (self);
|
||||
|
||||
G_OBJECT_CLASS (gtk_label_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -1562,7 +1564,7 @@ gtk_label_finalize (GObject *object)
|
||||
g_clear_pointer (&self->attrs, pango_attr_list_unref);
|
||||
g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
|
||||
|
||||
if (self->select_info)
|
||||
if (self->select_info && self->select_info->provider)
|
||||
g_object_unref (self->select_info->provider);
|
||||
|
||||
gtk_label_clear_links (self);
|
||||
@@ -4925,7 +4927,7 @@ gtk_label_clear_select_info (GtkLabel *self)
|
||||
gtk_widget_remove_controller (GTK_WIDGET (self), self->select_info->motion_controller);
|
||||
gtk_widget_remove_controller (GTK_WIDGET (self), self->select_info->focus_controller);
|
||||
GTK_LABEL_CONTENT (self->select_info->provider)->label = NULL;
|
||||
g_object_unref (self->select_info->provider);
|
||||
g_clear_object (&self->select_info->provider);
|
||||
|
||||
g_free (self->select_info);
|
||||
self->select_info = NULL;
|
||||
@@ -4936,6 +4938,15 @@ gtk_label_clear_select_info (GtkLabel *self)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_clear_provider_info (GtkLabel *self)
|
||||
{
|
||||
if (self->select_info == NULL)
|
||||
return;
|
||||
|
||||
GTK_LABEL_CONTENT (self->select_info->provider)->label = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_label_set_selectable: (attributes org.gtk.Method.set_property=selectable)
|
||||
* @self: a `GtkLabel`
|
||||
@@ -6179,6 +6190,55 @@ gtk_label_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_label_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (self);
|
||||
PangoLayout *layout;
|
||||
const char *text;
|
||||
float lx, ly;
|
||||
cairo_region_t *range_clip;
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
int range[2];
|
||||
|
||||
layout = label->layout;
|
||||
text = label->text;
|
||||
get_layout_location (label, &lx, &ly);
|
||||
|
||||
range[0] = g_utf8_pointer_to_offset (text, text + start);
|
||||
range[1] = g_utf8_pointer_to_offset (text, text + end);
|
||||
|
||||
range_clip = gdk_pango_layout_get_clip_region (layout, lx, ly, range, 1);
|
||||
cairo_region_get_extents (range_clip, &clip_rect);
|
||||
cairo_region_destroy (range_clip);
|
||||
|
||||
extents->origin.x = clip_rect.x;
|
||||
extents->origin.y = clip_rect.y;
|
||||
extents->size.width = clip_rect.width;
|
||||
extents->size.height = clip_rect.height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_label_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (self);
|
||||
int index;
|
||||
|
||||
if (!get_layout_index (label, roundf (point->x), roundf (point->y), &index))
|
||||
return FALSE;
|
||||
|
||||
*offset = (unsigned int) g_utf8_pointer_to_offset (label->text, label->text + index);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
@@ -6188,6 +6248,8 @@ gtk_label_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
iface->get_selection = gtk_label_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_label_accessible_text_get_attributes;
|
||||
iface->get_default_attributes = gtk_label_accessible_text_get_default_attributes;
|
||||
iface->get_extents = gtk_label_accessible_text_get_extents;
|
||||
iface->get_offset = gtk_label_accessible_text_get_offset;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -37,11 +37,14 @@ gtk_list_item_widget_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
GtkWidget *child = gtk_widget_get_first_child (widget);
|
||||
GtkWidget *focus_child = gtk_widget_get_focus_child (widget);
|
||||
|
||||
if (gtk_widget_get_focus_child (widget))
|
||||
if (focus_child)
|
||||
{
|
||||
/* focus is in the child */
|
||||
if (direction == GTK_DIR_TAB_BACKWARD)
|
||||
if (gtk_widget_child_focus (focus_child, direction))
|
||||
return TRUE;
|
||||
else if (direction == GTK_DIR_TAB_BACKWARD)
|
||||
return gtk_widget_grab_focus_self (widget);
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
@@ -150,6 +150,7 @@ struct _GtkScalePrivate
|
||||
|
||||
guint draw_value : 1;
|
||||
guint value_pos : 2;
|
||||
guint has_markup : 1;
|
||||
|
||||
GtkScaleFormatValueFunc format_value_func;
|
||||
gpointer format_value_func_user_data;
|
||||
@@ -375,6 +376,27 @@ gtk_scale_allocate_value (GtkScale *scale)
|
||||
g_return_if_reached ();
|
||||
break;
|
||||
}
|
||||
if (priv->has_markup && (priv->value_pos == GTK_POS_LEFT || priv->value_pos == GTK_POS_RIGHT))
|
||||
{
|
||||
if (priv->top_marks_widget)
|
||||
{
|
||||
int marks_height;
|
||||
gtk_widget_measure (priv->top_marks_widget,
|
||||
GTK_ORIENTATION_VERTICAL, -1,
|
||||
&marks_height, NULL,
|
||||
NULL, NULL);
|
||||
value_alloc.y += marks_height / 2;
|
||||
}
|
||||
if (priv->bottom_marks_widget)
|
||||
{
|
||||
int marks_height;
|
||||
gtk_widget_measure (priv->bottom_marks_widget,
|
||||
GTK_ORIENTATION_VERTICAL, -1,
|
||||
&marks_height, NULL,
|
||||
NULL, NULL);
|
||||
value_alloc.y -= marks_height / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* VERTICAL */
|
||||
{
|
||||
@@ -403,6 +425,27 @@ gtk_scale_allocate_value (GtkScale *scale)
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
if (priv->has_markup && (priv->value_pos == GTK_POS_TOP || priv->value_pos == GTK_POS_BOTTOM))
|
||||
{
|
||||
if (priv->top_marks_widget)
|
||||
{
|
||||
int marks_width;
|
||||
gtk_widget_measure (priv->top_marks_widget,
|
||||
GTK_ORIENTATION_HORIZONTAL, -1,
|
||||
&marks_width, NULL,
|
||||
NULL, NULL);
|
||||
value_alloc.x += marks_width / 2;
|
||||
}
|
||||
if (priv->bottom_marks_widget)
|
||||
{
|
||||
int marks_width;
|
||||
gtk_widget_measure (priv->bottom_marks_widget,
|
||||
GTK_ORIENTATION_HORIZONTAL, -1,
|
||||
&marks_width, NULL,
|
||||
NULL, NULL);
|
||||
value_alloc.x -= marks_width / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_size_allocate (priv->value_widget, &value_alloc, -1);
|
||||
@@ -1285,6 +1328,7 @@ gtk_scale_get_range_border (GtkRange *range,
|
||||
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
int height;
|
||||
bool need_symmetry = !priv->has_markup && (priv->value_pos == GTK_POS_LEFT || priv->value_pos == GTK_POS_RIGHT || !priv->draw_value);
|
||||
|
||||
if (priv->top_marks_widget)
|
||||
{
|
||||
@@ -1293,7 +1337,11 @@ gtk_scale_get_range_border (GtkRange *range,
|
||||
&height, NULL,
|
||||
NULL, NULL);
|
||||
if (height > 0)
|
||||
border->top += height;
|
||||
{
|
||||
border->top += height;
|
||||
if (need_symmetry)
|
||||
border->bottom += height;
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->bottom_marks_widget)
|
||||
@@ -1303,12 +1351,17 @@ gtk_scale_get_range_border (GtkRange *range,
|
||||
&height, NULL,
|
||||
NULL, NULL);
|
||||
if (height > 0)
|
||||
border->bottom += height;
|
||||
{
|
||||
border->bottom += height;
|
||||
if (need_symmetry)
|
||||
border->top += height;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int width;
|
||||
bool need_symmetry = !priv->has_markup && (priv->value_pos == GTK_POS_TOP || priv->value_pos == GTK_POS_BOTTOM || !priv->draw_value);
|
||||
|
||||
if (priv->top_marks_widget)
|
||||
{
|
||||
@@ -1317,7 +1370,11 @@ gtk_scale_get_range_border (GtkRange *range,
|
||||
&width, NULL,
|
||||
NULL, NULL);
|
||||
if (width > 0)
|
||||
border->left += width;
|
||||
{
|
||||
border->left += width;
|
||||
if (need_symmetry)
|
||||
border->right += width;
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->bottom_marks_widget)
|
||||
@@ -1327,7 +1384,11 @@ gtk_scale_get_range_border (GtkRange *range,
|
||||
&width, NULL,
|
||||
NULL, NULL);
|
||||
if (width > 0)
|
||||
border->right += width;
|
||||
{
|
||||
border->right += width;
|
||||
if (need_symmetry)
|
||||
border->left += width;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1642,6 +1703,7 @@ gtk_scale_clear_marks (GtkScale *scale)
|
||||
|
||||
g_slist_free_full (priv->marks, gtk_scale_mark_free);
|
||||
priv->marks = NULL;
|
||||
priv->has_markup = false;
|
||||
|
||||
g_clear_pointer (&priv->top_marks_widget, gtk_widget_unparent);
|
||||
g_clear_pointer (&priv->bottom_marks_widget, gtk_widget_unparent);
|
||||
@@ -1760,6 +1822,7 @@ gtk_scale_add_mark (GtkScale *scale,
|
||||
gtk_widget_insert_after (mark->label_widget, mark->widget, NULL);
|
||||
else
|
||||
gtk_widget_insert_before (mark->label_widget, mark->widget, NULL);
|
||||
priv->has_markup = true;
|
||||
}
|
||||
|
||||
m = g_slist_find (priv->marks, mark);
|
||||
|
||||
@@ -82,8 +82,8 @@ gtk_shortcut_manager_get_model (GtkShortcutManager *self,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcut_manager_default_add_controller (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller)
|
||||
gtk_shortcut_manager_add_controller (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller)
|
||||
{
|
||||
GtkFlattenListModel *model;
|
||||
GtkPropagationPhase phase;
|
||||
@@ -98,13 +98,12 @@ gtk_shortcut_manager_default_add_controller (GtkShortcutManager *self,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcut_manager_default_remove_controller (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller)
|
||||
gtk_shortcut_manager_remove_controller_for_phase (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller,
|
||||
GtkPropagationPhase phase)
|
||||
{
|
||||
GtkFlattenListModel *model;
|
||||
GtkPropagationPhase phase;
|
||||
|
||||
phase = gtk_event_controller_get_propagation_phase (GTK_EVENT_CONTROLLER (controller));
|
||||
model = gtk_shortcut_manager_get_model (self, phase);
|
||||
if (model)
|
||||
{
|
||||
@@ -117,6 +116,41 @@ gtk_shortcut_manager_default_remove_controller (GtkShortcutManager *self,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
propagation_phase_changed (GtkShortcutController *controller,
|
||||
GParamSpec *pspec,
|
||||
GtkShortcutManager *self)
|
||||
{
|
||||
/* Remove from all models and readd */
|
||||
gtk_shortcut_manager_remove_controller_for_phase (self, controller, GTK_PHASE_CAPTURE);
|
||||
gtk_shortcut_manager_remove_controller_for_phase (self, controller, GTK_PHASE_BUBBLE);
|
||||
|
||||
gtk_shortcut_manager_add_controller (self, controller);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcut_manager_default_add_controller (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller)
|
||||
{
|
||||
gtk_shortcut_manager_add_controller (self, controller);
|
||||
|
||||
g_signal_connect_object (controller, "notify::propagation-phase",
|
||||
G_CALLBACK (propagation_phase_changed), self, G_CONNECT_DEFAULT);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcut_manager_default_remove_controller (GtkShortcutManager *self,
|
||||
GtkShortcutController *controller)
|
||||
{
|
||||
GtkPropagationPhase phase;
|
||||
|
||||
phase = gtk_event_controller_get_propagation_phase (GTK_EVENT_CONTROLLER (controller));
|
||||
gtk_shortcut_manager_remove_controller_for_phase (self, controller, phase);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (controller, propagation_phase_changed, self);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcut_manager_default_init (GtkShortcutManagerInterface *iface)
|
||||
{
|
||||
|
||||
@@ -295,7 +295,7 @@ static void gtk_spin_button_activate (GtkText *entry,
|
||||
static void gtk_spin_button_unset_adjustment (GtkSpinButton *spin_button);
|
||||
static void gtk_spin_button_set_orientation (GtkSpinButton *spin_button,
|
||||
GtkOrientation orientation);
|
||||
static double gtk_spin_button_snap (GtkSpinButton *spin_button,
|
||||
static void gtk_spin_button_snap (GtkSpinButton *spin_button,
|
||||
double val);
|
||||
static void gtk_spin_button_insert_text (GtkEditable *editable,
|
||||
const char *new_text,
|
||||
@@ -1519,24 +1519,25 @@ gtk_spin_button_real_change_value (GtkSpinButton *spin,
|
||||
gtk_widget_error_bell (GTK_WIDGET (spin));
|
||||
}
|
||||
|
||||
static double
|
||||
static void
|
||||
gtk_spin_button_snap (GtkSpinButton *spin_button,
|
||||
double val)
|
||||
{
|
||||
double inc;
|
||||
double tmp;
|
||||
|
||||
inc = gtk_adjustment_get_step_increment (spin_button->adjustment);
|
||||
if (inc == 0)
|
||||
return val;
|
||||
if (inc != 0)
|
||||
{
|
||||
double tmp;
|
||||
|
||||
tmp = (val - gtk_adjustment_get_lower (spin_button->adjustment)) / inc;
|
||||
if (tmp - floor (tmp) < ceil (tmp) - tmp)
|
||||
val = gtk_adjustment_get_lower (spin_button->adjustment) + floor (tmp) * inc;
|
||||
else
|
||||
val = gtk_adjustment_get_lower (spin_button->adjustment) + ceil (tmp) * inc;
|
||||
tmp = (val - gtk_adjustment_get_lower (spin_button->adjustment)) / inc;
|
||||
if (tmp - floor (tmp) < ceil (tmp) - tmp)
|
||||
val = gtk_adjustment_get_lower (spin_button->adjustment) + floor (tmp) * inc;
|
||||
else
|
||||
val = gtk_adjustment_get_lower (spin_button->adjustment) + ceil (tmp) * inc;
|
||||
}
|
||||
|
||||
return val;
|
||||
gtk_spin_button_set_value (spin_button, val);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2538,22 +2539,26 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
|
||||
else if (return_val == GTK_INPUT_ERROR)
|
||||
error = 1;
|
||||
|
||||
const double lower = gtk_adjustment_get_lower (spin_button->adjustment);
|
||||
const double upper = gtk_adjustment_get_upper (spin_button->adjustment);
|
||||
|
||||
if (spin_button->update_policy == GTK_UPDATE_ALWAYS)
|
||||
{
|
||||
val = CLAMP (val, lower, upper);
|
||||
|
||||
if (spin_button->snap_to_ticks)
|
||||
val = gtk_spin_button_snap (spin_button, val);
|
||||
|
||||
gtk_spin_button_set_value (spin_button, val);
|
||||
if (val < gtk_adjustment_get_lower (spin_button->adjustment))
|
||||
val = gtk_adjustment_get_lower (spin_button->adjustment);
|
||||
else if (val > gtk_adjustment_get_upper (spin_button->adjustment))
|
||||
val = gtk_adjustment_get_upper (spin_button->adjustment);
|
||||
}
|
||||
else if (error || val < lower || val > upper)
|
||||
else if ((spin_button->update_policy == GTK_UPDATE_IF_VALID) &&
|
||||
(error ||
|
||||
val < gtk_adjustment_get_lower (spin_button->adjustment) ||
|
||||
val > gtk_adjustment_get_upper (spin_button->adjustment)))
|
||||
{
|
||||
gtk_spin_button_value_changed (spin_button->adjustment, spin_button);
|
||||
return;
|
||||
}
|
||||
|
||||
if (spin_button->snap_to_ticks)
|
||||
gtk_spin_button_snap (spin_button, val);
|
||||
else
|
||||
gtk_spin_button_set_value (spin_button, val);
|
||||
}
|
||||
|
||||
GtkText *
|
||||
@@ -2561,3 +2566,4 @@ gtk_spin_button_get_text_widget (GtkSpinButton *spin_button)
|
||||
{
|
||||
return GTK_TEXT (spin_button->entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
* 
|
||||
*
|
||||
* The user can control which state should be active by clicking the
|
||||
* empty area, or by dragging the handle.
|
||||
* empty area, or by dragging the slider.
|
||||
*
|
||||
* `GtkSwitch` can also handle situations where the underlying state
|
||||
* changes with a delay. In this case, the slider position indicates
|
||||
* the user's recent change (as indicated by the [property@Gtk.Switch:active]
|
||||
* property), and the color indicates whether the underlying state (represented
|
||||
* by the [property@Gtk.Switch:state] property) has been updated yet.
|
||||
* `GtkSwitch` can also express situations where the underlying state changes
|
||||
* with a delay. In this case, the slider position indicates the user's recent
|
||||
* change (represented by the [property@Gtk.Switch:active] property), while the
|
||||
* trough color indicates the present underlying state (represented by the
|
||||
* [property@Gtk.Switch:state] property).
|
||||
*
|
||||
* 
|
||||
*
|
||||
@@ -582,6 +582,10 @@ gtk_switch_class_init (GtkSwitchClass *klass)
|
||||
*
|
||||
* The backend state that is controlled by the switch.
|
||||
*
|
||||
* Applications should usually set the [property@Gtk.Switch:active] property,
|
||||
* except when indicating a change to the backend state which occurs
|
||||
* separately from the user's interaction.
|
||||
*
|
||||
* See [signal@Gtk.Switch::state-set] for details.
|
||||
*/
|
||||
switch_props[PROP_STATE] =
|
||||
@@ -629,8 +633,8 @@ gtk_switch_class_init (GtkSwitchClass *klass)
|
||||
* Emitted to change the underlying state.
|
||||
*
|
||||
* The ::state-set signal is emitted when the user changes the switch
|
||||
* position. The default handler keeps the state in sync with the
|
||||
* [property@Gtk.Switch:active] property.
|
||||
* position. The default handler calls [method@Gtk.Switch.set_state] with the
|
||||
* value of @state.
|
||||
*
|
||||
* To implement delayed state change, applications can connect to this
|
||||
* signal, initiate the change of the underlying state, and call
|
||||
@@ -638,10 +642,6 @@ gtk_switch_class_init (GtkSwitchClass *klass)
|
||||
* complete. The signal handler should return %TRUE to prevent the
|
||||
* default handler from running.
|
||||
*
|
||||
* Visually, the underlying state is represented by the trough color of
|
||||
* the switch, while the [property@Gtk.Switch:active] property is
|
||||
* represented by the position of the switch.
|
||||
*
|
||||
* Returns: %TRUE to stop the signal emission
|
||||
*/
|
||||
signals[STATE_SET] =
|
||||
|
||||
@@ -3452,7 +3452,7 @@ gtk_text_insert_text (GtkText *self,
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
*position,
|
||||
n_inserted);
|
||||
*position + n_inserted);
|
||||
|
||||
*position += n_inserted;
|
||||
|
||||
@@ -7555,6 +7555,56 @@ gtk_text_accessible_text_get_default_attributes (GtkAccessibleText *self,
|
||||
*attribute_values = values;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents)
|
||||
{
|
||||
PangoLayout *layout = gtk_text_get_layout (GTK_TEXT (self));
|
||||
const char *text;
|
||||
int lx, ly;
|
||||
int range[2];
|
||||
cairo_region_t *range_clip;
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
|
||||
layout = gtk_text_get_layout (GTK_TEXT (self));
|
||||
text = gtk_entry_buffer_get_text (get_buffer (GTK_TEXT (self)));
|
||||
get_layout_position (GTK_TEXT (self), &lx, &ly);
|
||||
|
||||
range[0] = g_utf8_pointer_to_offset (text, text + start);
|
||||
range[1] = g_utf8_pointer_to_offset (text, text + end);
|
||||
|
||||
range_clip = gdk_pango_layout_get_clip_region (layout, lx, ly, range, 1);
|
||||
cairo_region_get_extents (range_clip, &clip_rect);
|
||||
cairo_region_destroy (range_clip);
|
||||
|
||||
extents->origin.x = clip_rect.x;
|
||||
extents->origin.y = clip_rect.y;
|
||||
extents->size.width = clip_rect.width;
|
||||
extents->size.height = clip_rect.height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset)
|
||||
{
|
||||
int lx;
|
||||
int index;
|
||||
const char *text;
|
||||
|
||||
gtk_text_get_layout_offsets (GTK_TEXT (self), &lx, NULL);
|
||||
index = gtk_text_find_position (GTK_TEXT (self), point->x - lx);
|
||||
text = gtk_entry_buffer_get_text (get_buffer (GTK_TEXT (self)));
|
||||
|
||||
*offset = (unsigned int) g_utf8_pointer_to_offset (text, text + index);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
@@ -7564,6 +7614,8 @@ gtk_text_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
iface->get_selection = gtk_text_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_text_accessible_text_get_attributes;
|
||||
iface->get_default_attributes = gtk_text_accessible_text_get_default_attributes;
|
||||
iface->get_extents = gtk_text_accessible_text_get_extents;
|
||||
iface->get_offset = gtk_text_accessible_text_get_offset;
|
||||
}
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
||||
@@ -10685,6 +10685,77 @@ gtk_text_view_accessible_text_get_default_attributes (GtkAccessibleText *self,
|
||||
g_hash_table_unref (attrs);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_view_accessible_text_get_extents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end,
|
||||
graphene_rect_t *extents)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start_iter, end_iter;
|
||||
cairo_region_t *region;
|
||||
GdkRectangle rect;
|
||||
|
||||
buffer = get_buffer (GTK_TEXT_VIEW (self));
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &start_iter, start);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &end_iter, end);
|
||||
|
||||
region = cairo_region_create ();
|
||||
do
|
||||
{
|
||||
gtk_text_view_get_iter_location (GTK_TEXT_VIEW (self), &start_iter, &rect);
|
||||
cairo_region_union_rectangle (region, &rect);
|
||||
|
||||
gtk_text_iter_forward_to_line_end (&start_iter);
|
||||
gtk_text_iter_order (&start_iter, &end_iter);
|
||||
|
||||
gtk_text_view_get_iter_location (GTK_TEXT_VIEW (self), &end_iter, &rect);
|
||||
cairo_region_union_rectangle (region, &rect);
|
||||
|
||||
gtk_text_iter_forward_line (&start_iter);
|
||||
}
|
||||
while (gtk_text_iter_compare (&start_iter, &end_iter) < 0);
|
||||
|
||||
cairo_region_get_extents (region, &rect);
|
||||
cairo_region_destroy (region);
|
||||
|
||||
gtk_text_view_buffer_to_window_coords (GTK_TEXT_VIEW (self),
|
||||
GTK_TEXT_WINDOW_TEXT,
|
||||
rect.x, rect.y,
|
||||
&rect.x, &rect.y);
|
||||
_text_window_to_widget_coords (GTK_TEXT_VIEW (self), &rect.x, &rect.y);
|
||||
|
||||
extents->origin.x = rect.x;
|
||||
extents->origin.y = rect.y;
|
||||
extents->size.width = rect.width;
|
||||
extents->size.height = rect.height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_view_accessible_text_get_offset (GtkAccessibleText *self,
|
||||
const graphene_point_t *point,
|
||||
unsigned int *offset)
|
||||
{
|
||||
GtkTextView *text_view = GTK_TEXT_VIEW (self);
|
||||
int x, y;
|
||||
GtkTextIter iter;
|
||||
|
||||
x = point->x;
|
||||
y = point->y;
|
||||
|
||||
_widget_to_text_surface_coords (text_view, &x, &y);
|
||||
gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_TEXT, x, y, &x, &y);
|
||||
|
||||
if (!gtk_text_view_get_iter_at_location (text_view, &iter, x, y))
|
||||
return FALSE;
|
||||
|
||||
*offset = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_view_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
@@ -10694,6 +10765,8 @@ gtk_text_view_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
iface->get_selection = gtk_text_view_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_text_view_accessible_text_get_attributes;
|
||||
iface->get_default_attributes = gtk_text_view_accessible_text_get_default_attributes;
|
||||
iface->get_extents = gtk_text_view_accessible_text_get_extents;
|
||||
iface->get_offset = gtk_text_view_accessible_text_get_offset;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -6477,8 +6477,7 @@ gtk_widget_update_pango_context (GtkWidget *widget,
|
||||
scale = gtk_widget_get_scale_factor (widget);
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
|
||||
if (settings != NULL &&
|
||||
cairo_version () >= CAIRO_VERSION_ENCODE (1, 17, 4))
|
||||
if (settings)
|
||||
{
|
||||
g_object_get (settings, "gtk-hint-font-metrics", &hint_font_metrics, NULL);
|
||||
|
||||
|
||||
@@ -692,6 +692,7 @@ add_wayland_protocols (GdkDisplay *display,
|
||||
append_wayland_protocol_row (gen, (struct wl_proxy *)d->xdg_activation);
|
||||
append_wayland_protocol_row (gen, (struct wl_proxy *)d->fractional_scale);
|
||||
append_wayland_protocol_row (gen, (struct wl_proxy *)d->viewporter);
|
||||
append_wayland_protocol_row (gen, (struct wl_proxy *)d->presentation);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -59,3 +59,7 @@ picture.light {
|
||||
row:not(:selected) > .highlight {
|
||||
background-color: rgba(135, 206, 250, 0.4);
|
||||
}
|
||||
|
||||
scale.inline {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ struct _GtkInspectorVisual
|
||||
|
||||
GtkWidget *swin;
|
||||
GtkWidget *box;
|
||||
|
||||
GtkWidget *visual_box;
|
||||
GtkWidget *theme_combo;
|
||||
GtkWidget *dark_switch;
|
||||
@@ -80,6 +81,9 @@ struct _GtkInspectorVisual
|
||||
GtkWidget *cursor_size_spin;
|
||||
GtkWidget *direction_combo;
|
||||
GtkWidget *font_button;
|
||||
GtkWidget *font_aa_switch;
|
||||
GtkWidget *font_hinting_combo;
|
||||
GtkWidget *metrics_hinting_switch;
|
||||
GtkWidget *animation_switch;
|
||||
GtkWidget *font_scale_entry;
|
||||
GtkAdjustment *font_scale_adjustment;
|
||||
@@ -237,6 +241,95 @@ font_scale_adjustment_changed (GtkAdjustment *adjustment,
|
||||
update_font_scale (vis, factor, FALSE, TRUE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_font_aa (GtkInspectorVisual *vis)
|
||||
{
|
||||
int aa;
|
||||
|
||||
g_object_get (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-xft-antialias", &aa,
|
||||
NULL);
|
||||
|
||||
return aa != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_metrics_hinting (GtkInspectorVisual *vis)
|
||||
{
|
||||
gboolean hinting;
|
||||
|
||||
g_object_get (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-hint-font-metrics", &hinting,
|
||||
NULL);
|
||||
|
||||
return hinting;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_font_hinting (GtkInspectorVisual *vis)
|
||||
{
|
||||
int hinting;
|
||||
char *hint_style_str;
|
||||
unsigned int hint_style;
|
||||
|
||||
g_object_get (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-xft-hinting", &hinting,
|
||||
"gtk-xft-hintstyle", &hint_style_str,
|
||||
NULL);
|
||||
|
||||
hint_style = 1;
|
||||
if (hinting == 0)
|
||||
{
|
||||
hint_style = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcmp (hint_style_str, "hintnone") == 0)
|
||||
hint_style = 0;
|
||||
else if (strcmp (hint_style_str, "hintslight") == 0)
|
||||
hint_style = 1;
|
||||
else if (strcmp (hint_style_str, "hintmedium") == 0)
|
||||
hint_style = 2;
|
||||
else if (strcmp (hint_style_str, "hintfull") == 0)
|
||||
hint_style = 3;
|
||||
}
|
||||
|
||||
g_free (hint_style_str);
|
||||
|
||||
return hint_style;
|
||||
}
|
||||
|
||||
static void
|
||||
update_font_hinting (GtkInspectorVisual *vis,
|
||||
unsigned int hint_style)
|
||||
{
|
||||
const char *styles[] = { "hintnone", "hintslight", "hintmedium", "hintfull" };
|
||||
|
||||
g_object_set (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-xft-hinting", hint_style != 0,
|
||||
"gtk-xft-hintstyle", styles[hint_style],
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
font_aa_activate (GtkSwitch *sw,
|
||||
GParamSpec *pspec,
|
||||
GtkInspectorVisual *vis)
|
||||
{
|
||||
g_object_set (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-xft-antialias", gtk_switch_get_active (sw) ? 1 : 0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
metrics_hinting_activate (GtkSwitch *sw,
|
||||
GParamSpec *pspec,
|
||||
GtkInspectorVisual *vis)
|
||||
{
|
||||
g_object_set (gtk_settings_get_for_display (vis->display),
|
||||
"gtk-hint-font-metrics", gtk_switch_get_active (sw),
|
||||
NULL);
|
||||
}
|
||||
static void
|
||||
font_scale_entry_activated (GtkEntry *entry,
|
||||
GtkInspectorVisual *vis)
|
||||
@@ -923,6 +1016,32 @@ init_font_scale (GtkInspectorVisual *vis)
|
||||
G_CALLBACK (font_scale_entry_activated), vis);
|
||||
}
|
||||
|
||||
static void
|
||||
init_font_aa (GtkInspectorVisual *vis)
|
||||
{
|
||||
gtk_switch_set_active (GTK_SWITCH (vis->font_aa_switch), get_font_aa (vis));
|
||||
}
|
||||
|
||||
static void
|
||||
font_hinting_changed (GtkDropDown *combo,
|
||||
GParamSpec *pspec,
|
||||
GtkInspectorVisual *vis)
|
||||
{
|
||||
update_font_hinting (vis, gtk_drop_down_get_selected (combo));
|
||||
}
|
||||
|
||||
static void
|
||||
init_font_hinting (GtkInspectorVisual *vis)
|
||||
{
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (vis->font_hinting_combo), get_font_hinting (vis));
|
||||
}
|
||||
|
||||
static void
|
||||
init_metrics_hinting (GtkInspectorVisual *vis)
|
||||
{
|
||||
gtk_switch_set_active (GTK_SWITCH (vis->metrics_hinting_switch), get_metrics_hinting (vis));
|
||||
}
|
||||
|
||||
static void
|
||||
init_animation (GtkInspectorVisual *vis)
|
||||
{
|
||||
@@ -1171,6 +1290,9 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_adjustment);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, visual_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_aa_switch);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_hinting_combo);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, metrics_hinting_switch);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, debug_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_scale_entry);
|
||||
@@ -1188,6 +1310,9 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
|
||||
gtk_widget_class_bind_template_callback (widget_class, updates_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, cairo_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, direction_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, font_aa_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, font_hinting_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, metrics_hinting_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, baselines_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, layout_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, focus_activate);
|
||||
@@ -1212,6 +1337,9 @@ gtk_inspector_visual_set_display (GtkInspectorVisual *vis,
|
||||
init_cursor_size (vis);
|
||||
init_font (vis);
|
||||
init_font_scale (vis);
|
||||
init_font_aa (vis);
|
||||
init_font_hinting (vis);
|
||||
init_metrics_hinting (vis);
|
||||
init_animation (vis);
|
||||
init_slowdown (vis);
|
||||
init_gl (vis);
|
||||
|
||||
@@ -158,81 +158,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_label">
|
||||
<property name="label" translatable="yes">Font</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFontDialogButton" id="font_button">
|
||||
<property name="level">family</property>
|
||||
<property name="dialog">
|
||||
<object class="GtkFontDialog">
|
||||
</object>
|
||||
</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_scale_label">
|
||||
<property name="label" translatable="yes">Font Scale</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="font_scale_scale">
|
||||
<property name="valign">baseline</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="font_scale_adjustment">
|
||||
<property name="lower">0.5</property>
|
||||
<property name="upper">2</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.01</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<marks>
|
||||
<mark value="1.0" position="top"></mark>
|
||||
</marks>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="font_scale_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
@@ -301,7 +226,7 @@
|
||||
<object class="GtkLabel" id="slowdown_label">
|
||||
<property name="label" translatable="yes">Slowdown</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="valign">baseline-fill</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -315,18 +240,21 @@
|
||||
<property name="page-increment">1</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="valign">baseline-fill</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<marks>
|
||||
<mark value="0.0" position="top"></mark>
|
||||
</marks>
|
||||
<style>
|
||||
<class name="inline"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="slowdown_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="valign">baseline-center</property>
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="input-purpose">number</property>
|
||||
@@ -338,6 +266,179 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBox" id="font_box">
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
<class name="boxed-list"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_label">
|
||||
<property name="label" translatable="yes">Font</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFontDialogButton" id="font_button">
|
||||
<property name="level">family</property>
|
||||
<property name="dialog">
|
||||
<object class="GtkFontDialog">
|
||||
</object>
|
||||
</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_scale_label">
|
||||
<property name="label" translatable="yes">Scale</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline-fill</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="font_scale_scale">
|
||||
<property name="valign">baseline-fill</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="font_scale_adjustment">
|
||||
<property name="lower">0.5</property>
|
||||
<property name="upper">2</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.01</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<marks>
|
||||
<mark value="1.0" position="top"></mark>
|
||||
</marks>
|
||||
<style>
|
||||
<class name="inline"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="font_scale_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline-center</property>
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_aa_label">
|
||||
<property name="label" translatable="yes">Antialiasing</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="font_aa_switch">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
<signal name="notify::active" handler="font_aa_activate"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="font_hinting_label">
|
||||
<property name="label" translatable="yes">Hinting</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropDown" id="font_hinting_combo">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline-center</property>
|
||||
<property name="hexpand">1</property>
|
||||
<signal name="notify::selected" handler="font_hinting_changed"/>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item translatable="yes" context="Font hinting style">None</item>
|
||||
<item translatable="yes" context="Font hinting style">Slight</item>
|
||||
<item translatable="yes" context="Font hinting style">Medium</item>
|
||||
<item translatable="yes" context="Font hinting style">Full</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="metrics_hinting_label">
|
||||
<property name="label" translatable="yes">Metrics Hinting</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="metrics_hinting_switch">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
<signal name="notify::active" handler="metrics_hinting_activate"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBox" id="debug_box">
|
||||
<property name="selection-mode">none</property>
|
||||
@@ -686,6 +787,9 @@
|
||||
<widget name="cursor_label"/>
|
||||
<widget name="cursor_size_label"/>
|
||||
<widget name="font_label"/>
|
||||
<widget name="font_aa_label"/>
|
||||
<widget name="font_hinting_label"/>
|
||||
<widget name="metrics_hinting_label"/>
|
||||
<widget name="direction_label"/>
|
||||
<widget name="animation_label"/>
|
||||
<widget name="updates_label"/>
|
||||
@@ -709,11 +813,13 @@
|
||||
<widget name="cursor_combo"/>
|
||||
<widget name="font_button"/>
|
||||
<widget name="direction_combo"/>
|
||||
<widget name="font_hinting_combo"/>
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkSizeGroup">
|
||||
<widgets>
|
||||
<widget name="visual_box"/>
|
||||
<widget name="font_box"/>
|
||||
<widget name="debug_box"/>
|
||||
<widget name="inspector_box"/>
|
||||
</widgets>
|
||||
|
||||
@@ -725,6 +725,7 @@ if macos_enabled
|
||||
'gtksearchenginequartz.c',
|
||||
'gtkapplication-quartz.c',
|
||||
'gtkapplication-quartz-menu.c',
|
||||
'gtkcolorpickerquartz.c',
|
||||
'gtkfilechoosernativequartz.c',
|
||||
'gtkimcontextquartz.c',
|
||||
'gtkquartz.c',
|
||||
|
||||
@@ -402,7 +402,11 @@ entry {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
progress > trough > progress {
|
||||
> progress > trough {
|
||||
min-height: 2px;
|
||||
}
|
||||
|
||||
> progress > trough > progress {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
border-radius: 0;
|
||||
@@ -410,7 +414,6 @@ entry {
|
||||
border-color: $selected_bg_color;
|
||||
border-style: solid;
|
||||
box-shadow: none;
|
||||
|
||||
}
|
||||
|
||||
// linked entries
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('gtk', 'c',
|
||||
version: '4.14.2',
|
||||
version: '4.15.0',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
'warning_level=1',
|
||||
@@ -13,10 +13,10 @@ project('gtk', 'c',
|
||||
# keep these numbers in sync with wrap files where there exist
|
||||
glib_req = '>= 2.76.0'
|
||||
introspection_req = '>= 1.76.0' # keep this in sync with glib
|
||||
pango_req = '>= 1.50.0' # keep this in sync with .gitlab-ci/test-msys.sh
|
||||
pango_req = '>= 1.52.0' # keep this in sync with .gitlab-ci/test-msys.sh
|
||||
harfbuzz_req = '>= 2.6.0'
|
||||
fribidi_req = '>= 1.0.6'
|
||||
cairo_req = '>= 1.14.0'
|
||||
cairo_req = '>= 1.18.0'
|
||||
gdk_pixbuf_req = '>= 2.30.0'
|
||||
wayland_proto_req = '>= 1.31'
|
||||
wayland_req = '>= 1.21.0'
|
||||
|
||||
@@ -538,7 +538,12 @@ cpdb_printer_get_options (GtkPrinter *printer,
|
||||
{
|
||||
/* job-priority is represented as a number from 1-100 */
|
||||
const char *prio[] = {"100", "80", "50", "30"};
|
||||
const char *prio_display[] = {N_("Urgent"), N_("High"), N_("Medium"), N_("Low")};
|
||||
const char *prio_display[] = {
|
||||
NC_("Print job priority", "Urgent"),
|
||||
NC_("Print job priority", "High"),
|
||||
NC_("Print job priority", "Medium"),
|
||||
NC_("Print job priority", "Low")
|
||||
};
|
||||
|
||||
for (int i = 0; i < G_N_ELEMENTS(prio_display); i++)
|
||||
prio_display[i] = _(prio_display[i]);
|
||||
|
||||
@@ -5664,7 +5664,12 @@ cups_printer_get_options (GtkPrinter *printer,
|
||||
/* Translators: These strings name the possible values of the
|
||||
* job priority option in the print dialog
|
||||
*/
|
||||
const char *prio_display[] = {N_("Urgent"), N_("High"), N_("Medium"), N_("Low") };
|
||||
const char *prio_display[] = {
|
||||
NC_("Print job priority", "Urgent"),
|
||||
NC_("Print job priority", "High"),
|
||||
NC_("Print job priority", "Medium"),
|
||||
NC_("Print job priority", "Low")
|
||||
};
|
||||
const char *n_up_layout[] = { "lrtb", "lrbt", "rltb", "rlbt", "tblr", "tbrl", "btlr", "btrl" };
|
||||
/* Translators: These strings name the possible arrangements of
|
||||
* multiple pages on a sheet when printing
|
||||
|
||||
@@ -60,6 +60,7 @@ is
|
||||
it
|
||||
ja
|
||||
ka
|
||||
kab
|
||||
kg
|
||||
kk
|
||||
km
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
msgid ""
|
||||
msgstr "Project-Id-Version: gtk+ master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-03-02 15:19+0000\n"
|
||||
"PO-Revision-Date: 2024-03-04 10:00+0100\n"
|
||||
"POT-Creation-Date: 2024-04-04 17:02+0000\n"
|
||||
"PO-Revision-Date: 2024-04-05 10:00+0100\n"
|
||||
"Last-Translator: Asier Sarasua Garmendia <asiersarasua@ni.eus>\n"
|
||||
"Language-Team: Basque <librezale@librezale.eus>\n"
|
||||
"Language: eu\n"
|
||||
@@ -32,7 +32,7 @@ msgstr "Arbel honek ezin du daturik biltegiratu."
|
||||
msgid "Cannot read from empty clipboard."
|
||||
msgstr "Ezin da irakurri arbel huts batetik."
|
||||
|
||||
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
|
||||
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:606
|
||||
msgid "No compatible formats to transfer clipboard contents."
|
||||
msgstr "Ez dago formatu bateragarririk arbeleko edukiak transferitzeko."
|
||||
|
||||
@@ -47,11 +47,11 @@ msgstr "Ezin dira edukiak “%s” gisa hornitu"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "Ezin dira edukiak %s gisa hornitu"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:464
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "Uneko motorrak ez du OpenGL onartzen"
|
||||
|
||||
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1596
|
||||
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1600
|
||||
msgid "Vulkan support disabled via GDK_DEBUG"
|
||||
msgstr "Vulkan euskarria desgaituta GDK_DEBUG bidez"
|
||||
|
||||
@@ -59,46 +59,46 @@ msgstr "Vulkan euskarria desgaituta GDK_DEBUG bidez"
|
||||
msgid "GL support disabled via GDK_DEBUG"
|
||||
msgstr "GL euskarria desgaituta GDK_DEBUG bidez"
|
||||
|
||||
#: gdk/gdkdisplay.c:1665
|
||||
#: gdk/gdkdisplay.c:1675
|
||||
msgid "No EGL configuration available"
|
||||
msgstr "Ez dago EGL konfiguraziorik erabilgarri"
|
||||
|
||||
#: gdk/gdkdisplay.c:1673
|
||||
#: gdk/gdkdisplay.c:1683
|
||||
msgid "Failed to get EGL configurations"
|
||||
msgstr "Huts egin du EGL konfigurazioa eskuratzeak"
|
||||
|
||||
#: gdk/gdkdisplay.c:1703
|
||||
#: gdk/gdkdisplay.c:1713
|
||||
msgid "No EGL configuration with required features found"
|
||||
msgstr "Ez da beharrezkoak diren eginbideak dituen EGL konfiguraziorik aurkitu"
|
||||
|
||||
#: gdk/gdkdisplay.c:1710
|
||||
#: gdk/gdkdisplay.c:1720
|
||||
msgid "No perfect EGL configuration found"
|
||||
msgstr "Ez da EGL konfigurazio perfektua aurkitu"
|
||||
|
||||
#: gdk/gdkdisplay.c:1752
|
||||
#: gdk/gdkdisplay.c:1762
|
||||
#, c-format
|
||||
msgid "EGL implementation is missing extension %s"
|
||||
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
|
||||
msgstr[0] "EGL inplementazioari %s hedapena falta zaio"
|
||||
msgstr[1] "EGL inplementazioari %2$d hedapen falta zaizkio: %1$s"
|
||||
|
||||
#: gdk/gdkdisplay.c:1801
|
||||
#: gdk/gdkdisplay.c:1811
|
||||
msgid "libEGL not available in this sandbox"
|
||||
msgstr "libEGL ez dago erabilgarri isolatu honetan"
|
||||
|
||||
#: gdk/gdkdisplay.c:1802
|
||||
#: gdk/gdkdisplay.c:1812
|
||||
msgid "libEGL not available"
|
||||
msgstr "libEGL ez dago erabilgarri"
|
||||
|
||||
#: gdk/gdkdisplay.c:1812
|
||||
#: gdk/gdkdisplay.c:1822
|
||||
msgid "Failed to create EGL display"
|
||||
msgstr "Huts egin du EGL ikuspegia sortzeak"
|
||||
|
||||
#: gdk/gdkdisplay.c:1821
|
||||
#: gdk/gdkdisplay.c:1831
|
||||
msgid "Could not initialize EGL display"
|
||||
msgstr "Ezin da EGL ikuspegia hasieratu"
|
||||
|
||||
#: gdk/gdkdisplay.c:1831
|
||||
#: gdk/gdkdisplay.c:1841
|
||||
#, c-format
|
||||
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
|
||||
msgstr "EGL %d.%d bertsioa zaharregia da. GTK aplikazioak %d.%d behar du"
|
||||
@@ -111,32 +111,32 @@ msgstr "Ez da onartzen beste aplikazio batzuetatik arrastatu eta jaregitea."
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "Ez dago formatu bateragarririk edukiak transferitzeko."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:424 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "Ez da onartzen GL APIrik."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#: gdk/gdkglcontext.c:447 gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:538
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:582 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "Ezin da GL testuingurua sortu"
|
||||
|
||||
#: gdk/gdkglcontext.c:1304
|
||||
#: gdk/gdkglcontext.c:1310
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL ES desgaituta GDK_DEBUG bidez"
|
||||
|
||||
#: gdk/gdkglcontext.c:1316
|
||||
#: gdk/gdkglcontext.c:1322
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL desgaituta GDK_DEBUG bidez"
|
||||
|
||||
#: gdk/gdkglcontext.c:1327
|
||||
#: gdk/gdkglcontext.c:1333
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "Aplikazioak ez du %s APIa onartzen"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2113
|
||||
#: gdk/gdkglcontext.c:2123
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "%s erabiltzen saiatzen, baina %s jadanik erabiltzen ari da"
|
||||
@@ -820,7 +820,7 @@ msgstr "Onartzen ez den kodeketa: “%s”"
|
||||
msgid "This GLES %d.%d implementation does not support half-float vertex data"
|
||||
msgstr "GLES %d.%d inplementazio honek ez du onartzen erpin-datu sasimugikorrak"
|
||||
|
||||
#: gsk/gpu/gskgldevice.c:245
|
||||
#: gsk/gpu/gskgldevice.c:246
|
||||
#, c-format
|
||||
msgid "OpenGL ES 3.0 is not supported by this renderer."
|
||||
msgstr "Errendatzaile honek ez du onartzen OpenGL ES 3.0."
|
||||
@@ -1068,7 +1068,7 @@ msgid "Pick a Font"
|
||||
msgstr "Hautatu letra-tipoa"
|
||||
|
||||
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3815
|
||||
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
|
||||
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:285
|
||||
msgid "Font"
|
||||
msgstr "Letra-tipoa"
|
||||
|
||||
@@ -2319,7 +2319,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Elementu bat ezabatzen baduzu, betirako galduko duzu."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
|
||||
msgid "_Delete"
|
||||
msgstr "Ez_abatu"
|
||||
|
||||
@@ -2528,7 +2528,7 @@ msgid "_Time"
|
||||
msgstr "O_rdua"
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:7375 gtk/gtkplacessidebar.c:2306
|
||||
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:19
|
||||
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:18
|
||||
#: gtk/inspector/css-node-tree.ui:22 gtk/inspector/prop-list.ui:24
|
||||
#: gtk/ui/gtkfilechooserwidget.ui:385 gtk/print/ui/gtkprintunixdialog.ui:80
|
||||
msgid "Name"
|
||||
@@ -2657,19 +2657,19 @@ msgstr "Itxi"
|
||||
msgid "Close the infobar"
|
||||
msgstr "Itxi informazio-barra"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
|
||||
msgid "Cu_t"
|
||||
msgstr "_Ebaki"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
|
||||
msgid "_Copy"
|
||||
msgstr "_Kopiatu"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
|
||||
msgid "_Paste"
|
||||
msgstr "_Itsatsi"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
|
||||
msgid "Select _All"
|
||||
msgstr "Hautatu _dena"
|
||||
|
||||
@@ -2681,7 +2681,7 @@ msgstr "_Ireki esteka"
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "Kopiatu _estekaren helbidea"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
|
||||
msgid "Context menu"
|
||||
msgstr "Testuinguru-menua"
|
||||
|
||||
@@ -3370,7 +3370,7 @@ msgstr "Paperik ez"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: gtk/print/gtkprintoperation-win32.c:640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1528
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1533
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2639
|
||||
msgid "Paused"
|
||||
msgstr "Pausatuta"
|
||||
@@ -3441,42 +3441,42 @@ msgstr "Inprimagailuaren informazioa lortzen…"
|
||||
#. * multiple pages on a sheet when printing
|
||||
#.
|
||||
#: gtk/print/gtkprintunixdialog.c:2753
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5645
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5677
|
||||
msgid "Left to right, top to bottom"
|
||||
msgstr "Ezkerretik eskuinera, goitik behera"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2753
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5645
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5677
|
||||
msgid "Left to right, bottom to top"
|
||||
msgstr "Ezkerretik eskuinera, behetik gora"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2754
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5646
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5678
|
||||
msgid "Right to left, top to bottom"
|
||||
msgstr "Eskuinetik ezkerrera, goitik behera"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2754
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5646
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5678
|
||||
msgid "Right to left, bottom to top"
|
||||
msgstr "Eskuinetik ezkerrera, behetik gora"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2755
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5647
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5679
|
||||
msgid "Top to bottom, left to right"
|
||||
msgstr "Goitik behera, ezkerretik eskuinera"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2755
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5647
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5679
|
||||
msgid "Top to bottom, right to left"
|
||||
msgstr "Goitik behera, eskuinetik ezkerrera"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2756
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5648
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5680
|
||||
msgid "Bottom to top, left to right"
|
||||
msgstr "Behetik gora, ezkerretik eskuinera"
|
||||
|
||||
#: gtk/print/gtkprintunixdialog.c:2756
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5648
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5680
|
||||
msgid "Bottom to top, right to left"
|
||||
msgstr "Behetik gora, eskuinetik ezkerrera"
|
||||
|
||||
@@ -3614,15 +3614,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "Alboko barra"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6208 gtk/gtktextview.c:9125
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "Txertatu _emojia"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9107
|
||||
msgid "_Undo"
|
||||
msgstr "_Desegin"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9111
|
||||
msgid "_Redo"
|
||||
msgstr "_Berregin"
|
||||
|
||||
@@ -3845,7 +3845,7 @@ msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "Bat ere ez"
|
||||
|
||||
#: gtk/inspector/general.c:922
|
||||
#: gtk/inspector/general.c:924
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "IM testuingurua GTK_IM_MODULE kodean txertatuta dago"
|
||||
|
||||
@@ -4031,7 +4031,7 @@ msgstr "Fotograma kopurua"
|
||||
msgid "Frame Rate"
|
||||
msgstr "Fotograma-emaria"
|
||||
|
||||
#: gtk/inspector/misc-info.ui:527
|
||||
#: gtk/inspector/misc-info.ui:527 gtk/inspector/visual.ui:315
|
||||
msgid "Scale"
|
||||
msgstr "Eskala"
|
||||
|
||||
@@ -4216,27 +4216,27 @@ msgstr "Tamaina:"
|
||||
msgid "Trigger"
|
||||
msgstr "Abiarazlea"
|
||||
|
||||
#: gtk/inspector/size-groups.c:225
|
||||
#: gtk/inspector/size-groups.c:228
|
||||
msgctxt "sizegroup mode"
|
||||
msgid "None"
|
||||
msgstr "Bat ere ez"
|
||||
|
||||
#: gtk/inspector/size-groups.c:226
|
||||
#: gtk/inspector/size-groups.c:229
|
||||
msgctxt "sizegroup mode"
|
||||
msgid "Horizontal"
|
||||
msgstr "Horizontala"
|
||||
|
||||
#: gtk/inspector/size-groups.c:227
|
||||
#: gtk/inspector/size-groups.c:230
|
||||
msgctxt "sizegroup mode"
|
||||
msgid "Vertical"
|
||||
msgstr "Bertikala"
|
||||
|
||||
#: gtk/inspector/size-groups.c:228
|
||||
#: gtk/inspector/size-groups.c:231
|
||||
msgctxt "sizegroup mode"
|
||||
msgid "Both"
|
||||
msgstr "Biak"
|
||||
|
||||
#: gtk/inspector/size-groups.c:240
|
||||
#: gtk/inspector/size-groups.c:243
|
||||
msgid "Mode"
|
||||
msgstr "Modua"
|
||||
|
||||
@@ -4293,14 +4293,10 @@ msgstr "Hierarkia"
|
||||
msgid "Implements"
|
||||
msgstr "Inplementatzen du"
|
||||
|
||||
#: gtk/inspector/visual.c:674 gtk/inspector/visual.c:693
|
||||
#: gtk/inspector/visual.c:765 gtk/inspector/visual.c:784
|
||||
msgid "Theme is hardcoded by GTK_THEME"
|
||||
msgstr "Gaia GTK_THEME-k kodean txertatuta dago"
|
||||
|
||||
#: gtk/inspector/visual.c:942
|
||||
msgid "Backend does not support window scaling"
|
||||
msgstr "Motorrak ez du leihoa eskalatzea onartzen"
|
||||
|
||||
#: gtk/inspector/visual.ui:34
|
||||
msgid "GTK Theme"
|
||||
msgstr "GTK gaia"
|
||||
@@ -4321,89 +4317,113 @@ msgstr "Kurtsorearen tamaina"
|
||||
msgid "Icon Theme"
|
||||
msgstr "Ikonoen gaia"
|
||||
|
||||
#: gtk/inspector/visual.ui:194
|
||||
msgid "Font Scale"
|
||||
msgstr "Letra-tipoaren eskala"
|
||||
|
||||
#: gtk/inspector/visual.ui:239
|
||||
#: gtk/inspector/visual.ui:169
|
||||
msgid "Text Direction"
|
||||
msgstr "Testuaren norabidea"
|
||||
|
||||
#: gtk/inspector/visual.ui:254
|
||||
#: gtk/inspector/visual.ui:184
|
||||
msgid "Left-to-Right"
|
||||
msgstr "Ezkerretik eskuinera"
|
||||
|
||||
#: gtk/inspector/visual.ui:255
|
||||
#: gtk/inspector/visual.ui:185
|
||||
msgid "Right-to-Left"
|
||||
msgstr "Eskuinetik ezkerrera"
|
||||
|
||||
#: gtk/inspector/visual.ui:273
|
||||
msgid "Window Scaling"
|
||||
msgstr "Leihoa eskalatzea"
|
||||
|
||||
#: gtk/inspector/visual.ui:306
|
||||
#: gtk/inspector/visual.ui:202
|
||||
msgid "Animations"
|
||||
msgstr "Animazioak"
|
||||
|
||||
#: gtk/inspector/visual.ui:331
|
||||
#: gtk/inspector/visual.ui:227
|
||||
msgid "Slowdown"
|
||||
msgstr "Geldotu"
|
||||
|
||||
#: gtk/inspector/visual.ui:385
|
||||
#: gtk/inspector/visual.ui:362
|
||||
msgid "Antialiasing"
|
||||
msgstr "Antialiasing-a"
|
||||
|
||||
#: gtk/inspector/visual.ui:387
|
||||
msgid "Hinting"
|
||||
msgstr "Atxikitzea"
|
||||
|
||||
#: gtk/inspector/visual.ui:402
|
||||
msgctxt "Font hinting style"
|
||||
msgid "None"
|
||||
msgstr "Bat ere ez"
|
||||
|
||||
#: gtk/inspector/visual.ui:403
|
||||
msgctxt "Font hinting style"
|
||||
msgid "Slight"
|
||||
msgstr "Arina"
|
||||
|
||||
#: gtk/inspector/visual.ui:404
|
||||
msgctxt "Font hinting style"
|
||||
msgid "Medium"
|
||||
msgstr "Tartekoa"
|
||||
|
||||
#: gtk/inspector/visual.ui:405
|
||||
msgctxt "Font hinting style"
|
||||
msgid "Full"
|
||||
msgstr "Osoa"
|
||||
|
||||
#: gtk/inspector/visual.ui:422
|
||||
msgid "Metrics Hinting"
|
||||
msgstr "Metriken atxikitzea"
|
||||
|
||||
#: gtk/inspector/visual.ui:457
|
||||
msgid "Show Framerate"
|
||||
msgstr "Erakutsi fotograma-tasa"
|
||||
|
||||
#: gtk/inspector/visual.ui:410
|
||||
#: gtk/inspector/visual.ui:482
|
||||
msgid "Show Graphic Updates"
|
||||
msgstr "Erakutsi eguneraketa grafikoak"
|
||||
|
||||
#: gtk/inspector/visual.ui:430
|
||||
#: gtk/inspector/visual.ui:502
|
||||
msgid ""
|
||||
"Tints all the places where the current renderer uses Cairo instead of the "
|
||||
"GPU."
|
||||
msgstr "Uneko errendatzaileak PUZaren ordez Cairo erabiltzen dituen toki guztiak tindatzen ditu."
|
||||
|
||||
#: gtk/inspector/visual.ui:436
|
||||
#: gtk/inspector/visual.ui:508
|
||||
msgid "Show Cairo Rendering"
|
||||
msgstr "Erakutsi Cairo errendatzea"
|
||||
|
||||
#: gtk/inspector/visual.ui:461
|
||||
#: gtk/inspector/visual.ui:533
|
||||
msgid "Show Baselines"
|
||||
msgstr "Erakutsi oinarri-lerroak"
|
||||
|
||||
#: gtk/inspector/visual.ui:489
|
||||
#: gtk/inspector/visual.ui:561
|
||||
msgid "Show Layout Borders"
|
||||
msgstr "Erakutsi diseinuaren ertzak"
|
||||
|
||||
#: gtk/inspector/visual.ui:546
|
||||
#: gtk/inspector/visual.ui:618
|
||||
msgid "CSS Padding"
|
||||
msgstr "CSS betegarria"
|
||||
|
||||
#: gtk/inspector/visual.ui:556
|
||||
#: gtk/inspector/visual.ui:628
|
||||
msgid "CSS Border"
|
||||
msgstr "CSS ertza"
|
||||
|
||||
#: gtk/inspector/visual.ui:566
|
||||
#: gtk/inspector/visual.ui:638
|
||||
msgid "CSS Margin"
|
||||
msgstr "CSS marjina"
|
||||
|
||||
#: gtk/inspector/visual.ui:576
|
||||
#: gtk/inspector/visual.ui:648
|
||||
msgid "Widget Margin"
|
||||
msgstr "Trepetaren marjina"
|
||||
|
||||
#: gtk/inspector/visual.ui:611
|
||||
#: gtk/inspector/visual.ui:683
|
||||
msgid "Show Focus"
|
||||
msgstr "Erakutsi fokua"
|
||||
|
||||
#: gtk/inspector/visual.ui:636
|
||||
#: gtk/inspector/visual.ui:708
|
||||
msgid "Show Accessibility warnings"
|
||||
msgstr "Erakutsi erabilerraztasun-abisuak"
|
||||
|
||||
#: gtk/inspector/visual.ui:661
|
||||
#: gtk/inspector/visual.ui:733
|
||||
msgid "Show Graphics Offload"
|
||||
msgstr "Erakutsi grafikoen libratzea"
|
||||
|
||||
#: gtk/inspector/visual.ui:693
|
||||
#: gtk/inspector/visual.ui:765
|
||||
msgid "Inspect Inspector"
|
||||
msgstr "Ikuskatu ikuskatzailea"
|
||||
|
||||
@@ -6526,34 +6546,35 @@ msgstr "Aurreratua"
|
||||
msgid "Some of the settings in the dialog conflict"
|
||||
msgstr "Elkarrizketa-koadroko ezarpen batzuk gatazkan daude"
|
||||
|
||||
#. Translators: These strings name the possible values of the
|
||||
#. * job priority option in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:542
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5668
|
||||
msgctxt "Print job priority"
|
||||
msgid "Urgent"
|
||||
msgstr "Presazkoa"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:543
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5669
|
||||
msgctxt "Print job priority"
|
||||
msgid "High"
|
||||
msgstr "Altua"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:544
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5670
|
||||
msgctxt "Print job priority"
|
||||
msgid "Medium"
|
||||
msgstr "Tartekoa"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:541
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5640
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:545
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5671
|
||||
msgctxt "Print job priority"
|
||||
msgid "Low"
|
||||
msgstr "Baxua"
|
||||
|
||||
#. Translators, this is the label used for the option in the print
|
||||
#. * dialog that controls the front cover page.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:562
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5782
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:567
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5814
|
||||
msgctxt "printer option"
|
||||
msgid "Before"
|
||||
msgstr "Aurretik"
|
||||
@@ -6561,33 +6582,33 @@ msgstr "Aurretik"
|
||||
#. Translators, this is the label used for the option in the print
|
||||
#. * dialog that controls the back cover page.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:569
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5797
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:574
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5829
|
||||
msgctxt "printer option"
|
||||
msgid "After"
|
||||
msgstr "Ondoren"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:592
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:597
|
||||
msgid "Print at"
|
||||
msgstr "Inprimatze-unea:"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:602
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:607
|
||||
msgid "Print at time"
|
||||
msgstr "Inprimatu orduan"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:665
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:670
|
||||
msgctxt "print option"
|
||||
msgid "Borderless"
|
||||
msgstr "Ertzik gabea"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1525
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1530
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2636
|
||||
msgid "Paused; Rejecting Jobs"
|
||||
msgstr "Pausarazita; Lanak baztertzen"
|
||||
|
||||
#. Translators: this is a printer status.
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1531
|
||||
#: modules/printbackends/gtkprintbackendcpdb.c:1536
|
||||
#: modules/printbackends/gtkprintbackendcups.c:2642
|
||||
msgid "Rejecting Jobs"
|
||||
msgstr "Lanak baztertzen"
|
||||
@@ -6738,266 +6759,266 @@ msgstr "Arazoa dago '%s' inprimagailuarekin."
|
||||
msgid "; "
|
||||
msgstr "; "
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4582
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4649
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4609
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4676
|
||||
msgctxt "printing option"
|
||||
msgid "Two Sided"
|
||||
msgstr "Alde bietatik"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4583
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4610
|
||||
msgctxt "printing option"
|
||||
msgid "Paper Type"
|
||||
msgstr "Paper mota"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4584
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4611
|
||||
msgctxt "printing option"
|
||||
msgid "Paper Source"
|
||||
msgstr "Paper-iturria"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4585
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4650
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4612
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4677
|
||||
msgctxt "printing option"
|
||||
msgid "Output Tray"
|
||||
msgstr "Irteerako erretilua"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4586
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4613
|
||||
msgctxt "printing option"
|
||||
msgid "Resolution"
|
||||
msgstr "Bereizmena"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4587
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4614
|
||||
msgctxt "printing option"
|
||||
msgid "GhostScript pre-filtering"
|
||||
msgstr "GhostScript aurre-iragazketa"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4596
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4623
|
||||
msgctxt "printing option value"
|
||||
msgid "One Sided"
|
||||
msgstr "Alde batetik"
|
||||
|
||||
#. Translators: this is an option of "Two Sided"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4598
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4625
|
||||
msgctxt "printing option value"
|
||||
msgid "Long Edge (Standard)"
|
||||
msgstr "Marjina luzea (estandarra)"
|
||||
|
||||
#. Translators: this is an option of "Two Sided"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4600
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4627
|
||||
msgctxt "printing option value"
|
||||
msgid "Short Edge (Flip)"
|
||||
msgstr "Marjina laburra (iraulia)"
|
||||
|
||||
#. Translators: this is an option of "Paper Source"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4602
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4604
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4612
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4629
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4631
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4639
|
||||
msgctxt "printing option value"
|
||||
msgid "Auto Select"
|
||||
msgstr "Hautapen automatikoa"
|
||||
|
||||
#. Translators: this is an option of "Paper Source"
|
||||
#. Translators: this is an option of "Resolution"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4606
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4608
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4610
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4614
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4633
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4635
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4637
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4641
|
||||
msgctxt "printing option value"
|
||||
msgid "Printer Default"
|
||||
msgstr "Inprimagailu lehenetsia"
|
||||
|
||||
#. Translators: this is an option of "GhostScript"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4616
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4643
|
||||
msgctxt "printing option value"
|
||||
msgid "Embed GhostScript fonts only"
|
||||
msgstr "Kapsulatutako GhostScript letra-tipoak soilik"
|
||||
|
||||
#. Translators: this is an option of "GhostScript"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4618
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4645
|
||||
msgctxt "printing option value"
|
||||
msgid "Convert to PS level 1"
|
||||
msgstr "BIhurtu PS 1. mailara"
|
||||
|
||||
#. Translators: this is an option of "GhostScript"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4620
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4647
|
||||
msgctxt "printing option value"
|
||||
msgid "Convert to PS level 2"
|
||||
msgstr "BIhurtu PS 2. mailara"
|
||||
|
||||
#. Translators: this is an option of "GhostScript"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4622
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4649
|
||||
msgctxt "printing option value"
|
||||
msgid "No pre-filtering"
|
||||
msgstr "Aurre-iragazketarik ez"
|
||||
|
||||
#. Translators: "Miscellaneous" is the label for a button, that opens
|
||||
#. up an extra panel of settings in a print dialog.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4631
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4658
|
||||
msgctxt "printing option group"
|
||||
msgid "Miscellaneous"
|
||||
msgstr "Bestelakoak"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4658
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4685
|
||||
msgctxt "sides"
|
||||
msgid "One Sided"
|
||||
msgstr "Alde batetik"
|
||||
|
||||
#. Translators: this is an option of "Two Sided"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4660
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4687
|
||||
msgctxt "sides"
|
||||
msgid "Long Edge (Standard)"
|
||||
msgstr "Marjina luzea (estandarra)"
|
||||
|
||||
#. Translators: this is an option of "Two Sided"
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4662
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4689
|
||||
msgctxt "sides"
|
||||
msgid "Short Edge (Flip)"
|
||||
msgstr "Marjina laburra (iraulia)"
|
||||
|
||||
#. Translators: Top output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4665
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4692
|
||||
msgctxt "output-bin"
|
||||
msgid "Top Bin"
|
||||
msgstr "Goiko edukiontzia"
|
||||
|
||||
#. Translators: Middle output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4667
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4694
|
||||
msgctxt "output-bin"
|
||||
msgid "Middle Bin"
|
||||
msgstr "Erdiko edukiontzia"
|
||||
|
||||
#. Translators: Bottom output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4669
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4696
|
||||
msgctxt "output-bin"
|
||||
msgid "Bottom Bin"
|
||||
msgstr "Beheko edukiontzia"
|
||||
|
||||
#. Translators: Side output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4671
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4698
|
||||
msgctxt "output-bin"
|
||||
msgid "Side Bin"
|
||||
msgstr "Alboko edukiontzia"
|
||||
|
||||
#. Translators: Left output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4673
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4700
|
||||
msgctxt "output-bin"
|
||||
msgid "Left Bin"
|
||||
msgstr "Ezkerreko edukiontzia"
|
||||
|
||||
#. Translators: Right output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4675
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4702
|
||||
msgctxt "output-bin"
|
||||
msgid "Right Bin"
|
||||
msgstr "Eskuineko edukiontzia"
|
||||
|
||||
#. Translators: Center output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4677
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4704
|
||||
msgctxt "output-bin"
|
||||
msgid "Center Bin"
|
||||
msgstr "Zentroko edukiontzia"
|
||||
|
||||
#. Translators: Rear output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4679
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4706
|
||||
msgctxt "output-bin"
|
||||
msgid "Rear Bin"
|
||||
msgstr "Atzeko edukiontzia"
|
||||
|
||||
#. Translators: Output bin where one sided output is oriented in the face-up position
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4681
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4708
|
||||
msgctxt "output-bin"
|
||||
msgid "Face Up Bin"
|
||||
msgstr "Edukiontzia buruz gora"
|
||||
|
||||
#. Translators: Output bin where one sided output is oriented in the face-down position
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4683
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4710
|
||||
msgctxt "output-bin"
|
||||
msgid "Face Down Bin"
|
||||
msgstr "Edukiontzia buruz behera"
|
||||
|
||||
#. Translators: Large capacity output bin
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4685
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4712
|
||||
msgctxt "output-bin"
|
||||
msgid "Large Capacity Bin"
|
||||
msgstr "Tamaina handiko edukiontzia"
|
||||
|
||||
#. Translators: Output stacker number %d
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4707
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4734
|
||||
#, c-format
|
||||
msgctxt "output-bin"
|
||||
msgid "Stacker %d"
|
||||
msgstr "%d pilatzailea"
|
||||
|
||||
#. Translators: Output mailbox number %d
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4711
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4738
|
||||
#, c-format
|
||||
msgctxt "output-bin"
|
||||
msgid "Mailbox %d"
|
||||
msgstr "%d. postontzia"
|
||||
|
||||
#. Translators: Private mailbox
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4715
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4742
|
||||
msgctxt "output-bin"
|
||||
msgid "My Mailbox"
|
||||
msgstr "Nire postontzia"
|
||||
|
||||
#. Translators: Output tray number %d
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4719
|
||||
#: modules/printbackends/gtkprintbackendcups.c:4746
|
||||
#, c-format
|
||||
msgctxt "output-bin"
|
||||
msgid "Tray %d"
|
||||
msgstr "%d. erretilua"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5196
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5223
|
||||
msgid "Printer Default"
|
||||
msgstr "Inprimagailu lehenetsia"
|
||||
|
||||
#. Translators, this string is used to label the job priority option
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5670
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5702
|
||||
msgid "Job Priority"
|
||||
msgstr "Lanaren lehentasuna"
|
||||
|
||||
#. Translators, this string is used to label the billing info entry
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5681
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5713
|
||||
msgid "Billing Info"
|
||||
msgstr "Fakturaren datuak"
|
||||
|
||||
#. Translators, these strings are names for various 'standard' cover
|
||||
#. * pages that the printing system may support.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5705
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5737
|
||||
msgctxt "cover page"
|
||||
msgid "None"
|
||||
msgstr "Bat ere ez"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5706
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5738
|
||||
msgctxt "cover page"
|
||||
msgid "Classified"
|
||||
msgstr "Klasifikatuta"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5707
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5739
|
||||
msgctxt "cover page"
|
||||
msgid "Confidential"
|
||||
msgstr "Konfidentziala"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5708
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5740
|
||||
msgctxt "cover page"
|
||||
msgid "Secret"
|
||||
msgstr "Ezkutukoa"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5709
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5741
|
||||
msgctxt "cover page"
|
||||
msgid "Standard"
|
||||
msgstr "Arrunta"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5710
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5742
|
||||
msgctxt "cover page"
|
||||
msgid "Top Secret"
|
||||
msgstr "Ezkutu gorenekoa"
|
||||
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5711
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5743
|
||||
msgctxt "cover page"
|
||||
msgid "Unclassified"
|
||||
msgstr "Sailkatu gabe"
|
||||
@@ -7005,7 +7026,7 @@ msgstr "Sailkatu gabe"
|
||||
#. Translators, this string is used to label the pages-per-sheet option
|
||||
#. * in the print dialog
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5723
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5755
|
||||
msgctxt "printer option"
|
||||
msgid "Pages per Sheet"
|
||||
msgstr "Orrialde orriko"
|
||||
@@ -7013,7 +7034,7 @@ msgstr "Orrialde orriko"
|
||||
#. Translators, this string is used to label the option in the print
|
||||
#. * dialog that controls in what order multiple pages are arranged
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5740
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5772
|
||||
msgctxt "printer option"
|
||||
msgid "Page Ordering"
|
||||
msgstr "Orrialdeak ordenatzea"
|
||||
@@ -7022,7 +7043,7 @@ msgstr "Orrialdeak ordenatzea"
|
||||
#. * a print job is printed. Possible values are 'now', a specified time,
|
||||
#. * or 'on hold'
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5817
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5849
|
||||
msgctxt "printer option"
|
||||
msgid "Print at"
|
||||
msgstr "Noiz inprimatu"
|
||||
@@ -7030,7 +7051,7 @@ msgstr "Noiz inprimatu"
|
||||
#. Translators: this is the name of the option that allows the user
|
||||
#. * to specify a time when a print job will be printed.
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5828
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5860
|
||||
msgctxt "printer option"
|
||||
msgid "Print at time"
|
||||
msgstr "Noiz inprimatu"
|
||||
@@ -7040,19 +7061,19 @@ msgstr "Noiz inprimatu"
|
||||
#. * the width and height in points. E.g: "Custom
|
||||
#. * 230.4x142.9"
|
||||
#.
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5875
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5907
|
||||
#, c-format
|
||||
msgid "Custom %s×%s"
|
||||
msgstr "%sx%s pertsonalizatua"
|
||||
|
||||
#. TRANSLATORS: this is the ICC color profile to use for this job
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5986
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6018
|
||||
msgctxt "printer option"
|
||||
msgid "Printer Profile"
|
||||
msgstr "Inprimagailuaren profila"
|
||||
|
||||
#. TRANSLATORS: this is when color profile information is unavailable
|
||||
#: modules/printbackends/gtkprintbackendcups.c:5993
|
||||
#: modules/printbackends/gtkprintbackendcups.c:6025
|
||||
msgctxt "printer option value"
|
||||
msgid "Unavailable"
|
||||
msgstr "Ez dago erabilgarri"
|
||||
@@ -8029,6 +8050,15 @@ msgid ""
|
||||
msgstr "Ez dago gaiaren indize fitxategirik “%s”(e)n.\n"
|
||||
"Ikono-cache bat sortu nahi baduzu hemen, erabili --ignore-theme-index.\n"
|
||||
|
||||
#~ msgid "Backend does not support window scaling"
|
||||
#~ msgstr "Motorrak ez du leihoa eskalatzea onartzen"
|
||||
|
||||
#~ msgid "Font Scale"
|
||||
#~ msgstr "Letra-tipoaren eskala"
|
||||
|
||||
#~ msgid "Window Scaling"
|
||||
#~ msgstr "Leihoa eskalatzea"
|
||||
|
||||
#~ msgid "Show _Size Column"
|
||||
#~ msgstr "Erakutsi zutabearen _tamaina"
|
||||
|
||||
|
||||