Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27c978ce64 | |||
| add0afae30 |
+29
-30
@@ -210,52 +210,52 @@ msys2-mingw64:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
||||
|
||||
macos:
|
||||
macos-x86_64:
|
||||
rules:
|
||||
# Do not run in forks as the runner is not available there.
|
||||
# (except for dehesselle who maintains the runner)
|
||||
- if: $CI_PROJECT_NAMESPACE != "GNOME" && $CI_PROJECT_NAMESPACE != "dehesselle"
|
||||
when: never
|
||||
- if: $RUNNER == "macosintel"
|
||||
variables:
|
||||
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
||||
when: manual
|
||||
allow_failure: true
|
||||
- if: $RUNNER == "macosarm"
|
||||
variables:
|
||||
SDKROOT: /opt/sdks/MacOSX11.3.sdk
|
||||
- if: $CI_PROJECT_NAMESPACE == "GNOME"
|
||||
- if: $CI_PROJECT_NAMESPACE == "dehesselle"
|
||||
stage: build
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: [ "macosintel", "macosarm" ]
|
||||
tags:
|
||||
- ${RUNNER}
|
||||
- macosintel
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: ""
|
||||
BACKEND_FLAGS: "-Dx11-backend=false -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dmedia-gstreamer=disabled -Dintrospection=enabled -Dgobject-introspection:werror=false"
|
||||
MESON_FORCE_BACKTRACKE: 1
|
||||
TMPDIR: /Users/Shared/work/tmp
|
||||
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
||||
PIP_CACHE_DIR: /Users/Shared/build/cache
|
||||
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
|
||||
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
|
||||
EXTRA_MESON_FLAGS: "-Dgobject-introspection:werror=false"
|
||||
before_script:
|
||||
- .gitlab-ci/show-info-macos.sh
|
||||
- python3 -m venv .venv
|
||||
# Building the introspection feature requires pkg-config and bison.
|
||||
- curl -L $CI_API_V4_URL/projects/30437/packages/generic/pkgconfig/v0.29.2+10/pkg-config-0.29.2+10_$(uname -m).tar.xz | tar -C .venv -xJ
|
||||
- curl -L $CI_API_V4_URL/projects/30438/packages/generic/bison/v3.8.2+3/bison-3.8.2+3_$(uname -m).tar.xz | tar -C .venv -xJ
|
||||
# Not using ccache on purpose as it accelerates the build so much that it
|
||||
# can trigger race conditions in the gobject-introspection subproject.
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- /opt/macports/bin/python3.10 -m venv .venv
|
||||
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
|
||||
- ln -s /opt/pkg-config/bin/pkg-config .venv/bin
|
||||
- ln -s /opt/bison/bin/bison .venv/bin
|
||||
- source .venv/bin/activate
|
||||
- pip3 install meson==1.3.2 ninja==1.11.1.1
|
||||
# We're not setting up ccache here on purpose as it accelerates the build
|
||||
# so much that it triggers race conditions in the gobject-introspection
|
||||
# subproject.
|
||||
- pip3 install meson==1.2.0
|
||||
- pip3 install ninja==1.11.1
|
||||
- pip3 install /Users/Shared/build/pkgs/PyGObject-3.44.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
/Users/Shared/build/pkgs/pycairo-1.23.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
script:
|
||||
- meson setup
|
||||
${COMMON_MESON_FLAGS}
|
||||
${EXTRA_MESON_FLAGS}
|
||||
${BACKEND_FLAGS}
|
||||
${FEATURE_FLAGS}
|
||||
-Dx11-backend=false
|
||||
-Dbroadway-backend=true
|
||||
-Dmacos-backend=true
|
||||
-Dmedia-gstreamer=disabled
|
||||
-Dintrospection=enabled
|
||||
-Dcpp_std=c++11
|
||||
-Dpixman:tests=disabled
|
||||
-Dlibjpeg-turbo:simd=disabled
|
||||
-Dbuild-demos=false
|
||||
-Dbuild-examples=false
|
||||
-Dbuild-testsuite=false
|
||||
_build
|
||||
- meson compile -C _build
|
||||
artifacts:
|
||||
@@ -479,4 +479,3 @@ publish-docs:
|
||||
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=docs-gtk-org https://gitlab.gnome.org/api/v4/projects/665/trigger/pipeline"
|
||||
rules:
|
||||
- if: $CI_COMMIT_REF_NAME == "main"
|
||||
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
set -eux -o pipefail
|
||||
|
||||
xcodebuild -version || :
|
||||
|
||||
if [ -z "$SDKROOT" ]; then
|
||||
xcodebuild -showsdks || :
|
||||
else
|
||||
echo "SDKROOT = $SDKROOT"
|
||||
fi
|
||||
xcodebuild -showsdks || :
|
||||
|
||||
system_profiler SPSoftwareDataType || :
|
||||
@@ -1,4 +1,4 @@
|
||||
Overview of Changes in 4.13.9, xx-xx-xxxx
|
||||
Overview of Changes in 4.13.8, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
Note: The new renderers and dmabuf support are using graphics drivers
|
||||
@@ -7,46 +7,6 @@ in different ways than the old gl renderer, and trigger new driver bugs,
|
||||
https://gitlab.gnome.org/GNOME/gtk/-/issues/6388). Therefore, it is
|
||||
recommended to use the latest mesa release (24.0) with the new renderers.
|
||||
|
||||
|
||||
Overview of Changes in 4.13.8, 20-02-2024
|
||||
=========================================
|
||||
|
||||
* Accessibility:
|
||||
- Add a GtkAccessibleText interface for allowing 3rd party
|
||||
text widgets (notably vte) to be accessible
|
||||
- Avoid duplicate accessible descriptions
|
||||
- Fix GetAccessibleAtPoint
|
||||
|
||||
* GSK:
|
||||
- Avoid offscreens for disjoint containers
|
||||
- Don't use the gpu renderers with llvmpipe
|
||||
- Fix various rendering issues found by tests
|
||||
- Allow unnormalized node bounds again
|
||||
- Fix a broken case of rounded-rect intersection
|
||||
- Fix handling of external textures in gpu renderers
|
||||
- Make gpu renderers work with WGL on Windows
|
||||
|
||||
* build:
|
||||
- Allow building without dmabuf support on (old) Linux
|
||||
|
||||
* X11:
|
||||
- Fix monitor enter/leave signals
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Catalan
|
||||
Czech
|
||||
Galician
|
||||
Georgian
|
||||
Hebrew
|
||||
Lithuanian
|
||||
Persian
|
||||
Russian
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.13.7, 11-02-2024
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ SYNOPSIS
|
||||
| **gtk4-rendernode-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||
|
|
||||
| **gtk4-rendernode-tool** benchmark [OPTIONS...] <FILE>
|
||||
| **gtk4-rendernode-tool** compare [OPTIONS...] <FILE1> <FILE2>
|
||||
| **gtk4-rendernode-tool** info [OPTIONS...] <FILE>
|
||||
| **gtk4-rendernode-tool** render [OPTIONS...] <FILE> [<FILE>]
|
||||
| **gtk4-rendernode-tool** show [OPTIONS...] <FILE>
|
||||
@@ -76,21 +75,7 @@ and prints the runtimes.
|
||||
the execution of the commands on the GPU. It can be useful to use this flag to test
|
||||
command submission performance.
|
||||
|
||||
Compare
|
||||
^^^^^^^
|
||||
|
||||
The ``compare`` command compares the rendering of a node with a reference image,
|
||||
or the renderings of two nodes, or two images. If any differences are found, the
|
||||
exit code is 1. If the images are identical, it is 0.
|
||||
|
||||
``--renderer=RENDERER``
|
||||
|
||||
Use the given renderer.
|
||||
|
||||
``--output=FILE``
|
||||
|
||||
Save the differences as a png image in ``FILE``.
|
||||
|
||||
``--quiet``
|
||||
|
||||
Don't write results to stdout.`
|
||||
|
||||
+42
-177
@@ -309,202 +309,67 @@ typedef enum
|
||||
* The color values are premultiplied with the alpha value.
|
||||
* @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha
|
||||
* The color values are premultiplied with the alpha value.
|
||||
* @GDK_MEMORY_A8B8G8R8_PREMULTIPLIED: 4 bytes; for alpha, blue, green, red,
|
||||
* The color values are premultiplied with the alpha value. Since 4.14
|
||||
* @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha.
|
||||
* @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue.
|
||||
* @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha.
|
||||
* @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red.
|
||||
* @GDK_MEMORY_B8G8R8X8: 4 bytes; for blue, green, red, unused. Since 4.14
|
||||
* @GDK_MEMORY_X8R8G8B8: 4 bytes; for unused, red, green, blue. Since 4.14
|
||||
* @GDK_MEMORY_R8G8B8X8: 4 bytes; for red, green, blue, unused. Since 4.14
|
||||
* @GDK_MEMORY_X8B8G8R8: 4 bytes; for unused, blue, green, red. Since 4.14
|
||||
* @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque.
|
||||
* @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque.
|
||||
* @GDK_MEMORY_R16G16B16: 3 guint16 values; for red, green, blue. Since: 4.6
|
||||
* @GDK_MEMORY_R16G16B16A16_PREMULTIPLIED: 4 guint16 values; for red, green,
|
||||
* blue, alpha. The color values are premultiplied with the alpha value.
|
||||
* Since: 4.6
|
||||
* @GDK_MEMORY_R16G16B16A16: 4 guint16 values; for red, green, blue, alpha.
|
||||
* Since: 4.6
|
||||
* @GDK_MEMORY_R16G16B16_FLOAT: 3 half-float values; for red, green, blue.
|
||||
* The data is opaque. Since: 4.6
|
||||
* @GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED: 4 half-float values; for
|
||||
* red, green, blue and alpha. The color values are premultiplied with
|
||||
* the alpha value. Since: 4.6
|
||||
* @GDK_MEMORY_R16G16B16A16_FLOAT: 4 half-float values; for red, green,
|
||||
* blue and alpha. Since: 4.6
|
||||
* @GDK_MEMORY_B32G32R32_FLOAT: 3 float values; for blue, green, red.
|
||||
* The data is opaque. Since: 4.6
|
||||
* @GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: 4 float values; for
|
||||
* red, green, blue and alpha. The color values are premultiplied with
|
||||
* the alpha value. Since: 4.6
|
||||
* @GDK_MEMORY_R32G32B32A32_FLOAT: 4 float values; for red, green, blue and
|
||||
* alpha. Since: 4.6
|
||||
* @GDK_MEMORY_G8A8_PREMULTIPLIED: 2 bytes; for grayscale, alpha. The color
|
||||
* values are premultiplied with the alpha value. Since: 4.12
|
||||
* @GDK_MEMORY_G8A8: 2 bytes; for grayscale, alpha. Since: 4.12
|
||||
* @GDK_MEMORY_G8: One byte; for grayscale. The data is opaque.
|
||||
* Since: 4.12
|
||||
* @GDK_MEMORY_G16A16_PREMULTIPLIED: 2 guint16 values; for grayscale, alpha.
|
||||
* The color values are premultiplied with the alpha value. Since: 4.12
|
||||
* @GDK_MEMORY_G16A16: 2 guint16 values; for grayscale, alpha. Since: 4.12
|
||||
* @GDK_MEMORY_G16: One guint16 value; for grayscale. The data is opaque.
|
||||
* Since: 4.12
|
||||
* @GDK_MEMORY_A8: One byte; for alpha.
|
||||
* Since: 4.12
|
||||
* @GDK_MEMORY_A16: One guint16 value; for alpha.
|
||||
* Since: 4.12
|
||||
* @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as
|
||||
* more formats get added, so do not rely on its concrete integer.
|
||||
* @GDK_MEMORY_R32G32B32_FLOAT: 3 float values; for red, green, blue.
|
||||
*
|
||||
* `GdkMemoryFormat` describes formats that image data can have in memory.
|
||||
*
|
||||
* It describes formats by listing the contents of the memory passed to it.
|
||||
* So `GDK_MEMORY_A8R8G8B8` will be 1 byte (8 bits) of alpha, followed by a
|
||||
* So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a
|
||||
* byte each of red, green and blue. It is not endian-dependent, so
|
||||
* `CAIRO_FORMAT_ARGB32` is represented by different `GdkMemoryFormats`
|
||||
* CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats`
|
||||
* on architectures with different endiannesses.
|
||||
*
|
||||
* Its naming is modelled after
|
||||
* [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
|
||||
* for details).
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_A8B8G8R8_PREMULTIPLIED:
|
||||
*
|
||||
* 4 bytes; for alpha, blue, green, red, The color values are premultiplied with
|
||||
* the alpha value.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_B8G8R8X8:
|
||||
*
|
||||
* 4 bytes; for blue, green, red, unused.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_X8R8G8B8:
|
||||
*
|
||||
* 4 bytes; for unused, red, green, blue.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R8G8B8X8:
|
||||
*
|
||||
* 4 bytes; for red, green, blue, unused.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_X8B8G8R8:
|
||||
*
|
||||
* 4 bytes; for unused, blue, green, red.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16:
|
||||
*
|
||||
* 3 guint16 values; for red, green, blue.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16A16_PREMULTIPLIED:
|
||||
*
|
||||
* 4 guint16 values; for red, green, blue, alpha. The color values are
|
||||
* premultiplied with the alpha value.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16A16:
|
||||
*
|
||||
* 4 guint16 values; for red, green, blue, alpha.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16_FLOAT:
|
||||
*
|
||||
* 3 half-float values; for red, green, blue. The data is opaque.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED:
|
||||
*
|
||||
* 4 half-float values; for red, green, blue and alpha. The color values are
|
||||
* premultiplied with the alpha value.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R16G16B16A16_FLOAT:
|
||||
*
|
||||
* 4 half-float values; for red, green, blue and alpha.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_B32G32R32_FLOAT:
|
||||
*
|
||||
* 3 float values; for blue, green, red. The data is opaque.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED:
|
||||
*
|
||||
* 4 float values; for red, green, blue and alpha. The color values are
|
||||
* premultiplied with the alpha value.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_R32G32B32A32_FLOAT:
|
||||
*
|
||||
* 4 float values; for red, green, blue and alpha.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G8A8_PREMULTIPLIED:
|
||||
*
|
||||
* 2 bytes; for grayscale, alpha. The color values are premultiplied with the
|
||||
* alpha value.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G8A8:
|
||||
*
|
||||
* 2 bytes; for grayscale, alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G8:
|
||||
*
|
||||
* One byte; for grayscale. The data is opaque.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G16A16_PREMULTIPLIED:
|
||||
*
|
||||
* 2 guint16 values; for grayscale, alpha. The color values are premultiplied
|
||||
* with the alpha value.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G16A16:
|
||||
*
|
||||
* 2 guint16 values; for grayscale, alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_G16:
|
||||
*
|
||||
* One guint16 value; for grayscale. The data is opaque.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_A8:
|
||||
*
|
||||
* One byte; for alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_A16:
|
||||
*
|
||||
* One guint16 value; for alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_A16_FLOAT:
|
||||
*
|
||||
* One half-float value; for alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
/**
|
||||
* GDK_MEMORY_A32_FLOAT:
|
||||
*
|
||||
* One float value; for alpha.
|
||||
*
|
||||
* Since: 4.12
|
||||
*/
|
||||
typedef enum {
|
||||
GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
|
||||
GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
|
||||
|
||||
@@ -266,10 +266,10 @@ _XcursorReadUInt (XcursorFile *file, XcursorUInt *u)
|
||||
|
||||
if ((*file->read) (file, bytes, 4) != 4)
|
||||
return XcursorFalse;
|
||||
*u = ((((unsigned int)(bytes[0])) << 0) |
|
||||
(((unsigned int)(bytes[1])) << 8) |
|
||||
(((unsigned int)(bytes[2])) << 16) |
|
||||
(((unsigned int)(bytes[3])) << 24));
|
||||
*u = ((bytes[0] << 0) |
|
||||
(bytes[1] << 8) |
|
||||
(bytes[2] << 16) |
|
||||
(bytes[3] << 24));
|
||||
return XcursorTrue;
|
||||
}
|
||||
|
||||
|
||||
@@ -2437,13 +2437,12 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
||||
gboolean needs_scaling = FALSE;
|
||||
double scale;
|
||||
|
||||
if (monitor_has_xdg_output (monitor) &&
|
||||
monitor->xdg_output_geometry.width != 0 &&
|
||||
monitor->xdg_output_geometry.height != 0)
|
||||
if (monitor->xdg_output_done)
|
||||
{
|
||||
logical_geometry = monitor->xdg_output_geometry;
|
||||
needs_scaling = logical_geometry.width == monitor->output_geometry.width &&
|
||||
logical_geometry.height == monitor->output_geometry.height;
|
||||
needs_scaling =
|
||||
logical_geometry.width == monitor->output_geometry.width ||
|
||||
logical_geometry.height == monitor->output_geometry.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2454,7 +2453,6 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
||||
if (needs_scaling)
|
||||
{
|
||||
int scale_factor = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
|
||||
|
||||
logical_geometry.y /= scale_factor;
|
||||
logical_geometry.x /= scale_factor;
|
||||
logical_geometry.width /= scale_factor;
|
||||
|
||||
+10
-21
@@ -892,11 +892,11 @@ pixbuf_to_hicon (GdkPixbuf *pixbuf,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
HICON
|
||||
_gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||
gboolean is_icon,
|
||||
int x,
|
||||
int y)
|
||||
static GdkWin32HCursor *
|
||||
gdk_win32hcursor_create_for_texture (GdkWin32Display *display,
|
||||
GdkTexture *texture,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
GdkPixbuf *pixbuf;
|
||||
@@ -906,24 +906,13 @@ _gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||
surface = gdk_texture_download_surface (texture);
|
||||
width = cairo_image_surface_get_width (surface);
|
||||
height = cairo_image_surface_get_height (surface);
|
||||
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
|
||||
|
||||
icon = pixbuf_to_hicon (pixbuf, is_icon, x, y);
|
||||
|
||||
|
||||
icon = pixbuf_to_hicon (pixbuf, FALSE, x, y);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
static GdkWin32HCursor *
|
||||
gdk_win32hcursor_create_for_texture (GdkWin32Display *display,
|
||||
GdkTexture *texture,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
HICON icon = _gdk_win32_create_hicon_for_texture (texture, FALSE, x, y);
|
||||
|
||||
|
||||
return gdk_win32_hcursor_new (display, (HCURSOR) icon, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, depth, update_area);
|
||||
}
|
||||
|
||||
#define PIXEL_ATTRIBUTES 21
|
||||
#define PIXEL_ATTRIBUTES 17
|
||||
|
||||
static int
|
||||
get_wgl_pfd (HDC hdc,
|
||||
@@ -176,19 +176,10 @@ get_wgl_pfd (HDC hdc,
|
||||
pixelAttribs[i++] = WGL_ALPHA_BITS_ARB;
|
||||
pixelAttribs[i++] = 8;
|
||||
|
||||
pixelAttribs[i++] = WGL_DEPTH_BITS_ARB;
|
||||
pixelAttribs[i++] = 0;
|
||||
|
||||
pixelAttribs[i++] = WGL_STENCIL_BITS_ARB;
|
||||
pixelAttribs[i++] = 0;
|
||||
|
||||
pixelAttribs[i++] = WGL_ACCUM_BITS_ARB;
|
||||
pixelAttribs[i++] = 0;
|
||||
|
||||
/* end of "Update PIXEL_ATTRIBUTES above if any groups are added here!" */
|
||||
|
||||
pixelAttribs[i++] = 0; /* end of pixelAttribs */
|
||||
g_assert (i == PIXEL_ATTRIBUTES);
|
||||
g_assert (i <= PIXEL_ATTRIBUTES);
|
||||
|
||||
if (!wglMakeCurrent (display_win32->dummy_context_wgl.hdc,
|
||||
display_win32->dummy_context_wgl.hglrc))
|
||||
@@ -214,7 +205,7 @@ get_wgl_pfd (HDC hdc,
|
||||
pfd->iPixelType = PFD_TYPE_RGBA;
|
||||
pfd->cColorBits = GetDeviceCaps (hdc, BITSPIXEL);
|
||||
pfd->cAlphaBits = 8;
|
||||
pfd->iLayerType = PFD_MAIN_PLANE;
|
||||
pfd->dwLayerMask = PFD_MAIN_PLANE;
|
||||
|
||||
best_pf = ChoosePixelFormat (hdc, pfd);
|
||||
}
|
||||
@@ -613,7 +604,7 @@ set_wgl_pixformat_for_hdc (GdkWin32Display *display_win32,
|
||||
{
|
||||
gboolean skip_acquire = FALSE;
|
||||
gboolean set_pixel_format_result = FALSE;
|
||||
PIXELFORMATDESCRIPTOR pfd = {0};
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
|
||||
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
|
||||
* one single time per window HDC
|
||||
|
||||
@@ -211,11 +211,6 @@ Win32Cursor * win32_cursor_theme_get_cursor (Win32CursorTheme *theme,
|
||||
void win32_cursor_theme_destroy (Win32CursorTheme *theme);
|
||||
Win32CursorTheme *_gdk_win32_display_get_cursor_theme (GdkWin32Display *win32_display);
|
||||
|
||||
HICON _gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||
gboolean is_icon,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
gboolean _gdk_win32_display_has_pending (GdkDisplay *display);
|
||||
void _gdk_win32_display_queue_events (GdkDisplay *display);
|
||||
|
||||
|
||||
@@ -4308,82 +4308,6 @@ gdk_win32_surface_set_shadow_width (GdkSurface *window,
|
||||
impl->shadow_y = top + bottom;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_surface_set_icon_list (GdkSurface *surface,
|
||||
GList *textures)
|
||||
{
|
||||
GdkTexture *texture, *big_texture, *small_texture;
|
||||
gint big_diff, small_diff;
|
||||
gint big_w, big_h, small_w, small_h;
|
||||
gint w, h;
|
||||
gint dw, dh, diff;
|
||||
HICON small_hicon, big_hicon;
|
||||
GdkWin32Surface *impl;
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
impl = GDK_WIN32_SURFACE (surface);
|
||||
|
||||
/* ideal sizes for small and large icons */
|
||||
big_w = GetSystemMetrics (SM_CXICON);
|
||||
big_h = GetSystemMetrics (SM_CYICON);
|
||||
small_w = GetSystemMetrics (SM_CXSMICON);
|
||||
small_h = GetSystemMetrics (SM_CYSMICON);
|
||||
|
||||
/* find closest sized icons in the list */
|
||||
big_texture = NULL;
|
||||
small_texture = NULL;
|
||||
big_diff = 0;
|
||||
small_diff = 0;
|
||||
while (textures)
|
||||
{
|
||||
texture = (GdkTexture*) textures->data;
|
||||
w = gdk_texture_get_width (texture);
|
||||
h = gdk_texture_get_height (texture);
|
||||
|
||||
dw = ABS (w - big_w);
|
||||
dh = ABS (h - big_h);
|
||||
diff = dw*dw + dh*dh;
|
||||
if (big_texture == NULL || diff < big_diff)
|
||||
{
|
||||
big_texture = texture;
|
||||
big_diff = diff;
|
||||
}
|
||||
|
||||
dw = ABS (w - small_w);
|
||||
dh = ABS (h - small_h);
|
||||
diff = dw*dw + dh*dh;
|
||||
if (small_texture == NULL || diff < small_diff)
|
||||
{
|
||||
small_texture = texture;
|
||||
small_diff = diff;
|
||||
}
|
||||
|
||||
textures = textures->next;
|
||||
}
|
||||
|
||||
if (big_texture == NULL || small_texture == NULL)
|
||||
return;
|
||||
|
||||
/* Create the icons */
|
||||
big_hicon = big_texture ? _gdk_win32_create_hicon_for_texture (big_texture, TRUE, 0, 0) : NULL;
|
||||
small_hicon = small_texture ? _gdk_win32_create_hicon_for_texture (small_texture, TRUE, 0, 0) : NULL;
|
||||
|
||||
/* Set the icons */
|
||||
SendMessage (GDK_SURFACE_HWND (surface), WM_SETICON, ICON_BIG,
|
||||
(LPARAM)big_hicon);
|
||||
SendMessage (GDK_SURFACE_HWND (surface), WM_SETICON, ICON_SMALL,
|
||||
(LPARAM)small_hicon);
|
||||
|
||||
/* Store the icons, destroying any previous icons */
|
||||
if (impl->hicon_big)
|
||||
GDI_CALL (DestroyIcon, (impl->hicon_big));
|
||||
impl->hicon_big = big_hicon;
|
||||
if (impl->hicon_small)
|
||||
GDI_CALL (DestroyIcon, (impl->hicon_small));
|
||||
impl->hicon_small = small_hicon;
|
||||
}
|
||||
|
||||
double
|
||||
_gdk_win32_surface_get_scale (GdkSurface *surface)
|
||||
@@ -4814,8 +4738,6 @@ gdk_win32_toplevel_set_property (GObject *object,
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
||||
gdk_win32_surface_set_icon_list (surface, g_value_get_pointer (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
|
||||
@@ -1430,8 +1430,6 @@ gdk_x11_display_open (const char *display_name)
|
||||
int maj, min;
|
||||
char *cm_name;
|
||||
gboolean frame_extents;
|
||||
gboolean rgba;
|
||||
gboolean composited;
|
||||
|
||||
XInitThreads ();
|
||||
|
||||
@@ -1648,10 +1646,7 @@ gdk_x11_display_open (const char *display_name)
|
||||
|
||||
frame_extents = gdk_x11_screen_supports_net_wm_hint (gdk_x11_display_get_screen (display),
|
||||
g_intern_static_string ("_GTK_FRAME_EXTENTS"));
|
||||
rgba = gdk_display_is_rgba (display);
|
||||
composited = gdk_display_is_composited (display);
|
||||
|
||||
gdk_display_set_shadow_width (display, frame_extents && rgba && composited);
|
||||
gdk_display_set_shadow_width (display, frame_extents);
|
||||
|
||||
gdk_display_emit_opened (display);
|
||||
|
||||
|
||||
@@ -2655,7 +2655,6 @@ gdk_x11_surface_get_geometry (GdkSurface *surface,
|
||||
{
|
||||
GdkX11Surface *impl;
|
||||
Window root;
|
||||
Window child;
|
||||
int tx;
|
||||
int ty;
|
||||
guint twidth;
|
||||
@@ -2670,11 +2669,7 @@ gdk_x11_surface_get_geometry (GdkSurface *surface,
|
||||
XGetGeometry (GDK_SURFACE_XDISPLAY (surface),
|
||||
GDK_SURFACE_XID (surface),
|
||||
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
||||
|
||||
XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
|
||||
GDK_SURFACE_XID (surface),
|
||||
root, 0, 0, &tx, &ty, &child);
|
||||
|
||||
|
||||
if (x)
|
||||
*x = tx / impl->surface_scale;
|
||||
if (y)
|
||||
|
||||
@@ -1066,7 +1066,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
gsk_gl_profiler_begin_gpu_region (self->gl_profiler);
|
||||
gsk_profiler_timer_begin (self->profiler, self->metrics.cpu_time);
|
||||
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
|
||||
/* Pre-multiplied alpha */
|
||||
glEnable (GL_BLEND);
|
||||
|
||||
@@ -144,7 +144,8 @@ gsk_gl_frame_submit (GskGpuFrame *frame,
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glEnable (GL_BLEND);
|
||||
|
||||
if (vertex_buffer)
|
||||
|
||||
+44
-137
@@ -11,7 +11,6 @@
|
||||
#include "gdk/gdkprofilerprivate.h"
|
||||
|
||||
#include "gsk/gskdebugprivate.h"
|
||||
#include "gsk/gskprivate.h"
|
||||
|
||||
#define MAX_SLICES_PER_ATLAS 64
|
||||
|
||||
@@ -33,37 +32,6 @@ typedef struct _GskGpuCachedGlyph GskGpuCachedGlyph;
|
||||
typedef struct _GskGpuCachedTexture GskGpuCachedTexture;
|
||||
typedef struct _GskGpuDevicePrivate GskGpuDevicePrivate;
|
||||
|
||||
typedef struct {
|
||||
PangoFont *font;
|
||||
float scale;
|
||||
} FontCacheKey;
|
||||
|
||||
typedef struct {
|
||||
PangoGlyph glyph;
|
||||
GskGpuGlyphLookupFlags flags;
|
||||
} GlyphCacheKey;
|
||||
|
||||
typedef struct {
|
||||
FontCacheKey key;
|
||||
|
||||
GHashTable *cache;
|
||||
} FontGlyphCache;
|
||||
|
||||
static void
|
||||
font_glyph_cache_free (gpointer data)
|
||||
{
|
||||
FontGlyphCache *cache = data;
|
||||
|
||||
g_object_unref (cache->key.font);
|
||||
g_hash_table_unref (cache->cache);
|
||||
g_free (cache);
|
||||
}
|
||||
|
||||
static FontGlyphCache no_font_cache = {
|
||||
.key = { .font = NULL, .scale = -1 },
|
||||
.cache = NULL
|
||||
};
|
||||
|
||||
struct _GskGpuDevicePrivate
|
||||
{
|
||||
GdkDisplay *display;
|
||||
@@ -76,7 +44,6 @@ struct _GskGpuDevicePrivate
|
||||
|
||||
GHashTable *texture_cache;
|
||||
GHashTable *glyph_cache;
|
||||
FontGlyphCache *last_font_cache;
|
||||
|
||||
GskGpuCachedAtlas *current_atlas;
|
||||
|
||||
@@ -101,15 +68,14 @@ struct _GskGpuCachedClass
|
||||
struct _GskGpuCached
|
||||
{
|
||||
const GskGpuCachedClass *class;
|
||||
|
||||
GskGpuCachedAtlas *atlas;
|
||||
GskGpuCached *next;
|
||||
GskGpuCached *prev;
|
||||
|
||||
gint64 timestamp;
|
||||
|
||||
unsigned int stale : 1;
|
||||
unsigned int pixels : 31; /* For glyphs and textures, pixels. For atlases, dead pixels */
|
||||
|
||||
gboolean stale;
|
||||
guint pixels; /* For glyphs and textures, pixels. For atlases, dead pixels */
|
||||
};
|
||||
|
||||
static inline void
|
||||
@@ -394,8 +360,10 @@ struct _GskGpuCachedGlyph
|
||||
{
|
||||
GskGpuCached parent;
|
||||
|
||||
FontGlyphCache *font_cache;
|
||||
GlyphCacheKey glyph_key;
|
||||
PangoFont *font;
|
||||
PangoGlyph glyph;
|
||||
GskGpuGlyphLookupFlags flags;
|
||||
float scale;
|
||||
|
||||
GskGpuImage *image;
|
||||
graphene_rect_t bounds;
|
||||
@@ -408,17 +376,10 @@ gsk_gpu_cached_glyph_free (GskGpuDevice *device,
|
||||
{
|
||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
|
||||
GskGpuCachedGlyph *self = (GskGpuCachedGlyph *) cached;
|
||||
FontGlyphCache *font_cache;
|
||||
|
||||
font_cache = self->font_cache;
|
||||
g_hash_table_remove (font_cache->cache, self);
|
||||
if (g_hash_table_size (font_cache->cache) == 0)
|
||||
{
|
||||
if (priv->last_font_cache == font_cache)
|
||||
priv->last_font_cache = &no_font_cache;
|
||||
g_hash_table_remove (priv->glyph_cache, font_cache);
|
||||
}
|
||||
g_hash_table_remove (priv->glyph_cache, self);
|
||||
|
||||
g_object_unref (self->font);
|
||||
g_object_unref (self->image);
|
||||
|
||||
g_free (self);
|
||||
@@ -441,35 +402,15 @@ gsk_gpu_cached_glyph_should_collect (GskGpuDevice *device,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static guint
|
||||
gsk_gpu_cached_font_hash (gconstpointer data)
|
||||
{
|
||||
const FontGlyphCache *cache = data;
|
||||
const FontCacheKey *key = &cache->key;
|
||||
|
||||
return GPOINTER_TO_UINT (key->font) ^ ((guint) key->scale * PANGO_SCALE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gsk_gpu_cached_font_equal (gconstpointer v1,
|
||||
gconstpointer v2)
|
||||
{
|
||||
const FontGlyphCache *c1 = v1;
|
||||
const FontCacheKey *key1 = &c1->key;
|
||||
const FontGlyphCache *c2 = v2;
|
||||
const FontCacheKey *key2 = &c2->key;
|
||||
|
||||
return key1->font == key2->font &&
|
||||
key1->scale == key2->scale;
|
||||
}
|
||||
|
||||
static guint
|
||||
gsk_gpu_cached_glyph_hash (gconstpointer data)
|
||||
{
|
||||
const GskGpuCachedGlyph *glyph = data;
|
||||
const GlyphCacheKey *key = &glyph->glyph_key;
|
||||
|
||||
return key->glyph ^ (key->flags << 24);
|
||||
return GPOINTER_TO_UINT (glyph->font) ^
|
||||
glyph->glyph ^
|
||||
(glyph->flags << 24) ^
|
||||
((guint) glyph->scale * PANGO_SCALE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -478,11 +419,11 @@ gsk_gpu_cached_glyph_equal (gconstpointer v1,
|
||||
{
|
||||
const GskGpuCachedGlyph *glyph1 = v1;
|
||||
const GskGpuCachedGlyph *glyph2 = v2;
|
||||
const GlyphCacheKey *key1 = &glyph1->glyph_key;
|
||||
const GlyphCacheKey *key2 = &glyph2->glyph_key;
|
||||
|
||||
return key1->glyph == key2->glyph &&
|
||||
key1->flags == key2->flags;
|
||||
return glyph1->font == glyph2->font
|
||||
&& glyph1->glyph == glyph2->glyph
|
||||
&& glyph1->flags == glyph2->flags
|
||||
&& glyph1->scale == glyph2->scale;
|
||||
}
|
||||
|
||||
static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS =
|
||||
@@ -681,13 +622,10 @@ gsk_gpu_device_init (GskGpuDevice *self)
|
||||
{
|
||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||
|
||||
priv->glyph_cache = g_hash_table_new_full (gsk_gpu_cached_font_hash,
|
||||
gsk_gpu_cached_font_equal,
|
||||
NULL,
|
||||
font_glyph_cache_free);
|
||||
priv->glyph_cache = g_hash_table_new (gsk_gpu_cached_glyph_hash,
|
||||
gsk_gpu_cached_glyph_equal);
|
||||
priv->texture_cache = g_hash_table_new (g_direct_hash,
|
||||
g_direct_equal);
|
||||
priv->last_font_cache = &no_font_cache;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -951,71 +889,40 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
GskGpuGlyphLookupFlags flags,
|
||||
float scale,
|
||||
graphene_rect_t *out_bounds,
|
||||
graphene_point_t *out_origin,
|
||||
PangoFont **out_scaled_font)
|
||||
graphene_point_t *out_origin)
|
||||
{
|
||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||
FontGlyphCache font_lookup = {
|
||||
.key = { .font = font, .scale = scale }
|
||||
GskGpuCachedGlyph lookup = {
|
||||
.font = font,
|
||||
.glyph = glyph,
|
||||
.flags = flags,
|
||||
.scale = scale
|
||||
};
|
||||
GskGpuCachedGlyph glyph_lookup = {
|
||||
.glyph_key = { .glyph = glyph, .flags = flags }
|
||||
};
|
||||
FontGlyphCache *font_cache = NULL;
|
||||
GskGpuCachedGlyph *cache = NULL;
|
||||
GskGpuCachedGlyph *cache;
|
||||
PangoRectangle ink_rect;
|
||||
graphene_rect_t rect;
|
||||
graphene_point_t origin;
|
||||
GskGpuImage *image;
|
||||
gsize atlas_x, atlas_y, padding;
|
||||
float subpixel_x, subpixel_y;
|
||||
PangoFont *scaled_font;
|
||||
|
||||
if (priv->last_font_cache->key.font == font &&
|
||||
priv->last_font_cache->key.scale == scale)
|
||||
font_cache = priv->last_font_cache;
|
||||
else
|
||||
font_cache = g_hash_table_lookup (priv->glyph_cache, &font_lookup);
|
||||
|
||||
if (font_cache)
|
||||
cache = g_hash_table_lookup (priv->glyph_cache, &lookup);
|
||||
if (cache)
|
||||
{
|
||||
cache = g_hash_table_lookup (font_cache->cache, &glyph_lookup);
|
||||
if (cache)
|
||||
{
|
||||
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
||||
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
||||
|
||||
*out_bounds = cache->bounds;
|
||||
*out_origin = cache->origin;
|
||||
|
||||
priv->last_font_cache = font_cache;
|
||||
|
||||
return cache->image;
|
||||
}
|
||||
*out_bounds = cache->bounds;
|
||||
*out_origin = cache->origin;
|
||||
return cache->image;
|
||||
}
|
||||
else
|
||||
{
|
||||
font_cache = g_new (FontGlyphCache, 1);
|
||||
font_cache->key.font = g_object_ref (font);
|
||||
font_cache->key.scale = scale;
|
||||
font_cache->cache = g_hash_table_new (gsk_gpu_cached_glyph_hash,
|
||||
gsk_gpu_cached_glyph_equal);
|
||||
g_hash_table_insert (priv->glyph_cache, font_cache, font_cache);
|
||||
}
|
||||
|
||||
priv->last_font_cache = font_cache;
|
||||
|
||||
if (*out_scaled_font)
|
||||
scaled_font = *out_scaled_font;
|
||||
else
|
||||
scaled_font = gsk_get_scaled_font (font, scale);
|
||||
|
||||
subpixel_x = (flags & 3) / 4.f;
|
||||
subpixel_y = ((flags >> 2) & 3) / 4.f;
|
||||
pango_font_get_glyph_extents (scaled_font, glyph, &ink_rect, NULL);
|
||||
origin.x = floor (ink_rect.x * 1.0 / PANGO_SCALE + subpixel_x);
|
||||
origin.y = floor (ink_rect.y * 1.0 / PANGO_SCALE + subpixel_y);
|
||||
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * 1.0 / PANGO_SCALE + subpixel_x) - origin.x;
|
||||
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * 1.0 / PANGO_SCALE + subpixel_y) - origin.y;
|
||||
pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
|
||||
origin.x = floor (ink_rect.x * scale / PANGO_SCALE + subpixel_x);
|
||||
origin.y = floor (ink_rect.y * scale / PANGO_SCALE + subpixel_y);
|
||||
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * scale / PANGO_SCALE + subpixel_x) - origin.x;
|
||||
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * scale / PANGO_SCALE + subpixel_y) - origin.y;
|
||||
padding = 1;
|
||||
|
||||
image = gsk_gpu_device_add_atlas_image (self,
|
||||
@@ -1037,9 +944,10 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
cache = gsk_gpu_cached_new (self, &GSK_GPU_CACHED_GLYPH_CLASS, NULL);
|
||||
}
|
||||
|
||||
cache->font_cache = font_cache;
|
||||
cache->glyph_key.glyph = glyph;
|
||||
cache->glyph_key.flags = flags;
|
||||
cache->font = g_object_ref (font);
|
||||
cache->glyph = glyph;
|
||||
cache->flags = flags;
|
||||
cache->scale = scale;
|
||||
cache->bounds = rect;
|
||||
cache->image = image;
|
||||
cache->origin = GRAPHENE_POINT_INIT (- origin.x + subpixel_x,
|
||||
@@ -1048,7 +956,7 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
|
||||
gsk_gpu_upload_glyph_op (frame,
|
||||
cache->image,
|
||||
scaled_font,
|
||||
font,
|
||||
glyph,
|
||||
&(cairo_rectangle_int_t) {
|
||||
.x = rect.origin.x - padding,
|
||||
@@ -1056,16 +964,15 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
.width = rect.size.width + 2 * padding,
|
||||
.height = rect.size.height + 2 * padding,
|
||||
},
|
||||
scale,
|
||||
&GRAPHENE_POINT_INIT (cache->origin.x + padding,
|
||||
cache->origin.y + padding));
|
||||
|
||||
g_hash_table_insert (font_cache->cache, cache, cache);
|
||||
g_hash_table_insert (priv->glyph_cache, cache, cache);
|
||||
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
||||
|
||||
*out_bounds = cache->bounds;
|
||||
*out_origin = cache->origin;
|
||||
*out_scaled_font = scaled_font;
|
||||
|
||||
return cache->image;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,8 +96,7 @@ GskGpuImage * gsk_gpu_device_lookup_glyph_image (GskGpuD
|
||||
GskGpuGlyphLookupFlags flags,
|
||||
float scale,
|
||||
graphene_rect_t *out_bounds,
|
||||
graphene_point_t *out_origin,
|
||||
PangoFont **out_scaled_font);
|
||||
graphene_point_t *out_origin);
|
||||
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GskGpuDevice, g_object_unref)
|
||||
|
||||
@@ -2992,15 +2992,11 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
GskGpuDevice *device;
|
||||
const PangoGlyphInfo *glyphs;
|
||||
PangoFont *font;
|
||||
PangoFont *scaled_font = NULL;
|
||||
graphene_point_t offset;
|
||||
guint i, num_glyphs;
|
||||
float scale, inv_scale;
|
||||
GdkRGBA color;
|
||||
gboolean glyph_align;
|
||||
GskGpuImage *last_image;
|
||||
guint32 descriptor = 0;
|
||||
GskGpuClip old_clip;
|
||||
|
||||
if (self->opacity < 1.0 &&
|
||||
gsk_text_node_has_color_glyphs (node))
|
||||
@@ -3009,10 +3005,6 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
gsk_gpu_clip_init_copy (&old_clip, &self->clip);
|
||||
if (gsk_gpu_clip_contains_rect (&self->clip, &self->offset, &node->bounds))
|
||||
gsk_gpu_clip_init_contained (&self->clip, &node->bounds);
|
||||
|
||||
glyph_align = gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_GLYPH_ALIGN) &&
|
||||
gsk_transform_get_category (self->modelview) >= GSK_TRANSFORM_CATEGORY_2D;
|
||||
device = gsk_gpu_frame_get_device (self->frame);
|
||||
@@ -3028,24 +3020,31 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
scale = MAX (graphene_vec2_get_x (&self->scale), graphene_vec2_get_y (&self->scale));
|
||||
inv_scale = 1.f / scale;
|
||||
|
||||
last_image = NULL;
|
||||
for (i = 0; i < num_glyphs; i++)
|
||||
{
|
||||
GskGpuImage *image;
|
||||
graphene_rect_t glyph_bounds, glyph_tex_rect;
|
||||
graphene_point_t glyph_offset, glyph_origin;
|
||||
guint32 descriptor;
|
||||
GskGpuGlyphLookupFlags flags;
|
||||
|
||||
glyph_origin = GRAPHENE_POINT_INIT (offset.x + (float) glyphs[i].geometry.x_offset / PANGO_SCALE,
|
||||
offset.y + (float) glyphs[i].geometry.y_offset / PANGO_SCALE);
|
||||
if (glyph_align)
|
||||
{
|
||||
glyph_origin.x = roundf (glyph_origin.x * scale * 4);
|
||||
glyph_origin.y = roundf (glyph_origin.y * scale * 4);
|
||||
flags = ((int) glyph_origin.x & 3) |
|
||||
(((int) glyph_origin.y & 3) << 2);
|
||||
glyph_origin.x = 0.25 * inv_scale * glyph_origin.x;
|
||||
glyph_origin.y = 0.25 * inv_scale * glyph_origin.y;
|
||||
float x, y;
|
||||
int frac_x, frac_y;
|
||||
|
||||
x = glyph_origin.x * scale;
|
||||
y = glyph_origin.y * scale;
|
||||
|
||||
frac_x = (int) roundf ((x - floor (x)) * 4);
|
||||
frac_y = (int) roundf ((y - floor (y)) * 4);
|
||||
|
||||
flags = (frac_x & 3) | ((frac_y & 3) << 2);
|
||||
|
||||
glyph_origin.x = (floor (x) + (frac_x == 4 ? 1.f : 0.f)) * inv_scale;
|
||||
glyph_origin.y = (floor (y) + (frac_y == 4 ? 1.f : 0.f)) * inv_scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3059,20 +3058,13 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
flags,
|
||||
scale,
|
||||
&glyph_bounds,
|
||||
&glyph_offset,
|
||||
&scaled_font);
|
||||
&glyph_offset);
|
||||
|
||||
gsk_rect_scale (&GRAPHENE_RECT_INIT (-glyph_bounds.origin.x, -glyph_bounds.origin.y, gsk_gpu_image_get_width (image), gsk_gpu_image_get_height (image)), inv_scale, inv_scale, &glyph_tex_rect);
|
||||
gsk_rect_scale (&GRAPHENE_RECT_INIT(0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv_scale, inv_scale, &glyph_bounds);
|
||||
glyph_origin = GRAPHENE_POINT_INIT (glyph_origin.x - glyph_offset.x * inv_scale,
|
||||
glyph_origin.y - glyph_offset.y * inv_scale);
|
||||
|
||||
if (image != last_image)
|
||||
{
|
||||
descriptor = gsk_gpu_node_processor_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT);
|
||||
last_image = image;
|
||||
}
|
||||
|
||||
descriptor = gsk_gpu_node_processor_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT);
|
||||
if (glyphs[i].attr.is_color)
|
||||
gsk_gpu_texture_op (self->frame,
|
||||
gsk_gpu_clip_get_shader_clip (&self->clip, &glyph_offset, &glyph_bounds),
|
||||
@@ -3093,10 +3085,6 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
|
||||
offset.x += (float) glyphs[i].geometry.width / PANGO_SCALE;
|
||||
}
|
||||
|
||||
g_clear_object (&scaled_font);
|
||||
|
||||
gsk_gpu_clip_init_copy (&self->clip, &old_clip);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -3106,7 +3094,6 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
|
||||
GskGpuDevice *device;
|
||||
const PangoGlyphInfo *glyphs;
|
||||
PangoFont *font;
|
||||
PangoFont *scaled_font = NULL;
|
||||
guint num_glyphs;
|
||||
gsize i;
|
||||
float scale, inv_scale;
|
||||
@@ -3146,13 +3133,12 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
|
||||
0,
|
||||
scale,
|
||||
&glyph_bounds,
|
||||
&glyph_offset,
|
||||
&scaled_font);
|
||||
&glyph_offset);
|
||||
|
||||
if (image != last_image)
|
||||
{
|
||||
if (!gsk_gpu_pattern_writer_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT, &tex_id))
|
||||
break;
|
||||
return FALSE;
|
||||
|
||||
last_image = image;
|
||||
}
|
||||
@@ -3181,9 +3167,7 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
|
||||
offset.x += (float) glyphs[i].geometry.width / PANGO_SCALE;
|
||||
}
|
||||
|
||||
g_clear_object (&scaled_font);
|
||||
|
||||
return i == num_glyphs;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -485,6 +485,7 @@ struct _GskGpuUploadGlyphOp
|
||||
cairo_rectangle_int_t area;
|
||||
PangoFont *font;
|
||||
PangoGlyph glyph;
|
||||
float scale;
|
||||
graphene_point_t origin;
|
||||
|
||||
GskGpuBuffer *buffer;
|
||||
@@ -508,19 +509,11 @@ gsk_gpu_upload_glyph_op_print (GskGpuOp *op,
|
||||
guint indent)
|
||||
{
|
||||
GskGpuUploadGlyphOp *self = (GskGpuUploadGlyphOp *) op;
|
||||
PangoFontDescription *desc;
|
||||
char *str;
|
||||
|
||||
desc = pango_font_describe_with_absolute_size (self->font);
|
||||
str = pango_font_description_to_string (desc);
|
||||
|
||||
gsk_gpu_print_op (string, indent, "upload-glyph");
|
||||
gsk_gpu_print_int_rect (string, &self->area);
|
||||
g_string_append_printf (string, "glyph %u font %s ", self->glyph, str);
|
||||
g_string_append_printf (string, "glyph %u @ %g ", self->glyph, self->scale);
|
||||
gsk_gpu_print_newline (string);
|
||||
|
||||
g_free (str);
|
||||
pango_font_description_free (desc);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -538,6 +531,7 @@ gsk_gpu_upload_glyph_op_draw (GskGpuOp *op,
|
||||
self->area.height,
|
||||
stride);
|
||||
cairo_surface_set_device_offset (surface, self->origin.x, self->origin.y);
|
||||
cairo_surface_set_device_scale (surface, self->scale, self->scale);
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
|
||||
@@ -616,6 +610,7 @@ gsk_gpu_upload_glyph_op (GskGpuFrame *frame,
|
||||
PangoFont *font,
|
||||
const PangoGlyph glyph,
|
||||
const cairo_rectangle_int_t *area,
|
||||
float scale,
|
||||
const graphene_point_t *origin)
|
||||
{
|
||||
GskGpuUploadGlyphOp *self;
|
||||
@@ -626,5 +621,6 @@ gsk_gpu_upload_glyph_op (GskGpuFrame *frame,
|
||||
self->area = *area;
|
||||
self->font = g_object_ref (font);
|
||||
self->glyph = glyph;
|
||||
self->scale = scale;
|
||||
self->origin = *origin;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ void gsk_gpu_upload_glyph_op (GskGpuF
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph,
|
||||
const cairo_rectangle_int_t *area,
|
||||
float scale,
|
||||
const graphene_point_t *origin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "gskresources.h"
|
||||
#include "gskprivate.h"
|
||||
|
||||
#include <cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <math.h>
|
||||
|
||||
static gpointer
|
||||
register_resources (gpointer data)
|
||||
{
|
||||
@@ -19,78 +15,3 @@ gsk_ensure_resources (void)
|
||||
|
||||
g_once (®ister_resources_once, register_resources, NULL);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gsk_get_scaled_font:
|
||||
* @font: a `PangoFont`
|
||||
* @scale: the scale
|
||||
*
|
||||
* Returns a font that is just like @font, at a size that
|
||||
* is multiplied by @scale.
|
||||
*
|
||||
* Returns: (transfer full): a scaled version of @font
|
||||
*/
|
||||
PangoFont *
|
||||
gsk_get_scaled_font (PangoFont *font,
|
||||
float scale)
|
||||
{
|
||||
if (scale == 1.0)
|
||||
return g_object_ref (font);
|
||||
|
||||
#if PANGO_VERSION_CHECK (1, 52, 0)
|
||||
return pango_font_map_reload_font (pango_font_get_font_map (font), font, scale, NULL, NULL);
|
||||
#else
|
||||
GHashTable *fonts;
|
||||
int key;
|
||||
PangoFont *font2;
|
||||
PangoFontDescription *desc;
|
||||
int size;
|
||||
PangoFontMap *fontmap;
|
||||
PangoContext *context;
|
||||
cairo_scaled_font_t *sf;
|
||||
cairo_font_options_t *options;
|
||||
|
||||
key = (int) roundf (scale * PANGO_SCALE);
|
||||
|
||||
fonts = (GHashTable *) g_object_get_data (G_OBJECT (font), "gsk-scaled-fonts");
|
||||
|
||||
if (fonts)
|
||||
{
|
||||
font2 = g_hash_table_lookup (fonts, GINT_TO_POINTER (key));
|
||||
if (font2)
|
||||
return g_object_ref (font2);
|
||||
}
|
||||
else
|
||||
{
|
||||
fonts = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
|
||||
g_object_set_data_full (G_OBJECT (font), "gsk-scaled-fonts",
|
||||
fonts, (GDestroyNotify) g_hash_table_unref);
|
||||
}
|
||||
|
||||
desc = pango_font_describe (font);
|
||||
size = pango_font_description_get_size (desc);
|
||||
|
||||
if (pango_font_description_get_size_is_absolute (desc))
|
||||
pango_font_description_set_absolute_size (desc, size * scale);
|
||||
else
|
||||
pango_font_description_set_size (desc, (int) roundf (size * scale));
|
||||
|
||||
fontmap = pango_font_get_font_map (font);
|
||||
context = pango_font_map_create_context (fontmap);
|
||||
|
||||
sf = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font));
|
||||
options = cairo_font_options_create ();
|
||||
cairo_scaled_font_get_font_options (sf, options);
|
||||
pango_cairo_context_set_font_options (context, options);
|
||||
cairo_font_options_destroy (options);
|
||||
|
||||
font2 = pango_font_map_load_font (fontmap, context, desc);
|
||||
|
||||
pango_font_description_free (desc);
|
||||
g_object_unref (context);
|
||||
|
||||
g_hash_table_insert (fonts, GINT_TO_POINTER (key), font2);
|
||||
|
||||
return g_object_ref (font2);
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-4
@@ -5,10 +5,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void gsk_ensure_resources (void);
|
||||
|
||||
PangoFont *gsk_get_scaled_font (PangoFont *font,
|
||||
float scale);
|
||||
void gsk_ensure_resources (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+12
-4
@@ -5854,11 +5854,19 @@ gsk_text_node_new (PangoFont *font,
|
||||
self->glyphs = glyph_infos;
|
||||
self->num_glyphs = n;
|
||||
|
||||
/* Since we do subpixel positioning in device pixels, and the app and
|
||||
* device pixel grid may not be aligned, we can end up rounding down
|
||||
* for subpixel positioning even when we are exactly on an app pixel
|
||||
* boundary.
|
||||
*
|
||||
* Play it safe, and enlarge the node bounds by one app pixel
|
||||
* in each direction, so we don't leak ink when diffing.
|
||||
*/
|
||||
gsk_rect_init (&node->bounds,
|
||||
offset->x + ink_rect.x,
|
||||
offset->y + ink_rect.y,
|
||||
ink_rect.width,
|
||||
ink_rect.height);
|
||||
offset->x + ink_rect.x - 1,
|
||||
offset->y + ink_rect.y - 1,
|
||||
ink_rect.width + 2,
|
||||
ink_rect.height + 2);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
+2
-117
@@ -23,7 +23,6 @@
|
||||
#include "gtkatspicontextprivate.h"
|
||||
|
||||
#include "gtkaccessibleprivate.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
|
||||
#include "gtkatspiactionprivate.h"
|
||||
#include "gtkatspieditabletextprivate.h"
|
||||
@@ -1155,8 +1154,8 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
|
||||
if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_DESCRIPTION)
|
||||
{
|
||||
char *label = gtk_at_context_get_description (GTK_AT_CONTEXT (self));
|
||||
GVariant *v = g_variant_new_take_string (label);
|
||||
char *label = gtk_at_context_get_description (GTK_AT_CONTEXT (self));
|
||||
GVariant *v = g_variant_new_take_string (label);
|
||||
emit_property_changed (self, "accessible-description", v);
|
||||
}
|
||||
|
||||
@@ -1568,117 +1567,6 @@ gtk_at_spi_context_announce (GtkATContext *context,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_spi_context_update_caret_position (GtkATContext *context)
|
||||
{
|
||||
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
|
||||
GtkAccessibleText *accessible_text = GTK_ACCESSIBLE_TEXT (accessible);
|
||||
guint offset;
|
||||
|
||||
if (self->connection == NULL)
|
||||
return;
|
||||
|
||||
offset = gtk_accessible_text_get_caret_position (accessible_text);
|
||||
|
||||
g_dbus_connection_emit_signal (self->connection,
|
||||
NULL,
|
||||
self->context_path,
|
||||
"org.a11y.atspi.Event.Object",
|
||||
"TextCaretMoved",
|
||||
g_variant_new ("(siiva{sv})",
|
||||
"",
|
||||
(int) offset,
|
||||
0,
|
||||
g_variant_new_string (""),
|
||||
NULL),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_spi_context_update_selection_bound (GtkATContext *context)
|
||||
{
|
||||
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
|
||||
|
||||
if (self->connection == NULL)
|
||||
return;
|
||||
|
||||
g_dbus_connection_emit_signal (self->connection,
|
||||
NULL,
|
||||
self->context_path,
|
||||
"org.a11y.atspi.Event.Object",
|
||||
"TextSelectionChanged",
|
||||
g_variant_new ("(siiva{sv})",
|
||||
"",
|
||||
0,
|
||||
0,
|
||||
g_variant_new_string (""),
|
||||
NULL),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_spi_context_update_text_contents (GtkATContext *context,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
|
||||
|
||||
if (self->connection == NULL)
|
||||
return;
|
||||
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
|
||||
if (!GTK_IS_ACCESSIBLE_TEXT (accessible))
|
||||
return;
|
||||
|
||||
const char *kind = "";
|
||||
|
||||
switch (change)
|
||||
{
|
||||
case GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT:
|
||||
kind = "insert";
|
||||
break;
|
||||
|
||||
case GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE:
|
||||
kind = "delete";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
/* Retrieve the text using the given range */
|
||||
GBytes *contents = gtk_accessible_text_get_contents (GTK_ACCESSIBLE_TEXT (accessible),
|
||||
start, end);
|
||||
if (contents == NULL)
|
||||
goto out;
|
||||
|
||||
const char *text = g_bytes_get_data (contents, NULL);
|
||||
if (text == NULL)
|
||||
goto out;
|
||||
|
||||
/* Using G_MAXUINT in GTK maps to the text length */
|
||||
if (end == G_MAXUINT)
|
||||
end = g_utf8_strlen (text, -1);
|
||||
|
||||
g_dbus_connection_emit_signal (self->connection,
|
||||
NULL,
|
||||
self->context_path,
|
||||
"org.a11y.atspi.Event.Object",
|
||||
"TextChanged",
|
||||
g_variant_new ("(siiva{sv})",
|
||||
kind,
|
||||
start,
|
||||
end - start,
|
||||
g_variant_new_string (text),
|
||||
NULL),
|
||||
NULL);
|
||||
|
||||
out:
|
||||
g_clear_pointer (&contents, g_bytes_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_spi_context_class_init (GtkAtSpiContextClass *klass)
|
||||
{
|
||||
@@ -1694,9 +1582,6 @@ gtk_at_spi_context_class_init (GtkAtSpiContextClass *klass)
|
||||
context_class->bounds_change = gtk_at_spi_context_bounds_change;
|
||||
context_class->child_change = gtk_at_spi_context_child_change;
|
||||
context_class->announce = gtk_at_spi_context_announce;
|
||||
context_class->update_caret_position = gtk_at_spi_context_update_caret_position;
|
||||
context_class->update_selection_bound = gtk_at_spi_context_update_selection_bound;
|
||||
context_class->update_text_contents = gtk_at_spi_context_update_text_contents;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -20,6 +20,266 @@
|
||||
#include "gtkatspipangoprivate.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
|
||||
void
|
||||
gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
GVariantBuilder *builder)
|
||||
{
|
||||
char buf[60];
|
||||
|
||||
g_variant_builder_add (builder, "{ss}", "style",
|
||||
pango_style_to_string (pango_font_description_get_style (font)));
|
||||
g_variant_builder_add (builder, "{ss}", "variant",
|
||||
pango_variant_to_string (pango_font_description_get_variant (font)));
|
||||
g_variant_builder_add (builder, "{ss}", "stretch",
|
||||
pango_stretch_to_string (pango_font_description_get_stretch (font)));
|
||||
g_variant_builder_add (builder, "{ss}", "family-name",
|
||||
pango_font_description_get_family (font));
|
||||
|
||||
g_snprintf (buf, 60, "%d", pango_font_description_get_weight (font));
|
||||
g_variant_builder_add (builder, "{ss}", "weight", buf);
|
||||
g_snprintf (buf, 60, "%i", pango_font_description_get_size (font) / PANGO_SCALE);
|
||||
g_variant_builder_add (builder, "{ss}", "size", buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_get_default_attributes:
|
||||
* @layout: the `PangoLayout` from which to get attributes
|
||||
* @builder: a `GVariantBuilder` to add to
|
||||
*
|
||||
* Adds the default text attributes from @layout to @builder,
|
||||
* after translating them from Pango attributes to atspi
|
||||
* attributes.
|
||||
*
|
||||
* This is a convenience function that can be used to implement
|
||||
* support for the `AtkText` interface in widgets using Pango
|
||||
* layouts.
|
||||
*
|
||||
* Returns: the modified @attributes
|
||||
*/
|
||||
void
|
||||
gtk_pango_get_default_attributes (PangoLayout *layout,
|
||||
GVariantBuilder *builder)
|
||||
{
|
||||
PangoContext *context;
|
||||
|
||||
context = pango_layout_get_context (layout);
|
||||
if (context)
|
||||
{
|
||||
PangoLanguage *language;
|
||||
PangoFontDescription *font;
|
||||
|
||||
language = pango_context_get_language (context);
|
||||
if (language)
|
||||
g_variant_builder_add (builder, "{ss}", "language",
|
||||
pango_language_to_string (language));
|
||||
|
||||
font = pango_context_get_font_description (context);
|
||||
if (font)
|
||||
gtk_pango_get_font_attributes (font, builder);
|
||||
}
|
||||
|
||||
g_variant_builder_add (builder, "{ss}", "justification",
|
||||
pango_align_to_string (pango_layout_get_alignment (layout)));
|
||||
|
||||
g_variant_builder_add (builder, "{ss}", "wrap-mode",
|
||||
pango_wrap_mode_to_string (pango_layout_get_wrap (layout)));
|
||||
g_variant_builder_add (builder, "{ss}", "strikethrough", "false");
|
||||
g_variant_builder_add (builder, "{ss}", "underline", "false");
|
||||
g_variant_builder_add (builder, "{ss}", "rise", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "scale", "1");
|
||||
g_variant_builder_add (builder, "{ss}", "bg-full-height", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-inside-wrap", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-below-lines", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-above-lines", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "editable", "false");
|
||||
g_variant_builder_add (builder, "{ss}", "invisible", "false");
|
||||
g_variant_builder_add (builder, "{ss}", "indent", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "right-margin", "0");
|
||||
g_variant_builder_add (builder, "{ss}", "left-margin", "0");
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_get_run_attributes:
|
||||
* @layout: the `PangoLayout` to get the attributes from
|
||||
* @builder: `GVariantBuilder` to add to
|
||||
* @offset: the offset at which the attributes are wanted
|
||||
* @start_offset: return location for the starting offset
|
||||
* of the current run
|
||||
* @end_offset: return location for the ending offset of the
|
||||
* current run
|
||||
*
|
||||
* Finds the “run” around index (i.e. the maximal range of characters
|
||||
* where the set of applicable attributes remains constant) and
|
||||
* returns the starting and ending offsets for it.
|
||||
*
|
||||
* The attributes for the run are added to @attributes, after
|
||||
* translating them from Pango attributes to atspi attributes.
|
||||
*
|
||||
* This is a convenience function that can be used to implement
|
||||
* support for the #AtkText interface in widgets using Pango
|
||||
* layouts.
|
||||
*/
|
||||
void
|
||||
gtk_pango_get_run_attributes (PangoLayout *layout,
|
||||
GVariantBuilder *builder,
|
||||
int offset,
|
||||
int *start_offset,
|
||||
int *end_offset)
|
||||
{
|
||||
PangoAttrIterator *iter;
|
||||
PangoAttrList *attr;
|
||||
PangoAttrString *pango_string;
|
||||
PangoAttrInt *pango_int;
|
||||
PangoAttrColor *pango_color;
|
||||
PangoAttrLanguage *pango_lang;
|
||||
PangoAttrFloat *pango_float;
|
||||
int index, start_index, end_index;
|
||||
gboolean is_next;
|
||||
glong len;
|
||||
const char *text;
|
||||
char *value;
|
||||
const char *val;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
/* Grab the attributes of the PangoLayout, if any */
|
||||
attr = pango_layout_get_attributes (layout);
|
||||
|
||||
if (attr == NULL)
|
||||
{
|
||||
*start_offset = 0;
|
||||
*end_offset = len;
|
||||
return;
|
||||
}
|
||||
|
||||
iter = pango_attr_list_get_iterator (attr);
|
||||
/* Get invariant range offsets */
|
||||
/* If offset out of range, set offset in range */
|
||||
if (offset > len)
|
||||
offset = len;
|
||||
else if (offset < 0)
|
||||
offset = 0;
|
||||
|
||||
index = g_utf8_offset_to_pointer (text, offset) - text;
|
||||
pango_attr_iterator_range (iter, &start_index, &end_index);
|
||||
is_next = TRUE;
|
||||
while (is_next)
|
||||
{
|
||||
if (index >= start_index && index < end_index)
|
||||
{
|
||||
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
|
||||
if (end_index == G_MAXINT) /* Last iterator */
|
||||
end_index = len;
|
||||
|
||||
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
|
||||
break;
|
||||
}
|
||||
is_next = pango_attr_iterator_next (iter);
|
||||
pango_attr_iterator_range (iter, &start_index, &end_index);
|
||||
}
|
||||
|
||||
/* Get attributes */
|
||||
pango_string = (PangoAttrString *) pango_attr_iterator_get (iter, PANGO_ATTR_FAMILY);
|
||||
if (pango_string != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%s", pango_string->value);
|
||||
g_variant_builder_add (builder, "{ss}", "family-name", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STYLE);
|
||||
if (pango_int != NULL)
|
||||
g_variant_builder_add (builder, "{ss}", "style", pango_style_to_string (pango_int->value));
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_WEIGHT);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%i", pango_int->value);
|
||||
g_variant_builder_add (builder, "{ss}", "weight", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_VARIANT);
|
||||
if (pango_int != NULL)
|
||||
g_variant_builder_add (builder, "{ss}", "variant",
|
||||
pango_variant_to_string (pango_int->value));
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STRETCH);
|
||||
if (pango_int != NULL)
|
||||
g_variant_builder_add (builder, "{ss}", "stretch",
|
||||
pango_stretch_to_string (pango_int->value));
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_SIZE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%i", pango_int->value / PANGO_SCALE);
|
||||
g_variant_builder_add (builder, "{ss}", "size", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_UNDERLINE);
|
||||
if (pango_int != NULL)
|
||||
g_variant_builder_add (builder, "{ss}", "underline",
|
||||
pango_underline_to_string (pango_int->value));
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STRIKETHROUGH);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
if (pango_int->value)
|
||||
val = "true";
|
||||
else
|
||||
val = "false";
|
||||
g_variant_builder_add (builder, "{ss}", "strikethrough", val);
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_RISE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%i", pango_int->value);
|
||||
g_variant_builder_add (builder, "{ss}", "rise", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_lang = (PangoAttrLanguage *) pango_attr_iterator_get (iter, PANGO_ATTR_LANGUAGE);
|
||||
if (pango_lang != NULL)
|
||||
{
|
||||
g_variant_builder_add (builder, "{ss}", "language",
|
||||
pango_language_to_string (pango_lang->value));
|
||||
}
|
||||
|
||||
pango_float = (PangoAttrFloat *) pango_attr_iterator_get (iter, PANGO_ATTR_SCALE);
|
||||
if (pango_float != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%g", pango_float->value);
|
||||
g_variant_builder_add (builder, "{ss}", "scale", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_color = (PangoAttrColor *) pango_attr_iterator_get (iter, PANGO_ATTR_FOREGROUND);
|
||||
if (pango_color != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%u,%u,%u",
|
||||
pango_color->color.red,
|
||||
pango_color->color.green,
|
||||
pango_color->color.blue);
|
||||
g_variant_builder_add (builder, "{ss}", "fg-color", value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
pango_color = (PangoAttrColor *) pango_attr_iterator_get (iter, PANGO_ATTR_BACKGROUND);
|
||||
if (pango_color != NULL)
|
||||
{
|
||||
value = g_strdup_printf ("%u,%u,%u",
|
||||
pango_color->color.red,
|
||||
pango_color->color.green,
|
||||
pango_color->color.blue);
|
||||
g_variant_builder_add (builder, "{ss}", "bg-color", value);
|
||||
g_free (value);
|
||||
}
|
||||
pango_attr_iterator_destroy (iter);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_move_chars:
|
||||
* @layout: a `PangoLayout`
|
||||
@@ -820,3 +1080,75 @@ gtk_pango_get_text_at (PangoLayout *layout,
|
||||
|
||||
return g_utf8_substring (text, start, end);
|
||||
}
|
||||
|
||||
char *gtk_pango_get_string_at (PangoLayout *layout,
|
||||
int offset,
|
||||
AtspiTextGranularity granularity,
|
||||
int *start_offset,
|
||||
int *end_offset)
|
||||
{
|
||||
const char *text;
|
||||
int start, end;
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
|
||||
if (text[0] == 0)
|
||||
{
|
||||
*start_offset = 0;
|
||||
*end_offset = 0;
|
||||
return g_strdup ("");
|
||||
}
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
start = offset;
|
||||
end = start;
|
||||
|
||||
switch (granularity)
|
||||
{
|
||||
case ATSPI_TEXT_GRANULARITY_CHAR:
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case ATSPI_TEXT_GRANULARITY_WORD:
|
||||
if (!attrs[start].is_word_start)
|
||||
start = gtk_pango_move_words (layout, start, -1);
|
||||
if (gtk_pango_is_inside_word (layout, end))
|
||||
end = gtk_pango_move_words (layout, end, 1);
|
||||
while (!attrs[end].is_word_start && end < n_attrs - 1)
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case ATSPI_TEXT_GRANULARITY_SENTENCE:
|
||||
if (!attrs[start].is_sentence_start)
|
||||
start = gtk_pango_move_sentences (layout, start, -1);
|
||||
if (gtk_pango_is_inside_sentence (layout, end))
|
||||
end = gtk_pango_move_sentences (layout, end, 1);
|
||||
while (!attrs[end].is_sentence_start && end < n_attrs - 1)
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case ATSPI_TEXT_GRANULARITY_LINE:
|
||||
pango_layout_get_line_at (layout, offset, ATSPI_TEXT_BOUNDARY_LINE_START, &start, &end);
|
||||
break;
|
||||
|
||||
case ATSPI_TEXT_GRANULARITY_PARAGRAPH:
|
||||
/* FIXME: In theory, a layout can hold more than one paragraph */
|
||||
start = 0;
|
||||
end = g_utf8_strlen (text, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
*start_offset = start;
|
||||
*end_offset = end;
|
||||
|
||||
g_assert (start <= end);
|
||||
|
||||
return g_utf8_substring (text, start, end);
|
||||
}
|
||||
|
||||
@@ -19,10 +19,19 @@
|
||||
|
||||
#include <pango/pangocairo.h>
|
||||
#include "gtkatspiprivate.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
GVariantBuilder *builder);
|
||||
void gtk_pango_get_default_attributes (PangoLayout *layout,
|
||||
GVariantBuilder *builder);
|
||||
void gtk_pango_get_run_attributes (PangoLayout *layout,
|
||||
GVariantBuilder *builder,
|
||||
int offset,
|
||||
int *start_offset,
|
||||
int *end_offset);
|
||||
|
||||
char *gtk_pango_get_text_before (PangoLayout *layout,
|
||||
int offset,
|
||||
AtspiTextBoundaryType boundary_type,
|
||||
@@ -38,5 +47,10 @@ char *gtk_pango_get_text_after (PangoLayout *layout,
|
||||
AtspiTextBoundaryType boundary_type,
|
||||
int *start_offset,
|
||||
int *end_offset);
|
||||
char *gtk_pango_get_string_at (PangoLayout *layout,
|
||||
int offset,
|
||||
AtspiTextGranularity granularity,
|
||||
int *start_offset,
|
||||
int *end_offset);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+53
-466
@@ -41,306 +41,9 @@
|
||||
#include "gtkspinbuttonprivate.h"
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtktextviewprivate.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
static GtkAccessibleTextGranularity
|
||||
atspi_granularity_to_gtk (AtspiTextGranularity granularity)
|
||||
{
|
||||
switch (granularity)
|
||||
{
|
||||
case ATSPI_TEXT_GRANULARITY_CHAR:
|
||||
return GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER;
|
||||
case ATSPI_TEXT_GRANULARITY_WORD:
|
||||
return GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD;
|
||||
case ATSPI_TEXT_GRANULARITY_SENTENCE:
|
||||
return GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE;
|
||||
case ATSPI_TEXT_GRANULARITY_LINE:
|
||||
return GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE;
|
||||
case ATSPI_TEXT_GRANULARITY_PARAGRAPH:
|
||||
return GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ GtkAccessibleText */
|
||||
|
||||
static void
|
||||
accessible_text_handle_method (GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *method_name,
|
||||
GVariant *parameters,
|
||||
GDBusMethodInvocation *invocation,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkATContext *self = user_data;
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (self);
|
||||
GtkAccessibleText *accessible_text = GTK_ACCESSIBLE_TEXT (accessible);
|
||||
|
||||
if (g_strcmp0 (method_name, "GetCaretOffset") == 0)
|
||||
{
|
||||
guint offset;
|
||||
|
||||
offset = gtk_accessible_text_get_caret_position (accessible_text);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", (int)offset));
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "SetCaretOffset") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetText") == 0)
|
||||
{
|
||||
int start, end;
|
||||
GBytes *contents;
|
||||
|
||||
g_variant_get (parameters, "(ii)", &start, &end);
|
||||
|
||||
contents = gtk_accessible_text_get_contents (accessible_text, start, end < 0 ? G_MAXUINT : end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", g_bytes_get_data (contents, NULL)));
|
||||
|
||||
g_bytes_unref (contents);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetTextBeforeOffset") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "This method is deprecated in favor of GetStringAtOffset");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetTextAtOffset") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "This method is deprecated in favor of GetStringAtOffset");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetTextAfterOffset") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "This method is deprecated in favor of GetStringAtOffset");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetCharacterAtOffset") == 0)
|
||||
{
|
||||
int offset;
|
||||
gunichar ch = 0;
|
||||
|
||||
g_variant_get (parameters, "(i)", &offset);
|
||||
|
||||
GBytes *text = gtk_accessible_text_get_contents (accessible_text, offset, offset + 1);
|
||||
|
||||
if (text != NULL)
|
||||
{
|
||||
const char *str = g_bytes_get_data (text, NULL);
|
||||
if (g_utf8_strlen (str, -1) > 0)
|
||||
ch = g_utf8_get_char (str);
|
||||
}
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", ch));
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetStringAtOffset") == 0)
|
||||
{
|
||||
unsigned int start, end;
|
||||
int offset;
|
||||
AtspiTextGranularity granularity;
|
||||
GBytes *bytes;
|
||||
|
||||
g_variant_get (parameters, "(iu)", &offset, &granularity);
|
||||
|
||||
bytes = gtk_accessible_text_get_contents_at (accessible_text, offset,
|
||||
atspi_granularity_to_gtk (granularity),
|
||||
&start, &end);
|
||||
|
||||
if (bytes == NULL)
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", "", -1, -1));
|
||||
else
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", g_bytes_get_data (bytes, NULL), start, end));
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributes") == 0)
|
||||
{
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
gsize n_attrs = 0;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
int start, end;
|
||||
char **attr_names = NULL;
|
||||
char **attr_values = NULL;
|
||||
|
||||
g_variant_get (parameters, "(i)", &offset);
|
||||
|
||||
gtk_accessible_text_get_attributes (accessible_text,
|
||||
offset,
|
||||
&n_attrs,
|
||||
&ranges,
|
||||
&attr_names,
|
||||
&attr_values);
|
||||
|
||||
start = 0;
|
||||
end = G_MAXINT;
|
||||
|
||||
for (int i = 0; i < n_attrs; i++)
|
||||
{
|
||||
g_variant_builder_add (&builder, "{ss}", attr_names[i], attr_values[i]);
|
||||
start = MAX (start, ranges[i].start);
|
||||
end = MIN (end, start + ranges[i].length);
|
||||
}
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
|
||||
g_clear_pointer (&ranges, g_free);
|
||||
g_strfreev (attr_names);
|
||||
g_strfreev (attr_values);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
|
||||
{
|
||||
int offset;
|
||||
const char *name;
|
||||
const char *val = "";
|
||||
char **names, **values;
|
||||
GtkAccessibleTextRange *ranges;
|
||||
gsize n_ranges;
|
||||
|
||||
g_variant_get (parameters, "(i&s)", &offset, &name);
|
||||
|
||||
gtk_accessible_text_get_attributes (accessible_text, offset,
|
||||
&n_ranges, &ranges,
|
||||
&names, &values);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
{
|
||||
if (g_strcmp0 (names[i], name) == 0)
|
||||
{
|
||||
val = values[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", val));
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetDefaultAttributes") == 0 ||
|
||||
g_strcmp0 (method_name, "GetDefaultAttributeSet") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetNSelections") == 0)
|
||||
{
|
||||
gsize n_ranges;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
|
||||
gtk_accessible_text_get_selection (accessible_text, &n_ranges, &ranges);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", (int)n_ranges));
|
||||
|
||||
g_clear_pointer (&ranges, g_free);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetSelection") == 0)
|
||||
{
|
||||
int num;
|
||||
gsize n_ranges;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
|
||||
g_variant_get (parameters, "(i)", &num);
|
||||
|
||||
gtk_accessible_text_get_selection (accessible_text, &n_ranges, &ranges);
|
||||
|
||||
if (num < 0 || num >= n_ranges)
|
||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Not a valid selection: %d", num);
|
||||
else
|
||||
{
|
||||
int start = ranges[num].start;
|
||||
int end = start + ranges[num].length;
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(ii)", start, end));
|
||||
}
|
||||
|
||||
g_clear_pointer (&ranges, g_free);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "AddSelection") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "RemoveSelection") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "SetSelection") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetCharacterExtents") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetRangeExtents") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetBoundedRanges") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "ScrollSubstringTo") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "ScrollSubstringToPoint") == 0)
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
|
||||
}
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
accessible_text_get_property (GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *property_name,
|
||||
GError **error,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkATContext *self = user_data;
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (self);
|
||||
GtkAccessibleText *accessible_text = GTK_ACCESSIBLE_TEXT (accessible);
|
||||
|
||||
if (g_strcmp0 (property_name, "CharacterCount") == 0)
|
||||
{
|
||||
GBytes *contents;
|
||||
const char *str;
|
||||
gsize len;
|
||||
|
||||
contents = gtk_accessible_text_get_contents (accessible_text, 0, G_MAXUINT);
|
||||
str = g_bytes_get_data (contents, NULL);
|
||||
len = g_utf8_strlen (str, -1);
|
||||
g_bytes_unref (contents);
|
||||
|
||||
return g_variant_new_int32 ((int) len);
|
||||
}
|
||||
else if (g_strcmp0 (property_name, "CaretOffset") == 0)
|
||||
{
|
||||
guint offset;
|
||||
|
||||
offset = gtk_accessible_text_get_caret_position (accessible_text);
|
||||
|
||||
return g_variant_new_int32 ((int) offset);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const GDBusInterfaceVTable accessible_text_vtable = {
|
||||
accessible_text_handle_method,
|
||||
accessible_text_get_property,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* }}} */
|
||||
/* {{{ GtkLabel */
|
||||
|
||||
static void
|
||||
@@ -472,13 +175,11 @@ label_handle_method (GDBusConnection *connection,
|
||||
int offset;
|
||||
AtspiTextGranularity granularity;
|
||||
char *string;
|
||||
unsigned int start, end;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(iu)", &offset, &granularity);
|
||||
|
||||
string = gtk_pango_get_string_at (layout, offset,
|
||||
atspi_granularity_to_gtk (granularity),
|
||||
&start, &end);
|
||||
string = gtk_pango_get_string_at (layout, offset, granularity, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", string, start, end));
|
||||
g_free (string);
|
||||
@@ -488,47 +189,34 @@ label_handle_method (GDBusConnection *connection,
|
||||
PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(i)", &offset);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
|
||||
{
|
||||
PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
const char *name;
|
||||
unsigned int start, end;
|
||||
const char *val = "";
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
GVariant *attrs;
|
||||
const char *val;
|
||||
|
||||
g_variant_get (parameters, "(i&s)", &offset, &name);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
{
|
||||
if (g_strcmp0 (names[i], name) == 0)
|
||||
{
|
||||
val = values[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
attrs = g_variant_builder_end (&builder);
|
||||
if (!g_variant_lookup (attrs, name, "&s", &val))
|
||||
val = "";
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", val));
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
g_variant_unref (attrs);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
|
||||
{
|
||||
@@ -536,29 +224,14 @@ label_handle_method (GDBusConnection *connection,
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
gboolean include_defaults;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(ib)", &offset, &include_defaults);
|
||||
|
||||
if (include_defaults)
|
||||
{
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
@@ -567,15 +240,8 @@ label_handle_method (GDBusConnection *connection,
|
||||
{
|
||||
PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss})", &builder));
|
||||
}
|
||||
@@ -862,13 +528,11 @@ inscription_handle_method (GDBusConnection *connection,
|
||||
int offset;
|
||||
AtspiTextGranularity granularity;
|
||||
char *string;
|
||||
unsigned int start, end;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(iu)", &offset, &granularity);
|
||||
|
||||
string = gtk_pango_get_string_at (layout, offset,
|
||||
atspi_granularity_to_gtk (granularity),
|
||||
&start, &end);
|
||||
string = gtk_pango_get_string_at (layout, offset, granularity, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", string, start, end));
|
||||
g_free (string);
|
||||
@@ -878,47 +542,34 @@ inscription_handle_method (GDBusConnection *connection,
|
||||
PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(i)", &offset);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
|
||||
{
|
||||
PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
const char *name;
|
||||
unsigned int start, end;
|
||||
const char *val = "";
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
GVariant *attrs;
|
||||
const char *val;
|
||||
|
||||
g_variant_get (parameters, "(i&s)", &offset, &name);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
{
|
||||
if (g_strcmp0 (names[i], name) == 0)
|
||||
{
|
||||
val = values[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
attrs = g_variant_builder_end (&builder);
|
||||
if (!g_variant_lookup (attrs, name, "&s", &val))
|
||||
val = "";
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", val));
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
g_variant_unref (attrs);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
|
||||
{
|
||||
@@ -926,29 +577,14 @@ inscription_handle_method (GDBusConnection *connection,
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
gboolean include_defaults;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(ib)", &offset, &include_defaults);
|
||||
|
||||
if (include_defaults)
|
||||
{
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
@@ -957,15 +593,8 @@ inscription_handle_method (GDBusConnection *connection,
|
||||
{
|
||||
PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss})", &builder));
|
||||
}
|
||||
@@ -1198,13 +827,11 @@ editable_handle_method (GDBusConnection *connection,
|
||||
int offset;
|
||||
AtspiTextGranularity granularity;
|
||||
char *string;
|
||||
unsigned int start, end;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(iu)", &offset, &granularity);
|
||||
|
||||
string = gtk_pango_get_string_at (layout, offset,
|
||||
atspi_granularity_to_gtk (granularity),
|
||||
&start, &end);
|
||||
string = gtk_pango_get_string_at (layout, offset, granularity, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", string, start, end));
|
||||
g_free (string);
|
||||
@@ -1214,47 +841,33 @@ editable_handle_method (GDBusConnection *connection,
|
||||
PangoLayout *layout = gtk_text_get_layout (text_widget);
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(i)", &offset);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
|
||||
{
|
||||
PangoLayout *layout = gtk_text_get_layout (text_widget);
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
const char *name;
|
||||
unsigned int start, end;
|
||||
const char *val = "";
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
GVariant *attrs;
|
||||
const char *val;
|
||||
|
||||
g_variant_get (parameters, "(i&s)", &offset, &name);
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
{
|
||||
if (g_strcmp0 (names[i], name) == 0)
|
||||
{
|
||||
val = values[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
attrs = g_variant_builder_end (&builder);
|
||||
if (!g_variant_lookup (attrs, name, "&s", &val))
|
||||
val = "";
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", val));
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
g_variant_unref (attrs);
|
||||
}
|
||||
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
|
||||
{
|
||||
@@ -1262,29 +875,14 @@ editable_handle_method (GDBusConnection *connection,
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int offset;
|
||||
gboolean include_defaults;
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
int start, end;
|
||||
|
||||
g_variant_get (parameters, "(ib)", &offset, &include_defaults);
|
||||
|
||||
if (include_defaults)
|
||||
{
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_run_attributes (layout, &builder, offset, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss}ii)", &builder, start, end));
|
||||
}
|
||||
@@ -1293,15 +891,8 @@ editable_handle_method (GDBusConnection *connection,
|
||||
{
|
||||
PangoLayout *layout = gtk_text_get_layout (text_widget);
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_default_attributes (layout, &names, &values);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (&builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
gtk_pango_get_default_attributes (layout, &builder);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{ss})", &builder));
|
||||
}
|
||||
@@ -1600,9 +1191,7 @@ text_view_handle_method (GDBusConnection *connection,
|
||||
|
||||
g_variant_get (parameters, "(iu)", &offset, &granularity);
|
||||
|
||||
string = gtk_text_view_get_string_at (GTK_TEXT_VIEW (widget), offset,
|
||||
granularity,
|
||||
&start, &end);
|
||||
string = gtk_text_view_get_string_at (GTK_TEXT_VIEW (widget), offset, granularity, &start, &end);
|
||||
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(sii)", string, start, end));
|
||||
g_free (string);
|
||||
@@ -1984,9 +1573,7 @@ static const GDBusInterfaceVTable text_view_vtable = {
|
||||
const GDBusInterfaceVTable *
|
||||
gtk_atspi_get_text_vtable (GtkAccessible *accessible)
|
||||
{
|
||||
if (GTK_IS_ACCESSIBLE_TEXT (accessible))
|
||||
return &accessible_text_vtable;
|
||||
else if (GTK_IS_LABEL (accessible))
|
||||
if (GTK_IS_LABEL (accessible))
|
||||
return &label_vtable;
|
||||
else if (GTK_IS_INSCRIPTION (accessible))
|
||||
return &inscription_vtable;
|
||||
|
||||
@@ -36,17 +36,7 @@ gtk_text_view_add_default_attributes (GtkTextView *view,
|
||||
font = text_attrs->font;
|
||||
|
||||
if (font)
|
||||
{
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_font_attributes (font, &names, &values);
|
||||
|
||||
for (unsigned i = 0; names[i] != NULL; i++)
|
||||
g_variant_builder_add (builder, "{ss}", names[i], values[i]);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
gtk_pango_get_font_attributes (font, builder);
|
||||
|
||||
g_variant_builder_add (builder, "{ss}", "justification",
|
||||
gtk_justification_to_string (text_attrs->justification));
|
||||
|
||||
@@ -291,9 +291,6 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
|
||||
case GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON:
|
||||
return ATSPI_ROLE_TOGGLE_BUTTON;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_TERMINAL:
|
||||
return ATSPI_ROLE_TERMINAL;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -852,8 +852,7 @@ gtk_tree_path_prepend_index (GtkTreePath *path,
|
||||
int *indices;
|
||||
path->alloc = MAX (path->alloc * 2, 1);
|
||||
indices = g_new (int, path->alloc);
|
||||
if (path->depth > 0)
|
||||
memcpy (indices + 1, path->indices, path->depth * sizeof (int));
|
||||
memcpy (indices + 1, path->indices, path->depth * sizeof (int));
|
||||
g_free (path->indices);
|
||||
path->indices = indices;
|
||||
}
|
||||
@@ -973,8 +972,7 @@ gtk_tree_path_copy (const GtkTreePath *path)
|
||||
retval->depth = path->depth;
|
||||
retval->alloc = retval->depth;
|
||||
retval->indices = g_new (int, path->alloc);
|
||||
if (path->depth > 0)
|
||||
memcpy (retval->indices, path->indices, path->depth * sizeof (int));
|
||||
memcpy (retval->indices, path->indices, path->depth * sizeof (int));
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
+49
-74
@@ -22,15 +22,13 @@
|
||||
* language-specific data.raw.json as input
|
||||
*/
|
||||
|
||||
/* The format of the generated data is: a(aussasasu).
|
||||
/* The format of the generated data is: a(ausasu).
|
||||
* Each member of the array has the following fields:
|
||||
* au - sequence of unicode codepoints. If the
|
||||
* sequence contains a 0, it marks the point
|
||||
* where skin tone modifiers should be inserted
|
||||
* s - name in english, e.g. "man worker"
|
||||
* s - name in locale
|
||||
* as - keywords in english, e.g. "man", "worker"
|
||||
* as - keywords in locale
|
||||
* s - name, e.g. "man worker"
|
||||
* as - keywords, e.g. "man", "worker"
|
||||
* u - the group that this item belongs to:
|
||||
* 0: smileys-emotion
|
||||
* 1: people-body
|
||||
@@ -79,113 +77,90 @@ main (int argc, char *argv[])
|
||||
{
|
||||
JsonParser *parser;
|
||||
JsonNode *root;
|
||||
JsonParser *parser_en;
|
||||
JsonNode *root_en;
|
||||
JsonObject *ro;
|
||||
JsonArray *array;
|
||||
JsonArray *array_en;
|
||||
JsonNode *node;
|
||||
const char *unicode;
|
||||
JsonObjectIter iter;
|
||||
GError *error = NULL;
|
||||
guint length, length_en, i;
|
||||
guint length, i;
|
||||
GVariantBuilder builder;
|
||||
GVariant *v;
|
||||
GString *s;
|
||||
GHashTable *names;
|
||||
GString *name_key;
|
||||
|
||||
if (argc != 4) //0 -> compiled file, 1 -> en/data.raw.json, 2 -> de/data.raw.json, 3 -> de.data
|
||||
if (argc != 3)
|
||||
{
|
||||
g_print ("Usage: emoji-convert INPUT1 INPUT2 OUTPUT\nINPUT1 should be raw json data for English\nINPUT2 should be raw json data for the locale\n");
|
||||
g_print ("Usage: emoji-convert INPUT OUTPUT\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
parser = json_parser_new ();
|
||||
parser_en = json_parser_new ();
|
||||
|
||||
if (!json_parser_load_from_file (parser_en, argv[1], &error))
|
||||
{
|
||||
g_error ("%s", error->message);
|
||||
return 1;
|
||||
}
|
||||
if (!json_parser_load_from_file (parser, argv[2], &error))
|
||||
if (!json_parser_load_from_file (parser, argv[1], &error))
|
||||
{
|
||||
g_error ("%s", error->message);
|
||||
return 1;
|
||||
}
|
||||
|
||||
root = json_parser_get_root (parser);
|
||||
array = json_node_get_array (root);
|
||||
length = json_array_get_length (array);
|
||||
root_en = json_parser_get_root (parser_en);
|
||||
array_en = json_node_get_array (root_en);
|
||||
length_en = json_array_get_length (array_en);
|
||||
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(aussasasu)"));
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ausasu)"));
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
JsonObject *obj = json_array_get_object_element (array, i);
|
||||
JsonObject *obj_en = json_array_get_object_element (array_en, i);
|
||||
GVariantBuilder b1;
|
||||
GVariantBuilder b2;
|
||||
GVariantBuilder b3;
|
||||
guint group;
|
||||
const char *name;
|
||||
const char *name_en;
|
||||
char *code;
|
||||
if (!json_object_has_member (obj, "group"))
|
||||
continue;
|
||||
if (!json_object_has_member (obj_en, "group"))
|
||||
continue;
|
||||
group = json_object_get_int_member (obj, "group");
|
||||
name = json_object_get_string_member (obj, "label");
|
||||
name_en = json_object_get_string_member (obj_en, "label");
|
||||
if (json_object_has_member (obj, "skins") && json_object_has_member (obj_en, "skins"))
|
||||
{
|
||||
JsonArray *a2 = json_object_get_array_member (obj, "skins");
|
||||
JsonNode *n2 = json_array_get_element (a2, 0);
|
||||
JsonObject *o2 = json_node_get_object (n2);
|
||||
code = g_strdup (json_object_get_string_member (o2, "hexcode"));
|
||||
}
|
||||
else
|
||||
{
|
||||
code = g_strdup (json_object_get_string_member (obj, "hexcode"));
|
||||
}
|
||||
g_variant_builder_init (&b1, G_VARIANT_TYPE ("au"));
|
||||
{
|
||||
JsonObject *obj = json_array_get_object_element (array, i);
|
||||
GVariantBuilder b1;
|
||||
GVariantBuilder b2;
|
||||
guint group;
|
||||
const char *name;
|
||||
char *code;
|
||||
|
||||
if (!parse_code (&b1, code))
|
||||
return 1;
|
||||
if (!json_object_has_member (obj, "group"))
|
||||
continue;
|
||||
|
||||
g_variant_builder_init (&b2, G_VARIANT_TYPE ("as"));
|
||||
if (json_object_has_member (obj_en, "tags"))
|
||||
{
|
||||
JsonArray *tags_en = json_object_get_array_member (obj_en, "tags");
|
||||
for (int j = 0; j < json_array_get_length (tags_en); j++)
|
||||
group = json_object_get_int_member (obj, "group");
|
||||
name = json_object_get_string_member (obj, "label");
|
||||
|
||||
if (json_object_has_member (obj, "skins"))
|
||||
{
|
||||
g_variant_builder_add (&b2, "s", json_array_get_string_element (tags_en, j));
|
||||
JsonArray *a2 = json_object_get_array_member (obj, "skins");
|
||||
JsonNode *n2 = json_array_get_element (a2, 0);
|
||||
JsonObject *o2 = json_node_get_object (n2);
|
||||
code = g_strdup (json_object_get_string_member (o2, "hexcode"));
|
||||
}
|
||||
}
|
||||
|
||||
g_variant_builder_init (&b3, G_VARIANT_TYPE ("as"));
|
||||
if (json_object_has_member (obj, "tags"))
|
||||
{
|
||||
JsonArray *tags = json_object_get_array_member (obj, "tags");
|
||||
for (int j = 0; j < json_array_get_length (tags); j++)
|
||||
else
|
||||
{
|
||||
g_variant_builder_add (&b3, "s", json_array_get_string_element (tags, j));
|
||||
code = g_strdup (json_object_get_string_member (obj, "hexcode"));
|
||||
}
|
||||
}
|
||||
g_variant_builder_add (&builder, "(aussasasu)", &b1, name_en, name, &b2, &b3, group);
|
||||
}
|
||||
|
||||
g_variant_builder_init (&b1, G_VARIANT_TYPE ("au"));
|
||||
|
||||
if (!parse_code (&b1, code))
|
||||
return 1;
|
||||
|
||||
g_variant_builder_init (&b2, G_VARIANT_TYPE ("as"));
|
||||
if (json_object_has_member (obj, "tags"))
|
||||
{
|
||||
JsonArray *tags = json_object_get_array_member (obj, "tags");
|
||||
for (int j = 0; j < json_array_get_length (tags); j++)
|
||||
g_variant_builder_add (&b2, "s", json_array_get_string_element (tags, j));
|
||||
}
|
||||
|
||||
g_variant_builder_add (&builder, "(ausasu)", &b1, name, &b2, group);
|
||||
}
|
||||
|
||||
v = g_variant_builder_end (&builder);
|
||||
if (g_str_has_suffix (argv[3], ".json"))
|
||||
if (g_str_has_suffix (argv[2], ".json"))
|
||||
{
|
||||
JsonNode *node;
|
||||
char *out;
|
||||
|
||||
node = json_gvariant_serialize (v);
|
||||
out = json_to_string (node, TRUE);
|
||||
if (!g_file_set_contents (argv[3], out, -1, &error))
|
||||
if (!g_file_set_contents (argv[2], out, -1, &error))
|
||||
{
|
||||
g_error ("%s", error->message);
|
||||
return 1;
|
||||
@@ -196,7 +171,7 @@ main (int argc, char *argv[])
|
||||
GBytes *bytes;
|
||||
|
||||
bytes = g_variant_get_data_as_bytes (v);
|
||||
if (!g_file_set_contents (argv[3], g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), &error))
|
||||
if (!g_file_set_contents (argv[2], g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), &error))
|
||||
{
|
||||
g_error ("%s", error->message);
|
||||
return 1;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -34,7 +34,6 @@
|
||||
#include <gtk/gtkaccelgroup.h>
|
||||
#include <gtk/gtkaccessible.h>
|
||||
#include <gtk/gtkaccessiblerange.h>
|
||||
#include <gtk/gtkaccessibletext.h>
|
||||
#include <gtk/gtkactionable.h>
|
||||
#include <gtk/gtkactionbar.h>
|
||||
#include <gtk/gtkadjustment.h>
|
||||
|
||||
@@ -871,7 +871,6 @@ static const char *role_names[] = {
|
||||
[GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE] = NC_("accessibility", "block quote"),
|
||||
[GTK_ACCESSIBLE_ROLE_ARTICLE] = NC_("accessibility", "article"),
|
||||
[GTK_ACCESSIBLE_ROLE_COMMENT] = NC_("accessibility", "comment"),
|
||||
[GTK_ACCESSIBLE_ROLE_TERMINAL] = NC_("accessibility", "terminal"),
|
||||
};
|
||||
|
||||
/*< private >
|
||||
@@ -990,7 +989,6 @@ static struct {
|
||||
{ GTK_ACCESSIBLE_ROLE_DIALOG, GTK_ACCESSIBLE_ROLE_ALERT_DIALOG },
|
||||
{ GTK_ACCESSIBLE_ROLE_DOCUMENT, GTK_ACCESSIBLE_ROLE_ARTICLE },
|
||||
{ GTK_ACCESSIBLE_ROLE_ARTICLE, GTK_ACCESSIBLE_ROLE_COMMENT },
|
||||
{ GTK_ACCESSIBLE_ROLE_TERMINAL, GTK_ACCESSIBLE_ROLE_WIDGET },
|
||||
};
|
||||
|
||||
gboolean
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/* gtkaccessibletext-private.h: Private definitions for GtkAccessibleText
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023 Emmanuele Bassi
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gtkaccessibletext.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GBytes *
|
||||
gtk_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
|
||||
GBytes *
|
||||
gtk_accessible_text_get_contents_at (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start,
|
||||
unsigned int *end);
|
||||
|
||||
unsigned int
|
||||
gtk_accessible_text_get_caret_position (GtkAccessibleText *self);
|
||||
|
||||
gboolean
|
||||
gtk_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges);
|
||||
|
||||
gboolean
|
||||
gtk_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
G_END_DECLS
|
||||
@@ -1,355 +0,0 @@
|
||||
/* gtkaccessibletext.c: Interface for accessible text objects
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023 Emmanuele Bassi
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkaccessibletext-private.h"
|
||||
|
||||
#include "gtkatcontextprivate.h"
|
||||
|
||||
G_DEFINE_INTERFACE (GtkAccessibleText, gtk_accessible_text, GTK_TYPE_ACCESSIBLE)
|
||||
|
||||
static GBytes *
|
||||
gtk_accessible_text_default_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GBytes *
|
||||
gtk_accessible_text_default_get_contents_at (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start,
|
||||
unsigned int *end)
|
||||
{
|
||||
if (start != NULL)
|
||||
*start = 0;
|
||||
if (end != NULL)
|
||||
*end = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
gtk_accessible_text_default_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_accessible_text_default_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_accessible_text_default_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
*attribute_names = NULL;
|
||||
*attribute_values = NULL;
|
||||
*n_ranges = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_accessible_text_default_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
iface->get_contents = gtk_accessible_text_default_get_contents;
|
||||
iface->get_contents_at = gtk_accessible_text_default_get_contents_at;
|
||||
iface->get_caret_position = gtk_accessible_text_default_get_caret_position;
|
||||
iface->get_selection = gtk_accessible_text_default_get_selection;
|
||||
iface->get_attributes = gtk_accessible_text_default_get_attributes;
|
||||
}
|
||||
|
||||
static GBytes *
|
||||
nul_terminate_contents (GBytes *bytes)
|
||||
{
|
||||
const char *data;
|
||||
gsize size;
|
||||
|
||||
data = g_bytes_get_data (bytes, &size);
|
||||
if (size == 0 || (size > 0 && data[size - 1] != '\0'))
|
||||
{
|
||||
guchar *copy;
|
||||
|
||||
copy = g_new (guchar, size + 1);
|
||||
if (size > 0)
|
||||
memcpy (copy, data, size);
|
||||
copy[size] = '\0';
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
bytes = g_bytes_new_take (copy, size + 1);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_contents:
|
||||
* @self: the accessible object
|
||||
* @start: the beginning of the range, in characters
|
||||
* @end: the end of the range, in characters
|
||||
*
|
||||
* Retrieve the current contents of the accessible object within
|
||||
* the given range.
|
||||
*
|
||||
* If @end is `G_MAXUINT`, the end of the range is the full content of the
|
||||
* accessible object.
|
||||
*
|
||||
* Returns: (transfer full): the requested slice of the contents of the
|
||||
* accessible object, as NUL-terminated UTF-8
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GBytes *
|
||||
gtk_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
GBytes *bytes;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), NULL);
|
||||
g_return_val_if_fail (end >= start, NULL);
|
||||
|
||||
bytes = GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_contents (self, start, end);
|
||||
|
||||
return nul_terminate_contents (bytes);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_contents_at:
|
||||
* @self: the accessible object
|
||||
* @offset: the offset of the text to retrieve
|
||||
* @granularity: specify the boundaries of the text
|
||||
* @start: (out): the starting offset of the contents, in characters
|
||||
* @end: (out): the ending offset of the contents, in characters
|
||||
*
|
||||
* Retrieve the current contents of the accessible object at the given
|
||||
* offset.
|
||||
*
|
||||
* Using the @granularity enumeration allows to adjust the offset so that
|
||||
* this function can return the beginning of the word, line, or sentence;
|
||||
* the initial and final boundaries are stored in @start and @end.
|
||||
*
|
||||
* Returns: (transfer full): the requested slice of the contents of the
|
||||
* accessible object, as NUL-terminated UTF-8 buffer
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GBytes *
|
||||
gtk_accessible_text_get_contents_at (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start,
|
||||
unsigned int *end)
|
||||
{
|
||||
GBytes *bytes;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), NULL);
|
||||
|
||||
bytes = GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_contents_at (self, offset, granularity, start, end);
|
||||
|
||||
return nul_terminate_contents (bytes);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_caret_position:
|
||||
* @self: the accessible object
|
||||
*
|
||||
* Retrieves the position of the caret inside the accessible object.
|
||||
*
|
||||
* If the accessible has no caret, 0 is returned.
|
||||
*
|
||||
* Returns: the position of the caret, in characters
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
unsigned int
|
||||
gtk_accessible_text_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), 0);
|
||||
|
||||
return GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_caret_position (self);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_selection:
|
||||
* @self: the accessible object
|
||||
* @n_ranges: (out): the number of selection ranges
|
||||
* @ranges: (optional) (out) (array length=n_ranges): the selection ranges
|
||||
*
|
||||
* Retrieves the selection ranges in the accessible object.
|
||||
*
|
||||
* If this function returns true, `n_ranges` will be set to a value
|
||||
* greater than or equal to one, and @ranges will be set to a newly
|
||||
* allocated array of [struct#Gtk.AccessibleTextRange].
|
||||
*
|
||||
* Returns: true if there's at least one selected range inside the
|
||||
* accessible object, and false otherwise
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
gboolean
|
||||
gtk_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), FALSE);
|
||||
|
||||
return GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_selection (self, n_ranges, ranges);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_accessible_text_get_attributes:
|
||||
* @self: the accessible object
|
||||
* @offset: the offset, in characters
|
||||
* @n_ranges: (out): the number of attributes
|
||||
* @ranges: (out) (array length=n_attributes) (optional): the ranges of the attributes
|
||||
* inside the accessible object
|
||||
* @attribute_names: (out) (array zero-terminated=1) (element-type utf8) (optional) (transfer full):
|
||||
* the names of the attributes inside the accessible object
|
||||
* @attribute_values: (out) (array zero-terminated=1) (element-type utf8) (optional) (transfer full):
|
||||
* the values of the attributes inside the accessible object
|
||||
*
|
||||
* Retrieves the text attributes inside the accessible object.
|
||||
*
|
||||
* Each attribute is composed by:
|
||||
*
|
||||
* - a range
|
||||
* - a name, typically in the form of a reverse DNS identifier
|
||||
* - a value
|
||||
*
|
||||
* If this function returns true, `n_attributes` will be set to a value
|
||||
* greater than or equal to one, @ranges will be set to a newly
|
||||
* allocated array of [struct#Gtk.AccessibleTextRange] which should
|
||||
* be freed with g_free(), @attribute_names and @attribute_values
|
||||
* will be set to string arrays that should be freed with g_strfreev().
|
||||
*
|
||||
* Returns: true if the accessible object has at least an attribute,
|
||||
* and false otherwise
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
gboolean
|
||||
gtk_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE_TEXT (self), FALSE);
|
||||
|
||||
return GTK_ACCESSIBLE_TEXT_GET_IFACE (self)->get_attributes (self,
|
||||
offset,
|
||||
n_ranges,
|
||||
ranges,
|
||||
attribute_names,
|
||||
attribute_values);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_accessible_text_update_caret_position:
|
||||
* @self: the accessible object
|
||||
*
|
||||
* Updates the position of the caret.
|
||||
*
|
||||
* Implementations of the `GtkAccessibleText` interface should call this
|
||||
* function every time the caret has moved, in order to notify assistive
|
||||
* technologies.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
void
|
||||
gtk_accessible_text_update_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
g_return_if_fail (GTK_IS_ACCESSIBLE_TEXT (self));
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (self));
|
||||
if (context == NULL)
|
||||
return;
|
||||
|
||||
gtk_at_context_update_caret_position (context);
|
||||
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_accessible_text_update_selection_bound:
|
||||
* @self: the accessible object
|
||||
*
|
||||
* Updates the boundary of the selection.
|
||||
*
|
||||
* Implementations of the `GtkAccessibleText` interface should call this
|
||||
* function every time the selection has moved, in order to notify assistive
|
||||
* technologies.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
void
|
||||
gtk_accessible_text_update_selection_bound (GtkAccessibleText *self)
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
g_return_if_fail (GTK_IS_ACCESSIBLE_TEXT (self));
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (self));
|
||||
if (context == NULL)
|
||||
return;
|
||||
|
||||
gtk_at_context_update_selection_bound (context);
|
||||
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_accessible_text_update_contents:
|
||||
* @self: the accessible object
|
||||
* @change: the type of change in the contents
|
||||
* @start: the starting offset of the change, in characters
|
||||
* @end: the end offset of the change, in characters
|
||||
*
|
||||
* Notifies assistive technologies of a change in contents.
|
||||
*
|
||||
* Implementations of the `GtkAccessibleText` interface should call this
|
||||
* function every time their contents change as the result of an operation,
|
||||
* like an insertion or a removal.
|
||||
*
|
||||
* Note: If the change is a deletion, this function must be called *before*
|
||||
* removing the contents, if it is an insertion, it must be called *after*
|
||||
* inserting the new contents.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
void
|
||||
gtk_accessible_text_update_contents (GtkAccessibleText *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
g_return_if_fail (GTK_IS_ACCESSIBLE_TEXT (self));
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (self));
|
||||
if (context == NULL)
|
||||
return;
|
||||
|
||||
gtk_at_context_update_text_contents (context, change, start, end);
|
||||
|
||||
g_object_unref (context);
|
||||
}
|
||||
@@ -1,570 +0,0 @@
|
||||
/* gtkaccessibletext.h: Interface for accessible objects containing text
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023 Emmanuele Bassi
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkaccessible.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_ACCESSIBLE_TEXT (gtk_accessible_text_get_type ())
|
||||
|
||||
/**
|
||||
* GtkAccessibleText:
|
||||
*
|
||||
* An interface for accessible objects containing formatted text.
|
||||
*
|
||||
* The `GtkAccessibleText` interfaces is meant to be implemented by accessible
|
||||
* objects that have text formatted with attributes, or non-trivial text contents.
|
||||
*
|
||||
* You should use the [enum@Gtk.AccessibleProperty.LABEL] or the
|
||||
* [enum@Gtk.AccessibleProperty.DESCRIPTION] properties for accessible
|
||||
* objects containing simple, unformatted text.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
G_DECLARE_INTERFACE (GtkAccessibleText, gtk_accessible_text, GTK, ACCESSIBLE_TEXT, GtkAccessible)
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextRange:
|
||||
* @start: the start of the range, in characters
|
||||
* @length: the length of the range, in characters
|
||||
*
|
||||
* A range inside the text of an accessible object.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
typedef struct {
|
||||
gsize start;
|
||||
gsize length;
|
||||
} GtkAccessibleTextRange;
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextGranularity:
|
||||
* @GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER: Use the boundary between
|
||||
* characters (including non-printing characters)
|
||||
* @GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD: Use the boundary between words,
|
||||
* starting from the beginning of the current word and ending at the
|
||||
* beginning of the next word
|
||||
* @GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE: Use the boundary between
|
||||
* sentences, starting from the beginning of the current sentence and
|
||||
* ending at the beginning of the next sentence
|
||||
* @GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE: Use the boundary between lines,
|
||||
* starting from the beginning of the current line and ending at the
|
||||
* beginning of the next line
|
||||
* @GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH: Use the boundary between
|
||||
* paragraphs, starting from the beginning of the current paragraph and
|
||||
* ending at the beginning of the next paragraph
|
||||
*
|
||||
* The granularity for queries about the text contents of a [iface@Gtk.AccessibleText]
|
||||
* implementation.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER,
|
||||
GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD,
|
||||
GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE,
|
||||
GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE,
|
||||
GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH
|
||||
} GtkAccessibleTextGranularity;
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextContentChange:
|
||||
* @GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT: contents change as the result of
|
||||
* an insert operation
|
||||
* @GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE: contents change as the result of
|
||||
* a remove operation
|
||||
*
|
||||
* The type of contents change operation.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE
|
||||
} GtkAccessibleTextContentChange;
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface:
|
||||
*
|
||||
* The interface vtable for accessible objects containing text.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
struct _GtkAccessibleTextInterface
|
||||
{
|
||||
/*< private >*/
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/*< public >*/
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_contents:
|
||||
* @self: the accessible object
|
||||
* @start: the beginning of the range, in characters
|
||||
* @end: the end of the range, in characters
|
||||
*
|
||||
* Retrieve the current contents of the accessible object within
|
||||
* the given range.
|
||||
*
|
||||
* If @end is `G_MAXUINT`, the end of the range is the full content
|
||||
* of the accessible object.
|
||||
*
|
||||
* Returns: (transfer full): the requested slice of the contents of the
|
||||
* accessible object, as UTF-8. Note that the slice does not have to
|
||||
* be NUL-terminated
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GBytes * (* get_contents) (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_contents_at:
|
||||
* @self: the accessible object
|
||||
* @offset: the offset, in characters
|
||||
* @granularity: the granularity of the query
|
||||
* @start: (out): the start of the range, in characters
|
||||
* @end: (out): the end of the range, in characters
|
||||
*
|
||||
* Retrieve the current contents of the accessible object starting
|
||||
* from the given offset, and using the given granularity.
|
||||
*
|
||||
* The @start and @end values contain the boundaries of the text.
|
||||
*
|
||||
* Returns: (transfer full): the requested slice of the contents of the
|
||||
* accessible object, as UTF-8. Note that the slice does not have to
|
||||
* be NUL-terminated
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GBytes * (* get_contents_at) (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start,
|
||||
unsigned int *end);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_caret_position:
|
||||
* @self: the accessible object
|
||||
*
|
||||
* Retrieves the position of the caret inside the accessible object.
|
||||
*
|
||||
* Returns: the position of the caret, in characters
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
unsigned int (* get_caret_position) (GtkAccessibleText *self);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_selection:
|
||||
* @self: the accessible object
|
||||
* @n_ranges: (out): the number of selection ranges
|
||||
* @ranges: (optional) (out) (array length=n_ranges) (transfer container): the selection ranges
|
||||
*
|
||||
* Retrieves the selection ranges in the accessible object.
|
||||
*
|
||||
* If this function returns true, `n_ranges` will be set to a value
|
||||
* greater than or equal to one, and @ranges will be set to a newly
|
||||
* allocated array of [struct#Gtk.AccessibleTextRange].
|
||||
*
|
||||
* Returns: true if there is at least a selection inside the
|
||||
* accessible object, and false otherwise
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
gboolean (* get_selection) (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges);
|
||||
|
||||
/**
|
||||
* GtkAccessibleTextInterface::get_attributes:
|
||||
* @self: the accessible object
|
||||
* @offset: the offset, in characters
|
||||
* @n_ranges: (out): the number of attributes
|
||||
* @ranges: (out) (array length=n_ranges) (optional) (transfer container): the ranges of the attributes
|
||||
* inside the accessible object
|
||||
* @attribute_names: (out) (array zero-terminated=1) (optional) (transfer full): the
|
||||
* names of the attributes inside the accessible object
|
||||
* @attribute_values: (out) (array zero-terminated=1) (optional) (transfer full): the
|
||||
* values of the attributes inside the accessible object
|
||||
*
|
||||
* Retrieves the text attributes inside the accessible object.
|
||||
*
|
||||
* Each attribute is composed by:
|
||||
*
|
||||
* - a range
|
||||
* - a name
|
||||
* - a value
|
||||
*
|
||||
* It is left to the implementation to determine the serialization format
|
||||
* of the value to a string.
|
||||
*
|
||||
* GTK provides support for various text attribute names and values, but
|
||||
* implementations of this interface are free to add their own attributes.
|
||||
*
|
||||
* If this function returns true, `n_ranges` will be set to a value
|
||||
* greater than or equal to one, @ranges will be set to a newly
|
||||
* allocated array of [struct#Gtk.AccessibleTextRange].
|
||||
*
|
||||
* Returns: true if the accessible object has at least an attribute,
|
||||
* and false otherwise
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
gboolean (* get_attributes) (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gtk_accessible_text_update_caret_position (GtkAccessibleText *self);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gtk_accessible_text_update_selection_bound (GtkAccessibleText *self);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gtk_accessible_text_update_contents (GtkAccessibleText *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_FAMILY:
|
||||
*
|
||||
* An attribute for the font family name.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_FAMILY "family-name"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STYLE:
|
||||
*
|
||||
* An attribute for the font style.
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STYLE "style"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_WEIGHT:
|
||||
*
|
||||
* An attribute for the font weight.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_WEIGHT "weight"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT:
|
||||
*
|
||||
* An attribute for the font variant.
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT "variant"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH:
|
||||
*
|
||||
* An attribute for the font stretch type.
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH "stretch"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_SIZE:
|
||||
*
|
||||
* An attribute for the font size, expressed in points.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_SIZE "size"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_FOREGROUND:
|
||||
*
|
||||
* An attribute for the foreground color, expressed as an RGB value
|
||||
* encoded in a string using the format: `{r8},{g8},{b8}`.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_FOREGROUND "fg-color"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_BACKGROUND:
|
||||
*
|
||||
* An attribute for the background color, expressed as an RGB value
|
||||
* encoded in a string using the format: `{r8},{g8},{b8}`.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_BACKGROUND "bg-color"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE:
|
||||
*
|
||||
* An attribute for the underline style.
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE "underline"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE:
|
||||
*
|
||||
* An attribute for the overline style.
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE]
|
||||
* - [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE]
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE "overline"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH:
|
||||
*
|
||||
* An attribute for strikethrough text.
|
||||
*
|
||||
* Possible values are `true` or `false`.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH "strikethrough"
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL:
|
||||
*
|
||||
* The "normal" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL "normal"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE:
|
||||
*
|
||||
* The "oblique" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE "oblique"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC:
|
||||
*
|
||||
* The "italic" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC "italic"
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS:
|
||||
*
|
||||
* The "small caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS "small-caps"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS:
|
||||
*
|
||||
* The "all small caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS "all-small-caps"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS:
|
||||
*
|
||||
* The "petite caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS "petite-caps"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS:
|
||||
*
|
||||
* The "all petite caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS "all-petite-caps"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE:
|
||||
*
|
||||
* The "unicase" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE "unicase"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS:
|
||||
*
|
||||
* The "title caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS "title-caps"
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED:
|
||||
*
|
||||
* The "ultra condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED "ultra_condensed"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED:
|
||||
*
|
||||
* The "extra condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED "extra_condensed"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED:
|
||||
*
|
||||
* The "condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED "condensed"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED:
|
||||
*
|
||||
* The "semi condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED "semi_condensed"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL:
|
||||
*
|
||||
* The "normal" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL "normal"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED:
|
||||
*
|
||||
* The "semi expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED "semi_expanded"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED:
|
||||
*
|
||||
* The "expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED "expanded"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED:
|
||||
*
|
||||
* The "extra expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED "extra_expanded"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED:
|
||||
*
|
||||
* The "ultra expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED "ultra_expanded"
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE:
|
||||
*
|
||||
* The "none" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE "none"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE:
|
||||
*
|
||||
* The "single" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE "single"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE:
|
||||
*
|
||||
* The "double" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE "double"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR:
|
||||
*
|
||||
* The "error" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR "error"
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE:
|
||||
*
|
||||
* The "none" overline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE "none"
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE:
|
||||
*
|
||||
* The "single" overline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE].
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
#define GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE "single"
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
@@ -146,8 +146,7 @@ gtk_application_impl_wayland_inhibit (GtkApplicationImpl *impl,
|
||||
}
|
||||
}
|
||||
|
||||
if (flags)
|
||||
inhibitor->dbus_cookie = ((GtkApplicationImplWaylandClass *) G_OBJECT_GET_CLASS (wayland))->dbus_inhibit (impl, window, flags, reason);
|
||||
inhibitor->dbus_cookie = ((GtkApplicationImplWaylandClass *) G_OBJECT_GET_CLASS (wayland))->dbus_inhibit (impl, window, flags, reason);
|
||||
|
||||
return inhibitor->cookie;
|
||||
}
|
||||
|
||||
+1
-52
@@ -207,24 +207,6 @@ gtk_at_context_real_unrealize (GtkATContext *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_context_real_update_caret_position (GtkATContext *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_context_real_update_selection_bound (GtkATContext *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_context_real_update_text_contents (GtkATContext *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_context_class_init (GtkATContextClass *klass)
|
||||
{
|
||||
@@ -241,9 +223,6 @@ gtk_at_context_class_init (GtkATContextClass *klass)
|
||||
klass->platform_change = gtk_at_context_real_platform_change;
|
||||
klass->bounds_change = gtk_at_context_real_bounds_change;
|
||||
klass->child_change = gtk_at_context_real_child_change;
|
||||
klass->update_caret_position = gtk_at_context_real_update_caret_position;
|
||||
klass->update_selection_bound = gtk_at_context_real_update_selection_bound;
|
||||
klass->update_text_contents = gtk_at_context_real_update_text_contents;
|
||||
|
||||
/**
|
||||
* GtkATContext:accessible-role: (attributes org.gtk.Property.get=gtk_at_context_get_accessible_role)
|
||||
@@ -930,7 +909,7 @@ gtk_at_context_set_accessible_property (GtkATContext *self,
|
||||
else
|
||||
res = gtk_accessible_attribute_set_remove (self->properties, property);
|
||||
|
||||
if (res && self->realized)
|
||||
if (res)
|
||||
self->updated_properties |= (1 << property);
|
||||
}
|
||||
|
||||
@@ -1529,33 +1508,3 @@ gtk_at_context_announce (GtkATContext *self,
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->announce (self, message, priority);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_at_context_update_caret_position (GtkATContext *self)
|
||||
{
|
||||
if (!self->realized)
|
||||
return;
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->update_caret_position (self);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_at_context_update_selection_bound (GtkATContext *self)
|
||||
{
|
||||
if (!self->realized)
|
||||
return;
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->update_selection_bound (self);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_at_context_update_text_contents (GtkATContext *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
if (!self->realized)
|
||||
return;
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->update_text_contents (self, change, start, end);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "gtkaccessibleprivate.h"
|
||||
#include "gtkaccessibleattributesetprivate.h"
|
||||
#include "gtkaccessibletext.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -132,14 +131,6 @@ struct _GtkATContextClass
|
||||
void (* announce) (GtkATContext *self,
|
||||
const char *message,
|
||||
GtkAccessibleAnnouncementPriority priority);
|
||||
|
||||
/* Text interface */
|
||||
void (* update_caret_position) (GtkATContext *self);
|
||||
void (* update_selection_bound) (GtkATContext *self);
|
||||
void (* update_text_contents) (GtkATContext *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
};
|
||||
|
||||
GtkATContext * gtk_at_context_clone (GtkATContext *self,
|
||||
@@ -209,14 +200,5 @@ gtk_at_context_set_next_accessible_sibling (GtkATContext *self,
|
||||
void gtk_at_context_announce (GtkATContext *self,
|
||||
const char *message,
|
||||
GtkAccessibleAnnouncementPriority priority);
|
||||
void
|
||||
gtk_at_context_update_caret_position (GtkATContext *self);
|
||||
void
|
||||
gtk_at_context_update_selection_bound (GtkATContext *self);
|
||||
void
|
||||
gtk_at_context_update_text_contents (GtkATContext *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -482,13 +482,8 @@ gtk_editable_insert_text (GtkEditable *editable,
|
||||
int *position)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
g_return_if_fail (text != NULL);
|
||||
g_return_if_fail (length >= -1);
|
||||
g_return_if_fail (position != NULL);
|
||||
|
||||
if (text == NULL)
|
||||
text = "";
|
||||
|
||||
if (length < 0)
|
||||
length = strlen (text);
|
||||
|
||||
@@ -516,8 +511,6 @@ gtk_editable_delete_text (GtkEditable *editable,
|
||||
int end_pos)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
g_return_if_fail (start_pos >= 0);
|
||||
g_return_if_fail (end_pos == -1 || end_pos >= start_pos);
|
||||
|
||||
GTK_EDITABLE_GET_IFACE (editable)->do_delete_text (editable, start_pos, end_pos);
|
||||
}
|
||||
@@ -551,8 +544,6 @@ gtk_editable_get_chars (GtkEditable *editable,
|
||||
int start_index,end_index;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_EDITABLE (editable), NULL);
|
||||
g_return_val_if_fail (start_pos >= 0, NULL);
|
||||
g_return_val_if_fail (end_pos == -1 || end_pos >= start_pos, NULL);
|
||||
|
||||
text = GTK_EDITABLE_GET_IFACE (editable)->get_text (editable);
|
||||
length = g_utf8_strlen (text, -1);
|
||||
@@ -603,7 +594,6 @@ gtk_editable_set_text (GtkEditable *editable,
|
||||
int pos;
|
||||
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (editable));
|
||||
gtk_editable_delete_text (editable, 0, -1);
|
||||
|
||||
+13
-21
@@ -321,7 +321,7 @@ populate_recent_section (GtkEmojiChooser *chooser)
|
||||
GVariantIter iter;
|
||||
gboolean empty = TRUE;
|
||||
|
||||
variant = g_settings_get_value (chooser->settings, "recently-used-emoji");
|
||||
variant = g_settings_get_value (chooser->settings, "recent-emoji");
|
||||
g_variant_iter_init (&iter, variant);
|
||||
while ((item = g_variant_iter_next_value (&iter)))
|
||||
{
|
||||
@@ -354,8 +354,8 @@ add_recent_item (GtkEmojiChooser *chooser,
|
||||
|
||||
g_variant_ref (item);
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((aussasasu)u)"));
|
||||
g_variant_builder_add (&builder, "(@(aussasasu)u)", item, modifier);
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((ausasu)u)"));
|
||||
g_variant_builder_add (&builder, "(@(ausasu)u)", item, modifier);
|
||||
|
||||
children = NULL;
|
||||
for (child = gtk_widget_get_last_child (chooser->recent.box);
|
||||
@@ -380,7 +380,7 @@ add_recent_item (GtkEmojiChooser *chooser,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_variant_builder_add (&builder, "(@(aussasasu)u)", item2, modifier2);
|
||||
g_variant_builder_add (&builder, "(@(ausasu)u)", item2, modifier2);
|
||||
}
|
||||
g_list_free (children);
|
||||
|
||||
@@ -390,7 +390,7 @@ add_recent_item (GtkEmojiChooser *chooser,
|
||||
gtk_widget_set_visible (chooser->recent.box, TRUE);
|
||||
gtk_widget_set_sensitive (chooser->recent.button, TRUE);
|
||||
|
||||
g_settings_set_value (chooser->settings, "recently-used-emoji", g_variant_builder_end (&builder));
|
||||
g_settings_set_value (chooser->settings, "recent-emoji", g_variant_builder_end (&builder));
|
||||
|
||||
g_variant_unref (item);
|
||||
}
|
||||
@@ -720,7 +720,7 @@ populate_emoji_chooser (gpointer data)
|
||||
|
||||
bytes = get_emoji_data ();
|
||||
|
||||
chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(aussasasu)"), bytes, TRUE));
|
||||
chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(ausasu)"), bytes, TRUE));
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ populate_emoji_chooser (gpointer data)
|
||||
{
|
||||
guint group;
|
||||
|
||||
g_variant_get_child (item, 5, "u", &group);
|
||||
g_variant_get_child (item, 3, "u", &group);
|
||||
|
||||
if (group == chooser->people.group)
|
||||
chooser->box = chooser->people.box;
|
||||
@@ -866,12 +866,9 @@ filter_func (GtkFlowBoxChild *child,
|
||||
GtkEmojiChooser *chooser;
|
||||
GVariant *emoji_data;
|
||||
const char *text;
|
||||
const char *name_en;
|
||||
const char *name;
|
||||
const char **keywords_en;
|
||||
const char **keywords;
|
||||
char **term_tokens;
|
||||
char **name_tokens_en;
|
||||
char **name_tokens;
|
||||
gboolean res;
|
||||
|
||||
@@ -888,21 +885,16 @@ filter_func (GtkFlowBoxChild *child,
|
||||
goto out;
|
||||
|
||||
term_tokens = g_str_tokenize_and_fold (text, "en", NULL);
|
||||
g_variant_get_child (emoji_data, 1, "&s", &name_en);
|
||||
name_tokens = g_str_tokenize_and_fold (name_en, "en", NULL);
|
||||
g_variant_get_child (emoji_data, 2, "&s", &name);
|
||||
name_tokens_en = g_str_tokenize_and_fold (name, "en", NULL);
|
||||
g_variant_get_child (emoji_data, 3, "^a&s", &keywords_en);
|
||||
g_variant_get_child (emoji_data, 4, "^a&s", &keywords);
|
||||
|
||||
g_variant_get_child (emoji_data, 1, "&s", &name);
|
||||
name_tokens = g_str_tokenize_and_fold (name, "en", NULL);
|
||||
g_variant_get_child (emoji_data, 2, "^a&s", &keywords);
|
||||
|
||||
res = match_tokens ((const char **)term_tokens, (const char **)name_tokens) ||
|
||||
match_tokens ((const char **)term_tokens, (const char **)name_tokens_en) ||
|
||||
match_tokens ((const char **)term_tokens, keywords) ||
|
||||
match_tokens ((const char **)term_tokens, keywords_en);
|
||||
match_tokens ((const char **)term_tokens, keywords);
|
||||
|
||||
g_strfreev (term_tokens);
|
||||
g_strfreev (name_tokens);
|
||||
g_strfreev (name_tokens_en);
|
||||
|
||||
out:
|
||||
if (res)
|
||||
@@ -986,7 +978,7 @@ setup_section (GtkEmojiChooser *chooser,
|
||||
section->group = group;
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (section->button), icon);
|
||||
|
||||
|
||||
gtk_flow_box_disable_move_cursor (GTK_FLOW_BOX (section->box));
|
||||
gtk_flow_box_set_filter_func (GTK_FLOW_BOX (section->box), filter_func, section, NULL);
|
||||
g_signal_connect_swapped (section->button, "clicked", G_CALLBACK (scroll_to_section), section);
|
||||
|
||||
@@ -162,12 +162,9 @@ gtk_entry_buffer_normal_insert_text (GtkEntryBuffer *buffer,
|
||||
|
||||
/* Could be a password, so can't leave stuff in memory. */
|
||||
et_new = g_malloc (pv->normal_text_size);
|
||||
if (pv->normal_text)
|
||||
{
|
||||
memcpy (et_new, pv->normal_text, MIN (prev_size, pv->normal_text_size));
|
||||
trash_area (pv->normal_text, prev_size);
|
||||
g_free (pv->normal_text);
|
||||
}
|
||||
memcpy (et_new, pv->normal_text, MIN (prev_size, pv->normal_text_size));
|
||||
trash_area (pv->normal_text, prev_size);
|
||||
g_free (pv->normal_text);
|
||||
pv->normal_text = et_new;
|
||||
}
|
||||
|
||||
|
||||
+3
-14
@@ -1432,13 +1432,6 @@ typedef enum {
|
||||
* Since: 4.14
|
||||
*/
|
||||
|
||||
/**
|
||||
* GTK_ACCESSIBLE_ROLE_TERMINAL:
|
||||
*
|
||||
* A virtual terminal.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_ROLE_ALERT,
|
||||
GTK_ACCESSIBLE_ROLE_ALERT_DIALOG,
|
||||
@@ -1523,8 +1516,7 @@ typedef enum {
|
||||
GTK_ACCESSIBLE_ROLE_PARAGRAPH GDK_AVAILABLE_ENUMERATOR_IN_4_14,
|
||||
GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE GDK_AVAILABLE_ENUMERATOR_IN_4_14,
|
||||
GTK_ACCESSIBLE_ROLE_ARTICLE GDK_AVAILABLE_ENUMERATOR_IN_4_14,
|
||||
GTK_ACCESSIBLE_ROLE_COMMENT GDK_AVAILABLE_ENUMERATOR_IN_4_14,
|
||||
GTK_ACCESSIBLE_ROLE_TERMINAL GDK_AVAILABLE_ENUMERATOR_IN_4_14
|
||||
GTK_ACCESSIBLE_ROLE_COMMENT GDK_AVAILABLE_ENUMERATOR_IN_4_14
|
||||
} GtkAccessibleRole;
|
||||
|
||||
/**
|
||||
@@ -1834,16 +1826,13 @@ typedef enum {
|
||||
|
||||
/**
|
||||
* GtkPopoverMenuFlags:
|
||||
* @GTK_POPOVER_MENU_SLIDING: Submenus are presented as sliding submenus that
|
||||
* replace the main menu.
|
||||
* @GTK_POPOVER_MENU_NESTED: Submenus are presented as traditional, nested
|
||||
* popovers.
|
||||
*
|
||||
* Flags that affect how [class@Gtk.PopoverMenu] widgets built from
|
||||
* a [class@Gio.MenuModel] are created and displayed.
|
||||
*/
|
||||
/**
|
||||
* GTK_POPOVER_MENU_SLIDING:
|
||||
*
|
||||
* Submenus are presented as sliding submenus that replace the main menu.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
|
||||
@@ -4013,7 +4013,6 @@ gtk_icon_paintable_new_for_file (GFile *file,
|
||||
}
|
||||
|
||||
icon->is_svg = suffix_from_name (icon->filename) == ICON_CACHE_FLAG_SVG_SUFFIX;
|
||||
icon->is_symbolic = icon_uri_is_symbolic (icon->filename, -1);
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
+1
-101
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "gtkinscriptionprivate.h"
|
||||
|
||||
#include "gtkaccessibletext-private.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcssstylechangeprivate.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
@@ -30,8 +29,6 @@
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
|
||||
#include "a11y/gtkatspipangoprivate.h"
|
||||
|
||||
/**
|
||||
* GtkInscription:
|
||||
*
|
||||
@@ -99,11 +96,7 @@ enum
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static void gtk_inscription_accessible_text_init (GtkAccessibleTextInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkInscription, gtk_inscription, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE_TEXT,
|
||||
gtk_inscription_accessible_text_init))
|
||||
G_DEFINE_TYPE (GtkInscription, gtk_inscription, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
@@ -1327,96 +1320,3 @@ gtk_inscription_set_markup (GtkInscription *self,
|
||||
g_clear_pointer (&text, g_free);
|
||||
g_clear_pointer (&attrs, pango_attr_list_unref);
|
||||
}
|
||||
|
||||
/* {{{ GtkAccessibleText implementation */
|
||||
|
||||
static GBytes *
|
||||
gtk_inscription_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
const char *text;
|
||||
int len;
|
||||
char *string;
|
||||
gsize size;
|
||||
|
||||
text = gtk_inscription_get_text (GTK_INSCRIPTION (self));
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
start = CLAMP (start, 0, len);
|
||||
end = CLAMP (end, 0, len);
|
||||
|
||||
if (end <= start)
|
||||
{
|
||||
string = g_strdup ("");
|
||||
size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *p, *q;
|
||||
p = g_utf8_offset_to_pointer (text, start);
|
||||
q = g_utf8_offset_to_pointer (text, end);
|
||||
size = q - p + 1;
|
||||
string = g_strndup (p, q - p);
|
||||
}
|
||||
|
||||
return g_bytes_new_take (string, size);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
gtk_inscription_accessible_text_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_inscription_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_inscription_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (self));
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
*n_ranges = g_strv_length (names);
|
||||
*ranges = g_new (GtkAccessibleTextRange, *n_ranges);
|
||||
|
||||
for (unsigned i = 0; i < *n_ranges; i++)
|
||||
{
|
||||
GtkAccessibleTextRange *range = &(*ranges)[i];
|
||||
|
||||
range->start = start;
|
||||
range->length = end - start;
|
||||
}
|
||||
|
||||
*attribute_names = names;
|
||||
*attribute_values = values;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_inscription_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
iface->get_contents = gtk_inscription_accessible_text_get_contents;
|
||||
iface->get_caret_position = gtk_inscription_accessible_text_get_caret_position;
|
||||
iface->get_selection = gtk_inscription_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_inscription_accessible_text_get_attributes;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
||||
+2
-129
@@ -55,8 +55,6 @@
|
||||
#include "gtkdragicon.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkjoinedmenuprivate.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
@@ -431,22 +429,18 @@ static void gtk_label_update_active_link (GtkWidget *widget,
|
||||
double y);
|
||||
static void gtk_label_setup_mnemonic (GtkLabel *self);
|
||||
|
||||
static void gtk_label_buildable_interface_init (GtkBuildableIface *iface);
|
||||
/* For selectable labels: */
|
||||
static void gtk_label_move_cursor (GtkLabel *self,
|
||||
GtkMovementStep step,
|
||||
int count,
|
||||
gboolean extend_selection);
|
||||
|
||||
static void gtk_label_buildable_interface_init (GtkBuildableIface *iface);
|
||||
static GtkBuildableIface *buildable_parent_iface = NULL;
|
||||
|
||||
static void gtk_label_accessible_text_init (GtkAccessibleTextInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkLabel, gtk_label, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_label_buildable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE_TEXT,
|
||||
gtk_label_accessible_text_init))
|
||||
gtk_label_buildable_interface_init))
|
||||
|
||||
static void
|
||||
add_move_binding (GtkWidgetClass *widget_class,
|
||||
@@ -5111,12 +5105,8 @@ gtk_label_select_region_index (GtkLabel *self,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gtk_label_update_actions (self);
|
||||
|
||||
gtk_accessible_text_update_caret_position (GTK_ACCESSIBLE_TEXT (self));
|
||||
gtk_accessible_text_update_selection_bound (GTK_ACCESSIBLE_TEXT (self));
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (self));
|
||||
@@ -6061,120 +6051,3 @@ gtk_label_get_tabs (GtkLabel *self)
|
||||
|
||||
return self->tabs ? pango_tab_array_copy (self->tabs) : NULL;
|
||||
}
|
||||
|
||||
/* {{{ GtkAccessibleText implementation */
|
||||
|
||||
static GBytes *
|
||||
gtk_label_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
const char *text;
|
||||
int len;
|
||||
char *string;
|
||||
gsize size;
|
||||
|
||||
text = gtk_label_get_text (GTK_LABEL (self));
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
start = CLAMP (start, 0, len);
|
||||
end = CLAMP (end, 0, len);
|
||||
|
||||
if (end <= start)
|
||||
{
|
||||
string = g_strdup ("");
|
||||
size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *p, *q;
|
||||
p = g_utf8_offset_to_pointer (text, start);
|
||||
q = g_utf8_offset_to_pointer (text, end);
|
||||
size = q - p + 1;
|
||||
string = g_strndup (p, q - p);
|
||||
}
|
||||
|
||||
return g_bytes_new_take (string, size);
|
||||
}
|
||||
|
||||
static GBytes *
|
||||
gtk_label_accessible_text_get_contents_at (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start,
|
||||
unsigned int *end)
|
||||
{
|
||||
PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (self));
|
||||
char *string = gtk_pango_get_string_at (layout, offset, granularity, start, end);
|
||||
|
||||
return g_bytes_new_take (string, strlen (string));
|
||||
}
|
||||
|
||||
static unsigned
|
||||
gtk_label_accessible_text_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
return _gtk_label_get_cursor_position (GTK_LABEL (self));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_label_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
int start, end;
|
||||
|
||||
if (!gtk_label_get_selection_bounds (GTK_LABEL (self), &start, &end))
|
||||
return FALSE;
|
||||
|
||||
*n_ranges = 1;
|
||||
*ranges = g_new (GtkAccessibleTextRange, 1);
|
||||
(*ranges)[0].start = start;
|
||||
(*ranges)[0].length = end - start;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_label_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (self));
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
*n_ranges = g_strv_length (names);
|
||||
*ranges = g_new (GtkAccessibleTextRange, *n_ranges);
|
||||
|
||||
for (unsigned i = 0; i < *n_ranges; i++)
|
||||
{
|
||||
GtkAccessibleTextRange *range = &(*ranges)[i];
|
||||
|
||||
range->start = start;
|
||||
range->length = end - start;
|
||||
}
|
||||
|
||||
*attribute_names = names;
|
||||
*attribute_values = values;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
iface->get_contents = gtk_label_accessible_text_get_contents;
|
||||
iface->get_contents_at = gtk_label_accessible_text_get_contents_at;
|
||||
iface->get_caret_position = gtk_label_accessible_text_get_caret_position;
|
||||
iface->get_selection = gtk_label_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_label_accessible_text_get_attributes;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
||||
-745
@@ -472,20 +472,6 @@ pango_underline_to_string (PangoUnderline value)
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_overline_to_string (PangoOverline value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case PANGO_OVERLINE_NONE:
|
||||
return "none";
|
||||
case PANGO_OVERLINE_SINGLE:
|
||||
return "single";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_wrap_mode_to_string (PangoWrapMode mode)
|
||||
{
|
||||
@@ -518,734 +504,3 @@ pango_align_to_string (PangoAlignment align)
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
accumulate_font_attributes (PangoFontDescription *font,
|
||||
GPtrArray *names,
|
||||
GPtrArray *values)
|
||||
{
|
||||
char weight[60];
|
||||
char size[60];
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("style"));
|
||||
g_ptr_array_add (values, g_strdup (pango_style_to_string (pango_font_description_get_style (font))));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("variant"));
|
||||
g_ptr_array_add (values, g_strdup (pango_variant_to_string (pango_font_description_get_variant (font))));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("stretch"));
|
||||
g_ptr_array_add (values, g_strdup (pango_stretch_to_string (pango_font_description_get_stretch (font))));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("family-name"));
|
||||
g_ptr_array_add (values, g_strdup (pango_font_description_get_family (font)));
|
||||
|
||||
g_snprintf (weight, sizeof weight, "%d", pango_font_description_get_weight (font));
|
||||
g_ptr_array_add (names, g_strdup ("weight"));
|
||||
g_ptr_array_add (values, g_strdup (weight));
|
||||
|
||||
g_snprintf (size, sizeof size, "%i", pango_font_description_get_size (font) / PANGO_SCALE);
|
||||
g_ptr_array_add (names, g_strdup ("size"));
|
||||
g_ptr_array_add (values, g_strdup (size));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
GPtrArray *names = g_ptr_array_new_null_terminated (6, g_free, TRUE);
|
||||
GPtrArray *values = g_ptr_array_new_null_terminated (6, g_free, TRUE);
|
||||
|
||||
accumulate_font_attributes (font, names, values);
|
||||
|
||||
*attribute_names = g_strdupv ((char **) names->pdata);
|
||||
*attribute_values = g_strdupv ((char **) values->pdata);
|
||||
|
||||
g_ptr_array_unref (names);
|
||||
g_ptr_array_unref (values);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_get_default_attributes:
|
||||
* @layout: the `PangoLayout` from which to get attributes
|
||||
* @attribute_names: (out) (array zero-terminated=1) (transfer full): the attribute names
|
||||
* @attribute_values: (out) (array zero-terminated=1) (transfer full): the attribute values
|
||||
*
|
||||
* Returns the default text attributes from @layout,
|
||||
* after translating them from Pango attributes to atspi
|
||||
* attributes.
|
||||
*
|
||||
* This is a convenience function that can be used to implement
|
||||
* support for the `Text` interface in widgets using Pango
|
||||
* layouts.
|
||||
*/
|
||||
void
|
||||
gtk_pango_get_default_attributes (PangoLayout *layout,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
PangoContext *context;
|
||||
GPtrArray *names = g_ptr_array_new_null_terminated (16, g_free, TRUE);
|
||||
GPtrArray *values = g_ptr_array_new_null_terminated (16, g_free, TRUE);
|
||||
|
||||
context = pango_layout_get_context (layout);
|
||||
if (context)
|
||||
{
|
||||
PangoLanguage *language;
|
||||
PangoFontDescription *font;
|
||||
|
||||
language = pango_context_get_language (context);
|
||||
if (language)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("language"));
|
||||
g_ptr_array_add (values, g_strdup (pango_language_to_string (language)));
|
||||
}
|
||||
|
||||
font = pango_context_get_font_description (context);
|
||||
if (font)
|
||||
accumulate_font_attributes (font, names, values);
|
||||
}
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("justification"));
|
||||
g_ptr_array_add (values,
|
||||
g_strdup (pango_align_to_string (pango_layout_get_alignment (layout))));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("wrap-mode"));
|
||||
g_ptr_array_add (values,
|
||||
g_strdup (pango_wrap_mode_to_string (pango_layout_get_wrap (layout))));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("strikethrough"));
|
||||
g_ptr_array_add (values, g_strdup ("false"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("underline"));
|
||||
g_ptr_array_add (values, g_strdup ("false"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("rise"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("scale"));
|
||||
g_ptr_array_add (values, g_strdup ("1"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("bg-full-height"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("pixels-inside-wrap"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("pixels-below-lines"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("pixels-above-lines"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("editable"));
|
||||
g_ptr_array_add (values, g_strdup ("false"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("invisible"));
|
||||
g_ptr_array_add (values, g_strdup ("false"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("indent"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("right-margin"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
g_ptr_array_add (names, g_strdup ("left-margin"));
|
||||
g_ptr_array_add (values, g_strdup ("0"));
|
||||
|
||||
*attribute_names = g_strdupv ((char **) names->pdata);
|
||||
*attribute_values = g_strdupv ((char **) values->pdata);
|
||||
|
||||
g_ptr_array_unref (names);
|
||||
g_ptr_array_unref (values);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_get_run_attributes:
|
||||
* @layout: the `PangoLayout` to get the attributes from
|
||||
* @offset: the offset at which the attributes are wanted
|
||||
* @attribute_names: (array zero-terminated=1) (out) (transfer full): the
|
||||
* attribute names
|
||||
* @attribute_values: (array zero-terminated=1) (out) (transfer full): the
|
||||
* attribute values
|
||||
* @start_offset: return location for the starting offset
|
||||
* of the current run
|
||||
* @end_offset: return location for the ending offset of the
|
||||
* current run
|
||||
*
|
||||
* Finds the “run” around index (i.e. the maximal range of characters
|
||||
* where the set of applicable attributes remains constant) and
|
||||
* returns the starting and ending offsets for it.
|
||||
*
|
||||
* The attributes for the run are added to @attributes, after
|
||||
* translating them from Pango attributes to atspi attributes.
|
||||
*
|
||||
* This is a convenience function that can be used to implement
|
||||
* support for the #AtkText interface in widgets using Pango
|
||||
* layouts.
|
||||
*/
|
||||
void
|
||||
gtk_pango_get_run_attributes (PangoLayout *layout,
|
||||
unsigned int offset,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values,
|
||||
unsigned int *start_offset,
|
||||
unsigned int *end_offset)
|
||||
{
|
||||
PangoAttrIterator *iter;
|
||||
PangoAttrList *attr;
|
||||
PangoAttrString *pango_string;
|
||||
PangoAttrInt *pango_int;
|
||||
PangoAttrColor *pango_color;
|
||||
PangoAttrLanguage *pango_lang;
|
||||
PangoAttrFloat *pango_float;
|
||||
int index, start_index, end_index;
|
||||
gboolean is_next;
|
||||
glong len;
|
||||
const char *text;
|
||||
GPtrArray *names, *values;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
/* Grab the attributes of the PangoLayout, if any */
|
||||
attr = pango_layout_get_attributes (layout);
|
||||
|
||||
if (attr == NULL)
|
||||
{
|
||||
*attribute_names = g_new0 (char *, 1);
|
||||
*attribute_values = g_new0 (char *, 1);
|
||||
*start_offset = 0;
|
||||
*end_offset = len;
|
||||
return;
|
||||
}
|
||||
|
||||
iter = pango_attr_list_get_iterator (attr);
|
||||
/* Get invariant range offsets */
|
||||
/* If offset out of range, set offset in range */
|
||||
if (offset > len)
|
||||
offset = len;
|
||||
else if (offset < 0)
|
||||
offset = 0;
|
||||
|
||||
names = g_ptr_array_new_null_terminated (16, g_free, TRUE);
|
||||
values = g_ptr_array_new_null_terminated (16, g_free, TRUE);
|
||||
|
||||
index = g_utf8_offset_to_pointer (text, offset) - text;
|
||||
pango_attr_iterator_range (iter, &start_index, &end_index);
|
||||
is_next = TRUE;
|
||||
while (is_next)
|
||||
{
|
||||
if (index >= start_index && index < end_index)
|
||||
{
|
||||
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
|
||||
if (end_index == G_MAXINT) /* Last iterator */
|
||||
end_index = len;
|
||||
|
||||
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
|
||||
break;
|
||||
}
|
||||
is_next = pango_attr_iterator_next (iter);
|
||||
pango_attr_iterator_range (iter, &start_index, &end_index);
|
||||
}
|
||||
|
||||
/* Get attributes */
|
||||
pango_string = (PangoAttrString *) pango_attr_iterator_get (iter, PANGO_ATTR_FAMILY);
|
||||
if (pango_string != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("family-name"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%s", pango_string->value));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STYLE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("style"));
|
||||
g_ptr_array_add (values, g_strdup (pango_style_to_string (pango_int->value)));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_WEIGHT);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("weight"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%i", pango_int->value));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_VARIANT);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("variant"));
|
||||
g_ptr_array_add (values, g_strdup (pango_variant_to_string (pango_int->value)));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STRETCH);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("stretch"));
|
||||
g_ptr_array_add (values, g_strdup (pango_stretch_to_string (pango_int->value)));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_SIZE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("size"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%i", pango_int->value / PANGO_SCALE));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_UNDERLINE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("underline"));
|
||||
g_ptr_array_add (values, g_strdup (pango_underline_to_string (pango_int->value)));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_OVERLINE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("overline"));
|
||||
g_ptr_array_add (values, g_strdup (pango_overline_to_string (pango_int->value)));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_STRIKETHROUGH);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("strikethrough"));
|
||||
g_ptr_array_add (values, pango_int->value ? g_strdup ("true") : g_strdup ("false"));
|
||||
}
|
||||
|
||||
pango_int = (PangoAttrInt *) pango_attr_iterator_get (iter, PANGO_ATTR_RISE);
|
||||
if (pango_int != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("rise"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%i", pango_int->value));
|
||||
}
|
||||
|
||||
pango_lang = (PangoAttrLanguage *) pango_attr_iterator_get (iter, PANGO_ATTR_LANGUAGE);
|
||||
if (pango_lang != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("language"));
|
||||
g_ptr_array_add (values, g_strdup (pango_language_to_string (pango_lang->value)));
|
||||
}
|
||||
|
||||
pango_float = (PangoAttrFloat *) pango_attr_iterator_get (iter, PANGO_ATTR_SCALE);
|
||||
if (pango_float != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("scale"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%g", pango_float->value));
|
||||
}
|
||||
|
||||
pango_color = (PangoAttrColor *) pango_attr_iterator_get (iter, PANGO_ATTR_FOREGROUND);
|
||||
if (pango_color != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("fg-color"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%u,%u,%u",
|
||||
pango_color->color.red,
|
||||
pango_color->color.green,
|
||||
pango_color->color.blue));
|
||||
}
|
||||
|
||||
pango_color = (PangoAttrColor *) pango_attr_iterator_get (iter, PANGO_ATTR_BACKGROUND);
|
||||
if (pango_color != NULL)
|
||||
{
|
||||
g_ptr_array_add (names, g_strdup ("bg-color"));
|
||||
g_ptr_array_add (values, g_strdup_printf ("%u,%u,%u",
|
||||
pango_color->color.red,
|
||||
pango_color->color.green,
|
||||
pango_color->color.blue));
|
||||
}
|
||||
|
||||
pango_attr_iterator_destroy (iter);
|
||||
|
||||
*attribute_names = g_strdupv ((char **) names->pdata);
|
||||
*attribute_values = g_strdupv ((char **) values->pdata);
|
||||
|
||||
g_ptr_array_unref (names);
|
||||
g_ptr_array_unref (values);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_move_chars:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
* @count: the number of characters to move from @offset
|
||||
*
|
||||
* Returns the position that is @count characters from the
|
||||
* given @offset. @count may be positive or negative.
|
||||
*
|
||||
* For the purpose of this function, characters are defined
|
||||
* by what Pango considers cursor positions.
|
||||
*
|
||||
* Returns: the new position
|
||||
*/
|
||||
static int
|
||||
gtk_pango_move_chars (PangoLayout *layout,
|
||||
int offset,
|
||||
int count)
|
||||
{
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
while (count > 0 && offset < n_attrs - 1)
|
||||
{
|
||||
do
|
||||
offset++;
|
||||
while (offset < n_attrs - 1 && !attrs[offset].is_cursor_position);
|
||||
|
||||
count--;
|
||||
}
|
||||
while (count < 0 && offset > 0)
|
||||
{
|
||||
do
|
||||
offset--;
|
||||
while (offset > 0 && !attrs[offset].is_cursor_position);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_move_words:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
* @count: the number of words to move from @offset
|
||||
*
|
||||
* Returns the position that is @count words from the
|
||||
* given @offset. @count may be positive or negative.
|
||||
*
|
||||
* If @count is positive, the returned position will
|
||||
* be a word end, otherwise it will be a word start.
|
||||
* See the Pango documentation for details on how
|
||||
* word starts and ends are defined.
|
||||
*
|
||||
* Returns: the new position
|
||||
*/
|
||||
static int
|
||||
gtk_pango_move_words (PangoLayout *layout,
|
||||
int offset,
|
||||
int count)
|
||||
{
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
while (count > 0 && offset < n_attrs - 1)
|
||||
{
|
||||
do
|
||||
offset++;
|
||||
while (offset < n_attrs - 1 && !attrs[offset].is_word_end);
|
||||
|
||||
count--;
|
||||
}
|
||||
while (count < 0 && offset > 0)
|
||||
{
|
||||
do
|
||||
offset--;
|
||||
while (offset > 0 && !attrs[offset].is_word_start);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_move_sentences:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
* @count: the number of sentences to move from @offset
|
||||
*
|
||||
* Returns the position that is @count sentences from the
|
||||
* given @offset. @count may be positive or negative.
|
||||
*
|
||||
* If @count is positive, the returned position will
|
||||
* be a sentence end, otherwise it will be a sentence start.
|
||||
* See the Pango documentation for details on how
|
||||
* sentence starts and ends are defined.
|
||||
*
|
||||
* Returns: the new position
|
||||
*/
|
||||
static int
|
||||
gtk_pango_move_sentences (PangoLayout *layout,
|
||||
int offset,
|
||||
int count)
|
||||
{
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
while (count > 0 && offset < n_attrs - 1)
|
||||
{
|
||||
do
|
||||
offset++;
|
||||
while (offset < n_attrs - 1 && !attrs[offset].is_sentence_end);
|
||||
|
||||
count--;
|
||||
}
|
||||
while (count < 0 && offset > 0)
|
||||
{
|
||||
do
|
||||
offset--;
|
||||
while (offset > 0 && !attrs[offset].is_sentence_start);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* gtk_pango_move_lines:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
* @count: the number of lines to move from @offset
|
||||
*
|
||||
* Returns the position that is @count lines from the
|
||||
* given @offset. @count may be positive or negative.
|
||||
*
|
||||
* If @count is negative, the returned position will
|
||||
* be the start of a line, else it will be the end of
|
||||
* line.
|
||||
*
|
||||
* Returns: the new position
|
||||
*/
|
||||
static int
|
||||
gtk_pango_move_lines (PangoLayout *layout,
|
||||
int offset,
|
||||
int count)
|
||||
{
|
||||
GSList *lines, *l;
|
||||
PangoLayoutLine *line;
|
||||
int num;
|
||||
const char *text;
|
||||
int pos, line_pos;
|
||||
int index;
|
||||
int len;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
index = g_utf8_offset_to_pointer (text, offset) - text;
|
||||
lines = pango_layout_get_lines (layout);
|
||||
line = NULL;
|
||||
|
||||
num = 0;
|
||||
for (l = lines; l; l = l->next)
|
||||
{
|
||||
line = l->data;
|
||||
if (index < line->start_index + line->length)
|
||||
break;
|
||||
num++;
|
||||
}
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
num += count;
|
||||
if (num < 0)
|
||||
num = 0;
|
||||
|
||||
line = g_slist_nth_data (lines, num);
|
||||
|
||||
return g_utf8_pointer_to_offset (text, text + line->start_index);
|
||||
}
|
||||
else
|
||||
{
|
||||
line_pos = index - line->start_index;
|
||||
|
||||
len = g_slist_length (lines);
|
||||
num += count;
|
||||
if (num >= len || (count == 0 && num == len - 1))
|
||||
return g_utf8_strlen (text, -1) - 1;
|
||||
|
||||
line = l->data;
|
||||
pos = line->start_index + line_pos;
|
||||
if (pos >= line->start_index + line->length)
|
||||
pos = line->start_index + line->length - 1;
|
||||
|
||||
return g_utf8_pointer_to_offset (text, text + pos);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gtk_pango_is_inside_word:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
*
|
||||
* Returns whether the given position is inside
|
||||
* a word.
|
||||
*
|
||||
* Returns: %TRUE if @offset is inside a word
|
||||
*/
|
||||
static gboolean
|
||||
gtk_pango_is_inside_word (PangoLayout *layout,
|
||||
int offset)
|
||||
{
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
while (offset >= 0 &&
|
||||
!(attrs[offset].is_word_start || attrs[offset].is_word_end))
|
||||
offset--;
|
||||
|
||||
if (offset >= 0)
|
||||
return attrs[offset].is_word_start;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_pango_is_inside_sentence:
|
||||
* @layout: a `PangoLayout`
|
||||
* @offset: a character offset in @layout
|
||||
*
|
||||
* Returns whether the given position is inside
|
||||
* a sentence.
|
||||
*
|
||||
* Returns: %TRUE if @offset is inside a sentence
|
||||
*/
|
||||
static gboolean
|
||||
gtk_pango_is_inside_sentence (PangoLayout *layout,
|
||||
int offset)
|
||||
{
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
while (offset >= 0 &&
|
||||
!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
|
||||
offset--;
|
||||
|
||||
if (offset >= 0)
|
||||
return attrs[offset].is_sentence_start;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_pango_get_line_start (PangoLayout *layout,
|
||||
int offset,
|
||||
int *start_offset,
|
||||
int *end_offset)
|
||||
{
|
||||
PangoLayoutIter *iter;
|
||||
PangoLayoutLine *line, *prev_line = NULL;
|
||||
int index, start_index, length, end_index;
|
||||
const char *text;
|
||||
gboolean found = FALSE;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
index = g_utf8_offset_to_pointer (text, offset) - text;
|
||||
iter = pango_layout_get_iter (layout);
|
||||
do
|
||||
{
|
||||
line = pango_layout_iter_get_line (iter);
|
||||
start_index = pango_layout_line_get_start_index (line);
|
||||
length = pango_layout_line_get_length (line);
|
||||
end_index = start_index + length;
|
||||
|
||||
if (index >= start_index && index <= end_index)
|
||||
{
|
||||
/* Found line for offset */
|
||||
if (pango_layout_iter_next_line (iter))
|
||||
end_index = pango_layout_line_get_start_index (pango_layout_iter_get_line (iter));
|
||||
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
prev_line = line;
|
||||
}
|
||||
while (pango_layout_iter_next_line (iter));
|
||||
|
||||
if (!found)
|
||||
{
|
||||
start_index = pango_layout_line_get_start_index (prev_line) + pango_layout_line_get_length (prev_line);
|
||||
end_index = start_index;
|
||||
}
|
||||
|
||||
pango_layout_iter_free (iter);
|
||||
|
||||
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
|
||||
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
|
||||
}
|
||||
|
||||
char *
|
||||
gtk_pango_get_string_at (PangoLayout *layout,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start_offset,
|
||||
unsigned int *end_offset)
|
||||
{
|
||||
const char *text;
|
||||
int start, end;
|
||||
const PangoLogAttr *attrs;
|
||||
int n_attrs;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
|
||||
if (text[0] == 0)
|
||||
{
|
||||
*start_offset = 0;
|
||||
*end_offset = 0;
|
||||
return g_strdup ("");
|
||||
}
|
||||
|
||||
attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
|
||||
|
||||
start = offset;
|
||||
end = start;
|
||||
|
||||
switch (granularity)
|
||||
{
|
||||
case GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER:
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD:
|
||||
if (!attrs[start].is_word_start)
|
||||
start = gtk_pango_move_words (layout, start, -1);
|
||||
if (gtk_pango_is_inside_word (layout, end))
|
||||
end = gtk_pango_move_words (layout, end, 1);
|
||||
while (!attrs[end].is_word_start && end < n_attrs - 1)
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE:
|
||||
if (!attrs[start].is_sentence_start)
|
||||
start = gtk_pango_move_sentences (layout, start, -1);
|
||||
if (gtk_pango_is_inside_sentence (layout, end))
|
||||
end = gtk_pango_move_sentences (layout, end, 1);
|
||||
while (!attrs[end].is_sentence_start && end < n_attrs - 1)
|
||||
end = gtk_pango_move_chars (layout, end, 1);
|
||||
break;
|
||||
|
||||
case GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE:
|
||||
gtk_pango_get_line_start (layout, offset, &start, &end);
|
||||
break;
|
||||
|
||||
case GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH:
|
||||
/* FIXME: In theory, a layout can hold more than one paragraph */
|
||||
start = 0;
|
||||
end = g_utf8_strlen (text, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
*start_offset = start;
|
||||
*end_offset = end;
|
||||
|
||||
g_assert (start <= end);
|
||||
|
||||
return g_utf8_substring (text, start, end);
|
||||
}
|
||||
|
||||
+2
-23
@@ -24,10 +24,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <glib.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkaccessibletext.h"
|
||||
#include "gtkbuildable.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -57,29 +55,10 @@ gtk_pango_attribute_start_element (GtkBuildableParseContext *context,
|
||||
|
||||
const char *pango_wrap_mode_to_string (PangoWrapMode mode);
|
||||
const char *pango_underline_to_string (PangoUnderline underline);
|
||||
const char *pango_overline_to_string (PangoOverline underline);
|
||||
const char *pango_stretch_to_string (PangoStretch stretch);
|
||||
const char *pango_style_to_string (PangoStyle style);
|
||||
const char *pango_variant_to_string (PangoVariant variant);
|
||||
const char *pango_align_to_string (PangoAlignment align);
|
||||
|
||||
void gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
void gtk_pango_get_default_attributes (PangoLayout *layout,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values);
|
||||
void gtk_pango_get_run_attributes (PangoLayout *layout,
|
||||
unsigned int offset,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values,
|
||||
unsigned int *start_offset,
|
||||
unsigned int *end_offset);
|
||||
|
||||
char *gtk_pango_get_string_at (PangoLayout *layout,
|
||||
unsigned int offset,
|
||||
GtkAccessibleTextGranularity granularity,
|
||||
unsigned int *start_offset,
|
||||
unsigned int *end_offset);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkeventcontrollerkey.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcsspositionvalueprivate.h"
|
||||
@@ -106,8 +105,6 @@ enum {
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_PLACEHOLDER_TEXT,
|
||||
PROP_INPUT_PURPOSE,
|
||||
PROP_INPUT_HINTS,
|
||||
PROP_ACTIVATES_DEFAULT,
|
||||
PROP_SEARCH_DELAY,
|
||||
NUM_PROPERTIES,
|
||||
@@ -219,14 +216,6 @@ gtk_search_entry_set_property (GObject *object,
|
||||
-1);
|
||||
break;
|
||||
|
||||
case PROP_INPUT_PURPOSE:
|
||||
gtk_search_entry_set_input_purpose (entry, g_value_get_enum (value));
|
||||
break;
|
||||
|
||||
case PROP_INPUT_HINTS:
|
||||
gtk_search_entry_set_input_hints (entry, g_value_get_flags (value));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVATES_DEFAULT:
|
||||
if (gtk_text_get_activates_default (GTK_TEXT (entry->entry)) != g_value_get_boolean (value))
|
||||
{
|
||||
@@ -261,14 +250,6 @@ gtk_search_entry_get_property (GObject *object,
|
||||
g_value_set_string (value, gtk_text_get_placeholder_text (GTK_TEXT (entry->entry)));
|
||||
break;
|
||||
|
||||
case PROP_INPUT_PURPOSE:
|
||||
g_value_set_enum (value, gtk_text_get_input_purpose (GTK_TEXT (entry->entry)));
|
||||
break;
|
||||
|
||||
case PROP_INPUT_HINTS:
|
||||
g_value_set_flags (value, gtk_text_get_input_hints (GTK_TEXT (entry->entry)));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVATES_DEFAULT:
|
||||
g_value_set_boolean (value, gtk_text_get_activates_default (GTK_TEXT (entry->entry)));
|
||||
break;
|
||||
@@ -468,30 +449,6 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
|
||||
NULL,
|
||||
GTK_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GtkSearchEntry:input-purpose:
|
||||
*
|
||||
* The purpose for the `GtkSearchEntry` input used to alter the
|
||||
* behaviour of input methods.
|
||||
*/
|
||||
props[PROP_INPUT_PURPOSE] =
|
||||
g_param_spec_enum ("input-purpose", NULL, NULL,
|
||||
GTK_TYPE_INPUT_PURPOSE,
|
||||
GTK_INPUT_PURPOSE_FREE_FORM,
|
||||
GTK_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkSearchEntry:input-hints:
|
||||
*
|
||||
* The hints about input for the `GtkSearchEntry` used to alter the
|
||||
* behaviour of input methods.
|
||||
*/
|
||||
props[PROP_INPUT_HINTS] =
|
||||
g_param_spec_flags ("input-hints", NULL, NULL,
|
||||
GTK_TYPE_INPUT_HINTS,
|
||||
GTK_INPUT_HINT_NONE,
|
||||
GTK_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkSearchEntry:activates-default:
|
||||
*
|
||||
@@ -1056,88 +1013,6 @@ gtk_search_entry_set_placeholder_text (GtkSearchEntry *entry,
|
||||
gtk_text_set_placeholder_text (GTK_TEXT (entry->entry), text);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_get_input_purpose:
|
||||
* @entry: a `GtkSearchEntry`
|
||||
*
|
||||
* Gets the input purpose of @entry.
|
||||
*
|
||||
* Returns: The input hints
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GtkInputPurpose
|
||||
gtk_search_entry_get_input_purpose (GtkSearchEntry *entry)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_SEARCH_ENTRY (entry), GTK_INPUT_PURPOSE_FREE_FORM);
|
||||
|
||||
return gtk_text_get_input_purpose (GTK_TEXT (entry->entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_set_input_purpose:
|
||||
* @entry: a `GtkSearchEntry`
|
||||
* @purpose: the new input purpose
|
||||
*
|
||||
* Sets the input purpose of @entry.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
void
|
||||
gtk_search_entry_set_input_purpose (GtkSearchEntry *entry,
|
||||
GtkInputPurpose purpose)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_SEARCH_ENTRY (entry));
|
||||
|
||||
if (purpose != gtk_search_entry_get_input_purpose (entry))
|
||||
{
|
||||
gtk_text_set_input_purpose (GTK_TEXT (entry->entry), purpose);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_INPUT_PURPOSE]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_get_input_hints:
|
||||
* @entry: a `GtkSearchEntry`
|
||||
*
|
||||
* Gets the input purpose for @entry.
|
||||
*
|
||||
* Returns: The input hints
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
GtkInputHints
|
||||
gtk_search_entry_get_input_hints (GtkSearchEntry *entry)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_SEARCH_ENTRY (entry), GTK_INPUT_HINT_NONE);
|
||||
|
||||
return gtk_text_get_input_hints (GTK_TEXT (entry->entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_set_input_hints:
|
||||
* @entry: a `GtkSearchEntry`
|
||||
* @hints: the new input hints
|
||||
*
|
||||
* Sets the input hints for @entry.
|
||||
*
|
||||
* Since: 4.14
|
||||
*/
|
||||
void
|
||||
gtk_search_entry_set_input_hints (GtkSearchEntry *entry,
|
||||
GtkInputHints hints)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_SEARCH_ENTRY (entry));
|
||||
|
||||
if (hints != gtk_search_entry_get_input_hints (entry))
|
||||
{
|
||||
gtk_text_set_input_hints (GTK_TEXT (entry->entry), hints);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_INPUT_HINTS]);
|
||||
}
|
||||
}
|
||||
|
||||
GtkText *
|
||||
gtk_search_entry_get_text_widget (GtkSearchEntry *entry)
|
||||
{
|
||||
|
||||
@@ -65,18 +65,6 @@ void gtk_search_entry_set_placeholder_text (GtkSearchEntry *entry,
|
||||
GDK_AVAILABLE_IN_4_10
|
||||
const char * gtk_search_entry_get_placeholder_text (GtkSearchEntry *entry);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gtk_search_entry_set_input_purpose (GtkSearchEntry *entry,
|
||||
GtkInputPurpose purpose);
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GtkInputPurpose gtk_search_entry_get_input_purpose (GtkSearchEntry *entry);
|
||||
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
void gtk_search_entry_set_input_hints (GtkSearchEntry *entry,
|
||||
GtkInputHints hints);
|
||||
GDK_AVAILABLE_IN_4_14
|
||||
GtkInputHints gtk_search_entry_get_input_hints (GtkSearchEntry *entry);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSearchEntry, g_object_unref)
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "gtkenums.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
|
||||
struct _GtkTestATContext
|
||||
{
|
||||
@@ -40,15 +39,6 @@ struct _GtkTestATContextClass
|
||||
GtkATContextClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
UPDATE_CARET_POSITION,
|
||||
UPDATE_SELECTION_BOUND,
|
||||
UPDATE_TEXT_CONTENTS,
|
||||
LAST_SIGNAL,
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
G_DEFINE_TYPE (GtkTestATContext, gtk_test_at_context, GTK_TYPE_AT_CONTEXT)
|
||||
|
||||
static void
|
||||
@@ -112,38 +102,6 @@ gtk_test_at_context_platform_change (GtkATContext *self,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_update_caret_position (GtkATContext *self)
|
||||
{
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (self);
|
||||
GtkAccessibleText *accessible_text = GTK_ACCESSIBLE_TEXT (accessible);
|
||||
unsigned int position;
|
||||
|
||||
position = gtk_accessible_text_get_caret_position (accessible_text);
|
||||
g_signal_emit (self, signals[UPDATE_CARET_POSITION], 0, position);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_update_selection_bound (GtkATContext *self)
|
||||
{
|
||||
g_signal_emit (self, signals[UPDATE_SELECTION_BOUND], 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_update_text_contents (GtkATContext *self,
|
||||
GtkAccessibleTextContentChange change,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
GtkAccessible *accessible = gtk_at_context_get_accessible (self);
|
||||
GtkAccessibleText *accessible_text = GTK_ACCESSIBLE_TEXT (accessible);
|
||||
GBytes *contents;
|
||||
|
||||
contents = gtk_accessible_text_get_contents (accessible_text, start, end);
|
||||
g_signal_emit (self, signals[UPDATE_TEXT_CONTENTS], 0, change, start, end, contents);
|
||||
g_bytes_unref (contents);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_class_init (GtkTestATContextClass *klass)
|
||||
{
|
||||
@@ -151,41 +109,6 @@ gtk_test_at_context_class_init (GtkTestATContextClass *klass)
|
||||
|
||||
context_class->state_change = gtk_test_at_context_state_change;
|
||||
context_class->platform_change = gtk_test_at_context_platform_change;
|
||||
|
||||
context_class->update_caret_position = gtk_test_at_context_update_caret_position;
|
||||
context_class->update_selection_bound = gtk_test_at_context_update_selection_bound;
|
||||
context_class->update_text_contents = gtk_test_at_context_update_text_contents;
|
||||
|
||||
signals[UPDATE_CARET_POSITION] =
|
||||
g_signal_new ("update-caret-position",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 1, G_TYPE_UINT);
|
||||
|
||||
signals[UPDATE_SELECTION_BOUND] =
|
||||
g_signal_new ("update-selection-bound",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
signals[UPDATE_TEXT_CONTENTS] =
|
||||
g_signal_new ("update-text-contents",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 4,
|
||||
GTK_TYPE_ACCESSIBLE_TEXT_CONTENT_CHANGE,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_BYTES);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+4
-163
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "gtktextprivate.h"
|
||||
|
||||
#include "gtkaccessibletext-private.h"
|
||||
#include "gtkactionable.h"
|
||||
#include "gtkadjustment.h"
|
||||
#include "gtkbox.h"
|
||||
@@ -70,8 +69,6 @@
|
||||
#include "gtkactionmuxerprivate.h"
|
||||
#include "gtkjoinedmenuprivate.h"
|
||||
#include "deprecated/gtkrender.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
#include "a11y/gtkatspipangoprivate.h"
|
||||
|
||||
#include <cairo-gobject.h>
|
||||
#include <string.h>
|
||||
@@ -709,14 +706,9 @@ static const GtkTextHistoryFuncs history_funcs = {
|
||||
gtk_text_history_select_cb,
|
||||
};
|
||||
|
||||
static void gtk_text_accessible_text_init (GtkAccessibleTextInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkText, gtk_text, GTK_TYPE_WIDGET,
|
||||
G_ADD_PRIVATE (GtkText)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_text_editable_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE_TEXT,
|
||||
gtk_text_accessible_text_init))
|
||||
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_text_editable_init))
|
||||
|
||||
static void
|
||||
add_move_binding (GtkWidgetClass *widget_class,
|
||||
@@ -3448,11 +3440,6 @@ gtk_text_insert_text (GtkText *self,
|
||||
if (n_inserted != n_chars)
|
||||
gtk_widget_error_bell (GTK_WIDGET (self));
|
||||
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
*position,
|
||||
n_inserted);
|
||||
|
||||
*position += n_inserted;
|
||||
|
||||
update_placeholder_visibility (self);
|
||||
@@ -3467,17 +3454,9 @@ gtk_text_delete_text (GtkText *self,
|
||||
{
|
||||
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
|
||||
|
||||
if (end_pos < 0)
|
||||
end_pos = gtk_entry_buffer_get_length (get_buffer (self));
|
||||
|
||||
if (start_pos == end_pos)
|
||||
return;
|
||||
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE,
|
||||
start_pos,
|
||||
end_pos);
|
||||
|
||||
if (priv->change_count == 0)
|
||||
gtk_text_history_begin_irreversible_action (priv->history);
|
||||
begin_change (self);
|
||||
@@ -3502,9 +3481,6 @@ gtk_text_delete_selection (GtkText *self)
|
||||
int end_pos = MAX (priv->selection_bound, priv->current_pos);
|
||||
|
||||
gtk_editable_delete_text (GTK_EDITABLE (self), start_pos, end_pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE,
|
||||
start_pos, end_pos);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3525,9 +3501,6 @@ gtk_text_set_selection_bounds (GtkText *self,
|
||||
gtk_text_set_positions (self, MIN (end, length), MIN (start, length));
|
||||
|
||||
gtk_text_update_primary_selection (self);
|
||||
|
||||
gtk_accessible_text_update_caret_position (GTK_ACCESSIBLE_TEXT (self));
|
||||
gtk_accessible_text_update_selection_bound (GTK_ACCESSIBLE_TEXT (self));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -4009,10 +3982,6 @@ gtk_text_insert_at_cursor (GtkText *self,
|
||||
begin_change (self);
|
||||
gtk_text_reset_im_context (self);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), str, -1, &pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
pos,
|
||||
pos + g_utf8_strlen (str, -1));
|
||||
gtk_text_set_selection_bounds (self, pos, pos);
|
||||
end_change (self);
|
||||
}
|
||||
@@ -4087,6 +4056,7 @@ gtk_text_delete_from_cursor (GtkText *self,
|
||||
gtk_editable_delete_text (GTK_EDITABLE (self), 0, priv->current_pos);
|
||||
else
|
||||
gtk_editable_delete_text (GTK_EDITABLE (self), priv->current_pos, -1);
|
||||
|
||||
break;
|
||||
|
||||
case GTK_DELETE_DISPLAY_LINES:
|
||||
@@ -4166,12 +4136,8 @@ gtk_text_backspace (GtkText *self)
|
||||
int pos = priv->current_pos;
|
||||
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), normalized_text,
|
||||
g_utf8_offset_to_pointer (normalized_text, len - 1) - normalized_text,
|
||||
&pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
pos,
|
||||
pos + len);
|
||||
g_utf8_offset_to_pointer (normalized_text, len - 1) - normalized_text,
|
||||
&pos);
|
||||
gtk_text_set_selection_bounds (self, pos, pos);
|
||||
}
|
||||
|
||||
@@ -4457,9 +4423,6 @@ gtk_text_enter_text (GtkText *self,
|
||||
|
||||
tmp_pos = priv->current_pos;
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), str, strlen (str), &tmp_pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
tmp_pos, tmp_pos + g_utf8_strlen (str, -1));
|
||||
gtk_text_set_selection_bounds (self, tmp_pos, tmp_pos);
|
||||
|
||||
end_change (self);
|
||||
@@ -5423,9 +5386,6 @@ paste_received (GObject *clipboard,
|
||||
|
||||
pos = priv->current_pos;
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), text, length, &pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
pos, pos + length);
|
||||
gtk_text_set_selection_bounds (self, pos, pos);
|
||||
end_change (self);
|
||||
|
||||
@@ -5657,14 +5617,8 @@ gtk_text_set_text (GtkText *self,
|
||||
begin_change (self);
|
||||
g_object_freeze_notify (G_OBJECT (self));
|
||||
gtk_editable_delete_text (GTK_EDITABLE (self), 0, -1);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE,
|
||||
0, G_MAXUINT);
|
||||
tmp_pos = 0;
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), text, strlen (text), &tmp_pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
tmp_pos, tmp_pos + g_utf8_strlen (text, -1));
|
||||
g_object_thaw_notify (G_OBJECT (self));
|
||||
end_change (self);
|
||||
|
||||
@@ -6463,9 +6417,6 @@ gtk_text_drag_drop (GtkDropTarget *dest,
|
||||
drop_position > priv->current_pos)
|
||||
{
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), str, length, &drop_position);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
drop_position, drop_position + length);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6475,9 +6426,6 @@ gtk_text_drag_drop (GtkDropTarget *dest,
|
||||
gtk_text_delete_selection (self);
|
||||
pos = MIN (priv->selection_bound, priv->current_pos);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), str, length, &pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
pos, pos + length);
|
||||
end_change (self);
|
||||
}
|
||||
|
||||
@@ -7053,9 +7001,6 @@ emoji_picked (GtkEmojiChooser *chooser,
|
||||
|
||||
pos = priv->current_pos;
|
||||
gtk_editable_insert_text (GTK_EDITABLE (self), text, -1, &pos);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (self),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
pos, pos + 1);
|
||||
gtk_text_set_selection_bounds (self, pos, pos);
|
||||
end_change (self);
|
||||
}
|
||||
@@ -7383,9 +7328,6 @@ gtk_text_history_insert_cb (gpointer funcs_data,
|
||||
int location = begin;
|
||||
|
||||
gtk_editable_insert_text (GTK_EDITABLE (text), str, len, &location);
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (text),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
location, location + len);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -7436,104 +7378,3 @@ gtk_text_update_history (GtkText *self)
|
||||
priv->visible &&
|
||||
priv->editable);
|
||||
}
|
||||
|
||||
/* {{{ GtkAccessibleText implementation */
|
||||
|
||||
static GBytes *
|
||||
gtk_text_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
const char *text;
|
||||
int len;
|
||||
char *string;
|
||||
gsize size;
|
||||
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (self));
|
||||
len = g_utf8_strlen (text, -1);
|
||||
|
||||
start = CLAMP (start, 0, len);
|
||||
end = CLAMP (end, 0, len);
|
||||
|
||||
if (end <= start)
|
||||
{
|
||||
string = g_strdup ("");
|
||||
size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *p, *q;
|
||||
p = g_utf8_offset_to_pointer (text, start);
|
||||
q = g_utf8_offset_to_pointer (text, end);
|
||||
size = q - p + 1;
|
||||
string = g_strndup (p, q - p);
|
||||
}
|
||||
|
||||
return g_bytes_new_take (string, size);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
gtk_text_accessible_text_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
return gtk_editable_get_position (GTK_EDITABLE (self));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
int start, end;
|
||||
|
||||
if (!gtk_editable_get_selection_bounds (GTK_EDITABLE (self), &start, &end))
|
||||
return FALSE;
|
||||
|
||||
*n_ranges = 1;
|
||||
*ranges = g_new (GtkAccessibleTextRange, 1);
|
||||
(*ranges)[0].start = start;
|
||||
(*ranges)[0].length = end - start;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
PangoLayout *layout = gtk_text_get_layout (GTK_TEXT (self));
|
||||
unsigned int start, end;
|
||||
char **names, **values;
|
||||
|
||||
gtk_pango_get_run_attributes (layout, offset, &names, &values, &start, &end);
|
||||
|
||||
*n_ranges = g_strv_length (names);
|
||||
*ranges = g_new (GtkAccessibleTextRange, *n_ranges);
|
||||
|
||||
for (unsigned i = 0; i < *n_ranges; i++)
|
||||
{
|
||||
GtkAccessibleTextRange *range = &(*ranges)[i];
|
||||
|
||||
range->start = start;
|
||||
range->length = end - start;
|
||||
}
|
||||
|
||||
*attribute_names = names;
|
||||
*attribute_values = values;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
iface->get_contents = gtk_text_accessible_text_get_contents;
|
||||
iface->get_caret_position = gtk_text_accessible_text_get_caret_position;
|
||||
iface->get_selection = gtk_text_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_text_accessible_text_get_attributes;
|
||||
}
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
||||
+2
-178
@@ -44,7 +44,6 @@
|
||||
#include "gtkimmulticontext.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtktextutilprivate.h"
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtkscrollable.h"
|
||||
@@ -63,7 +62,7 @@
|
||||
#include "gtksnapshot.h"
|
||||
#include "gtkrenderbackgroundprivate.h"
|
||||
#include "gtkrenderborderprivate.h"
|
||||
#include "gtkaccessibletext-private.h"
|
||||
|
||||
|
||||
/**
|
||||
* GtkTextView:
|
||||
@@ -548,15 +547,6 @@ static void gtk_text_view_paste_done_handler (GtkTextBuffer *buffer,
|
||||
gpointer data);
|
||||
static void gtk_text_view_buffer_changed_handler (GtkTextBuffer *buffer,
|
||||
gpointer data);
|
||||
static void gtk_text_view_insert_text_handler (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
char *text,
|
||||
int len,
|
||||
gpointer data);
|
||||
static void gtk_text_view_delete_range_handler (GtkTextBuffer *buffer,
|
||||
GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
gpointer data);
|
||||
static void gtk_text_view_buffer_notify_redo (GtkTextBuffer *buffer,
|
||||
GParamSpec *pspec,
|
||||
GtkTextView *view);
|
||||
@@ -690,13 +680,9 @@ static int text_window_get_height (GtkTextWindow *win);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void gtk_text_view_accessible_text_init (GtkAccessibleTextInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkTextView, gtk_text_view, GTK_TYPE_WIDGET,
|
||||
G_ADD_PRIVATE (GtkTextView)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE_TEXT,
|
||||
gtk_text_view_accessible_text_init))
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
|
||||
|
||||
static GtkTextBuffer*
|
||||
get_buffer (GtkTextView *text_view)
|
||||
@@ -2169,12 +2155,6 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
|
||||
g_signal_handlers_disconnect_by_func (priv->buffer,
|
||||
gtk_text_view_buffer_notify_undo,
|
||||
text_view);
|
||||
g_signal_handlers_disconnect_by_func (priv->buffer,
|
||||
gtk_text_view_insert_text_handler,
|
||||
text_view);
|
||||
g_signal_handlers_disconnect_by_func (priv->buffer,
|
||||
gtk_text_view_delete_range_handler,
|
||||
text_view);
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
|
||||
{
|
||||
@@ -2231,12 +2211,6 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
|
||||
g_signal_connect (priv->buffer, "notify",
|
||||
G_CALLBACK (gtk_text_view_buffer_notify_redo),
|
||||
text_view);
|
||||
g_signal_connect_after (priv->buffer, "insert-text",
|
||||
G_CALLBACK (gtk_text_view_insert_text_handler),
|
||||
text_view);
|
||||
g_signal_connect (priv->buffer, "delete-range",
|
||||
G_CALLBACK (gtk_text_view_delete_range_handler),
|
||||
text_view);
|
||||
|
||||
can_undo = gtk_text_buffer_get_can_undo (buffer);
|
||||
can_redo = gtk_text_buffer_get_can_redo (buffer);
|
||||
@@ -7154,40 +7128,6 @@ gtk_text_view_buffer_changed_handler (GtkTextBuffer *buffer,
|
||||
gtk_text_view_update_handles (text_view);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_view_insert_text_handler (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
char *text,
|
||||
int len,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTextView *text_view = data;
|
||||
int position;
|
||||
int length;
|
||||
|
||||
position = gtk_text_iter_get_offset (iter);
|
||||
length = g_utf8_strlen (text, len);
|
||||
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (text_view),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
|
||||
position - length,
|
||||
position);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_view_delete_range_handler (GtkTextBuffer *buffer,
|
||||
GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTextView *text_view = data;
|
||||
|
||||
gtk_accessible_text_update_contents (GTK_ACCESSIBLE_TEXT (text_view),
|
||||
GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE,
|
||||
gtk_text_iter_get_offset (start),
|
||||
gtk_text_iter_get_offset (end));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_view_toggle_overwrite (GtkTextView *text_view)
|
||||
{
|
||||
@@ -8827,12 +8767,10 @@ gtk_text_view_mark_set_handler (GtkTextBuffer *buffer,
|
||||
text_view->priv->virtual_cursor_x = -1;
|
||||
text_view->priv->virtual_cursor_y = -1;
|
||||
gtk_text_view_update_im_spot_location (text_view);
|
||||
gtk_accessible_text_update_caret_position (GTK_ACCESSIBLE_TEXT (text_view));
|
||||
need_reset = TRUE;
|
||||
}
|
||||
else if (mark == gtk_text_buffer_get_selection_bound (buffer))
|
||||
{
|
||||
gtk_accessible_text_update_selection_bound (GTK_ACCESSIBLE_TEXT (text_view));
|
||||
need_reset = TRUE;
|
||||
}
|
||||
|
||||
@@ -10363,117 +10301,3 @@ gtk_text_view_get_key_controller (GtkTextView *text_view)
|
||||
{
|
||||
return text_view->priv->key_controller;
|
||||
}
|
||||
|
||||
/* {{{ GtkAccessibleText implementation */
|
||||
|
||||
static GBytes *
|
||||
gtk_text_view_accessible_text_get_contents (GtkAccessibleText *self,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
|
||||
GtkTextIter start_iter, end_iter;
|
||||
char *string;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &start_iter, start);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &end_iter, end == G_MAXUINT ? -1 : end);
|
||||
|
||||
string = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
||||
|
||||
return g_bytes_new_take (string, strlen (string) + 1);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
gtk_text_view_accessible_text_get_caret_position (GtkAccessibleText *self)
|
||||
{
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
|
||||
GtkTextMark *insert;
|
||||
GtkTextIter iter;
|
||||
|
||||
insert = gtk_text_buffer_get_insert (buffer);
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
|
||||
|
||||
return gtk_text_iter_get_offset (&iter);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_view_accessible_text_get_selection (GtkAccessibleText *self,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges)
|
||||
{
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
|
||||
GtkTextIter start_iter, end_iter;
|
||||
int start, end;
|
||||
|
||||
if (!gtk_text_buffer_get_selection_bounds (buffer, &start_iter, &end_iter))
|
||||
return FALSE;
|
||||
|
||||
start = gtk_text_iter_get_offset (&start_iter);
|
||||
end = gtk_text_iter_get_offset (&end_iter);
|
||||
|
||||
*n_ranges = 1;
|
||||
|
||||
*ranges = g_new (GtkAccessibleTextRange, 1);
|
||||
(*ranges)[0].start = start;
|
||||
(*ranges)[0].length = end - start;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_view_accessible_text_get_attributes (GtkAccessibleText *self,
|
||||
unsigned int offset,
|
||||
gsize *n_ranges,
|
||||
GtkAccessibleTextRange **ranges,
|
||||
char ***attribute_names,
|
||||
char ***attribute_values)
|
||||
{
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
|
||||
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
|
||||
int start, end;
|
||||
|
||||
gtk_text_buffer_get_run_attributes (buffer, &builder, offset, &start, &end);
|
||||
|
||||
GVariant *v = g_variant_builder_end (&builder);
|
||||
unsigned n = g_variant_n_children (v);
|
||||
if (n == 0)
|
||||
{
|
||||
g_variant_unref (v);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*n_ranges = n;
|
||||
*ranges = g_new (GtkAccessibleTextRange, n);
|
||||
*attribute_names = g_new (char *, n + 1);
|
||||
*attribute_values = g_new (char *, n + 1);
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
char *name, *value;
|
||||
|
||||
((*ranges)[i]).start = start;
|
||||
((*ranges)[i]).length = end - start;
|
||||
|
||||
g_variant_get_child (v, i, "{ss}", &name, &value);
|
||||
(*attribute_names)[i] = g_steal_pointer (&name);
|
||||
(*attribute_values)[i] = g_steal_pointer (&value);
|
||||
}
|
||||
|
||||
(*attribute_names)[n] = NULL;
|
||||
(*attribute_values)[n] = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_view_accessible_text_init (GtkAccessibleTextInterface *iface)
|
||||
{
|
||||
iface->get_contents = gtk_text_view_accessible_text_get_contents;
|
||||
iface->get_caret_position = gtk_text_view_accessible_text_get_caret_position;
|
||||
iface->get_selection = gtk_text_view_accessible_text_get_selection;
|
||||
iface->get_attributes = gtk_text_view_accessible_text_get_attributes;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
||||
@@ -155,7 +155,6 @@ gtk_public_sources = files([
|
||||
'gtkaccelgroup.c',
|
||||
'gtkaccessible.c',
|
||||
'gtkaccessiblerange.c',
|
||||
'gtkaccessibletext.c',
|
||||
'gtkactionable.c',
|
||||
'gtkactionbar.c',
|
||||
'gtkadjustment.c',
|
||||
@@ -418,7 +417,6 @@ gtk_public_headers = files([
|
||||
'gtkaccelgroup.h',
|
||||
'gtkaccessible.h',
|
||||
'gtkaccessiblerange.h',
|
||||
'gtkaccessibletext.h',
|
||||
'gtkactionable.h',
|
||||
'gtkactionbar.h',
|
||||
'gtkadjustment.h',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<schemalist>
|
||||
|
||||
<schema id='org.gtk.gtk4.Settings.EmojiChooser' path='/org/gtk/gtk4/settings/emoji-chooser/'>
|
||||
<key name='recently-used-emoji' type='a((aussasasu)u)'>
|
||||
<key name='recent-emoji' type='a((ausasu)u)'>
|
||||
<default>[]</default>
|
||||
<summary>Recently used Emoji</summary>
|
||||
<description>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
project('gtk', 'c',
|
||||
version: '4.13.9',
|
||||
version: '4.13.8',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
'warning_level=1',
|
||||
|
||||
@@ -35,7 +35,7 @@ msgstr ""
|
||||
"Project-Id-Version: gtk+ 2.8.2\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-12 01:46+0000\n"
|
||||
"PO-Revision-Date: 2024-02-21 22:28+0100\n"
|
||||
"PO-Revision-Date: 2024-02-14 22:28+0100\n"
|
||||
"Last-Translator: Jordi Mas i Hernàndez <jmas@softcatala.org>\n"
|
||||
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
|
||||
"Language: ca\n"
|
||||
@@ -3933,7 +3933,7 @@ msgstr "Cap"
|
||||
|
||||
#: gtk/inspector/general.c:901
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "El context IM està definit manualment per GTK_IM_MODULE"
|
||||
msgstr "El content IM està definit manualment per GTK_IM_MODULE"
|
||||
|
||||
#: gtk/inspector/general.ui:31
|
||||
msgid "GTK Version"
|
||||
@@ -7590,12 +7590,12 @@ msgstr "CAMÍ"
|
||||
|
||||
#: tools/gtk-path-tool-decompose.c:99
|
||||
msgid "Decompose a path."
|
||||
msgstr "Descompon un camí."
|
||||
msgstr "Descomposa un camí"
|
||||
|
||||
#: tools/gtk-path-tool-decompose.c:112 tools/gtk-path-tool-info.c:113
|
||||
#: tools/gtk-path-tool-restrict.c:64 tools/gtk-path-tool-reverse.c:58
|
||||
msgid "No paths given."
|
||||
msgstr "No s'ha proporcionat cap camí."
|
||||
msgstr "No s'ha proporcionat cap camí"
|
||||
|
||||
#: tools/gtk-path-tool-decompose.c:140 tools/gtk-path-tool-restrict.c:94
|
||||
#: tools/gtk-path-tool-reverse.c:78
|
||||
@@ -7809,7 +7809,7 @@ msgstr "Previsualització del camí"
|
||||
|
||||
#: tools/gtk-path-tool-show.c:180
|
||||
msgid "Display the path."
|
||||
msgstr "Visualitza el camí."
|
||||
msgstr "Visualitza el camí"
|
||||
|
||||
#: tools/gtk-path-tool-show.c:215
|
||||
msgid "Can only show a single path"
|
||||
@@ -8105,3 +8105,50 @@ msgstr ""
|
||||
"No hi ha el fitxer índex de tema a «%s».\n"
|
||||
"Si realment voleu crear una memòria cau d'icones aquí, utilitzeu --ignore-theme-index.\n"
|
||||
|
||||
#~ msgctxt "GL version"
|
||||
#~ msgid "Disabled"
|
||||
#~ msgstr "Inhabilitat"
|
||||
|
||||
#~ msgctxt "GL vendor"
|
||||
#~ msgid "Disabled"
|
||||
#~ msgstr "Inhabilitat"
|
||||
|
||||
#~ msgctxt "GL vendor"
|
||||
#~ msgid "None"
|
||||
#~ msgstr "Cap"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Unspecified error decoding media"
|
||||
#~ msgstr "S'ha produït un error no especificat descodificant un mitjà"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Cannot find decoder: %s"
|
||||
#~ msgstr "No s'ha pogut trobar el descodificador: %s"
|
||||
|
||||
#~ msgid "Failed to allocate a codec context"
|
||||
#~ msgstr "No s'ha pogut assignar un context de còdec"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Cannot find encoder: %s"
|
||||
#~ msgstr "No s'ha pogut trobar el codificador: %s"
|
||||
|
||||
#~ msgid "Cannot add new stream"
|
||||
#~ msgstr "No es pot afegir un flux nou"
|
||||
|
||||
#~ msgid "Failed to allocate an audio frame"
|
||||
#~ msgstr "No s'ha pogut assignar una trama d'àudio"
|
||||
|
||||
#~ msgid "Not enough memory"
|
||||
#~ msgstr "No hi ha prou memòria"
|
||||
|
||||
#~ msgid "Could not allocate resampler context"
|
||||
#~ msgstr "No s'ha pogut assignar el context del remostreig"
|
||||
|
||||
#~ msgid "No audio output found"
|
||||
#~ msgstr "No s'ha trobat cap sortida d'àudio"
|
||||
|
||||
#~ msgid "Show _Size Column"
|
||||
#~ msgstr "Mostra la columna de la _mida"
|
||||
|
||||
#~ msgid "Show T_ype Column"
|
||||
#~ msgstr "Mos_tra la columna tipus"
|
||||
|
||||
+1104
-1732
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+ 2.6\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-23 01:06+0000\n"
|
||||
"PO-Revision-Date: 2024-02-24 00:20+0330\n"
|
||||
"POT-Creation-Date: 2024-02-12 01:46+0000\n"
|
||||
"PO-Revision-Date: 2024-02-12 19:26+0330\n"
|
||||
"Last-Translator: Danial Behzadi <dani.behzi@ubuntu.com>\n"
|
||||
"Language-Team: Persian <>\n"
|
||||
"Language: fa\n"
|
||||
@@ -53,7 +53,7 @@ msgstr "نمیتوان محتوا را به شکل «%s» فراهم کرد"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "نمیتوان محتوا را به شکل %s فراهم کرد"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:462
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "پسانه در حال حاضر از OpenGL پشتیبانی نمیکند"
|
||||
|
||||
@@ -116,32 +116,32 @@ msgstr "کشیدن و رها کردن از دیگر برنامهها پشتی
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "هیچ قالب سازگاری برای انتقال محتویات وجود ندارد."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "هیچ رابط برنامهنویسی GLای مجاز نیست."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:538 gdk/win32/gdkglcontext-win32-wgl.c:582
|
||||
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:386
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:529 gdk/win32/gdkglcontext-win32-wgl.c:573
|
||||
#: gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "امکان ساخت زمینه مناسب برای GL نبود"
|
||||
|
||||
#: gdk/gdkglcontext.c:1303
|
||||
#: gdk/gdkglcontext.c:1306
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL ES به دست GDK_DEBUG از کار افتاد"
|
||||
|
||||
#: gdk/gdkglcontext.c:1315
|
||||
#: gdk/gdkglcontext.c:1318
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL به دست GDK_DEBUG از کار افتاد"
|
||||
|
||||
#: gdk/gdkglcontext.c:1326
|
||||
#: gdk/gdkglcontext.c:1329
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "برنامه از API مربوط به %s پشتبانی نمیکند"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2112
|
||||
#: gdk/gdkglcontext.c:2115
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "تلاش شد از %s استفاده شود، ولی %s از پیش در حال استفاده است"
|
||||
@@ -704,21 +704,21 @@ msgstr "IDataObject_GetData (0x%x) شکست خورد. 0x%lx را برگردان
|
||||
msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
|
||||
msgstr "شکست در تغییر شکل قالب W32 دادهٔ کور 0x%x به %p (%s)"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:329
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:320
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "هیچ پیاده سازی GLای پیدا نشد"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:404
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr "WGL نگارش %Id. %Id بیش از حد قدیمی است. کمینه به %Id.%Id نیاز است"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:422
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:413
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "پیادهسازی GL نمیتواند بافتارهای GL را همرساند"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:702
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:693
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "هیچ پیکربندی برای قالب نقطهای ارائه شده موجود نیست"
|
||||
|
||||
@@ -1738,11 +1738,6 @@ msgctxt "accessibility"
|
||||
msgid "comment"
|
||||
msgstr "نظر"
|
||||
|
||||
#: gtk/gtkaccessible.c:874
|
||||
msgctxt "accessibility"
|
||||
msgid "terminal"
|
||||
msgstr "پایانه"
|
||||
|
||||
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
|
||||
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
|
||||
msgid "_Close"
|
||||
@@ -2313,7 +2308,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "اگر موردی را پاک کنید، برای همیشه از دست خواهد رفت."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "_حذف"
|
||||
|
||||
@@ -2651,31 +2646,31 @@ msgstr "بستن"
|
||||
msgid "Close the infobar"
|
||||
msgstr "بستن نوار اطّلاعات"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "_برش"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "_رونوشت"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "_چسباندن"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "انتخاب _همه"
|
||||
|
||||
#: gtk/gtklabel.c:5722
|
||||
#: gtk/gtklabel.c:5712
|
||||
msgid "_Open Link"
|
||||
msgstr "_گشودن پیوند"
|
||||
|
||||
#: gtk/gtklabel.c:5726
|
||||
#: gtk/gtklabel.c:5716
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "_رونوشت از نشانی پیوند"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "فهرست بافتاری"
|
||||
|
||||
@@ -3509,7 +3504,7 @@ msgstr "نمیتوان مورد با نشانی «%s» را به %s منتق
|
||||
msgid "No registered application with name “%s” for item with URI “%s” found"
|
||||
msgstr "هیچ برنامهٔ ثبت شدهای با نام «%s» برای موردی با آدرس «%s» یافت نشد"
|
||||
|
||||
#: gtk/gtksearchentry.c:810
|
||||
#: gtk/gtksearchentry.c:767
|
||||
msgid "Clear Entry"
|
||||
msgstr "پاکسازی ورودی"
|
||||
|
||||
@@ -3600,15 +3595,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "نوار کناری"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "درج _ایموجی"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9026
|
||||
msgid "_Undo"
|
||||
msgstr "بر_گردان"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9030
|
||||
msgid "_Redo"
|
||||
msgstr "_انجام دوباره"
|
||||
|
||||
@@ -3806,39 +3801,39 @@ msgid "CSS Property"
|
||||
msgstr "مشخصه CSS"
|
||||
|
||||
# farmaan
|
||||
#: gtk/inspector/general.c:370
|
||||
#: gtk/inspector/general.c:363
|
||||
msgctxt "GL version"
|
||||
msgid "None"
|
||||
msgstr "هیچکدام"
|
||||
|
||||
#: gtk/inspector/general.c:461
|
||||
#: gtk/inspector/general.c:441
|
||||
msgctxt "GL version"
|
||||
msgid "Unknown"
|
||||
msgstr "ناشناخته"
|
||||
|
||||
#: gtk/inspector/general.c:523
|
||||
#: gtk/inspector/general.c:503
|
||||
msgctxt "Vulkan device"
|
||||
msgid "Disabled"
|
||||
msgstr "از کار افتاده"
|
||||
|
||||
#: gtk/inspector/general.c:524 gtk/inspector/general.c:525
|
||||
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
|
||||
msgctxt "Vulkan version"
|
||||
msgid "Disabled"
|
||||
msgstr "از کار افتاده"
|
||||
|
||||
# farmaan
|
||||
#: gtk/inspector/general.c:576
|
||||
#: gtk/inspector/general.c:555
|
||||
msgctxt "Vulkan device"
|
||||
msgid "None"
|
||||
msgstr "هیچکدام"
|
||||
|
||||
# farmaan
|
||||
#: gtk/inspector/general.c:577 gtk/inspector/general.c:578
|
||||
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
|
||||
msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "هیچکدام"
|
||||
|
||||
#: gtk/inspector/general.c:922
|
||||
#: gtk/inspector/general.c:901
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "بافتار IM به دست GTK_IM_MODULE به صورت سخت رمز شده است"
|
||||
|
||||
@@ -7729,7 +7724,6 @@ msgid ""
|
||||
"\n"
|
||||
"Commands:\n"
|
||||
" benchmark Benchmark rendering of a node\n"
|
||||
" compare Compare nodes or images\n"
|
||||
" info Provide information about the node\n"
|
||||
" show Show the node\n"
|
||||
" render Take a screenshot of the node\n"
|
||||
@@ -7743,7 +7737,6 @@ msgstr ""
|
||||
"دستورها:\n"
|
||||
"\n"
|
||||
" benchmark محک پرداخت یک گره\n"
|
||||
" compare مقایسهٔ گرهها یا تصویرها\n"
|
||||
" info فراهم کردن اطَلاعات دربارهٔ گره\n"
|
||||
" show نمایش گره\n"
|
||||
" render نماگرفت از گره\n"
|
||||
|
||||
@@ -20,8 +20,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+-master-po-gl-77922___.merged\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-22 15:33+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 19:18+0100\n"
|
||||
"POT-Creation-Date: 2024-02-12 01:46+0000\n"
|
||||
"PO-Revision-Date: 2024-02-15 03:26+0100\n"
|
||||
"Last-Translator: Fran Dieguez <fran.dieguez@gnome.org>\n"
|
||||
"Language-Team: Galician <proxecto@trasno.gal>\n"
|
||||
"Language: gl\n"
|
||||
@@ -65,7 +65,7 @@ msgstr "Non foi posíbel fornecer contidos como «%s»"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "Non foi posíbel fornecer contidos como %s"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:462
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "O backend actual non admite o OpenGL"
|
||||
|
||||
@@ -129,32 +129,32 @@ msgstr "Arrastrar e soltar desde outras aplicacións non está admitido."
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "Formatos non compatíbeis para transferir contidos."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "Non se permite a API GL."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 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
|
||||
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:386
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:529
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:573 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "Non é posíbel crear un contexto GL"
|
||||
|
||||
#: gdk/gdkglcontext.c:1303
|
||||
#: gdk/gdkglcontext.c:1306
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL ES está desactivado mediante GDK_DEBUG"
|
||||
|
||||
#: gdk/gdkglcontext.c:1315
|
||||
#: gdk/gdkglcontext.c:1318
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL desactivado mediante GDK_DEBUG"
|
||||
|
||||
#: gdk/gdkglcontext.c:1326
|
||||
#: gdk/gdkglcontext.c:1329
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "A aplicación non admite a API de %s"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2112
|
||||
#: gdk/gdkglcontext.c:2115
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "Tentando usar %s, pero %s xa está en uso"
|
||||
@@ -746,22 +746,22 @@ msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
|
||||
msgstr ""
|
||||
"Produciuse un fallo ao transmutar os datos DnD W32 ao formato 0x%x to %p (%s)"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:329
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:320
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "Non hai unha implementación de GL dispoñíbel"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:404
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr ""
|
||||
"A versión de WGL %d.%d é demasiado antiga, requírese cando menos a %d.%d"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:422
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:413
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "A implementación de GL non pode compartir os contextos de GL"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:702
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:693
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "Non hai configuracións dispoñíbeis para o formato de píxel fornecido"
|
||||
|
||||
@@ -1793,11 +1793,6 @@ msgctxt "accessibility"
|
||||
msgid "comment"
|
||||
msgstr "comentario"
|
||||
|
||||
#: gtk/gtkaccessible.c:874
|
||||
msgctxt "accessibility"
|
||||
msgid "terminal"
|
||||
msgstr "terminal"
|
||||
|
||||
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
|
||||
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
|
||||
msgid "_Close"
|
||||
@@ -2374,7 +2369,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Se elimina un elemento perderase para sempre."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "E_liminar"
|
||||
|
||||
@@ -2713,31 +2708,31 @@ msgstr "Pechar"
|
||||
msgid "Close the infobar"
|
||||
msgstr "Pecha a barra de información"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "Cor_tar"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "_Copiar"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "_Pegar"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "Seleccionar _todo"
|
||||
|
||||
#: gtk/gtklabel.c:5722
|
||||
#: gtk/gtklabel.c:5712
|
||||
msgid "_Open Link"
|
||||
msgstr "_Abrir ligazón"
|
||||
|
||||
#: gtk/gtklabel.c:5726
|
||||
#: gtk/gtklabel.c:5716
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "Copiar enderezo da _ligazón"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "Menú contextual"
|
||||
|
||||
@@ -3584,7 +3579,7 @@ msgstr ""
|
||||
"Non foi posíbel atopar ningunha aplicación rexistrada co nome «%s» para o "
|
||||
"elemento co URI «%s»"
|
||||
|
||||
#: gtk/gtksearchentry.c:810
|
||||
#: gtk/gtksearchentry.c:767
|
||||
msgid "Clear Entry"
|
||||
msgstr "Limpar entrada"
|
||||
|
||||
@@ -3675,15 +3670,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "Barra lateral"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "Inserir _emoticono"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9026
|
||||
msgid "_Undo"
|
||||
msgstr "_Desfacer"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9030
|
||||
msgid "_Redo"
|
||||
msgstr "_Refacer"
|
||||
|
||||
@@ -3882,37 +3877,37 @@ msgstr "Clases de estilo"
|
||||
msgid "CSS Property"
|
||||
msgstr "Propiedade CSS"
|
||||
|
||||
#: gtk/inspector/general.c:370
|
||||
#: gtk/inspector/general.c:363
|
||||
msgctxt "GL version"
|
||||
msgid "None"
|
||||
msgstr "Ningún"
|
||||
|
||||
#: gtk/inspector/general.c:461
|
||||
#: gtk/inspector/general.c:441
|
||||
msgctxt "GL version"
|
||||
msgid "Unknown"
|
||||
msgstr "Descoñecido"
|
||||
|
||||
#: gtk/inspector/general.c:523
|
||||
#: gtk/inspector/general.c:503
|
||||
msgctxt "Vulkan device"
|
||||
msgid "Disabled"
|
||||
msgstr "Desactivado"
|
||||
|
||||
#: gtk/inspector/general.c:524 gtk/inspector/general.c:525
|
||||
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
|
||||
msgctxt "Vulkan version"
|
||||
msgid "Disabled"
|
||||
msgstr "Desactivada"
|
||||
|
||||
#: gtk/inspector/general.c:576
|
||||
#: gtk/inspector/general.c:555
|
||||
msgctxt "Vulkan device"
|
||||
msgid "None"
|
||||
msgstr "Ningún"
|
||||
|
||||
#: gtk/inspector/general.c:577 gtk/inspector/general.c:578
|
||||
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
|
||||
msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "Ningunha"
|
||||
|
||||
#: gtk/inspector/general.c:922
|
||||
#: gtk/inspector/general.c:901
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "O contexto de IM está incrustado á man por GTK_IM_MODULE"
|
||||
|
||||
@@ -7824,21 +7819,18 @@ msgid ""
|
||||
"\n"
|
||||
"Commands:\n"
|
||||
" benchmark Benchmark rendering of a node\n"
|
||||
" compare Compare nodes or images\n"
|
||||
" info Provide information about the node\n"
|
||||
" show Show the node\n"
|
||||
" render Take a screenshot of the node\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Uso:\n"
|
||||
" gtk4-rendernode-tool [ORDE] [OPCIÓN…] FICHEIRO\n"
|
||||
"Usage:\n"
|
||||
" gtk4-rendernode-tool [COMMAND] [OPCIÓN…] FILE\n"
|
||||
"\n"
|
||||
"Leva a cabo varias tarefas nos nodos do renderizador de GTK.\n"
|
||||
"\n"
|
||||
"Ordes:\n"
|
||||
" benchmark Proba de rendemento do renderizado dun nodo\n"
|
||||
"\n"
|
||||
" compare Comparar nodos ou imaxes\n"
|
||||
" info Fornecer unha información sobre un nodo\n"
|
||||
" show Mostrar un nodo\n"
|
||||
" render Sacar unha captura dun nodo\n"
|
||||
|
||||
@@ -11,8 +11,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-22 15:33+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 19:48+0100\n"
|
||||
"POT-Creation-Date: 2024-02-12 01:46+0000\n"
|
||||
"PO-Revision-Date: 2024-02-12 12:39+0100\n"
|
||||
"Last-Translator: Ekaterine Papava <papava.e@gtu.ge>\n"
|
||||
"Language-Team: Georgian <http://mail.gnome.org/mailman/listinfo/gnome-ge-"
|
||||
"list>\n"
|
||||
@@ -51,7 +51,7 @@ msgstr "შემცველობის \"%s\"-ად გამოტანა
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "შემცველობის %s-ად გამოტანა შეუძლებელია"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:462
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "მიმდინარე უკანაბოლოს OpenGL-ის მხარდაჭერა არ გააჩნია"
|
||||
|
||||
@@ -114,32 +114,32 @@ msgstr "სხვა აპლიკაციებიდან DnD მხარ
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "შემცველობის გადატანის თავსებადი ფორმატების გარეშე."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "GL API არ არის დაშვებული."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 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
|
||||
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:386
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:529
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:573 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "GL-ის კონტექსტის შექმნა შეუძლებელია"
|
||||
|
||||
#: gdk/gdkglcontext.c:1303
|
||||
#: gdk/gdkglcontext.c:1306
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL ES გამორთულია GDK_DEBUG საშუალებით"
|
||||
|
||||
#: gdk/gdkglcontext.c:1315
|
||||
#: gdk/gdkglcontext.c:1318
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL გამორთულია GDK_DEBUG საშუალებით"
|
||||
|
||||
#: gdk/gdkglcontext.c:1326
|
||||
#: gdk/gdkglcontext.c:1329
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "აპლიკაციას %s-ის API-ის მხარდაჭერა არ გააცნია"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2112
|
||||
#: gdk/gdkglcontext.c:2115
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "%s გამოყენების მცდელობა, მაგრამ %s უკვე გამოიყენება"
|
||||
@@ -736,21 +736,21 @@ msgstr "IDataObject_GetData (0x%x) -ის შეცდომა, დააბ
|
||||
msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
|
||||
msgstr "DnD-ის W32 მონაცემების ფორმატის 0x%x-დან %p-ში (%s) გადაყვანის შეცდომა"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:329
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:320
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "GL-ის იმპლემენტაცია არ არსებობს"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:404
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr "WGL-ის ვერსია %d.%d ძალიან ძველია. საჭიროა მინიმუმ %d.%d"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:422
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:413
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "GL-ის განხორციელებებს GL-ის კონტექსტების გაზიარება არ შეუძლიათ"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:702
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:693
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "მითითებული პიქსელის ფორმატისთვის ხელმისაწვდომი კონფიგურაციების გარეშე"
|
||||
|
||||
@@ -1780,11 +1780,6 @@ msgctxt "accessibility"
|
||||
msgid "comment"
|
||||
msgstr "კომენტარი"
|
||||
|
||||
#: gtk/gtkaccessible.c:874
|
||||
msgctxt "accessibility"
|
||||
msgid "terminal"
|
||||
msgstr "ტერმინალი"
|
||||
|
||||
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
|
||||
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
|
||||
msgid "_Close"
|
||||
@@ -2358,7 +2353,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "თუ წაშლით ელემენტს, ის სამუდამოდ დაიკარგება."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "წაშლა"
|
||||
|
||||
@@ -2697,31 +2692,31 @@ msgstr "დახურვა"
|
||||
msgid "Close the infobar"
|
||||
msgstr "საინფორმაციო ზოლის დახურვა"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "ამოჭრა"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "ასლი"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "ჩასმა"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "ყველაფრის _მონიშვნა"
|
||||
|
||||
#: gtk/gtklabel.c:5722
|
||||
#: gtk/gtklabel.c:5712
|
||||
msgid "_Open Link"
|
||||
msgstr "_ბმულის გახსნა"
|
||||
|
||||
#: gtk/gtklabel.c:5726
|
||||
#: gtk/gtklabel.c:5716
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "დაა_კოპირე ბმულის მისამართი"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "კონტექსტური მენიუ"
|
||||
|
||||
@@ -3565,7 +3560,7 @@ msgstr ""
|
||||
"რეგისტრირებული აპლიკაცია სახელით \"%s\" ჩანაწერისთვის ბმულით \"%s\" "
|
||||
"აღმოჩენილი არაა"
|
||||
|
||||
#: gtk/gtksearchentry.c:810
|
||||
#: gtk/gtksearchentry.c:767
|
||||
msgid "Clear Entry"
|
||||
msgstr "ჩანაწერის გასუფთავება"
|
||||
|
||||
@@ -3656,15 +3651,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "გვერდითა ზოლი"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "ემოჯის _ჩასმა"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9026
|
||||
msgid "_Undo"
|
||||
msgstr "_დაბრუნება"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9030
|
||||
msgid "_Redo"
|
||||
msgstr "_გამეორება"
|
||||
|
||||
@@ -3862,37 +3857,37 @@ msgstr "სტილის კლასები"
|
||||
msgid "CSS Property"
|
||||
msgstr "CSS-ის თვისება"
|
||||
|
||||
#: gtk/inspector/general.c:370
|
||||
#: gtk/inspector/general.c:363
|
||||
msgctxt "GL version"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:461
|
||||
#: gtk/inspector/general.c:441
|
||||
msgctxt "GL version"
|
||||
msgid "Unknown"
|
||||
msgstr "უცნობი"
|
||||
|
||||
#: gtk/inspector/general.c:523
|
||||
#: gtk/inspector/general.c:503
|
||||
msgctxt "Vulkan device"
|
||||
msgid "Disabled"
|
||||
msgstr "გამორთულია"
|
||||
|
||||
#: gtk/inspector/general.c:524 gtk/inspector/general.c:525
|
||||
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
|
||||
msgctxt "Vulkan version"
|
||||
msgid "Disabled"
|
||||
msgstr "გამორთულია"
|
||||
|
||||
#: gtk/inspector/general.c:576
|
||||
#: gtk/inspector/general.c:555
|
||||
msgctxt "Vulkan device"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:577 gtk/inspector/general.c:578
|
||||
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
|
||||
msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "არცერთი"
|
||||
|
||||
#: gtk/inspector/general.c:922
|
||||
#: gtk/inspector/general.c:901
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "IM-ის კონტექსტი GTK_IM_MODULE-ში ხელითაა ჩაწერილი"
|
||||
|
||||
@@ -7794,7 +7789,6 @@ msgid ""
|
||||
"\n"
|
||||
"Commands:\n"
|
||||
" benchmark Benchmark rendering of a node\n"
|
||||
" compare Compare nodes or images\n"
|
||||
" info Provide information about the node\n"
|
||||
" show Show the node\n"
|
||||
" render Take a screenshot of the node\n"
|
||||
@@ -7807,7 +7801,6 @@ msgstr ""
|
||||
"\n"
|
||||
"ბრძანებები:\n"
|
||||
" benchmark კვანძის რენდერის წარმადობის გაზომვა\n"
|
||||
" compare კვანძების ან გამოსახულებების შედარება\n"
|
||||
" info ამ კვანძის შესახებ ინფორმაციის გამოტანა\n"
|
||||
" show ამ კვანძის ჩვენება\n"
|
||||
" render კვანძის ეკრანის ანაბეჭდის აღება\n"
|
||||
|
||||
+63
-74
@@ -24,23 +24,21 @@
|
||||
# Matheus Barbosa <mdpb.matheus@gmail.com>, 2022.
|
||||
# Leônidas Araújo <leorusvellt@hotmail.com>, 2022-2023.
|
||||
# Rafael Fontenelle <rafaelff@gnome.org>, 2013-2023.
|
||||
# Alex Jr <alexalencarjr@outlook.com>, 2023.
|
||||
# Juliano de Souza Camargo <julianosc@pm.me>, 2024.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: GTK\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-01-18 04:06+0000\n"
|
||||
"PO-Revision-Date: 2024-02-17 09:14-0300\n"
|
||||
"Last-Translator: Juliano de Souza Camargo <julianosc@pm.me>\n"
|
||||
"POT-Creation-Date: 2023-09-21 10:15+0000\n"
|
||||
"PO-Revision-Date: 2023-09-25 09:58-0300\n"
|
||||
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
|
||||
"Language-Team: Brazilian Portuguese <https://br.gnome.org/traducao>\n"
|
||||
"Language: pt_BR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
"X-Generator: Gtranslator 45.3\n"
|
||||
"X-Generator: Gtranslator 45.alpha0\n"
|
||||
"X-DL-Team: pt_BR\n"
|
||||
"X-DL-Module: gtk\n"
|
||||
"X-DL-Branch: main\n"
|
||||
@@ -57,11 +55,11 @@ msgstr "Sem suporte ao tipo de tela Broadway: %s"
|
||||
msgid "This clipboard cannot store data."
|
||||
msgstr "Essa área de transferência não pode armazenar dados."
|
||||
|
||||
#: gdk/gdkclipboard.c:287 gdk/gdkclipboard.c:786 gdk/gdkclipboard.c:1086
|
||||
#: gdk/gdkclipboard.c:287 gdk/gdkclipboard.c:785 gdk/gdkclipboard.c:1085
|
||||
msgid "Cannot read from empty clipboard."
|
||||
msgstr "Não é possível ler de área de transferência vazia."
|
||||
|
||||
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
|
||||
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1135 gdk/gdkdrag.c:618
|
||||
msgid "No compatible formats to transfer clipboard contents."
|
||||
msgstr ""
|
||||
"Nenhum formato compatível para transferir conteúdo de área de transferência."
|
||||
@@ -77,7 +75,7 @@ msgstr "Não foi possível fornecer o conteúdo como “%s”"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "Não foi possível fornecer o conteúdo como %s"
|
||||
|
||||
#: gdk/gdkdisplay.c:156 gdk/gdkglcontext.c:443
|
||||
#: gdk/gdkdisplay.c:156 gdk/gdkglcontext.c:442
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "O backend não oferece suporte a OpenGL"
|
||||
|
||||
@@ -142,33 +140,33 @@ msgstr "Não há suporte a arrastar e soltar de outros aplicativos."
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "Nenhum formato compatível para transferir conteúdo de transferência."
|
||||
|
||||
#: gdk/gdkglcontext.c:402 gdk/x11/gdkglcontext-glx.c:642
|
||||
#: gdk/gdkglcontext.c:401 gdk/x11/gdkglcontext-glx.c:642
|
||||
msgid "No GL API allowed."
|
||||
msgstr "Nenhuma API GL permitida."
|
||||
|
||||
#: gdk/gdkglcontext.c:426 gdk/win32/gdkglcontext-win32-wgl.c:383
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:526
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:570 gdk/x11/gdkglcontext-glx.c:691
|
||||
#: gdk/gdkglcontext.c:425 gdk/win32/gdkglcontext-win32-wgl.c:387
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:530
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:574 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "Não foi possível criar um contexto GL"
|
||||
|
||||
#: gdk/gdkglcontext.c:1281
|
||||
#: gdk/gdkglcontext.c:1280
|
||||
msgid "Anything but OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "Tudo menos OpenGL ES desabilitado via GDK_DEBUG"
|
||||
|
||||
#: gdk/gdkglcontext.c:1290
|
||||
#: gdk/gdkglcontext.c:1289
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "O aplicativo não é compatível com a API %s"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:1899
|
||||
#: gdk/gdkglcontext.c:1864
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "Tentando usar %s, mas %s já está em uso"
|
||||
|
||||
#: gdk/gdktexture.c:530
|
||||
#: gdk/gdktexture.c:528
|
||||
msgid "Unknown image format."
|
||||
msgstr "Formato de imagem desconhecido."
|
||||
|
||||
@@ -560,7 +558,7 @@ msgstr "Erro ao interpretar arquivo de imagem JPEG (%s)"
|
||||
msgid "Unsupported JPEG colorspace (%d)"
|
||||
msgstr "Espaço de cor JPEG não suportado (%d)"
|
||||
|
||||
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:286 gdk/loaders/gdktiff.c:467
|
||||
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:280 gdk/loaders/gdktiff.c:467
|
||||
#, c-format
|
||||
msgid "Not enough memory for image size %ux%u"
|
||||
msgstr "Memória insuficiente para o tamanho da imagem %ux%u"
|
||||
@@ -570,21 +568,16 @@ msgstr "Memória insuficiente para o tamanho da imagem %ux%u"
|
||||
msgid "Error reading png (%s)"
|
||||
msgstr "Erro ao ler png (%s)"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:212
|
||||
#: gdk/loaders/gdkpng.c:211
|
||||
#, c-format
|
||||
msgid "Unsupported depth %u in png image"
|
||||
msgstr "Profundidade %u não suportada na imagem PNG"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:262
|
||||
#: gdk/loaders/gdkpng.c:261
|
||||
#, c-format
|
||||
msgid "Unsupported color type %u in png image"
|
||||
msgstr "Tipo de cor não suportado %u na imagem png"
|
||||
|
||||
#: gdk/loaders/gdkpng.c:272
|
||||
#, c-format
|
||||
msgid "Image stride too large for image size %ux%u"
|
||||
msgstr "O passo da imagem é longo demais para o tamanho da imagem %ux%u"
|
||||
|
||||
#: gdk/loaders/gdktiff.c:353
|
||||
msgid "Failed to load RGB data from TIFF file"
|
||||
msgstr "Falha ao carregar dados RGB do arquivo TIFF"
|
||||
@@ -610,70 +603,70 @@ msgstr "Nenhum formato de transferência compatível localizado"
|
||||
msgid "Failed to decode contents with mime-type of '%s'"
|
||||
msgstr "Falha ao decodificar conteúdo com o tipo mime de “%s”"
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:719
|
||||
#: gdk/win32/gdkclipdrop-win32.c:721
|
||||
#, c-format
|
||||
msgid "Cannot claim clipboard ownership. OpenClipboard() timed out."
|
||||
msgstr ""
|
||||
"Não foi possível reivindicar a propriedade da área de transferência. "
|
||||
"OpenClipboard() expirou."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:729
|
||||
#: gdk/win32/gdkclipdrop-win32.c:731
|
||||
#, c-format
|
||||
msgid "Cannot claim clipboard ownership. Another process claimed it before us."
|
||||
msgstr ""
|
||||
"Não foi possível reivindicar a propriedade da área de transferência. Outro "
|
||||
"processo reivindicou antes de nós."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:743
|
||||
#: gdk/win32/gdkclipdrop-win32.c:745
|
||||
#, c-format
|
||||
msgid "Cannot claim clipboard ownership. OpenClipboard() failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível reivindicar a propriedade da área de transferência. "
|
||||
"OpenClipboard() falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:755
|
||||
#: gdk/win32/gdkclipdrop-win32.c:757
|
||||
#, c-format
|
||||
msgid "Cannot claim clipboard ownership. EmptyClipboard() failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível reivindicar a propriedade da área de transferência. "
|
||||
"EmptyClipboard() falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:798
|
||||
#: gdk/win32/gdkclipdrop-win32.c:800
|
||||
#, c-format
|
||||
msgid "Cannot set clipboard data. OpenClipboard() timed out."
|
||||
msgstr ""
|
||||
"Não foi possível definir dados da área de transferência. OpenClipboard() "
|
||||
"expirou."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:808 gdk/win32/gdkclipdrop-win32.c:839
|
||||
#: gdk/win32/gdkclipdrop-win32.c:810 gdk/win32/gdkclipdrop-win32.c:841
|
||||
#, c-format
|
||||
msgid "Cannot set clipboard data. Another process claimed clipboard ownership."
|
||||
msgstr ""
|
||||
"Não foi possível definir dados da área de transferência. Outro processo "
|
||||
"reivindicou a sua propriedade."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:822
|
||||
#: gdk/win32/gdkclipdrop-win32.c:824
|
||||
#, c-format
|
||||
msgid "Cannot set clipboard data. OpenClipboard() failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível definir dados da área de transferência. OpenClipboard() "
|
||||
"falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:874
|
||||
#: gdk/win32/gdkclipdrop-win32.c:876
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. GlobalLock(0x%p) failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. GlobalLock(0x%p) "
|
||||
"falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:885
|
||||
#: gdk/win32/gdkclipdrop-win32.c:887
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. GlobalSize(0x%p) failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. GlobalSize(0x%p) "
|
||||
"falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:898
|
||||
#: gdk/win32/gdkclipdrop-win32.c:900
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Cannot get clipboard data. Failed to allocate %s bytes to store the data."
|
||||
@@ -681,21 +674,21 @@ msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. Falha ao alocar %s "
|
||||
"bytes para armazenar os dados."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:930
|
||||
#: gdk/win32/gdkclipdrop-win32.c:932
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. OpenClipboard() timed out."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. OpenClipboard() "
|
||||
"expirou."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:940
|
||||
#: gdk/win32/gdkclipdrop-win32.c:942
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. Clipboard ownership changed."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. Propriedade da área "
|
||||
"de transferência alterada."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:950
|
||||
#: gdk/win32/gdkclipdrop-win32.c:952
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Cannot get clipboard data. Clipboard data changed before we could get it."
|
||||
@@ -703,21 +696,21 @@ msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. Dados da área de "
|
||||
"transferência alterados antes que nós pudéssemos obtê-los."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:967
|
||||
#: gdk/win32/gdkclipdrop-win32.c:969
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. OpenClipboard() failed: 0x%lx."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. OpenClipboard() "
|
||||
"falhou: 0x%lx."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:992
|
||||
#: gdk/win32/gdkclipdrop-win32.c:994
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. No compatible transfer format found."
|
||||
msgstr ""
|
||||
"Não foi possível obter dados da área de transferência. Nenhum formato de "
|
||||
"transferência compatível localizado."
|
||||
|
||||
#: gdk/win32/gdkclipdrop-win32.c:1002
|
||||
#: gdk/win32/gdkclipdrop-win32.c:1004
|
||||
#, c-format
|
||||
msgid "Cannot get clipboard data. GetClipboardData() failed: 0x%lx."
|
||||
msgstr ""
|
||||
@@ -761,21 +754,21 @@ msgstr "IDataObject_GetData (0x%x) falhou, retornando 0x%lx"
|
||||
msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
|
||||
msgstr "Falha ao transmutar dados DnD W32 de formato 0x%x para %p (%s)"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:315
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:319
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "Nenhuma implementação GL está disponível"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:392
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:396
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr "WGL versão %d.%d é muito baixa, é necessária pelo menos %d.%d"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:410
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:414
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "A implementação GL não consegue compartilhar contextos GL"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:692
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:696
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "Nenhuma configuração disponível para o formato de pixel dado"
|
||||
|
||||
@@ -1792,7 +1785,7 @@ msgstr "_Fechar"
|
||||
#. * suspend or screen locking, and the caller hasn't specified
|
||||
#. * a reason.
|
||||
#.
|
||||
#: gtk/gtkapplication-dbus.c:721 gtk/gtkapplication-dbus.c:763
|
||||
#: gtk/gtkapplication-dbus.c:721
|
||||
msgid "Reason not specified"
|
||||
msgstr "Monitor não especificado"
|
||||
|
||||
@@ -2268,7 +2261,7 @@ msgstr "Um arquivo com esse nome já existe"
|
||||
#: gtk/gtkmessagedialog.c:179 gtk/gtkmountoperation.c:608
|
||||
#: gtk/print/gtkpagesetupunixdialog.c:282 gtk/print/gtkprintbackend.c:638
|
||||
#: gtk/print/gtkprintunixdialog.c:682 gtk/print/gtkprintunixdialog.c:839
|
||||
#: gtk/gtkwindow.c:6233 gtk/ui/gtkappchooserdialog.ui:48
|
||||
#: gtk/gtkwindow.c:6242 gtk/ui/gtkappchooserdialog.ui:48
|
||||
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:36
|
||||
#: gtk/ui/gtkfontchooserdialog.ui:27
|
||||
msgid "_Cancel"
|
||||
@@ -2357,7 +2350,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Se você excluir um item, ele será permanentemente perdido."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1185 gtk/gtkfilechooserwidget.c:1815
|
||||
#: gtk/gtklabel.c:5696 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "E_xcluir"
|
||||
|
||||
@@ -2687,7 +2680,7 @@ msgstr "Variantes de estilo"
|
||||
msgid "Character Variations"
|
||||
msgstr "Variantes de caractere"
|
||||
|
||||
#: gtk/gtkglarea.c:309
|
||||
#: gtk/gtkglarea.c:305
|
||||
msgid "OpenGL context creation failed"
|
||||
msgstr "Criação de contexto OpenGL falhou"
|
||||
|
||||
@@ -2700,31 +2693,31 @@ msgstr "Fechar"
|
||||
msgid "Close the infobar"
|
||||
msgstr "Fecha a barra de informações"
|
||||
|
||||
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "Recor_tar"
|
||||
|
||||
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "_Copiar"
|
||||
|
||||
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "C_olar"
|
||||
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "_Selecionar tudo"
|
||||
|
||||
#: gtk/gtklabel.c:5706
|
||||
#: gtk/gtklabel.c:5705
|
||||
msgid "_Open Link"
|
||||
msgstr "_Abrir o link"
|
||||
|
||||
#: gtk/gtklabel.c:5710
|
||||
#: gtk/gtklabel.c:5709
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "Copiar endereço do _link"
|
||||
|
||||
#: gtk/gtklabel.c:5754 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
#: gtk/gtklabel.c:5753 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "Menu de contexto"
|
||||
|
||||
@@ -2795,7 +2788,7 @@ msgid "Play"
|
||||
msgstr "Reproduzir"
|
||||
|
||||
#: gtk/gtkmessagedialog.c:162 gtk/gtkmessagedialog.c:180
|
||||
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6234
|
||||
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6243
|
||||
msgid "_OK"
|
||||
msgstr "_OK"
|
||||
|
||||
@@ -3400,8 +3393,8 @@ msgstr "A razão mais provável é que um arquivo temporário não pôde ser cri
|
||||
|
||||
#. window
|
||||
#: gtk/print/gtkprintoperation-portal.c:264
|
||||
#: gtk/print/gtkprintoperation-portal.c:594
|
||||
#: gtk/print/gtkprintoperation-portal.c:663 gtk/print/gtkprintunixdialog.c:3008
|
||||
#: gtk/print/gtkprintoperation-portal.c:584
|
||||
#: gtk/print/gtkprintoperation-portal.c:653 gtk/print/gtkprintunixdialog.c:3008
|
||||
msgid "Print"
|
||||
msgstr "Imprimir"
|
||||
|
||||
@@ -3657,7 +3650,7 @@ msgstr "Deslizar para direita"
|
||||
# GtkEntry placeholder reference: https://goo.gl/e5Ehwr
|
||||
#. Translators: This is placeholder text for the search entry in the shortcuts window
|
||||
#: gtk/gtkshortcutswindow.c:855 gtk/gtkshortcutswindow.c:922
|
||||
#: gtk/gtkshortcutswindow.c:928
|
||||
#: gtk/gtkshortcutswindow.c:927
|
||||
msgid "Search Shortcuts"
|
||||
msgstr "Pesquisar atalhos"
|
||||
|
||||
@@ -3673,13 +3666,13 @@ msgstr "Atalhos"
|
||||
msgid "Search Results"
|
||||
msgstr "Resultados da pesquisa"
|
||||
|
||||
#: gtk/gtkshortcutswindow.c:990 gtk/ui/gtkemojichooser.ui:349
|
||||
#: gtk/gtkshortcutswindow.c:989 gtk/ui/gtkemojichooser.ui:349
|
||||
#: gtk/ui/gtkfilechooserwidget.ui:239
|
||||
msgid "No Results Found"
|
||||
msgstr "Nenhum resultado encontrado"
|
||||
|
||||
# Texto exibido abaixo do título anterior (No Results Found).
|
||||
#: gtk/gtkshortcutswindow.c:1001 gtk/ui/gtkemojichooser.ui:362
|
||||
#: gtk/gtkshortcutswindow.c:1000 gtk/ui/gtkemojichooser.ui:362
|
||||
#: gtk/ui/gtkfilechooserwidget.ui:252 gtk/ui/gtkplacesview.ui:218
|
||||
msgid "Try a different search"
|
||||
msgstr "Tente uma pesquisa diferente"
|
||||
@@ -3701,12 +3694,12 @@ msgstr "_Desfazer"
|
||||
msgid "_Redo"
|
||||
msgstr "_Refazer"
|
||||
|
||||
#: gtk/gtkwindow.c:6222
|
||||
#: gtk/gtkwindow.c:6231
|
||||
#, c-format
|
||||
msgid "Do you want to use GTK Inspector?"
|
||||
msgstr "Você deseja usar Inspetor GTK?"
|
||||
|
||||
#: gtk/gtkwindow.c:6224
|
||||
#: gtk/gtkwindow.c:6233
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK Inspector is an interactive debugger that lets you explore and modify "
|
||||
@@ -3717,7 +3710,7 @@ msgstr ""
|
||||
"modifique o estado interno de qualquer aplicativo GTK. Usá-lo pode fazer que "
|
||||
"o aplicativo se encerre ou falhe."
|
||||
|
||||
#: gtk/gtkwindow.c:6229
|
||||
#: gtk/gtkwindow.c:6238
|
||||
msgid "Don’t show this message again"
|
||||
msgstr "Não mostre essa mensagem novamente"
|
||||
|
||||
@@ -7301,7 +7294,7 @@ msgstr ""
|
||||
#: tools/gtk-builder-tool-enumerate.c:56 tools/gtk-builder-tool-preview.c:179
|
||||
#: tools/gtk-builder-tool-preview.c:180 tools/gtk-builder-tool-screenshot.c:360
|
||||
#: tools/gtk-builder-tool-simplify.c:2529 tools/gtk-builder-tool-validate.c:261
|
||||
#: tools/gtk-rendernode-tool-info.c:202 tools/gtk-rendernode-tool-show.c:106
|
||||
#: tools/gtk-rendernode-tool-info.c:202 tools/gtk-rendernode-tool-show.c:102
|
||||
msgid "FILE"
|
||||
msgstr "ARQUIVO"
|
||||
|
||||
@@ -7333,7 +7326,7 @@ msgid "Use style from CSS file"
|
||||
msgstr "Usa o estilo do arquivo CSS"
|
||||
|
||||
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
|
||||
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-show.c:113
|
||||
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-show.c:109
|
||||
#: tools/gtk-rendernode-tool-render.c:204
|
||||
#, c-format
|
||||
msgid "Could not initialize windowing system\n"
|
||||
@@ -7611,7 +7604,7 @@ msgstr "Origem: %g %g\n"
|
||||
msgid "Provide information about the render node."
|
||||
msgstr "Fornece informações sobre o nó de renderização."
|
||||
|
||||
#: tools/gtk-rendernode-tool-info.c:224 tools/gtk-rendernode-tool-show.c:134
|
||||
#: tools/gtk-rendernode-tool-info.c:224 tools/gtk-rendernode-tool-show.c:130
|
||||
#: tools/gtk-rendernode-tool-render.c:225
|
||||
#, c-format
|
||||
msgid "No .node file specified\n"
|
||||
@@ -7622,15 +7615,11 @@ msgstr "Nenhum arquivo .node especificado\n"
|
||||
msgid "Can only accept a single .node file\n"
|
||||
msgstr "Pode aceitar apenas um único arquivo .node\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-show.c:105
|
||||
msgid "Don't add a titlebar"
|
||||
msgstr "Não adicionar uma barra de título"
|
||||
|
||||
#: tools/gtk-rendernode-tool-show.c:121
|
||||
#: tools/gtk-rendernode-tool-show.c:117
|
||||
msgid "Show the render node."
|
||||
msgstr "Mostra o nó de renderização."
|
||||
|
||||
#: tools/gtk-rendernode-tool-show.c:140
|
||||
#: tools/gtk-rendernode-tool-show.c:136
|
||||
#, c-format
|
||||
msgid "Can only preview a single .node file\n"
|
||||
msgstr "Pode visualizar apenas um único arquivo .node\n"
|
||||
|
||||
@@ -22,9 +22,9 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-22 18:50+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 21:54+0300\n"
|
||||
"Last-Translator: Sabri Ünal <libreajans@gmail.com>\n"
|
||||
"POT-Creation-Date: 2024-02-12 22:55+0000\n"
|
||||
"PO-Revision-Date: 2024-02-13 15:09+0300\n"
|
||||
"Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>\n"
|
||||
"Language-Team: Türkçe <takim@gnome.org.tr>\n"
|
||||
"Language: tr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -61,7 +61,7 @@ msgstr "İçerikler “%s” olarak sağlanamıyor"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "İçerikler %s olarak sağlanamıyor"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:462
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "Şimdiki arka uç OpenGL’i desteklemiyor"
|
||||
|
||||
@@ -125,32 +125,32 @@ msgstr "Diğer uygulamalardan sürükle ve bırak desteklenmemektedir."
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "İçerikleri aktarmak için uyumlu biçim yok."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "İzin verilen GP API yok."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 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
|
||||
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:386
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:529
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:573 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "GL bağlamı oluşturulamadı"
|
||||
|
||||
#: gdk/gdkglcontext.c:1303
|
||||
#: gdk/gdkglcontext.c:1306
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL ES, GDK_DEBUG aracılığıyla devre dışı bırakılmış"
|
||||
|
||||
#: gdk/gdkglcontext.c:1315
|
||||
#: gdk/gdkglcontext.c:1318
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL, GDK_DEBUG aracılığıyla devre dışı bırakılmış"
|
||||
|
||||
#: gdk/gdkglcontext.c:1326
|
||||
#: gdk/gdkglcontext.c:1329
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "Uygulama %s APIsini desteklemiyor"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2112
|
||||
#: gdk/gdkglcontext.c:2115
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "%s kullanılmaya çalışılıyor ancak şu anda %s kullanılıyor"
|
||||
@@ -715,21 +715,21 @@ msgstr "IDataObject_GetData (0x%x) başarısız, 0x%lx döndürüyor"
|
||||
msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
|
||||
msgstr "W32 biçimli 0x%x DnD verisi, %p hedefine dönüştürülemedi (%s)"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:329
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:320
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "Kullanılabilir GL uygulaması yok"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:404
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr "WGL sürümü %d.%d çok düşük, en az %d.%d gerekiyor"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:422
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:413
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "GL uygulaması GL bağlamlarını paylaşamaz"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:702
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:693
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "Verilen piksel biçimi için kullanılabilir yapılandırma yok"
|
||||
|
||||
@@ -1756,11 +1756,6 @@ msgctxt "accessibility"
|
||||
msgid "comment"
|
||||
msgstr "yorum"
|
||||
|
||||
#: gtk/gtkaccessible.c:874
|
||||
msgctxt "accessibility"
|
||||
msgid "terminal"
|
||||
msgstr "uçbirim"
|
||||
|
||||
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
|
||||
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
|
||||
msgid "_Close"
|
||||
@@ -2334,7 +2329,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Eğer bir öge silerseniz kalıcı olarak kaybolur."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "_Sil"
|
||||
|
||||
@@ -2675,31 +2670,31 @@ msgstr "Kapat"
|
||||
msgid "Close the infobar"
|
||||
msgstr "Bilgi çubuğunu kapat"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "Ke_s"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "_Kopyala"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "_Yapıştır"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "_Tümünü Seç"
|
||||
|
||||
#: gtk/gtklabel.c:5722
|
||||
#: gtk/gtklabel.c:5712
|
||||
msgid "_Open Link"
|
||||
msgstr "Bağlantı _Aç"
|
||||
|
||||
#: gtk/gtklabel.c:5726
|
||||
#: gtk/gtklabel.c:5716
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "_Bağlantı Adresini Kopyala"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "Bağlamsal menü"
|
||||
|
||||
@@ -3541,7 +3536,7 @@ msgstr "“%s” URI’li öge “%s”e taşınamadı"
|
||||
msgid "No registered application with name “%s” for item with URI “%s” found"
|
||||
msgstr "“%2$s” URIʼli öge için “%1$s” adında kayıtlı uygulama bulunamadı"
|
||||
|
||||
#: gtk/gtksearchentry.c:810
|
||||
#: gtk/gtksearchentry.c:767
|
||||
msgid "Clear Entry"
|
||||
msgstr "Girdiyi Temizle"
|
||||
|
||||
@@ -3632,15 +3627,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "Kenar Çubuğu"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "_Emoji Ekle"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9026
|
||||
msgid "_Undo"
|
||||
msgstr "_Geri Al"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9030
|
||||
msgid "_Redo"
|
||||
msgstr "_Yinele"
|
||||
|
||||
@@ -7779,7 +7774,6 @@ msgid ""
|
||||
"\n"
|
||||
"Commands:\n"
|
||||
" benchmark Benchmark rendering of a node\n"
|
||||
" compare Compare nodes or images\n"
|
||||
" info Provide information about the node\n"
|
||||
" show Show the node\n"
|
||||
" render Take a screenshot of the node\n"
|
||||
@@ -7788,11 +7782,10 @@ msgstr ""
|
||||
"Kullanım:\n"
|
||||
" gtk4-rendernode-tool [KOMUT] [SEÇENEK…] DOSYA\n"
|
||||
"\n"
|
||||
"GTK gerçekleme düğümleri üzerinde türlü görevler gerçekleştir.\n"
|
||||
"GTK gerçekleme düğümleri üzerinde türlü görevler gerçekleştirin.\n"
|
||||
"\n"
|
||||
"Komutlar:\n"
|
||||
" benchmark Düğümlerin gerçeklemesini kıyasla\n"
|
||||
" compare Düğümleri ya da görüntüleri karşılaştır\n"
|
||||
" info Düğümle ilgili bilgi sağla\n"
|
||||
" show Düğümü göster\n"
|
||||
" render Düğümün ekran görüntüsünü al\n"
|
||||
|
||||
@@ -9,8 +9,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gtk+\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
|
||||
"POT-Creation-Date: 2024-02-23 01:06+0000\n"
|
||||
"PO-Revision-Date: 2024-02-23 09:47+0200\n"
|
||||
"POT-Creation-Date: 2024-02-12 01:46+0000\n"
|
||||
"PO-Revision-Date: 2024-02-12 22:09+0200\n"
|
||||
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
|
||||
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
|
||||
"Language: uk\n"
|
||||
@@ -50,7 +50,7 @@ msgstr "Не вдалося надати дані як «%s»"
|
||||
msgid "Cannot provide contents as %s"
|
||||
msgstr "Не вдалося надати дані як %s"
|
||||
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
|
||||
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:462
|
||||
msgid "The current backend does not support OpenGL"
|
||||
msgstr "Цей модуль не підтримує OpenGL"
|
||||
|
||||
@@ -118,32 +118,34 @@ msgstr ""
|
||||
msgid "No compatible formats to transfer contents."
|
||||
msgstr "Немає сумісних форматів для передавання даних."
|
||||
|
||||
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
|
||||
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:645
|
||||
msgid "No GL API allowed."
|
||||
msgstr "Програмний інтерфейс GL заборонено."
|
||||
|
||||
#: gdk/gdkglcontext.c:442 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
|
||||
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:386
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:529
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:573 gdk/x11/gdkglcontext-glx.c:691
|
||||
msgid "Unable to create a GL context"
|
||||
msgstr "Неможливо створити вміст GL"
|
||||
|
||||
#: gdk/gdkglcontext.c:1303
|
||||
#: gdk/gdkglcontext.c:1306
|
||||
#| msgid "Anything but OpenGL ES disabled via GDK_DEBUG"
|
||||
msgid "OpenGL ES disabled via GDK_DEBUG"
|
||||
msgstr "За допомогою GDK_DEBUG вимкнено OpenGL ES"
|
||||
|
||||
#: gdk/gdkglcontext.c:1315
|
||||
#: gdk/gdkglcontext.c:1318
|
||||
#| msgid "GL support disabled via GDK_DEBUG"
|
||||
msgid "OpenGL disabled via GDK_DEBUG"
|
||||
msgstr "OpenGL вимкнено за допомогою GDK_DEBUG"
|
||||
|
||||
#: gdk/gdkglcontext.c:1326
|
||||
#: gdk/gdkglcontext.c:1329
|
||||
#, c-format
|
||||
msgid "Application does not support %s API"
|
||||
msgstr "У програмі не передбачено підтримки програмного інтерфейсу %s"
|
||||
|
||||
#. translators: This is about OpenGL backend names, like
|
||||
#. * "Trying to use X11 GLX, but EGL is already in use"
|
||||
#: gdk/gdkglcontext.c:2112
|
||||
#: gdk/gdkglcontext.c:2115
|
||||
#, c-format
|
||||
msgid "Trying to use %s, but %s is already in use"
|
||||
msgstr "Намагаємося скористатися %s, але %s вже використано"
|
||||
@@ -561,6 +563,7 @@ msgstr "Непідтримуваний тип кольору, %u, у зобра
|
||||
|
||||
#: gdk/loaders/gdkpng.c:272
|
||||
#, c-format
|
||||
#| msgid "Not enough memory for image size %ux%u"
|
||||
msgid "Image stride too large for image size %ux%u"
|
||||
msgstr "Зображення поширюється надто далеко для розміру зображення %ux%u"
|
||||
|
||||
@@ -741,21 +744,21 @@ msgstr ""
|
||||
"Не вдалося перетворити формат W32 даних перетягування зі скиданням 0x%x до "
|
||||
"%p (%s)"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:329
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:320
|
||||
msgid "No GL implementation is available"
|
||||
msgstr "Немає жодної реалізації GL"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:404
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:395
|
||||
#, c-format
|
||||
msgid "WGL version %d.%d is too low, need at least %d.%d"
|
||||
msgstr "Версія WGL %d.%d є надто давньою. Потрібна версія принаймні %d.%d"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:422
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:413
|
||||
#, c-format
|
||||
msgid "GL implementation cannot share GL contexts"
|
||||
msgstr "Реалізація GL не може оприлюднювати контексти GL"
|
||||
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:702
|
||||
#: gdk/win32/gdkglcontext-win32-wgl.c:693
|
||||
msgid "No available configurations for the given pixel format"
|
||||
msgstr "Немає доступних налаштувань для заданого формату точок"
|
||||
|
||||
@@ -1251,6 +1254,7 @@ msgid "Mozilla Public License 2.0"
|
||||
msgstr "Громадська ліцензія Mozilla 2.0"
|
||||
|
||||
#: gtk/gtkaboutdialog.c:137
|
||||
#| msgid "BSD 2-Clause License"
|
||||
msgid "BSD Zero-Clause License"
|
||||
msgstr "Zero-Clause ліцензія BSD"
|
||||
|
||||
@@ -1782,21 +1786,19 @@ msgid "block quote"
|
||||
msgstr "цитата"
|
||||
|
||||
#: gtk/gtkaccessible.c:872
|
||||
#| msgctxt "sizegroup mode"
|
||||
#| msgid "Vertical"
|
||||
msgctxt "accessibility"
|
||||
msgid "article"
|
||||
msgstr "стаття"
|
||||
|
||||
#: gtk/gtkaccessible.c:873
|
||||
#| msgctxt "accessibility"
|
||||
#| msgid "command"
|
||||
msgctxt "accessibility"
|
||||
msgid "comment"
|
||||
msgstr "коментар"
|
||||
|
||||
#: gtk/gtkaccessible.c:874
|
||||
#| msgid "Terminal Pager"
|
||||
msgctxt "accessibility"
|
||||
msgid "terminal"
|
||||
msgstr "термінал"
|
||||
|
||||
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
|
||||
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
|
||||
msgid "_Close"
|
||||
@@ -2370,7 +2372,7 @@ msgid "If you delete an item, it will be permanently lost."
|
||||
msgstr "Якщо вилучити об'єкт, його буде втрачено назавжди."
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
|
||||
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
|
||||
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
|
||||
msgid "_Delete"
|
||||
msgstr "В_илучити"
|
||||
|
||||
@@ -2567,6 +2569,7 @@ msgid "Accessed"
|
||||
msgstr "Дозволено"
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:7361
|
||||
#| msgid "Size"
|
||||
msgid "_Size"
|
||||
msgstr "_Розмір"
|
||||
|
||||
@@ -2575,6 +2578,7 @@ msgid "T_ype"
|
||||
msgstr "Т_ип"
|
||||
|
||||
#: gtk/gtkfilechooserwidget.c:7369
|
||||
#| msgid "Show _Time"
|
||||
msgid "_Time"
|
||||
msgstr "_Час"
|
||||
|
||||
@@ -2708,31 +2712,31 @@ msgstr "Закрити"
|
||||
msgid "Close the infobar"
|
||||
msgstr "Закрити панель відомостей"
|
||||
|
||||
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
|
||||
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
|
||||
msgid "Cu_t"
|
||||
msgstr "Ви_різати"
|
||||
|
||||
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
|
||||
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
|
||||
msgid "_Copy"
|
||||
msgstr "_Копіювати"
|
||||
|
||||
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
|
||||
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
|
||||
msgid "_Paste"
|
||||
msgstr "Вст_авити"
|
||||
|
||||
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
|
||||
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
|
||||
msgid "Select _All"
|
||||
msgstr "Виді_лити все"
|
||||
|
||||
#: gtk/gtklabel.c:5722
|
||||
#: gtk/gtklabel.c:5712
|
||||
msgid "_Open Link"
|
||||
msgstr "_Відкрити посилання"
|
||||
|
||||
#: gtk/gtklabel.c:5726
|
||||
#: gtk/gtklabel.c:5716
|
||||
msgid "Copy _Link Address"
|
||||
msgstr "Копіювати _адресу посилання"
|
||||
|
||||
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
|
||||
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
|
||||
msgid "Context menu"
|
||||
msgstr "Контекстне меню"
|
||||
|
||||
@@ -3581,7 +3585,7 @@ msgid "No registered application with name “%s” for item with URI “%s” f
|
||||
msgstr ""
|
||||
"Не знайдено зареєстрованої програми з назвою «%s» для пункту з URI «%s»"
|
||||
|
||||
#: gtk/gtksearchentry.c:810
|
||||
#: gtk/gtksearchentry.c:767
|
||||
msgid "Clear Entry"
|
||||
msgstr "Спорожнити запис"
|
||||
|
||||
@@ -3672,15 +3676,15 @@ msgctxt "accessibility"
|
||||
msgid "Sidebar"
|
||||
msgstr "Бічна панель"
|
||||
|
||||
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
|
||||
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
|
||||
msgid "Insert _Emoji"
|
||||
msgstr "Вставити _емодзі"
|
||||
|
||||
#: gtk/gtktextview.c:9088
|
||||
#: gtk/gtktextview.c:9026
|
||||
msgid "_Undo"
|
||||
msgstr "_Скасувати"
|
||||
|
||||
#: gtk/gtktextview.c:9092
|
||||
#: gtk/gtktextview.c:9030
|
||||
msgid "_Redo"
|
||||
msgstr "Пов_торити"
|
||||
|
||||
@@ -3877,37 +3881,38 @@ msgstr "Класи стилів"
|
||||
msgid "CSS Property"
|
||||
msgstr "Властивість CSS"
|
||||
|
||||
#: gtk/inspector/general.c:370
|
||||
#: gtk/inspector/general.c:363
|
||||
msgctxt "GL version"
|
||||
msgid "None"
|
||||
msgstr "Немає"
|
||||
|
||||
#: gtk/inspector/general.c:461
|
||||
#: gtk/inspector/general.c:441
|
||||
#| msgid "Unknown"
|
||||
msgctxt "GL version"
|
||||
msgid "Unknown"
|
||||
msgstr "Невідомо"
|
||||
|
||||
#: gtk/inspector/general.c:523
|
||||
#: gtk/inspector/general.c:503
|
||||
msgctxt "Vulkan device"
|
||||
msgid "Disabled"
|
||||
msgstr "Вимкнено"
|
||||
|
||||
#: gtk/inspector/general.c:524 gtk/inspector/general.c:525
|
||||
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
|
||||
msgctxt "Vulkan version"
|
||||
msgid "Disabled"
|
||||
msgstr "Вимкнено"
|
||||
|
||||
#: gtk/inspector/general.c:576
|
||||
#: gtk/inspector/general.c:555
|
||||
msgctxt "Vulkan device"
|
||||
msgid "None"
|
||||
msgstr "Немає"
|
||||
|
||||
#: gtk/inspector/general.c:577 gtk/inspector/general.c:578
|
||||
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
|
||||
msgctxt "Vulkan version"
|
||||
msgid "None"
|
||||
msgstr "Немає"
|
||||
|
||||
#: gtk/inspector/general.c:922
|
||||
#: gtk/inspector/general.c:901
|
||||
msgid "IM Context is hardcoded by GTK_IM_MODULE"
|
||||
msgstr "Контекст способу введення жорстко встановлено у GTK_IM_MODULE"
|
||||
|
||||
@@ -3960,6 +3965,7 @@ msgid "Composited"
|
||||
msgstr "Складений"
|
||||
|
||||
#: gtk/inspector/general.ui:538
|
||||
#| msgid "Available Protocols"
|
||||
msgid "Protocols"
|
||||
msgstr "Протоколи"
|
||||
|
||||
@@ -3968,10 +3974,12 @@ msgid "GL Version"
|
||||
msgstr "Версія GL"
|
||||
|
||||
#: gtk/inspector/general.ui:621
|
||||
#| msgid "GL Version"
|
||||
msgid "GL Backend Version"
|
||||
msgstr "Версія модуля GL"
|
||||
|
||||
#: gtk/inspector/general.ui:671
|
||||
#| msgid "GL Vendor"
|
||||
msgid "GL Backend Vendor"
|
||||
msgstr "Постачальник модуля GL"
|
||||
|
||||
@@ -3980,6 +3988,7 @@ msgid "GL_VENDOR"
|
||||
msgstr "GL_VENDOR"
|
||||
|
||||
#: gtk/inspector/general.ui:727
|
||||
#| msgid "RENDERER"
|
||||
msgid "GL_RENDERER"
|
||||
msgstr "GL_RENDERER"
|
||||
|
||||
@@ -4424,10 +4433,11 @@ msgid ""
|
||||
"Tints all the places where the current renderer uses Cairo instead of the "
|
||||
"GPU."
|
||||
msgstr ""
|
||||
"Підсвітити усі місця, де поточний засіб обробки використовує Cairo замість "
|
||||
"графічного процесора."
|
||||
"Підсвітити усі місця, де поточний засіб обробки використовує Cairo замість"
|
||||
" графічного процесора."
|
||||
|
||||
#: gtk/inspector/visual.ui:436
|
||||
#| msgid "Show Fallback Rendering"
|
||||
msgid "Show Cairo Rendering"
|
||||
msgstr "Показати обробку Cairo"
|
||||
|
||||
@@ -4464,6 +4474,7 @@ msgid "Show Accessibility warnings"
|
||||
msgstr "Показати попередження щодо доступності"
|
||||
|
||||
#: gtk/inspector/visual.ui:661
|
||||
#| msgid "Show Graphic Updates"
|
||||
msgid "Show Graphics Offload"
|
||||
msgstr "Показувати графічне вивантаження"
|
||||
|
||||
@@ -7504,6 +7515,18 @@ msgstr "%s: помилка запускання програми: %s\n"
|
||||
|
||||
#: tools/gtk-path-tool.c:35
|
||||
#, c-format
|
||||
#| msgid ""
|
||||
#| "Usage:\n"
|
||||
#| " gtk4-path-tool [COMMAND] [OPTION…] PATH\n"
|
||||
#| "\n"
|
||||
#| "Perform various tasks on paths.\n"
|
||||
#| "\n"
|
||||
#| "Commands:\n"
|
||||
#| " decompose Decompose the path\n"
|
||||
#| " show Display the path in a window\n"
|
||||
#| " render Render the path as an image\n"
|
||||
#| " info Print information about the path\n"
|
||||
#| "\n"
|
||||
msgid ""
|
||||
"Usage:\n"
|
||||
" gtk4-path-tool [COMMAND] [OPTION…] PATH\n"
|
||||
@@ -7542,6 +7565,7 @@ msgid "Allow cubic Bézier curves"
|
||||
msgstr "Дозволити кубічні криві Безьє"
|
||||
|
||||
#: tools/gtk-path-tool-decompose.c:86
|
||||
#| msgid "Allow cubic Bézier curves"
|
||||
msgid "Allow conic Bézier curves"
|
||||
msgstr "Дозволити конічні криві Безьє"
|
||||
|
||||
@@ -7608,6 +7632,7 @@ msgstr "%d кубічних апроксимацій"
|
||||
|
||||
#: tools/gtk-path-tool-info.c:159
|
||||
#, c-format
|
||||
#| msgid "%d cubics"
|
||||
msgid "%d conics"
|
||||
msgstr "%d конічних перерізів"
|
||||
|
||||
@@ -7620,10 +7645,12 @@ msgid "Stroke the path"
|
||||
msgstr "Заштрихувати контур"
|
||||
|
||||
#: tools/gtk-path-tool-render.c:119 tools/gtk-path-tool-show.c:142
|
||||
#| msgid "Show other locations"
|
||||
msgid "Show path points"
|
||||
msgstr "Показати точки контура"
|
||||
|
||||
#: tools/gtk-path-tool-render.c:120 tools/gtk-path-tool-show.c:143
|
||||
#| msgid "Show other locations"
|
||||
msgid "Show control points"
|
||||
msgstr "Показати контрольні точки"
|
||||
|
||||
@@ -7646,6 +7673,7 @@ msgid "Background color"
|
||||
msgstr "Колір тла"
|
||||
|
||||
#: tools/gtk-path-tool-render.c:124 tools/gtk-path-tool-show.c:146
|
||||
#| msgid "Pick a Color"
|
||||
msgid "Point color"
|
||||
msgstr "Колір точки"
|
||||
|
||||
@@ -7702,6 +7730,7 @@ msgid "Options related to filling"
|
||||
msgstr "Параметри, які пов'язано із заповненням"
|
||||
|
||||
#: tools/gtk-path-tool-render.c:174 tools/gtk-path-tool-show.c:184
|
||||
#| msgid "Show other locations"
|
||||
msgid "Show help for fill options"
|
||||
msgstr "Показати довідку щодо варіантів заповнення"
|
||||
|
||||
@@ -7710,6 +7739,7 @@ msgid "Options related to stroking"
|
||||
msgstr "Параметри, які пов'язано зі штрихуванням"
|
||||
|
||||
#: tools/gtk-path-tool-render.c:182 tools/gtk-path-tool-show.c:192
|
||||
#| msgid "Show other locations"
|
||||
msgid "Show help for stroke options"
|
||||
msgstr "Показати довідку щодо варіантів штрихування"
|
||||
|
||||
@@ -7756,10 +7786,12 @@ msgid "End of segment"
|
||||
msgstr "Кінець сегмента"
|
||||
|
||||
#: tools/gtk-path-tool-restrict.c:51
|
||||
#| msgid "Render the path to a png image."
|
||||
msgid "Restrict a path to a segment."
|
||||
msgstr "Обмежити контур до сегмента."
|
||||
|
||||
#: tools/gtk-path-tool-reverse.c:45
|
||||
#| msgid "Reverse portrait"
|
||||
msgid "Reverse a path."
|
||||
msgstr "Обернути контур."
|
||||
|
||||
@@ -7811,6 +7843,17 @@ msgstr "Не вдалося обробити «%s» як число"
|
||||
|
||||
#: tools/gtk-rendernode-tool.c:35
|
||||
#, c-format
|
||||
#| msgid ""
|
||||
#| "Usage:\n"
|
||||
#| " gtk4-rendernode-tool [COMMAND] [OPTION…] FILE\n"
|
||||
#| "\n"
|
||||
#| "Perform various tasks on GTK render nodes.\n"
|
||||
#| "\n"
|
||||
#| "Commands:\n"
|
||||
#| " info Provide information about the node\n"
|
||||
#| " show Show the node\n"
|
||||
#| " render Take a screenshot of the node\n"
|
||||
#| "\n"
|
||||
msgid ""
|
||||
"Usage:\n"
|
||||
" gtk4-rendernode-tool [COMMAND] [OPTION…] FILE\n"
|
||||
@@ -7819,7 +7862,6 @@ msgid ""
|
||||
"\n"
|
||||
"Commands:\n"
|
||||
" benchmark Benchmark rendering of a node\n"
|
||||
" compare Compare nodes or images\n"
|
||||
" info Provide information about the node\n"
|
||||
" show Show the node\n"
|
||||
" render Take a screenshot of the node\n"
|
||||
@@ -7832,13 +7874,13 @@ msgstr ""
|
||||
"\n"
|
||||
"Команди:\n"
|
||||
" benchmark Тестувати обробку вузла\n"
|
||||
" compare Порівняти вузли або зображення\n"
|
||||
" info Надати дані щодо вузла\n"
|
||||
" show Показати вузол\n"
|
||||
" render Створити знімок вікна вузла\n"
|
||||
"\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:94
|
||||
#| msgid "Renderer to use"
|
||||
msgid "Add renderer to benchmark"
|
||||
msgstr "Додати обробник до тестування"
|
||||
|
||||
@@ -7873,6 +7915,7 @@ msgstr "Не вказано файл .node\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-benchmark.c:133
|
||||
#, c-format
|
||||
#| msgid "Can only accept a single .node file\n"
|
||||
msgid "Can only benchmark a single .node file\n"
|
||||
msgstr "Можлива одночасне тестування лише за допомогою одного файла .node\n"
|
||||
|
||||
@@ -7921,6 +7964,7 @@ msgstr "Не вдалося створити SVG: %s\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-render.c:150
|
||||
#, c-format
|
||||
#| msgid "Failed to rewrite header\n"
|
||||
msgid "Failed to create renderer: %s\n"
|
||||
msgstr "Не вдалося створити засіб обробки: %s\n"
|
||||
|
||||
@@ -7959,6 +8003,7 @@ msgstr "Помилка у %s: %s\n"
|
||||
|
||||
#: tools/gtk-rendernode-tool-utils.c:72
|
||||
#, c-format
|
||||
#| msgid "Failed to open file %s : %s\n"
|
||||
msgid "Failed to load node file: %s\n"
|
||||
msgstr "Не вдалося завантажити файл вузла: %s\n"
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtk/gtkaccessibletext-private.h"
|
||||
|
||||
static void
|
||||
inscription_text_interface (void)
|
||||
{
|
||||
GtkWidget *inscription = gtk_inscription_new ("");
|
||||
GBytes *bytes;
|
||||
gsize len;
|
||||
gboolean res;
|
||||
gsize n_ranges;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
char **attr_names, **attr_values;
|
||||
const char *string;
|
||||
|
||||
g_object_ref_sink (inscription);
|
||||
|
||||
gtk_inscription_set_markup (GTK_INSCRIPTION (inscription), "<markup>a<span overline='single'>b</span>c</markup>");
|
||||
|
||||
bytes = gtk_accessible_text_get_contents (GTK_ACCESSIBLE_TEXT (inscription), 0, G_MAXINT);
|
||||
string = g_bytes_get_data (bytes, &len);
|
||||
g_assert_cmpint (len, ==, 4);
|
||||
g_assert_cmpstr (string, ==, "abc");
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_assert_cmpint (gtk_accessible_text_get_caret_position (GTK_ACCESSIBLE_TEXT (inscription)), ==, 0);
|
||||
|
||||
res = gtk_accessible_text_get_selection (GTK_ACCESSIBLE_TEXT (inscription), &n_ranges, &ranges);
|
||||
g_assert_false (res);
|
||||
|
||||
res = gtk_accessible_text_get_attributes (GTK_ACCESSIBLE_TEXT (inscription), 1, &n_ranges, &ranges, &attr_names, &attr_values);
|
||||
g_assert_true (res);
|
||||
g_assert_cmpint (n_ranges, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].start, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].length, ==, 1);
|
||||
g_assert_cmpstr (attr_names[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE);
|
||||
g_assert_cmpstr (attr_values[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE);
|
||||
g_free (ranges);
|
||||
g_strfreev (attr_names);
|
||||
g_strfreev (attr_values);
|
||||
|
||||
g_object_unref (inscription);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/a11y/inscription/text-interface", inscription_text_interface);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtk/gtkaccessibletext-private.h"
|
||||
|
||||
static void
|
||||
label_role (void)
|
||||
{
|
||||
@@ -58,56 +56,6 @@ label_properties (void)
|
||||
g_object_unref (label);
|
||||
}
|
||||
|
||||
static void
|
||||
label_text_interface (void)
|
||||
{
|
||||
GtkWidget *label = gtk_label_new ("");
|
||||
GBytes *bytes;
|
||||
gsize len;
|
||||
gboolean res;
|
||||
gsize n_ranges;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
char **attr_names, **attr_values;
|
||||
const char *string;
|
||||
|
||||
g_object_ref_sink (label);
|
||||
|
||||
gtk_label_set_markup (GTK_LABEL (label), "<markup>a<span underline='single'>b</span>c</markup>");
|
||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
||||
gtk_label_select_region (GTK_LABEL (label), 1, 2);
|
||||
|
||||
bytes = gtk_accessible_text_get_contents (GTK_ACCESSIBLE_TEXT (label), 0, G_MAXINT);
|
||||
string = g_bytes_get_data (bytes, &len);
|
||||
g_assert_cmpint (len, ==, 4);
|
||||
g_assert_cmpstr (string, ==, "abc");
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_assert_cmpint (gtk_accessible_text_get_caret_position (GTK_ACCESSIBLE_TEXT (label)), ==, 2);
|
||||
|
||||
res = gtk_accessible_text_get_selection (GTK_ACCESSIBLE_TEXT (label), &n_ranges, &ranges);
|
||||
g_assert_true (res);
|
||||
g_assert_cmpint (n_ranges, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].start, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].length, ==, 1);
|
||||
g_free (ranges);
|
||||
|
||||
// Waiting for the attribute api to be fixed
|
||||
res = gtk_accessible_text_get_attributes (GTK_ACCESSIBLE_TEXT (label), 1, &n_ranges, &ranges, &attr_names, &attr_values);
|
||||
for (int i = 0; i < n_ranges; i++)
|
||||
g_print ("%s = %s\n", attr_names[i], attr_values[i]);
|
||||
g_assert_true (res);
|
||||
g_assert_cmpint (n_ranges, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].start, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].length, ==, 1);
|
||||
g_assert_cmpstr (attr_names[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE);
|
||||
g_assert_cmpstr (attr_values[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE);
|
||||
g_free (ranges);
|
||||
g_strfreev (attr_names);
|
||||
g_strfreev (attr_values);
|
||||
|
||||
g_object_unref (label);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@@ -116,7 +64,6 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/a11y/label/role", label_role);
|
||||
g_test_add_func ("/a11y/label/relations", label_relations);
|
||||
g_test_add_func ("/a11y/label/properties", label_properties);
|
||||
g_test_add_func ("/a11y/label/text-interface", label_text_interface);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ tests = [
|
||||
{ 'name': 'flowbox' },
|
||||
{ 'name': 'general' },
|
||||
{ 'name': 'image' },
|
||||
{ 'name': 'label' },
|
||||
{ 'name': 'listbox' },
|
||||
{ 'name': 'levelbar' },
|
||||
{ 'name': 'passwordentry' },
|
||||
@@ -29,16 +30,13 @@ tests = [
|
||||
{ 'name': 'spinbutton' },
|
||||
{ 'name': 'stack' },
|
||||
{ 'name': 'switch' },
|
||||
{ 'name': 'textview' },
|
||||
{ 'name': 'togglebutton' },
|
||||
{ 'name': 'value' },
|
||||
{ 'name': 'window' },
|
||||
]
|
||||
|
||||
internal_tests = [
|
||||
{ 'name': 'inscription' },
|
||||
{ 'name': 'label' },
|
||||
{ 'name': 'text' },
|
||||
{ 'name': 'textview' },
|
||||
{ 'name': 'names' },
|
||||
]
|
||||
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtk/gtkatcontextprivate.h"
|
||||
#include "gtk/gtkaccessibletext-private.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint update_caret_pos_count;
|
||||
guint caret_pos;
|
||||
|
||||
guint update_selection_bound_count;
|
||||
|
||||
guint update_text_contents_count;
|
||||
GtkAccessibleTextContentChange change;
|
||||
guint start;
|
||||
guint end;
|
||||
GBytes *contents;
|
||||
} TestData;
|
||||
|
||||
static void
|
||||
test_data_clear (TestData *td)
|
||||
{
|
||||
td->update_caret_pos_count = 0;
|
||||
td->caret_pos = G_MAXUINT;
|
||||
|
||||
td->update_selection_bound_count = 0;
|
||||
|
||||
td->update_text_contents_count = 0;
|
||||
td->change = 0;
|
||||
td->start = G_MAXUINT;
|
||||
td->end = G_MAXUINT;
|
||||
g_clear_pointer (&td->contents, g_bytes_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
update_caret_pos (GtkATContext *context,
|
||||
guint caret_pos,
|
||||
gpointer data)
|
||||
{
|
||||
TestData *td = data;
|
||||
|
||||
td->update_caret_pos_count++;
|
||||
td->caret_pos = caret_pos;
|
||||
}
|
||||
|
||||
static void
|
||||
update_selection_bound (GtkATContext *context,
|
||||
guint selection_bound,
|
||||
gpointer data)
|
||||
{
|
||||
TestData *td = data;
|
||||
|
||||
td->update_selection_bound_count++;
|
||||
}
|
||||
|
||||
static void
|
||||
update_text_contents (GtkATContext *context,
|
||||
GtkAccessibleTextContentChange change,
|
||||
guint start,
|
||||
guint end,
|
||||
GBytes *contents,
|
||||
gpointer data)
|
||||
{
|
||||
TestData *td = data;
|
||||
|
||||
td->update_text_contents_count++;
|
||||
|
||||
td->change = change;
|
||||
td->start = start;
|
||||
td->end = end;
|
||||
g_clear_pointer (&td->contents, g_bytes_unref);
|
||||
td->contents = g_bytes_ref (contents);
|
||||
}
|
||||
|
||||
static void
|
||||
test_text_accessible_text (void)
|
||||
{
|
||||
GtkWidget *text = gtk_text_new ();
|
||||
GBytes *bytes;
|
||||
gsize len;
|
||||
gboolean res;
|
||||
gsize n_ranges;
|
||||
GtkAccessibleTextRange *ranges = NULL;
|
||||
char **attr_names, **attr_values;
|
||||
const char *string;
|
||||
PangoAttrList *attrs;
|
||||
PangoAttribute *attr;
|
||||
GtkATContext *context;
|
||||
TestData td = { 0, };
|
||||
|
||||
g_object_ref_sink (text);
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (text));
|
||||
gtk_at_context_realize (context);
|
||||
|
||||
g_signal_connect (context, "update-caret-position", G_CALLBACK (update_caret_pos), &td);
|
||||
g_signal_connect (context, "update-selection-bound", G_CALLBACK (update_selection_bound), &td);
|
||||
g_signal_connect (context, "update-text-contents", G_CALLBACK (update_text_contents), &td);
|
||||
|
||||
test_data_clear (&td);
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (text), "abc");
|
||||
|
||||
g_assert_cmpuint (td.update_text_contents_count, ==, 1);
|
||||
g_assert_cmpuint (td.change, ==, GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT);
|
||||
g_assert_cmpuint (td.start, ==, 0);
|
||||
g_assert_cmpuint (td.end, ==, 3);
|
||||
g_assert_cmpstr ("abc", ==, g_bytes_get_data (td.contents, NULL));
|
||||
|
||||
attrs = pango_attr_list_new ();
|
||||
attr = pango_attr_underline_new (PANGO_UNDERLINE_DOUBLE);
|
||||
attr->start_index = 1;
|
||||
attr->end_index = 2;
|
||||
pango_attr_list_insert (attrs, attr);
|
||||
gtk_text_set_attributes (GTK_TEXT (text), attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
|
||||
test_data_clear (&td);
|
||||
|
||||
gtk_editable_select_region (GTK_EDITABLE (text), 1, 2);
|
||||
|
||||
g_assert_cmpuint (td.update_caret_pos_count, ==, 1);
|
||||
g_assert_cmpuint (td.caret_pos, ==, 2);
|
||||
|
||||
bytes = gtk_accessible_text_get_contents (GTK_ACCESSIBLE_TEXT (text), 0, G_MAXINT);
|
||||
string = g_bytes_get_data (bytes, &len);
|
||||
g_assert_cmpint (len, ==, 4);
|
||||
g_assert_cmpstr (string, ==, "abc");
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_assert_cmpint (gtk_accessible_text_get_caret_position (GTK_ACCESSIBLE_TEXT (text)), ==, 2);
|
||||
|
||||
res = gtk_accessible_text_get_selection (GTK_ACCESSIBLE_TEXT (text), &n_ranges, &ranges);
|
||||
g_assert_true (res);
|
||||
g_assert_cmpint (n_ranges, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].start, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].length, ==, 1);
|
||||
g_free (ranges);
|
||||
|
||||
res = gtk_accessible_text_get_attributes (GTK_ACCESSIBLE_TEXT (text), 1, &n_ranges, &ranges, &attr_names, &attr_values);
|
||||
g_assert_true (res);
|
||||
g_assert_cmpint (n_ranges, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].start, ==, 1);
|
||||
g_assert_cmpuint (ranges[0].length, ==, 1);
|
||||
g_assert_cmpstr (attr_names[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE);
|
||||
g_assert_cmpstr (attr_values[0], ==, GTK_ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE);
|
||||
g_free (ranges);
|
||||
g_strfreev (attr_names);
|
||||
g_strfreev (attr_values);
|
||||
|
||||
test_data_clear (&td);
|
||||
|
||||
gtk_editable_delete_text (GTK_EDITABLE (text), 1, 2);
|
||||
|
||||
g_assert_cmpuint (td.update_text_contents_count, ==, 1);
|
||||
g_assert_cmpuint (td.change, ==, GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE);
|
||||
g_assert_cmpuint (td.start, ==, 1);
|
||||
g_assert_cmpuint (td.end, ==, 2);
|
||||
g_assert_cmpstr ("b", ==, g_bytes_get_data (td.contents, NULL));
|
||||
|
||||
test_data_clear (&td);
|
||||
|
||||
gtk_at_context_unrealize (context);
|
||||
|
||||
g_object_unref (text);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/a11y/text/accessible-text", test_text_accessible_text);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user