Compare commits

..

82 Commits

Author SHA1 Message Date
Chun-wei Fan 127685ef22 laguage-names.c: Windows: Look for iso-codes dynamically
Use the internal APIs _gtk_get_localedir() and gtk_get_datadir() to look for
the XML files and translations for iso-codes, instead of using a path defined
at build time, on Windows.
2022-01-06 17:54:37 +08:00
Jordi Mas be81f6b4ab Update Catalan translation 2022-01-06 08:25:29 +01:00
Aleksandr Melman 716e0b97bd Update Russian translation 2022-01-05 11:03:11 +00:00
Matthias Clasen ff862dc926 Merge branch 'wip/smcv/gresource-internal' into 'main'
build: Tell glib-compile-resources to make symbols internal where possible

See merge request GNOME/gtk!4334
2022-01-04 18:58:14 +00:00
Simon McVittie 17c2a1cb4e build: Tell glib-compile-resources to make symbols internal where possible
Partial solution to https://gitlab.gnome.org/GNOME/gtk/-/issues/4598

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-01-04 18:08:22 +00:00
Aleksandr Melman 895e640fd0 Update Russian translation 2022-01-04 17:00:55 +00:00
Emmanuele Bassi e8f5f86ad5 Merge branch 'label-fix-section-link' into 'main'
docs: Fix link to section in GtkLabel

See merge request GNOME/gtk!4333
2022-01-04 15:54:05 +00:00
Marco Melorio 5055b41ee7 docs: Fix link to section in GtkLabel 2022-01-04 16:33:00 +01:00
Matthias Clasen 7efd08ca2e Merge branch 'fix-hc-warning' into 'main'
gdk/display-wayland: Don't bypass portal for theme entries

Closes #4593

See merge request GNOME/gtk!4331
2022-01-04 14:51:05 +00:00
Hugo Carvalho 76b421e064 Update Portuguese translation 2022-01-04 14:12:59 +00:00
Luca Bacci 063e6baa0a Merge branch 'gtk-grab-file-chooser-native-win32' into 'main'
GTK grab for GtkFileChooserNativeWin32

Closes #4582

See merge request GNOME/gtk!4329
2022-01-04 13:59:08 +00:00
Florian Müllner 9e5d412a8b gdk/display-wayland: Don't bypass portal for theme entries
When commit 49589e1da added support for the new high-contrast key,
it missed that the getter should only use the setting directly when
not going through the portal.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4593
2022-01-04 14:58:58 +01:00
Daniel Mustieles fa9b634d8f Updated Spanish translation 2022-01-04 14:38:09 +01:00
Matthias Clasen d76379428d Merge branch 'noexecstack' into 'main'
Make our stack noexec

Closes #4598

See merge request GNOME/gtk!4330
2022-01-04 13:09:39 +00:00
Matthias Clasen 46509b6dd2 Make our stack noexec
The change to use ld and objcopy for resources
had some side-effects: it leaked a few symbols
and made our stack executable. We don't want that.

Use -z nonexecstack and --strip-all to avoid this.

Fixes: #4598
2022-01-04 07:51:56 -05:00
Daniel Mustieles 89dbf9cc81 Updated Spanish translation 2022-01-04 12:18:11 +01:00
Luca Bacci c138aaabf3 Use a GTK grab when showing a modal GtkFileChooserNativeWin32 2022-01-04 10:46:20 +01:00
Yuri Chornoivan 7cef454c86 Update Ukrainian translation 2022-01-03 20:51:23 +00:00
Emmanuele Bassi 5cb8d15505 Merge branch 'fredmorcos-master-patch-48389' into 'main'
Minor doc fix

See merge request GNOME/gtk!4325
2022-01-03 13:34:00 +00:00
Luca Bacci 2aab55983d Merge branch 'wgl-legacy' into 'main'
GSK/GL: Relax check for GL 3.x+ legacy contexts

See merge request GNOME/gtk!4187
2022-01-03 13:11:04 +00:00
Fred Morcos 31714e5c1d Minor doc fix 2022-01-03 10:27:51 +00:00
Luca Bacci 96c351e792 Merge branch 'for-main' into 'main'
For main

See merge request GNOME/gtk!4322
2022-01-03 09:51:10 +00:00
Matthias Clasen edd57004d3 Merge branch 'matthiasc/for-main' into 'main'
fontchooser: Use new hb api

See merge request GNOME/gtk!4323
2022-01-03 02:52:45 +00:00
Matthias Clasen 234d20641c fontbutton: Pass the fontmap to the dialog 2022-01-02 21:37:32 -05:00
Matthias Clasen dd802f21e7 fontchooser: Cosmetics
Use harfbuzz api to format variations and features.
That matches what pango uses to parse them.
2022-01-02 21:37:32 -05:00
Matthias Clasen dbbc990c72 fontchooser: Use new hb api
Use hb_font_get_var_coords_design if we have it.
This should fix our handling of fonts with AVAR.
2022-01-02 21:37:32 -05:00
Matthias Clasen 3a6e772cba Merge branch 'wip/antoniof/expression-autocleanup' into 'main'
gtk: Define the GtkExpression autocleanup func

See merge request GNOME/gtk!4319
2022-01-02 17:49:49 +00:00
António Fernandes c9fa16fcfa gtk: Define the GtkExpression autocleanup func 2022-01-02 17:49:48 +00:00
Luca Bacci 07b04fbea9 Remove some unneeded files from gdk/win32
bdfcursor.c, cursor.bdf and libwntab32x.la
2022-01-02 18:49:44 +01:00
Luca Bacci 1c633cbea2 Add hid.lib to pkg-config file listing 2022-01-02 18:45:17 +01:00
Luca Bacci 2f685d5d2a Remove leftover code dealing with input-only windows 2022-01-02 18:42:33 +01:00
Luca Bacci 0fdf2cc195 Fix compilation with clang
From https://github.com/msys2/MINGW-packages/pull/9509
2022-01-02 18:42:33 +01:00
Luca Bacci 4f7d18a28f Do not use GetProcAddress for FlashWindowEx
It's available since Windows XP
2022-01-02 18:42:32 +01:00
Luca Bacci c77272a7d7 Remove call to ShowOwnedPopups (FALSE) to hide owned windows
This is needed to fully support windows with the property
"destroy-with-parent" set to FALSE.
2022-01-02 18:42:31 +01:00
Luca Bacci 7a1004df73 Remove WM_SYNCPAINT message handler
It was added to work around what seemed to be an OS or graphics
driver issue on Windows XP. The issue was not reproducible on
Windows Vista anyway.

References:
* https://bugzilla.gnome.org/show_bug.cgi?id=153567
* https://gitlab.gnome.org/GNOME/gtk/-/commit/c8fef535
* https://devblogs.microsoft.com/oldnewthing/20120723-00/?p=7073
2022-01-02 18:42:31 +01:00
Matthias Clasen 0e86d2b345 Merge branch 'ebassi/issue-4576' into 'main'
Update the accessible description of MenuButton

Closes #4576

See merge request GNOME/gtk!4317
2022-01-02 01:12:53 +00:00
Matthias Clasen 2441bdb900 Merge branch 'radioactiveman-main-patch-13472' into 'main'
texture: Fix typo in error message

See merge request GNOME/gtk!4311
2022-01-02 00:51:43 +00:00
Matthias Clasen 57679b7b7f Merge branch 'wip-fontchooser-tewaks' into 'main'
Revert "fontchoserwidget: Do our own face filtering"

See merge request GNOME/gtk!4314
2022-01-02 00:50:57 +00:00
Emmanuele Bassi 37063e7a05 Update the accessible description of MenuButton
We update the labelled-by relation, but we never update the described-by
one.

Fixes: #4576
2022-01-02 00:35:53 +00:00
Matthias Clasen 791dc7b9be fontchooser: Speed up fature examples
We were doing unnecessary work here, which could
get really slow with some fonts. Just compute
the reverse charmap once and reuse it.
2022-01-01 15:38:04 -05:00
Matthias Clasen ff24dfb2e7 Revert "fontchooserwidget: Revise handling of named instances"
This reverts commit 2dc56a6e9b.

This wasn't ready yet.
2022-01-01 15:36:29 -05:00
Matthias Clasen 4db60fa5a8 Revert "fontchoserwidget: Do our own face filtering"
This reverts commit b7b6c147f9.

This was premature.
2022-01-01 15:36:27 -05:00
Emmanuele Bassi 5301367630 Merge branch 'bilelmoussaoui/g-i' into 'main'
gdk: add missing nullable annotations

See merge request GNOME/gtk!4310
2022-01-01 20:22:18 +00:00
Bilal Elmoussaoui 9409b7ef7d gtk: mark few GtkPrinterSettings as nullable
Everything that makes use of gtk_printer_settings_get should be nullable
Because the hashtable might not contain the key and there's no default value provided
2022-01-01 19:20:29 +01:00
Bilal Elmoussaoui afeb7f668b gtk: mark few GtkFileChooser functions as nullable
- get_file, if no file is selected returns a NULL
- get_id, if the interface doesn't implement such function returns NULL
2022-01-01 19:11:10 +01:00
Bilal Elmoussaoui 38b8da0f5f gtk: mark gtk_flatten_list_model_get_model_for_item as nullable 2022-01-01 19:07:13 +01:00
Bilal Elmoussaoui d029b62d23 gtk: mark gtk_mount_operation_get_parent as nullable 2022-01-01 19:05:33 +01:00
Bilal Elmoussaoui 1e9bdb4647 gtk: mark gtk_list_box_get_adjustment as nullable
similar to its setter function
2022-01-01 19:05:06 +01:00
Bilal Elmoussaoui 1d72024605 gtk: mark MenuButton::get_label/get_icon_name as nullable 2022-01-01 18:38:56 +01:00
Bilal Elmoussaoui 06570443b7 gtk: mark gtk_icon_view_create_drag_icon as nullable 2022-01-01 18:33:29 +01:00
Bilal Elmoussaoui 77f7caf18d gtk: mark gtk_glarea_get_context as nullable 2022-01-01 18:26:40 +01:00
Thomas Lange 8767ffde2f texture: Fix typo in error message 2022-01-01 17:23:22 +00:00
Bilal Elmoussaoui d58b7fa779 gtk: mark gtk_text_mark_get_buffer as nullable 2022-01-01 18:19:41 +01:00
Bilal Elmoussaoui dcbf3f8879 gtk: mark gtk_lock_button_get_permission as nullable
like the constructor/setter
2022-01-01 18:17:31 +01:00
Bilal Elmoussaoui 30d8c8e17c gtk: mark buildable_get_id as nullable
the vfunc can return a nullable
2022-01-01 18:12:05 +01:00
Bilal Elmoussaoui b803bb5edb gtk: mark MultiSelection::get_model as nullable
the constructor & setter takes a nullable model
2022-01-01 18:04:24 +01:00
Bilal Elmoussaoui 985a39d41f gtk: mark gtk_native_get_for_surface as nullable 2022-01-01 17:59:35 +01:00
Bilal Elmoussaoui f846eec894 gtk: mark gtk_no_selection_get_model nullable
The constructor is nullable so should the getter be
2022-01-01 17:56:07 +01:00
Bilal Elmoussaoui e7fc8ad1f5 gtk: fix PasswordEntry annotation 2022-01-01 17:49:11 +01:00
Bilal Elmoussaoui 95169ad54b gtk: add nullable annotations to PopoverMenuBar/PopoverMenu
The constructor/setter accepts a null as a model so should the getter
2022-01-01 17:47:21 +01:00
Bilal Elmoussaoui ddb2e91a42 gtk: add nullable annotations for Scrollable getters
The adjustment setters takes a nullable and so should the getters be annotated
2022-01-01 17:39:45 +01:00
Bilal Elmoussaoui 90357193c9 gtk: add nullable annotation to gtk_css_section_get_file
The constructor takes a nullable file param
2022-01-01 17:31:38 +01:00
Bilal Elmoussaoui a336fe2850 gdk: add missing nullable annotations 2022-01-01 17:03:10 +01:00
Matthias Clasen fcb8e4cf37 Merge branch 'fontchooser-tweaks' into 'main'
fontchooserwidget: Avoid a crash

See merge request GNOME/gtk!4309
2021-12-31 18:32:49 +00:00
Matthias Clasen b7b6c147f9 fontchoserwidget: Do our own face filtering
Pango may not do this for us, so don't rely on it.
We only show one face with a given name, and we
prefer a variable face over a non-variable one.

The check for variable faces requires new Pango
API that will be in Pango 1.52.
2021-12-31 09:58:26 -05:00
Emmanuele Bassi 35ee82ca07 Merge branch 'wip/baedert/for-master' into 'main'
baseline = -1 means no baseline

Closes #4385

See merge request GNOME/gtk!4307
2021-12-31 14:55:20 +00:00
Matthias Clasen 2dc56a6e9b fontchooserwidget: Revise handling of named instances
Allowing to tweak the axes of named instances does
not do any harm. If we don't, we have to worry that
we need at least one non-named-instance in the face
list, and make it more obvious how to pick it out.
2021-12-31 09:50:47 -05:00
Matthias Clasen e12ef76de5 fontchooserwidget: Avoid a crash
languages may be NULL, we need to be more careful here.
2021-12-31 09:49:40 -05:00
Matthias Clasen 536b05e35b maplistmodel: Cosmetics 2021-12-31 09:48:34 -05:00
Timm Bäder 1354854d23 inspector: Fix coding style
ffs
2021-12-31 14:41:35 +01:00
Timm Bäder 2b062d60f2 baseline = -1 means no baseline
Fixes #4385
2021-12-31 13:08:01 +01:00
Matthias Clasen c8bdb4c7fb Merge branch 'fontchooser-cleanups' into 'main'
fontchooser: Stop using pangofc api

See merge request GNOME/gtk!4306
2021-12-31 04:30:04 +00:00
Matthias Clasen 80328e8a4f fontchooser: Stop using pangofc api
Pango now has backend-independent api for all
we need, so we can drop all the ifdefs.
2021-12-30 22:52:52 -05:00
Emmanuele Bassi 1138e3770b Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: add missing nullable annotation

See merge request GNOME/gtk!4304
2021-12-30 17:12:59 +00:00
Bilal Elmoussaoui ec58013b22 g-i: add missing nullable annotation
the constructor takes a nullable expression parameter, so should the getter be
2021-12-30 16:52:53 +00:00
Matthias Clasen 70cb61fb71 4.6.0 2021-12-30 10:31:52 -05:00
Yuri Chornoivan 8e6a0ec23d Update Ukrainian translation 2021-12-29 22:17:32 +00:00
Matthias Clasen e2ab334636 Merge branch 'doc-window' into 'main'
Document built-in actions on GtkWindow

See merge request GNOME/gtk!4297
2021-12-29 17:23:16 +00:00
Hofer-Julian ac210c1765 docs: Add missing star to block comment 2021-12-29 15:46:59 +01:00
Hofer-Julian c58e48e648 doc: Fix docs of window.minimize 2021-12-29 15:45:44 +01:00
Hofer-Julian acdadab617 docs: Document built-in actions on GtkWindow 2021-12-29 15:45:43 +01:00
Chun-wei Fan a619e8af4a gskglcompiler.c: Relax check for GL 3.x+ legacy contexts
On Windows with nVidia drivers at least, when we create a legacy context
via wglCreateContext(), we may still get a (W)GL 4.x context.  Allow
such contexts to also use GLSL version 130 instead of 110, so that
things do continue to work.
2021-12-01 17:29:02 +08:00
57 changed files with 8129 additions and 13795 deletions
+36
View File
@@ -1,3 +1,39 @@
Overview of Changes
===================
* GtkProgressBar:
- Fix handling of "inverted"
* GtkLabel:
- Add a "natural wrap mode" property to influence how
natural width is determined
* GtkTextView
- Scroll insertion on-screen after undo / redo
* gsk:
- Abort region diffing when changes are too complex
* gdk:
- Avoid compressing discrete scroll events
- Fix problems with hiding windows
- Improve GL and GLES version checks
* Wayland:
- Support new high-contrast setting
* Inspector:
- Add DND inspection support
* build:
- Avoid deprecated meson apis
* Translation updates
Galician
Portuguese
Ukrainian
Overview of Changes in 4.5.1, 16-12-2021
========================================
+1 -1
View File
@@ -264,7 +264,7 @@ gdk_content_deserializer_get_priority (GdkContentDeserializer *deserializer)
*
* This is the `GCancellable` that was passed to [func@Gdk.content_deserialize_async].
*
* Returns: (transfer none): the cancellable for the current operation
* Returns: (transfer none) (nullable): the cancellable for the current operation
*/
GCancellable *
gdk_content_deserializer_get_cancellable (GdkContentDeserializer *deserializer)
+1 -1
View File
@@ -270,7 +270,7 @@ gdk_content_serializer_get_priority (GdkContentSerializer *serializer)
*
* This is the `GCancellable` that was passed to [func@content_serialize_async].
*
* Returns: (transfer none): the cancellable for the current operation
* Returns: (transfer none) (nullable): the cancellable for the current operation
*/
GCancellable *
gdk_content_serializer_get_cancellable (GdkContentSerializer *serializer)
+1 -2
View File
@@ -47,8 +47,7 @@
* Cursors by themselves are not very interesting: they must be bound to a
* window for users to see them. This is done with [method@Gdk.Surface.set_cursor]
* or [method@Gdk.Surface.set_device_cursor]. Applications will typically
* use higher-level GTK functions such as [method@Gtk.Widget.set_cursor]`
* instead.
* use higher-level GTK functions such as [method@Gtk.Widget.set_cursor] instead.
*
* Cursors are not bound to a given [class@Gdk.Display], so they can be shared.
* However, the appearance of cursors may vary when used on different
+1 -1
View File
@@ -1225,7 +1225,7 @@ gdk_event_get_event_type (GdkEvent *event)
*
* Extracts the surface associated with an event.
*
* Returns: (transfer none): The `GdkSurface` associated with the event
* Returns: (transfer none) (nullable): The `GdkSurface` associated with the event
*/
GdkSurface *
gdk_event_get_surface (GdkEvent *event)
+1 -1
View File
@@ -187,7 +187,7 @@ gdk_popup_get_rect_anchor (GdkPopup *popup)
*
* Returns the parent surface of a popup.
*
* Returns: (transfer none): the parent surface
* Returns: (transfer none) (nullable): the parent surface
*/
GdkSurface *
gdk_popup_get_parent (GdkPopup *popup)
+1 -1
View File
@@ -454,7 +454,7 @@ gdk_texture_new_from_resource (const char *resource_path)
texture = NULL;
if (texture == NULL)
g_error ("Resource path %s s not a valid image: %s", resource_path, error->message);
g_error ("Resource path %s is not a valid image: %s", resource_path, error->message);
return texture;
}
+5 -1
View File
@@ -2110,7 +2110,11 @@ set_theme_from_entry (GdkDisplay *display,
GSettingsSchema *schema = NULL;
gboolean hc = FALSE;
settings = (GSettings *)g_hash_table_lookup (display_wayland->settings, "org.gnome.desktop.a11y.interface");
if (display_wayland->settings_portal == NULL)
{
settings = (GSettings *)g_hash_table_lookup (display_wayland->settings,
"org.gnome.desktop.a11y.interface");
}
if (settings)
g_object_get (settings, "settings-schema", &schema, NULL);
-406
View File
@@ -1,406 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2001 Stefan Ondrejicka
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <stdlib.h>
#include <glib.h>
typedef struct {
char *name;
int id;
char *bitmap;
int hotx;
int hoty;
} font_info_t;
typedef struct {
char *name;
int id;
int width;
int height;
int hotx;
int hoty;
char *data;
} cursor_info_t;
static GSList *fonts = NULL;
static GSList *cursors = NULL;
static int dw,dh;
static gboolean debug = FALSE;
#define HEX(c) (((c) >= '0' && (c) <= '9') ? \
((c) - '0') : (toupper(c) - 'A' + 10))
static void print_font(fi)
font_info_t *fi;
{
int x,y;
for (y = 0; y < dh; y++)
{
for (x = 0; x < dw; x++)
{
printf(fi->bitmap[y*dw+x]? "X" : " ");
}
printf("\n");
}
}
static void print_cursor(ci)
cursor_info_t *ci;
{
int x,y;
for (y = 0; y < ci->height; y++)
{
printf("/* ");
for (x = 0; x < ci->width; x++)
{
if (ci->hotx == x && ci->hoty == y)
printf("o");
else
switch (ci->data[y*ci->width+x])
{
case 0:
printf(" ");
break;
case 1:
printf(".");
break;
case 2:
printf("X");
break;
}
}
printf(" */\n");
}
}
static int read_bdf_font(fname)
char *fname;
{
FILE *f;
char line[2048];
int rv = 0;
gboolean startchar = FALSE, startbitmap = FALSE;
char *charname,*p,*bitmap;
int dx = 0,dy = 0;
int w,h,x,y,py;
int id,tmp;
dw = 0;
dh = 0;
if (!(f = fopen(fname, "r")))
{
perror(fname);
return -1;
}
if (fgets(line, sizeof(line), f) && strncasecmp("STARTFONT ", line, 10))
{
printf("!BDF font file\n");
fclose(f);
return -1;
}
p = line;
while (fgets(line, sizeof(line), f))
{
if (!startchar)
{
if (!strncasecmp("STARTCHAR ", line, 10))
{
startchar = TRUE;
charname = g_strndup(p + 10,
strcspn(p+10, "\r\n"));
}
else if (!strncasecmp("FONTBOUNDINGBOX ", line, 16))
sscanf(p+16, "%d %d %d %d", &dw, &dh, &dx, &dy);
}
else
{
if (!strncasecmp("ENDCHAR", line, 7))
{
font_info_t *nfi;
if (debug)
printf(" %*s*/\n", dw, "");
startchar = FALSE;
startbitmap = FALSE;
nfi = g_malloc(sizeof(font_info_t));
memset(nfi, '\0', sizeof(font_info_t));
nfi->name = charname;
nfi->id = id;
nfi->bitmap = bitmap;
nfi->hotx = 0 - dx;
nfi->hoty = 0 - dy;
fonts = g_slist_append(fonts, nfi);
}
else if (startbitmap)
{
int px,cx;
guchar mask;
px = x - dx + py * dw;
for (cx = 0; cx < w; cx++)
{
mask = 1 << (3 - (cx % 4));
bitmap[px+cx] =
(mask & HEX(line[cx/4])) != 0;
if (debug)
printf(bitmap[px+cx] ? "X" : " ");
}
py++;
if (debug)
printf(" %*s*/\n/* %*s", dw-w, "", dw+dx, "");
}
else if (!strncasecmp("BBX ", line, 4))
{
sscanf(p+4, "%d %d %d %d", &w, &h, &x, &y);
if (debug)
printf("/* %s: */\n/* %*s", charname, dw+dx, "");
}
else if (!strncasecmp("ENCODING ", line, 9))
{
if (sscanf(p+9, "%d %d", &tmp, &id) != 2)
id = tmp;
}
else if (!strncasecmp("BITMAP", line, 6))
{
py = y - dy;
startbitmap = TRUE;
bitmap = g_malloc(dw*dh);
memset(bitmap, '\0', dw*dh);
}
}
}
if (strncasecmp("ENDFONT", line, 7))
rv = -1;
fclose(f);
return rv;
}
static int font_info_compare(fi, name)
font_info_t *fi;
char *name;
{
return strcmp(name, fi->name);
}
static cursor_info_t *gen_cursor(bmap, mask)
font_info_t *bmap;
font_info_t *mask;
{
cursor_info_t *ci;
int bx = dw,by = dh,ex = 0,ey = 0;
int i,j;
for (j = 0; j < dh; j++)
{
gboolean havep = FALSE;
for (i = 0; i < dw; i++)
{
if (bmap->bitmap[j*dw+i] || mask->bitmap[j*dw+i])
{
havep = TRUE;
bx = MIN(bx, i);
ex = MAX(i+1, ex);
}
}
if (havep)
{
by = MIN(by, j);
ey = MAX(ey, j+1);
}
}
ci = g_malloc(sizeof(cursor_info_t));
ci->name = g_strdup(bmap->name);
ci->id = bmap->id;
ci->width = ex - bx;
ci->height = ey - by;
ci->hotx = bmap->hotx - bx;
ci->hoty = ci->height - (bmap->hoty - by);
ci->data = g_malloc(ci->width * ci->height);
memset(ci->data, '\0', ci->width * ci->height);
for (j = 0; j < ci->height; j++)
{
for (i = 0; i < ci->width; i++)
{
int ofs = (by + j) * dw + bx + i;
ci->data[j*ci->width + i] = mask->bitmap[ofs] *
(1 + bmap->bitmap[ofs]);
}
}
return ci;
}
static void compose_cursors_from_fonts()
{
GSList *l;
for (l = g_slist_copy (fonts); l; l = g_slist_delete_link (l,l))
{
font_info_t *fi = l->data;
char *name;
GSList *ml;
name = g_strconcat(fi->name, "_mask", NULL);
if ((ml = g_slist_find_custom(fonts, name,
(GCompareFunc) font_info_compare)))
{
cursors = g_slist_append(cursors, gen_cursor(l->data, ml->data));
fonts = g_slist_remove(fonts, l->data);
fonts = g_slist_remove(fonts, ml->data);
}
g_free(name);
}
}
static char *dump_cursor(ci, id)
cursor_info_t *ci;
int id;
{
static char cdata[8192];
char *p;
int i;
int c;
gboolean flushed;
sprintf(cdata, " { \"%s\", %d, %d, %d, %d, %d, \n \"",
ci->name, ci->id, ci->width, ci->height, ci->hotx, ci->hoty);
p = cdata + strlen(cdata);
for (i = 0; i < ci->width * ci->height; i++)
{
flushed = FALSE;
if (!(i%4))
c = 0;
c = c << 2;
c += ci->data[i];
if ((i % 4) == 3)
{
flushed = TRUE;
sprintf(p, "\\%03o", c);
p += strlen(p);
}
if (i > 0 && !(i % 64))
{
strcpy(p ,"\"\n \"");
p += strlen(p);
}
}
if (!flushed)
{
sprintf(p, "\\%03o", c);
p += strlen(p);
}
strcpy(p, "\" }");
return cdata;
}
static int dump_cursors()
{
GSList *ptr;
FILE *f = stdout;
fprintf(f, "static const struct { const char *name; int type; guchar width; guchar height; guchar hotx; guchar hoty; guchar *data; } cursors[] = {\n");
for (ptr = cursors; ptr; ptr = ptr->next)
{
if (debug)
print_cursor(ptr->data);
fprintf(f, "%s, \n", dump_cursor(ptr->data));
}
fprintf(f, " { NULL, 0, 0, 0, 0, 0, NULL },\n};\n");
return 0;
}
int main(argc, argv)
int argc;
char **argv;
{
if (argc != 2)
{
printf("missing parameters !\n");
printf("Usage: %s [BDF cursor file]\n", argv[0]);
return -1;
}
if (g_getenv ("BDFCURSOR_DEBUG") != NULL)
debug = TRUE;
if (read_bdf_font(argv[1]) || !fonts)
{
printf("Error reading font\n");
return 1;
}
compose_cursors_from_fonts();
if (!cursors)
{
printf("failed to generate cursors from font!\n");
return 1;
}
dump_cursors();
if (fonts)
{
printf("some fonts remained unconverted!\n");
return 1;
}
return 0;
}
-3385
View File
File diff suppressed because it is too large Load Diff
-24
View File
@@ -157,7 +157,6 @@ static HKL latin_locale = NULL;
static gboolean in_ime_composition = FALSE;
static UINT modal_timer;
static UINT sync_timer = 0;
static int debug_indent = 0;
@@ -1453,23 +1452,6 @@ _gdk_win32_end_modal_call (GdkWin32ModalOpKind kind)
}
}
static VOID CALLBACK
sync_timer_proc (HWND hwnd,
UINT msg,
UINT_PTR id,
DWORD time)
{
MSG message;
if (PeekMessageW (&message, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE))
{
return;
}
RedrawWindow (hwnd, NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
KillTimer (hwnd, sync_timer);
}
static gboolean
handle_nchittest (HWND hwnd,
GdkSurface *window,
@@ -2854,12 +2836,6 @@ gdk_event_translate (MSG *msg,
*ret_valp = 1;
break;
case WM_SYNCPAINT:
sync_timer = SetTimer (GDK_SURFACE_HWND (window),
1,
200, sync_timer_proc);
break;
case WM_PAINT:
handle_wm_paint (msg, window);
break;
+12 -56
View File
@@ -787,26 +787,6 @@ show_window_internal (GdkSurface *window,
if (!unminimize && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window)))
return;
/* Other cases */
exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
/* Use SetWindowPos to show transparent windows so automatic redraws
* in other windows can be suppressed.
*/
if (exstyle & WS_EX_TRANSPARENT)
{
UINT flags = SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
if (GDK_IS_DRAG_SURFACE (window))
flags |= SWP_NOACTIVATE;
SetWindowPos (GDK_SURFACE_HWND (window),
SWP_NOZORDER_SPECIFIED, 0, 0, 0, 0, flags);
return;
}
/* For initial map of "normal" windows we want to emulate WM window
* positioning behaviour, which means:
* + default to the initial CW_USEDEFAULT placement,
@@ -953,6 +933,8 @@ show_window_internal (GdkSurface *window,
GtkShowWindow (window, SW_SHOW);
}
exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
/* Sync STATE_ABOVE to TOPMOST */
if (!GDK_IS_DRAG_SURFACE (window) &&
(((window->state & GDK_TOPLEVEL_STATE_ABOVE) &&
@@ -989,22 +971,7 @@ gdk_win32_surface_hide (GdkSurface *window)
_gdk_surface_clear_update_area (window);
if (GDK_IS_TOPLEVEL (window))
ShowOwnedPopups (GDK_SURFACE_HWND (window), FALSE);
/* Use SetWindowPos to hide transparent windows so automatic redraws
* in other windows can be suppressed.
*/
if (GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
{
SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED,
0, 0, 0, 0,
SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
}
else
{
GtkShowWindow (window, SW_HIDE);
}
GtkShowWindow (window, SW_HIDE);
}
static void
@@ -1336,33 +1303,22 @@ gdk_win32_surface_set_urgency_hint (GdkSurface *window,
gboolean urgent)
{
FLASHWINFO flashwinfo;
typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
PFN_FlashWindowEx flashWindowEx = NULL;
g_return_if_fail (GDK_IS_SURFACE (window));
if (GDK_SURFACE_DESTROYED (window))
return;
flashWindowEx = (PFN_FlashWindowEx) GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx");
if (flashWindowEx)
{
flashwinfo.cbSize = sizeof (flashwinfo);
flashwinfo.hwnd = GDK_SURFACE_HWND (window);
if (urgent)
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
else
flashwinfo.dwFlags = FLASHW_STOP;
flashwinfo.uCount = 0;
flashwinfo.dwTimeout = 0;
flashWindowEx (&flashwinfo);
}
flashwinfo.cbSize = sizeof (flashwinfo);
flashwinfo.hwnd = GDK_SURFACE_HWND (window);
if (urgent)
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
else
{
FlashWindow (GDK_SURFACE_HWND (window), urgent);
}
flashwinfo.dwFlags = FLASHW_STOP;
flashwinfo.uCount = 0;
flashwinfo.dwTimeout = 0;
FlashWindowEx (&flashwinfo);
}
static gboolean
-30
View File
@@ -1,30 +0,0 @@
# libwntab32x.la - a libtool library file
# Generated by hand, compatible with libtool
# Just a wrapper for libwntab32x.a, which is just a copy of wntab32x.lib
#
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libwntab32x.a'
# Libraries that this one depends upon.
dependency_libs=''
# Version information
current=0
age=0
revision=0
# Is this an already installed library?
installed=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir=''
+1 -1
View File
@@ -3535,7 +3535,7 @@ gdk_x11_surface_unfullscreen (GdkSurface *surface)
*
* Returns the group this surface belongs to.
*
* Returns: (transfer none): The group of this surface;
* Returns: (transfer none) (nullable): The group of this surface;
*/
GdkSurface *
gdk_x11_surface_get_group (GdkSurface *surface)
+2 -1
View File
@@ -147,7 +147,8 @@ gsk_gl_compiler_new (GskGLDriver *driver,
gdk_gl_context_get_version (context, &maj, &min);
if (maj == 3)
/* On Windows, legacy contexts can give us a GL 4.x context */
if (maj >= 3)
self->glsl_version = SHADER_VERSION_GL3_LEGACY;
else
self->glsl_version = SHADER_VERSION_GL2_LEGACY;
+1 -1
View File
@@ -140,7 +140,7 @@ gtk_css_section_get_parent (const GtkCssSection *section)
* If no such file exists, for example because the CSS was loaded via
* [method@Gtk.CssProvider.load_from_data], then `NULL` is returned.
*
* Returns: (transfer none): the `GFile` from which the `section`
* Returns: (transfer none) (nullable): the `GFile` from which the `section`
* was parsed
**/
GFile *
+1 -1
View File
@@ -83,7 +83,7 @@ gtk_buildable_set_buildable_id (GtkBuildable *buildable,
* `GtkBuilder` sets the name based on the ID attribute
* of the <object> tag used to construct the @buildable.
*
* Returns: the ID of the buildable object
* Returns: (nullable): the ID of the buildable object
**/
const char *
gtk_buildable_get_buildable_id (GtkBuildable *buildable)
+1 -2
View File
@@ -1,4 +1,3 @@
/*
* Copyright © 2019 Benjamin Otte
*
@@ -1372,7 +1371,7 @@ gtk_property_expression_new_for_pspec (GtkExpression *expression,
* Gets the expression specifying the object of
* a property expression.
*
* Returns: (transfer none): the object expression
* Returns: (transfer none) (nullable): the object expression
*/
GtkExpression *
gtk_property_expression_get_expression (GtkExpression *expression)
+1
View File
@@ -50,6 +50,7 @@ GDK_AVAILABLE_IN_ALL
GtkExpression * gtk_expression_ref (GtkExpression *self);
GDK_AVAILABLE_IN_ALL
void gtk_expression_unref (GtkExpression *self);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkExpression, gtk_expression_unref)
GDK_AVAILABLE_IN_ALL
GType gtk_expression_get_value_type (GtkExpression *self);
+2 -2
View File
@@ -523,7 +523,7 @@ gtk_file_chooser_set_file (GtkFileChooser *chooser,
* If the file chooser is in folder mode, this function returns
* the selected folder.
*
* Returns: (transfer full): a selected `GFile`. You own the
* Returns: (transfer full) (nullable): a selected `GFile`. You own the
* returned file; use g_object_unref() to release it.
*/
GFile *
@@ -794,7 +794,7 @@ gtk_file_chooser_set_choice (GtkFileChooser *chooser,
*
* Gets the currently selected option in the 'choice' with the given ID.
*
* Returns: the ID of the currently selected option
* Returns: (nullable): the ID of the currently selected option
*/
const char *
gtk_file_chooser_get_choice (GtkFileChooser *chooser,
+16
View File
@@ -41,6 +41,7 @@
#include "gtktogglebutton.h"
#include "gtkheaderbar.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtkfilefilterprivate.h"
#include "gtknative.h"
@@ -50,6 +51,9 @@
typedef struct {
GtkFileChooserNative *self;
GtkWidget *grab_widget;
IFileDialogEvents *events;
HWND parent;
@@ -318,6 +322,12 @@ filechooser_win32_thread_data_free (FilechooserWin32ThreadData *data)
if (data->events)
IFileDialogEvents_Release (data->events);
if (data->grab_widget)
{
gtk_grab_remove (data->grab_widget);
g_object_unref (data->grab_widget);
}
g_clear_object (&data->current_folder);
g_clear_object (&data->current_file);
g_free (data->current_name);
@@ -969,6 +979,12 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self)
return FALSE;
}
if (data->modal)
{
data->grab_widget = g_object_ref_sink (gtk_label_new (""));
gtk_grab_add (GTK_WIDGET (data->grab_widget));
}
return TRUE;
}
+1 -1
View File
@@ -510,7 +510,7 @@ gtk_flatten_list_model_get_model (GtkFlattenListModel *self)
*
* Returns the model containing the item at the given position.
*
* Returns: (transfer none): the model containing the item at @position
* Returns: (transfer none) (nullable): the model containing the item at @position
*/
GListModel *
gtk_flatten_list_model_get_model_for_item (GtkFlattenListModel *self,
+2
View File
@@ -433,6 +433,8 @@ gtk_font_button_font_chooser_set_font_map (GtkFontChooser *chooser,
context = gtk_widget_get_pango_context (font_button->font_label);
pango_context_set_font_map (context, font_map);
if (font_button->font_dialog)
gtk_font_chooser_set_font_map (GTK_FONT_CHOOSER (font_button->font_dialog), font_map);
}
}
+234 -201
View File
@@ -64,9 +64,6 @@
#include "gtkstringsorter.h"
#include <hb-ot.h>
#if defined(HAVE_PANGOFT) && defined(HAVE_HARFBUZZ)
#include <pango/pangofc-font.h>
#endif
#include "language-names.h"
#include "script-names.h"
@@ -155,6 +152,8 @@ struct _GtkFontChooserWidget
GList *feature_items;
GAction *tweak_action;
hb_map_t *glyphmap;
};
struct _GtkFontChooserWidgetClass
@@ -362,7 +361,6 @@ user_filter_cb (gpointer item,
!pango_font_family_is_monospace (family))
return FALSE;
#ifdef HAVE_PANGOFT
if (self->filter_by_language &&
self->filter_language)
{
@@ -370,6 +368,7 @@ user_filter_cb (gpointer item,
PangoContext *context;
PangoFont *font;
gboolean ret;
PangoLanguage **langs;
desc = pango_font_face_describe (face);
pango_font_description_set_size (desc, 20);
@@ -377,27 +376,19 @@ user_filter_cb (gpointer item,
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
font = pango_context_load_font (context, desc);
ret = TRUE;
ret = FALSE;
if (PANGO_IS_FC_FONT (font))
langs = pango_font_get_languages (font);
if (langs)
{
PangoLanguage **langs;
int i;
ret = FALSE;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
langs = pango_fc_font_get_languages (PANGO_FC_FONT (font));
G_GNUC_END_IGNORE_DEPRECATIONS
if (langs)
for (i = 0; langs[i]; i++)
{
if (langs[i] == self->filter_language)
{
ret = TRUE;
break;
}
}
for (int i = 0; langs[i]; i++)
{
if (langs[i] == self->filter_language)
{
ret = TRUE;
break;
}
}
}
g_object_unref (font);
@@ -405,7 +396,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
return ret;
}
#endif
return TRUE;
}
@@ -549,10 +539,16 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
PangoFontFace *face,
PangoFontDescription *desc)
{
#if defined(HAVE_PANGOFT) && defined(HAVE_HARFBUZZ)
PangoContext *context;
PangoFont *font;
const char *sample;
PangoLanguage **languages;
GHashTable *langs = NULL;
PangoLanguage *default_lang;
PangoLanguage *alt_default = NULL;
PangoLanguage *lang = NULL;
int i;
const char *p;
/* If the user has typed text into the entry, we don't touch it */
if (self->preview_text_set)
@@ -576,88 +572,77 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
font = pango_context_load_font (context, desc);
if (PANGO_IS_FC_FONT (font))
default_lang = pango_language_get_default ();
p = pango_language_to_string (default_lang);
/* The default language tends to be of the form en-us.
* Since fontconfig languages just have the language part,
* and we want to use direct pointer comparisons, we need
* an PangoLanguage for the shortened default language.
*/
if (strchr (p, '-'))
{
PangoLanguage **languages;
GHashTable *langs = NULL;
PangoLanguage *default_lang;
PangoLanguage *alt_default = NULL;
PangoLanguage *lang = NULL;
int i;
const char *p;
char q[10];
for (i = 0; p[i] != '-' && i < 9; i++)
q[i] = p[i];
q[i] = '\0';
alt_default = pango_language_from_string (q);
}
default_lang = pango_language_get_default ();
p = pango_language_to_string (default_lang);
languages = pango_font_get_languages (font);
/* The default language tends to be of the form en-us.
* Since fontconfig languages just have the language part,
* and we want to use direct pointer comparisons, we need
* an PangoLanguage for the shortened default language.
*/
if (strchr (p, '-'))
{
char q[10];
for (i = 0; p[i] != '-' && i < 9; i++)
q[i] = p[i];
q[i] = '\0';
alt_default = pango_language_from_string (q);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
languages = pango_fc_font_get_languages (PANGO_FC_FONT (font));
G_GNUC_END_IGNORE_DEPRECATIONS
/* If the font supports the default language, just use it. */
if (languages)
for (i = 0; languages[i]; i++)
/* If the font supports the default language, just use it. */
if (languages)
for (i = 0; languages[i]; i++)
{
if (languages[i] == default_lang || languages[i] == alt_default)
{
if (languages[i] == default_lang || languages[i] == alt_default)
{
lang = default_lang;
goto found;
}
lang = default_lang;
goto found;
}
}
/* Otherwise, we make a list of representative languages */
langs = g_hash_table_new (NULL, NULL);
/* Otherwise, we make a list of representative languages */
langs = g_hash_table_new (NULL, NULL);
for (i = 0; languages[i]; i++)
if (languages)
for (i = 0; languages[i]; i++)
{
const PangoScript *scripts;
int num, j;
scripts = pango_language_get_scripts (languages[i], &num);
for (j = 0; j < num; j++)
{
lang = pango_script_get_sample_language (scripts[j]);
if (lang)
g_hash_table_add (langs, lang);
}
}
/* ... and compare it to the users default and preferred languages */
if (g_hash_table_contains (langs, default_lang) ||
g_hash_table_contains (langs, alt_default))
{
lang = default_lang;
}
else
{
PangoLanguage **preferred;
preferred = pango_language_get_preferred ();
if (preferred)
{
const PangoScript *scripts;
int num, j;
scripts = pango_language_get_scripts (languages[i], &num);
for (j = 0; j < num; j++)
for (i = 0; preferred[i]; i++)
{
lang = pango_script_get_sample_language (scripts[j]);
if (lang)
g_hash_table_add (langs, lang);
}
}
/* ... and compare it to the users default and preferred languages */
if (g_hash_table_contains (langs, default_lang) ||
g_hash_table_contains (langs, alt_default))
{
lang = default_lang;
}
else
{
PangoLanguage **preferred;
preferred = pango_language_get_preferred ();
if (preferred)
{
for (i = 0; preferred[i]; i++)
if (g_hash_table_contains (langs, preferred[i]))
{
if (g_hash_table_contains (langs, preferred[i]))
{
lang = preferred[i];
break;
}
lang = preferred[i];
break;
}
}
}
g_hash_table_unref (langs);
found:
@@ -667,7 +652,6 @@ found:
}
g_object_unref (font);
#endif
}
@@ -1027,7 +1011,6 @@ axis_free (gpointer v)
g_free (a);
}
#ifdef HAVE_PANGOFT
static void
select_added (GListModel *model,
guint position,
@@ -1051,6 +1034,10 @@ add_languages_from_font (GtkFontChooserWidget *self,
PangoFontDescription *desc;
PangoFont *font;
PangoContext *context;
GtkSelectionModel *model = gtk_list_view_get_model (GTK_LIST_VIEW (self->language_list));
PangoLanguage *default_lang = pango_language_get_default ();
PangoLanguage **langs;
int i;
if (PANGO_IS_FONT_FAMILY (item))
face = pango_font_family_get_face (PANGO_FONT_FAMILY (item), NULL);
@@ -1066,44 +1053,35 @@ add_languages_from_font (GtkFontChooserWidget *self,
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
font = pango_context_load_font (context, desc);
if (PANGO_IS_FC_FONT (font))
langs = pango_font_get_languages (font);
if (langs)
{
GtkSelectionModel *model = gtk_list_view_get_model (GTK_LIST_VIEW (self->language_list));
PangoLanguage *default_lang = pango_language_get_default ();
PangoLanguage **langs;
int i;
for (i = 0; langs[i]; i++)
{
if (!g_hash_table_contains (self->language_table, langs[i]))
{
g_hash_table_add (self->language_table, langs[i]);
if (get_language_name (langs[i]))
{
const char *l = pango_language_to_string (langs[i]);
gulong id = 0;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
langs = pango_fc_font_get_languages (PANGO_FC_FONT (font));
G_GNUC_END_IGNORE_DEPRECATIONS
if (langs)
for (i = 0; langs[i]; i++)
{
if (!g_hash_table_contains (self->language_table, langs[i]))
{
g_hash_table_add (self->language_table, langs[i]);
if (get_language_name (langs[i]))
{
const char *l = pango_language_to_string (langs[i]);
gulong id = 0;
/* Pre-select the default language */
if (pango_language_matches (default_lang, l))
id = g_signal_connect (model, "items-changed", G_CALLBACK (select_added), NULL);
/* Pre-select the default language */
if (pango_language_matches (default_lang, l))
id = g_signal_connect (model, "items-changed", G_CALLBACK (select_added), NULL);
gtk_string_list_append (self->languages, l);
gtk_string_list_append (self->languages, l);
if (id)
g_signal_handler_disconnect (model, id);
}
}
}
if (id)
g_signal_handler_disconnect (model, id);
}
}
}
}
g_object_unref (font);
pango_font_description_free (desc);
}
#endif
static gboolean
gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self);
@@ -1130,7 +1108,6 @@ add_to_fontlist (GtkWidget *widget,
n = gtk_slice_list_model_get_size (model);
#ifdef HAVE_PANGOFT
for (i = n; i < n + 10; i++)
{
gpointer item = g_list_model_get_item (child_model, i);
@@ -1139,7 +1116,6 @@ add_to_fontlist (GtkWidget *widget,
add_languages_from_font (self, item);
g_object_unref (item);
}
#endif
n += 10;
@@ -1179,7 +1155,6 @@ update_fontlist (GtkFontChooserWidget *self)
g_object_unref (model);
}
#ifdef HAVE_PANGOFT
static void
setup_lang_item (GtkSignalListItemFactory *factory,
gpointer item,
@@ -1269,7 +1244,6 @@ setup_language_list (GtkFontChooserWidget *self)
return TRUE;
}
#endif
static void
gtk_font_chooser_widget_init (GtkFontChooserWidget *self)
@@ -1310,12 +1284,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *self)
gtk_custom_filter_set_filter_func (self->user_filter, user_filter_cb, self, NULL);
#ifdef HAVE_PANGOFT
setup_language_list (self);
#else
gtk_widget_hide (GTK_WIDGET (self->language_button));
gtk_widget_hide (GTK_WIDGET (self->language_frame));
#endif
}
/**
@@ -1501,26 +1470,23 @@ add_font_variations (GtkFontChooserWidget *fontchooser,
{
GHashTableIter iter;
Axis *axis;
const char *sep = "";
char buf[G_ASCII_DTOSTR_BUF_SIZE];
g_hash_table_iter_init (&iter, fontchooser->axes);
while (g_hash_table_iter_next (&iter, (gpointer *)NULL, (gpointer *)&axis))
{
char tag[5];
double value;
char buf[128];
value = gtk_adjustment_get_value (axis->adjustment);
if (value == axis->default_value)
continue;
tag[0] = (axis->tag >> 24) & 0xff;
tag[1] = (axis->tag >> 16) & 0xff;
tag[2] = (axis->tag >> 8) & 0xff;
tag[3] = (axis->tag >> 0) & 0xff;
tag[4] = '\0';
g_string_append_printf (s, "%s%s=%s", sep, tag, g_ascii_dtostr (buf, sizeof(buf), value));
sep = ",";
hb_variation_to_string (&(hb_variation_t) { axis->tag, value }, buf, sizeof (buf));
if (s->len > 0)
g_string_append_c (s, ',');
g_string_append (s, buf);
}
}
@@ -1549,10 +1515,7 @@ adjustment_changed (GtkAdjustment *adjustment,
static gboolean
should_show_axis (hb_ot_var_axis_info_t *ax)
{
if (ax->flags & HB_OT_VAR_AXIS_FLAG_HIDDEN)
return FALSE;
return TRUE;
return (ax->flags & HB_OT_VAR_AXIS_FLAG_HIDDEN) == 0;
}
static gboolean
@@ -1566,11 +1529,11 @@ static struct {
guint32 tag;
const char *name;
} axis_names[] = {
{ HB_OT_TAG_VAR_AXIS_WIDTH, N_("Width") },
{ HB_OT_TAG_VAR_AXIS_WEIGHT, N_("Weight") },
{ HB_OT_TAG_VAR_AXIS_ITALIC, N_("Italic") },
{ HB_OT_TAG_VAR_AXIS_SLANT, N_("Slant") },
{ HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE, N_("Optical Size") },
{ HB_OT_TAG_VAR_AXIS_WIDTH, NC_("Font variation axis", "Width") },
{ HB_OT_TAG_VAR_AXIS_WEIGHT, NC_("Font variation axis", "Weight") },
{ HB_OT_TAG_VAR_AXIS_ITALIC, NC_("Font variation axis", "Italic") },
{ HB_OT_TAG_VAR_AXIS_SLANT, NC_("Font variation axis", "Slant") },
{ HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE, NC_("Font variation axis", "Optical Size") },
};
static gboolean
@@ -1601,7 +1564,7 @@ add_axis (GtkFontChooserWidget *fontchooser,
{
if (axis_names[i].tag == ax->tag)
{
name = _(axis_names[i].name);
name = g_dpgettext2 (NULL, "Font variation axis", axis_names[i].name);
break;
}
}
@@ -1643,6 +1606,33 @@ add_axis (GtkFontChooserWidget *fontchooser,
return TRUE;
}
#if HB_VERSION_ATLEAST (3, 3, 0)
static void
get_axes_and_values (hb_font_t *font,
unsigned int n_axes,
hb_ot_var_axis_info_t *axes,
float *coords)
{
const float *dcoords;
unsigned int length = n_axes;
hb_ot_var_get_axis_infos (hb_font_get_face (font), 0, &length, axes);
dcoords = hb_font_get_var_coords_design (font, &length);
if (dcoords)
memcpy (coords, dcoords, sizeof (float) * length);
else
{
for (int i = 0; i < n_axes; i++)
{
hb_ot_var_axis_info_t *axis = &axes[i];
coords[axis->axis_index] = axis->default_value;
}
}
}
#else
/* FIXME: This doesn't work if the font has an avar table */
static float
denorm_coord (hb_ot_var_axis_info_t *axis, int coord)
@@ -1655,16 +1645,40 @@ denorm_coord (hb_ot_var_axis_info_t *axis, int coord)
return axis->default_value + r * (axis->max_value - axis->default_value);
}
static void
get_axes_and_values (hb_font_t *font,
unsigned int n_axes,
hb_ot_var_axis_info_t *axes,
float *coords)
{
const int *ncoords;
unsigned int length = n_axes;
hb_ot_var_get_axis_infos (hb_font_get_face (font), 0, &length, axes);
ncoords = hb_font_get_var_coords_normalized (font, &length);
for (int i = 0; i < n_axes; i++)
{
hb_ot_var_axis_info_t *axis = &axes[i];
int idx = axis->axis_index;
if (ncoords)
coords[idx] = denorm_coord (axis, ncoords[idx]);
else
coords[idx] = axis->default_value;
}
}
#endif
static gboolean
gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchooser)
{
PangoFont *pango_font;
hb_font_t *hb_font;
hb_face_t *hb_face;
const int *coords;
unsigned int n_coords;
unsigned int n_axes;
hb_ot_var_axis_info_t *axes;
float *coords;
gboolean has_axis = FALSE;
int i;
@@ -1685,24 +1699,17 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
if (!hb_ot_var_has_data (hb_face))
return FALSE;
coords = hb_font_get_var_coords_normalized (hb_font, &n_coords);
n_axes = hb_ot_var_get_axis_count (hb_face);
axes = g_new0 (hb_ot_var_axis_info_t, n_axes);
hb_ot_var_get_axis_infos (hb_face, 0, &n_axes, axes);
axes = g_alloca (sizeof (hb_ot_var_axis_info_t) * n_axes);
coords = g_alloca (sizeof (float) * n_axes);
get_axes_and_values (hb_font, n_axes, axes, coords);
for (i = 0; i < n_axes; i++)
{
float value;
if (coords && i < n_coords)
value = denorm_coord (&axes[i], coords[i]);
else
value = axes[i].default_value;
if (add_axis (fontchooser, hb_font, &axes[i], value, i + 4))
if (add_axis (fontchooser, hb_font, &axes[i], coords[axes[i].axis_index], i + 4))
has_axis = TRUE;
}
g_free (axes);
g_object_unref (pango_font);
return has_axis;
@@ -1827,11 +1834,12 @@ feat_pressed (GtkGestureClick *gesture,
}
static char *
find_affected_text (hb_tag_t feature_tag,
hb_font_t *hb_font,
hb_tag_t script_tag,
hb_tag_t lang_tag,
int max_chars)
find_affected_text (GtkFontChooserWidget *fontchooser,
hb_tag_t feature_tag,
hb_font_t *hb_font,
hb_tag_t script_tag,
hb_tag_t lang_tag,
int max_chars)
{
hb_face_t *hb_face;
unsigned int script_index = 0;
@@ -1881,24 +1889,35 @@ find_affected_text (hb_tag_t feature_tag,
glyphs_after,
glyphs_output);
gid = -1;
while (hb_set_next (glyphs_input, &gid)) {
hb_codepoint_t ch;
if (n_chars == max_chars)
{
g_string_append (chars, "");
break;
}
for (ch = 0; ch < 0xffff; ch++) {
hb_codepoint_t glyph = 0;
hb_font_get_nominal_glyph (hb_font, ch, &glyph);
if (glyph == gid) {
g_string_append_unichar (chars, (gunichar)ch);
n_chars++;
break;
}
if (!fontchooser->glyphmap)
{
fontchooser->glyphmap = hb_map_create ();
for (hb_codepoint_t ch = 0; ch < 0xffff; ch++)
{
hb_codepoint_t glyph = 0;
if (hb_font_get_nominal_glyph (hb_font, ch, &glyph) &&
!hb_map_has (fontchooser->glyphmap, glyph))
hb_map_set (fontchooser->glyphmap, glyph, ch);
}
}
}
while (hb_set_next (glyphs_input, &gid))
{
hb_codepoint_t ch;
if (n_chars == max_chars)
{
g_string_append (chars, "");
break;
}
ch = hb_map_get (fontchooser->glyphmap, gid);
if (ch != HB_MAP_VALUE_INVALID)
{
g_string_append_unichar (chars, (gunichar)ch);
n_chars++;
}
}
hb_set_destroy (glyphs_input);
}
}
@@ -1907,7 +1926,8 @@ find_affected_text (hb_tag_t feature_tag,
}
static void
update_feature_example (FeatureItem *item,
update_feature_example (GtkFontChooserWidget *fontchooser,
FeatureItem *item,
hb_font_t *hb_font,
hb_tag_t script_tag,
hb_tag_t lang_tag,
@@ -1962,9 +1982,9 @@ update_feature_example (FeatureItem *item,
else if (strcmp (item->name, "frac") == 0)
input = g_strdup ("1/2 2/3 7/8");
else if (strcmp (item->name, "nalt") == 0)
input = find_affected_text (item->tag, hb_font, script_tag, lang_tag, 3);
input = find_affected_text (fontchooser, item->tag, hb_font, script_tag, lang_tag, 3);
else
input = find_affected_text (item->tag, hb_font, script_tag, lang_tag, 10);
input = find_affected_text (fontchooser, item->tag, hb_font, script_tag, lang_tag, 10);
if (input[0] != '\0')
{
@@ -2244,7 +2264,7 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
gtk_widget_show (item->top);
gtk_widget_show (gtk_widget_get_parent (item->top));
update_feature_example (item, hb_font, script_tag, lang_tag, fontchooser->font_desc);
update_feature_example (fontchooser, item, hb_font, script_tag, lang_tag, fontchooser->font_desc);
if (GTK_IS_CHECK_BUTTON (item->feat))
{
@@ -2260,6 +2280,12 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
}
}
}
if (fontchooser->glyphmap)
{
hb_map_destroy (fontchooser->glyphmap);
fontchooser->glyphmap = NULL;
}
}
g_object_unref (pango_font);
@@ -2272,6 +2298,7 @@ update_font_features (GtkFontChooserWidget *fontchooser)
{
GString *s;
GList *l;
char buf[128];
s = g_string_new ("");
@@ -2287,17 +2314,24 @@ update_font_features (GtkFontChooserWidget *fontchooser)
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (item->feat)) &&
strcmp (item->name, "xxxx") != 0)
{
g_string_append_printf (s, "%s\"%s\" %d", s->len > 0 ? ", " : "", item->name, 1);
hb_feature_to_string (&(hb_feature_t) { item->tag, 1, 0, -1 }, buf, sizeof (buf));
if (s->len > 0)
g_string_append_c (s, ',');
g_string_append (s, buf);
}
}
else if (GTK_IS_CHECK_BUTTON (item->feat))
{
guint32 value;
if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (item->feat)))
continue;
g_string_append_printf (s, "%s\"%s\" %d",
s->len > 0 ? ", " : "", item->name,
gtk_check_button_get_active (GTK_CHECK_BUTTON (item->feat)));
value = gtk_check_button_get_active (GTK_CHECK_BUTTON (item->feat));
hb_feature_to_string (&(hb_feature_t) { item->tag, value, 0, -1 }, buf, sizeof (buf));
if (s->len > 0)
g_string_append_c (s, ',');
g_string_append (s, buf);
}
}
@@ -2334,12 +2368,11 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser
if (mask & PANGO_FONT_MASK_SIZE)
{
double font_size = (double) pango_font_description_get_size (fontchooser->font_desc) / PANGO_SCALE;
g_signal_handlers_block_by_func (gtk_range_get_adjustment (GTK_RANGE (fontchooser->size_slider)), size_change_cb, fontchooser);
g_signal_handlers_block_by_func (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(fontchooser->size_spin)), size_change_cb, fontchooser);
/* XXX: This clamps, which can cause it to reloop into here, do we need
* to block its signal handler?
*/
gtk_range_set_value (GTK_RANGE (fontchooser->size_slider), font_size);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (fontchooser->size_spin), font_size);
g_signal_handlers_unblock_by_func (gtk_range_get_adjustment (GTK_RANGE (fontchooser->size_slider)), size_change_cb, fontchooser);
g_signal_handlers_unblock_by_func (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(fontchooser->size_spin)), size_change_cb, fontchooser);
}
if (mask & (PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT |
PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH))
+1 -1
View File
@@ -1317,7 +1317,7 @@ gtk_gl_area_set_auto_render (GtkGLArea *area,
*
* Retrieves the `GdkGLContext` used by @area.
*
* Returns: (transfer none): the `GdkGLContext`
* Returns: (transfer none) (nullable): the `GdkGLContext`
*/
GdkGLContext *
gtk_gl_area_get_context (GtkGLArea *area)
+1 -1
View File
@@ -6519,7 +6519,7 @@ gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
* Creates a `GdkPaintable` representation of the item at @path.
* This image is used for a drag icon.
*
* Returns: (transfer full): a newly-allocated `GdkPaintable` of the drag icon.
* Returns: (transfer full) (nullable): a newly-allocated `GdkPaintable` of the drag icon.
**/
GdkPaintable *
gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
+3 -2
View File
@@ -55,6 +55,7 @@
#include "gtkjoinedmenuprivate.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
/**
@@ -2492,7 +2493,7 @@ gtk_label_class_init (GtkLabelClass *class)
*
* If this property is set to -1, the width will be calculated automatically.
*
* See the section on [text layout](#text-layout) for details of how
* See the section on [text layout](class.Label.html#text-layout) for details of how
* [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
* determine the width of ellipsized and wrapped labels.
*/
@@ -2528,7 +2529,7 @@ gtk_label_class_init (GtkLabelClass *class)
*
* If this property is set to -1, the width will be calculated automatically.
*
* See the section on [text layout](#text-layout) for details of how
* See the section on [text layout](class.Label.html#text-layout) for details of how
* [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
* determine the width of ellipsized and wrapped labels.
*/
+1 -1
View File
@@ -1078,7 +1078,7 @@ gtk_list_box_set_adjustment (GtkListBox *box,
* Gets the adjustment (if any) that the widget uses to
* for vertical scrolling.
*
* Returns: (transfer none): the adjustment
* Returns: (transfer none) (nullable): the adjustment
*/
GtkAdjustment *
gtk_list_box_get_adjustment (GtkListBox *box)
+1 -1
View File
@@ -535,7 +535,7 @@ gtk_lock_button_new (GPermission *permission)
*
* Obtains the `GPermission` object that controls @button.
*
* Returns: (transfer none): the `GPermission` of @button
* Returns: (transfer none) (nullable): the `GPermission` of @button
*/
GPermission *
gtk_lock_button_get_permission (GtkLockButton *button)
+1 -2
View File
@@ -45,8 +45,7 @@
*
* widgets = gtk_widget_observe_children (widget);
*
* controllers = gtk_map_list_model_new (G_TYPE_LIST_MODEL,
* widgets,
* controllers = gtk_map_list_model_new (widgets,
* map_to_controllers,
* NULL, NULL);
*
+4 -2
View File
@@ -1028,6 +1028,7 @@ gtk_menu_button_set_icon_name (GtkMenuButton *menu_button,
*/
gtk_accessible_update_relation (GTK_ACCESSIBLE (menu_button->button),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, menu_button, NULL,
GTK_ACCESSIBLE_RELATION_DESCRIBED_BY, menu_button, NULL,
-1);
image_widget = g_object_new (GTK_TYPE_IMAGE,
@@ -1059,7 +1060,7 @@ gtk_menu_button_set_icon_name (GtkMenuButton *menu_button,
*
* Gets the name of the icon shown in the button.
*
* Returns: the name of the icon shown in the button
* Returns: (nullable): the name of the icon shown in the button
*/
const char *
gtk_menu_button_get_icon_name (GtkMenuButton *menu_button)
@@ -1164,6 +1165,7 @@ gtk_menu_button_set_label (GtkMenuButton *menu_button,
gtk_accessible_update_relation (GTK_ACCESSIBLE (menu_button->button),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, menu_button->label_widget, NULL,
GTK_ACCESSIBLE_RELATION_DESCRIBED_BY, menu_button->label_widget, NULL,
-1);
menu_button->image_widget = NULL;
@@ -1182,7 +1184,7 @@ gtk_menu_button_set_label (GtkMenuButton *menu_button,
*
* Gets the label shown in the button
*
* Returns: the label shown in the button
* Returns: (nullable): the label shown in the button
*/
const char *
gtk_menu_button_get_label (GtkMenuButton *menu_button)
+1 -1
View File
@@ -1873,7 +1873,7 @@ gtk_mount_operation_set_parent (GtkMountOperation *op,
*
* Gets the transient parent used by the `GtkMountOperation`.
*
* Returns: (transfer none): the transient parent for windows shown by @op
* Returns: (transfer none) (nullable): the transient parent for windows shown by @op
*/
GtkWindow *
gtk_mount_operation_get_parent (GtkMountOperation *op)
+1 -1
View File
@@ -396,7 +396,7 @@ gtk_multi_selection_new (GListModel *model)
*
* Returns the underlying model of @self.
*
* Returns: (transfer none): the underlying model
* Returns: (transfer none) (nullable): the underlying model
*/
GListModel *
gtk_multi_selection_get_model (GtkMultiSelection *self)
+1 -1
View File
@@ -267,7 +267,7 @@ gtk_native_get_surface_transform (GtkNative *self,
*
* Finds the `GtkNative` associated with the surface.
*
* Returns: (transfer none): the `GtkNative` that is associated with @surface
* Returns: (transfer none) (nullable): the `GtkNative` that is associated with @surface
*/
GtkNative *
gtk_native_get_for_surface (GdkSurface *surface)
+1 -1
View File
@@ -242,7 +242,7 @@ gtk_no_selection_new (GListModel *model)
*
* Gets the model that @self is wrapping.
*
* Returns: (transfer none): The model being wrapped
* Returns: (transfer none) (nullable): The model being wrapped
*/
GListModel *
gtk_no_selection_get_model (GtkNoSelection *self)
+1 -1
View File
@@ -729,7 +729,7 @@ gtk_password_entry_set_extra_menu (GtkPasswordEntry *entry,
*
* Gets the menu model set with gtk_password_entry_set_extra_menu().
*
* Returns: (transfer none): (nullable): the menu model
* Returns: (transfer none) (nullable): the menu model
*/
GMenuModel *
gtk_password_entry_get_extra_menu (GtkPasswordEntry *entry)
+1 -1
View File
@@ -819,7 +819,7 @@ gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover,
*
* Returns the menu model used to populate the popover.
*
* Returns: (transfer none): the menu model of @popover
* Returns: (transfer none) (nullable): the menu model of @popover
*/
GMenuModel *
gtk_popover_menu_get_menu_model (GtkPopoverMenu *popover)
+1 -1
View File
@@ -746,7 +746,7 @@ gtk_popover_menu_bar_set_menu_model (GtkPopoverMenuBar *bar,
*
* Returns the model from which the contents of @bar are taken.
*
* Returns: (transfer none): a `GMenuModel`
* Returns: (transfer none) (nullable): a `GMenuModel`
*/
GMenuModel *
gtk_popover_menu_bar_get_menu_model (GtkPopoverMenuBar *bar)
+9 -9
View File
@@ -154,7 +154,7 @@ gtk_print_settings_copy (GtkPrintSettings *other)
*
* Looks up the string value associated with @key.
*
* Returns: the string value for @key
* Returns: (nullable): the string value for @key
*/
const char *
gtk_print_settings_get (GtkPrintSettings *settings,
@@ -480,7 +480,7 @@ gtk_print_settings_foreach (GtkPrintSettings *settings,
* Convenience function to obtain the value of
* %GTK_PRINT_SETTINGS_PRINTER.
*
* Returns: the printer name
* Returns: (nullable): the printer name
*/
const char *
gtk_print_settings_get_printer (GtkPrintSettings *settings)
@@ -574,7 +574,7 @@ gtk_print_settings_set_orientation (GtkPrintSettings *settings,
* Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
* converted to a `GtkPaperSize`.
*
* Returns: the paper size
* Returns: (nullable): the paper size
*/
GtkPaperSize *
gtk_print_settings_get_paper_size (GtkPrintSettings *settings)
@@ -779,7 +779,7 @@ gtk_print_settings_set_collate (GtkPrintSettings *settings,
*
* Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
*
* Returns: whether to reverse the order of the printed pages
* Returns: whether to reverse the order of the printed pages
*/
gboolean
gtk_print_settings_get_reverse (GtkPrintSettings *settings)
@@ -1415,7 +1415,7 @@ gtk_print_settings_set_page_ranges (GtkPrintSettings *settings,
*
* Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
*
* Returns: the default source
* Returns: (nullable): the default source
*/
const char *
gtk_print_settings_get_default_source (GtkPrintSettings *settings)
@@ -1445,7 +1445,7 @@ gtk_print_settings_set_default_source (GtkPrintSettings *settings,
*
* The set of media types is defined in PWG 5101.1-2002 PWG.
*
* Returns: the media type
* Returns: (nullable): the media type
*/
const char *
gtk_print_settings_get_media_type (GtkPrintSettings *settings)
@@ -1475,7 +1475,7 @@ gtk_print_settings_set_media_type (GtkPrintSettings *settings,
*
* Gets the value of %GTK_PRINT_SETTINGS_DITHER.
*
* Returns: the dithering that is used
* Returns: (nullable): the dithering that is used
*/
const char *
gtk_print_settings_get_dither (GtkPrintSettings *settings)
@@ -1503,7 +1503,7 @@ gtk_print_settings_set_dither (GtkPrintSettings *settings,
*
* Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
*
* Returns: the finishings
* Returns: (nullable): the finishings
*/
const char *
gtk_print_settings_get_finishings (GtkPrintSettings *settings)
@@ -1531,7 +1531,7 @@ gtk_print_settings_set_finishings (GtkPrintSettings *settings,
*
* Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
*
* Returns: the output bin
* Returns: (nullable): the output bin
*/
const char *
gtk_print_settings_get_output_bin (GtkPrintSettings *settings)
+2 -2
View File
@@ -130,7 +130,7 @@ gtk_scrollable_default_init (GtkScrollableInterface *iface)
*
* Retrieves the `GtkAdjustment` used for horizontal scrolling.
*
* Returns: (transfer none): horizontal `GtkAdjustment`.
* Returns: (transfer none) (nullable): horizontal `GtkAdjustment`.
*/
GtkAdjustment *
gtk_scrollable_get_hadjustment (GtkScrollable *scrollable)
@@ -174,7 +174,7 @@ gtk_scrollable_set_hadjustment (GtkScrollable *scrollable,
*
* Retrieves the `GtkAdjustment` used for vertical scrolling.
*
* Returns: (transfer none): vertical `GtkAdjustment`.
* Returns: (transfer none) (nullable): vertical `GtkAdjustment`.
*/
GtkAdjustment *
gtk_scrollable_get_vadjustment (GtkScrollable *scrollable)
+2 -2
View File
@@ -461,9 +461,9 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
* @minimum: (out) (optional): location to store the minimum size
* @natural: (out) (optional): location to store the natural size
* @minimum_baseline: (out) (optional): location to store the baseline
* position for the minimum size
* position for the minimum size, or -1 to report no baseline
* @natural_baseline: (out) (optional): location to store the baseline
* position for the natural size
* position for the natural size, or -1 to report no baseline
*
* Measures @widget in the orientation @orientation and for the given @for_size.
*
+1 -1
View File
@@ -346,7 +346,7 @@ gtk_text_mark_get_deleted (GtkTextMark *mark)
*
* Returns %NULL if the mark is deleted.
*
* Returns: (transfer none): the marks `GtkTextBuffer`
* Returns: (transfer none) (nullable): the marks `GtkTextBuffer`
*/
GtkTextBuffer*
gtk_text_mark_get_buffer (GtkTextMark *mark)
+9 -1
View File
@@ -148,6 +148,14 @@
* # Accessibility
*
* `GtkWindow` uses the %GTK_ACCESSIBLE_ROLE_WINDOW role.
*
* # Actions
*
* `GtkWindow` defines a set of built-in actions:
* - `default.activate`: Activate the default widget.
* - `window.minimize`: Minimize the window.
* - `window.toggle-maximized`: Maximize or restore the window.
* - `window.close`: Close the window.
*/
#define MENU_BAR_ACCEL GDK_KEY_F10
@@ -1200,7 +1208,7 @@ gtk_window_class_init (GtkWindowClass *klass)
/**
* GtkWindow|window.minimize:
*
* Close the window.
* Minimize the window.
*/
gtk_widget_class_install_action (widget_class, "window.minimize", NULL,
gtk_window_activate_minimize);
+5 -4
View File
@@ -108,10 +108,11 @@ gtk_inspector_init (void)
void
gtk_inspector_register_extension (void)
{
if (extension_point == NULL) {
extension_point = g_io_extension_point_register ("gtk-inspector-page");
g_io_extension_point_set_required_type (extension_point, GTK_TYPE_WIDGET);
}
if (extension_point == NULL)
{
extension_point = g_io_extension_point_register ("gtk-inspector-page");
g_io_extension_point_set_required_type (extension_point, GTK_TYPE_WIDGET);
}
}
// vim: set et sw=2 ts=2:
+16 -2
View File
@@ -18,6 +18,7 @@
#include <hb-ot.h>
#include "language-names.h"
#include "gtkprivate.h"
#ifndef ISO_CODES_PREFIX
#define ISO_CODES_PREFIX "/usr"
@@ -200,11 +201,22 @@ languages_variant_init (const char *variant)
char *filename;
GError *error;
bindtextdomain (variant, ISO_CODES_LOCALESDIR);
char *iso_codes_datadir;
char *iso_codes_localedir;
#ifdef G_OS_WIN32
iso_codes_datadir = g_build_filename (_gtk_get_datadir (), "xml", "iso-codes", NULL);
iso_codes_localedir = _gtk_get_localedir ();
#else
iso_codes_datadir = g_strdup (ISO_CODES_DATADIR);
iso_codes_localedir = g_strdup (ISO_CODES_LOCALESDIR);
#endif
bindtextdomain (variant, iso_codes_localedir);
bind_textdomain_codeset (variant, "UTF-8");
error = NULL;
filename = g_strconcat (ISO_CODES_DATADIR, "/", variant, ".xml", NULL);
filename = g_strconcat (iso_codes_datadir, "/", variant, ".xml", NULL);
res = g_file_get_contents (filename, &buf, &buf_len, &error);
if (res)
{
@@ -230,6 +242,8 @@ languages_variant_init (const char *variant)
g_free (filename);
g_free (buf);
g_free (iso_codes_datadir);
g_free (iso_codes_localedir);
}
static void
+5
View File
@@ -883,6 +883,7 @@ if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.
depfile : 'gtk.gresource.d',
command : [glib_compile_resources,
'--generate',
'--internal',
'--target=@OUTPUT@',
'--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(),
@@ -897,6 +898,7 @@ if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.
depfile : 'gtkresources.c.d',
command : [glib_compile_resources,
'--generate-source',
'--internal',
'--target=@OUTPUT@',
'--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(),
@@ -913,6 +915,7 @@ if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.
depfile : 'gtkresources.h.d',
command : [glib_compile_resources,
'--generate-header',
'--internal',
'--target=@OUTPUT@',
'--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(),
@@ -927,6 +930,7 @@ if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.
input : gtk_gresource,
output : 'gtkresources_blob.o',
command : [ld,
'-z', 'noexecstack',
'-r',
'-b','binary',
'@INPUT@',
@@ -937,6 +941,7 @@ if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.
input : gtk_resources_binary,
output : 'gtkresources_blob2.o',
command : [objcopy,
'--strip-all',
'--add-symbol','_gtk_resource_data=.data:0',
'@INPUT@',
'@OUTPUT@'])
-1
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkSingleSelection" id="selection">
<property name="autoselect">0</property>
<signal name="notify::selected-item" handler="selection_changed_cb" object="GtkFontChooserWidget" swapped="0"/>
<signal name="items-changed" handler="rows_changed_cb" object="GtkFontChooserWidget" swapped="1"/>
<property name="model">
+2 -2
View File
@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.5.1',
version: '4.6.0',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
@@ -614,7 +614,7 @@ if win32_enabled
else
pc_gdk_extra_libs += ['-Wl,-luuid']
endif
pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32']
pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32', '-lhid']
# Check whether libepoxy is built with EGL support on Windows
endif
+248 -232
View File
File diff suppressed because it is too large Load Diff
+268 -283
View File
File diff suppressed because it is too large Load Diff
+3792 -5547
View File
File diff suppressed because it is too large Load Diff
+241 -173
View File
File diff suppressed because it is too large Load Diff
+257 -204
View File
File diff suppressed because it is too large Load Diff
+35 -30
View File
@@ -12,8 +12,8 @@ msgid ""
msgstr ""
"Project-Id-Version: 3.10\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2021-12-27 13:54+0000\n"
"PO-Revision-Date: 2021-12-27 22:51+0000\n"
"POT-Creation-Date: 2022-01-04 11:18+0000\n"
"PO-Revision-Date: 2022-01-04 14:12+0000\n"
"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
"Language-Team: Português <https://l10n.gnome.org/teams/pt/>\n"
"Language: pt\n"
@@ -2125,7 +2125,7 @@ msgstr "Já existe um ficheiro com esse nome"
#: gtk/gtkmountoperation.c:610 gtk/gtkpagesetupunixdialog.c:283
#: gtk/gtkprintbackend.c:642 gtk/gtkprinteroptionwidget.c:713
#: gtk/gtkprintunixdialog.c:667 gtk/gtkprintunixdialog.c:823
#: gtk/gtkwindow.c:6218 gtk/inspector/css-editor.c:248
#: gtk/gtkwindow.c:6226 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1706
msgid "_Cancel"
msgstr "_Cancelar"
@@ -2215,7 +2215,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Se eliminar um item, estará permanentemente perdido."
#: gtk/gtkfilechooserwidget.c:1210 gtk/gtkfilechooserwidget.c:1826
#: gtk/gtklabel.c:5644 gtk/gtktext.c:6064 gtk/gtktextview.c:8920
#: gtk/gtklabel.c:5645 gtk/gtktext.c:6064 gtk/gtktextview.c:8920
msgid "_Delete"
msgstr "_Eliminar"
@@ -2336,7 +2336,7 @@ msgstr "Programa"
msgid "Audio"
msgstr "Áudio"
#: gtk/gtkfilechooserwidget.c:4303 gtk/gtkfontbutton.c:602
#: gtk/gtkfilechooserwidget.c:4303 gtk/gtkfontbutton.c:604
#: gtk/inspector/visual.ui:170
msgid "Font"
msgstr "Letra"
@@ -2421,60 +2421,65 @@ msgstr "Acedido"
msgid "Sans 12"
msgstr "Sans 12"
#: gtk/gtkfontbutton.c:506 gtk/gtkfontbutton.c:626
#: gtk/gtkfontbutton.c:508 gtk/gtkfontbutton.c:628
msgid "Pick a Font"
msgstr "Escolha uma letra"
#: gtk/gtkfontbutton.c:1363
#: gtk/gtkfontbutton.c:1365
msgctxt "font"
msgid "None"
msgstr "Nenhuma"
#: gtk/gtkfontchooserwidget.c:1569
#: gtk/gtkfontchooserwidget.c:1532
msgctxt "Font variation axis"
msgid "Width"
msgstr "Largura"
#: gtk/gtkfontchooserwidget.c:1570
#: gtk/gtkfontchooserwidget.c:1533
msgctxt "Font variation axis"
msgid "Weight"
msgstr "Peso"
#: gtk/gtkfontchooserwidget.c:1571
#: gtk/gtkfontchooserwidget.c:1534
msgctxt "Font variation axis"
msgid "Italic"
msgstr "Itálico"
#: gtk/gtkfontchooserwidget.c:1572
#: gtk/gtkfontchooserwidget.c:1535
msgctxt "Font variation axis"
msgid "Slant"
msgstr "Inclinado"
#: gtk/gtkfontchooserwidget.c:1573
#: gtk/gtkfontchooserwidget.c:1536
msgctxt "Font variation axis"
msgid "Optical Size"
msgstr "Tamanho ótico"
#: gtk/gtkfontchooserwidget.c:2120
#: gtk/gtkfontchooserwidget.c:2140
msgid "Default"
msgstr "Predefinição"
#: gtk/gtkfontchooserwidget.c:2166
#: gtk/gtkfontchooserwidget.c:2186
msgid "Ligatures"
msgstr "Ligaduras"
#: gtk/gtkfontchooserwidget.c:2167
#: gtk/gtkfontchooserwidget.c:2187
msgid "Letter Case"
msgstr "Caixa de letra"
#: gtk/gtkfontchooserwidget.c:2168
#: gtk/gtkfontchooserwidget.c:2188
msgid "Number Case"
msgstr "Caixa de número"
#: gtk/gtkfontchooserwidget.c:2169
#: gtk/gtkfontchooserwidget.c:2189
msgid "Number Spacing"
msgstr "Espaçamento de número"
#: gtk/gtkfontchooserwidget.c:2170
#: gtk/gtkfontchooserwidget.c:2190
msgid "Number Formatting"
msgstr "Formatação de número"
#: gtk/gtkfontchooserwidget.c:2171
#: gtk/gtkfontchooserwidget.c:2191
msgid "Character Variants"
msgstr "Variantes de carácter"
@@ -2482,27 +2487,27 @@ msgstr "Variantes de carácter"
msgid "OpenGL context creation failed"
msgstr "Falha ao criar o contexto OpenGL"
#: gtk/gtklabel.c:5641 gtk/gtktext.c:6052 gtk/gtktextview.c:8908
#: gtk/gtklabel.c:5642 gtk/gtktext.c:6052 gtk/gtktextview.c:8908
msgid "Cu_t"
msgstr "Cor_tar"
#: gtk/gtklabel.c:5642 gtk/gtktext.c:6056 gtk/gtktextview.c:8912
#: gtk/gtklabel.c:5643 gtk/gtktext.c:6056 gtk/gtktextview.c:8912
msgid "_Copy"
msgstr "_Copiar"
#: gtk/gtklabel.c:5643 gtk/gtktext.c:6060 gtk/gtktextview.c:8916
#: gtk/gtklabel.c:5644 gtk/gtktext.c:6060 gtk/gtktextview.c:8916
msgid "_Paste"
msgstr "Co_lar"
#: gtk/gtklabel.c:5649 gtk/gtktext.c:6073 gtk/gtktextview.c:8941
#: gtk/gtklabel.c:5650 gtk/gtktext.c:6073 gtk/gtktextview.c:8941
msgid "Select _All"
msgstr "Selecionar _tudo"
#: gtk/gtklabel.c:5654
#: gtk/gtklabel.c:5655
msgid "_Open Link"
msgstr "_Abrir Ligação"
#: gtk/gtklabel.c:5658
#: gtk/gtklabel.c:5659
msgid "Copy _Link Address"
msgstr "Copiar endereço da _ligação"
@@ -2551,7 +2556,7 @@ msgstr ""
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: gtk/gtkmain.c:768
#: gtk/gtkmain.c:771
msgid "default:LTR"
msgstr "default:LTR"
@@ -2604,7 +2609,7 @@ msgid "%d:%02d"
msgstr "%d:%02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
#: gtk/gtkprintbackend.c:643 gtk/gtkwindow.c:6219
#: gtk/gtkprintbackend.c:643 gtk/gtkwindow.c:6227
msgid "_OK"
msgstr "_Aceitar"
@@ -3506,12 +3511,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:6206
#: gtk/gtkwindow.c:6214
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Deseja usar o Inspetor GTK?"
#: gtk/gtkwindow.c:6208
#: gtk/gtkwindow.c:6216
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@@ -3522,7 +3527,7 @@ msgstr ""
"estado interno de qualquer aplicação GTK. Usá-lo pode fazer que a aplicação "
"se encerre ou falhe."
#: gtk/gtkwindow.c:6213
#: gtk/gtkwindow.c:6221
msgid "Dont show this message again"
msgstr "Não mostrar esta mensagem novamente"
+2860 -3137
View File
File diff suppressed because it is too large Load Diff
+36 -28
View File
@@ -4,13 +4,13 @@
# Maxim Dziumanenko <dziumanenko@gmail.com>, 2004-2010.
# wanderlust <wanderlust@ukr.net>, 2009.
# Daniel Korostil <ted.korostiled@gmail.com>, 2013, 2014, 2015, 2016.
# Yuri Chornoivan <yurchor@ukr.net>, 2014, 2020, 2021.
# Yuri Chornoivan <yurchor@ukr.net>, 2014, 2020, 2021, 2022.
msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2021-12-27 13:54+0000\n"
"PO-Revision-Date: 2021-12-27 16:07+0200\n"
"POT-Creation-Date: 2022-01-03 02:53+0000\n"
"PO-Revision-Date: 2022-01-03 22:50+0200\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
"Language: uk\n"
@@ -2126,7 +2126,7 @@ msgstr "Файл з такою назвою вже існує"
#: gtk/gtkmountoperation.c:610 gtk/gtkpagesetupunixdialog.c:283
#: gtk/gtkprintbackend.c:642 gtk/gtkprinteroptionwidget.c:713
#: gtk/gtkprintunixdialog.c:667 gtk/gtkprintunixdialog.c:823
#: gtk/gtkwindow.c:6218 gtk/inspector/css-editor.c:248
#: gtk/gtkwindow.c:6226 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1706
msgid "_Cancel"
msgstr "_Скасувати"
@@ -2336,7 +2336,7 @@ msgstr "Програма"
msgid "Audio"
msgstr "Звук"
#: gtk/gtkfilechooserwidget.c:4303 gtk/gtkfontbutton.c:602
#: gtk/gtkfilechooserwidget.c:4303 gtk/gtkfontbutton.c:604
#: gtk/inspector/visual.ui:170
msgid "Font"
msgstr "Шрифт"
@@ -2420,60 +2420,70 @@ msgstr "Дозволено"
msgid "Sans 12"
msgstr "Sans 12"
#: gtk/gtkfontbutton.c:506 gtk/gtkfontbutton.c:626
#: gtk/gtkfontbutton.c:508 gtk/gtkfontbutton.c:628
msgid "Pick a Font"
msgstr "Виберіть шрифт"
#: gtk/gtkfontbutton.c:1363
#: gtk/gtkfontbutton.c:1365
msgctxt "font"
msgid "None"
msgstr "Немає"
#: gtk/gtkfontchooserwidget.c:1569
#: gtk/gtkfontchooserwidget.c:1532
#| msgid "Width"
msgctxt "Font variation axis"
msgid "Width"
msgstr "Ширина"
#: gtk/gtkfontchooserwidget.c:1570
#: gtk/gtkfontchooserwidget.c:1533
#| msgid "Weight"
msgctxt "Font variation axis"
msgid "Weight"
msgstr "Вага"
#: gtk/gtkfontchooserwidget.c:1571
#: gtk/gtkfontchooserwidget.c:1534
#| msgid "Italic"
msgctxt "Font variation axis"
msgid "Italic"
msgstr "Курсив"
#: gtk/gtkfontchooserwidget.c:1572
#: gtk/gtkfontchooserwidget.c:1535
#| msgid "Slant"
msgctxt "Font variation axis"
msgid "Slant"
msgstr "Нахил"
#: gtk/gtkfontchooserwidget.c:1573
#: gtk/gtkfontchooserwidget.c:1536
#| msgid "Optical Size"
msgctxt "Font variation axis"
msgid "Optical Size"
msgstr "Оптичний розмір"
#: gtk/gtkfontchooserwidget.c:2120
#: gtk/gtkfontchooserwidget.c:2140
msgid "Default"
msgstr "Типово"
#: gtk/gtkfontchooserwidget.c:2166
#: gtk/gtkfontchooserwidget.c:2186
msgid "Ligatures"
msgstr "Лігатури"
#: gtk/gtkfontchooserwidget.c:2167
#: gtk/gtkfontchooserwidget.c:2187
msgid "Letter Case"
msgstr "Розмір літер"
#: gtk/gtkfontchooserwidget.c:2168
#: gtk/gtkfontchooserwidget.c:2188
msgid "Number Case"
msgstr "Розмір цифр"
#: gtk/gtkfontchooserwidget.c:2169
#: gtk/gtkfontchooserwidget.c:2189
msgid "Number Spacing"
msgstr "Інтервали між цифрами"
#: gtk/gtkfontchooserwidget.c:2170
#: gtk/gtkfontchooserwidget.c:2190
msgid "Number Formatting"
msgstr "Форматування чисел"
#: gtk/gtkfontchooserwidget.c:2171
#: gtk/gtkfontchooserwidget.c:2191
msgid "Character Variants"
msgstr "Варіанти символів"
@@ -2550,7 +2560,7 @@ msgstr ""
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: gtk/gtkmain.c:768
#: gtk/gtkmain.c:771
msgid "default:LTR"
msgstr "default:LTR"
@@ -2603,7 +2613,7 @@ msgid "%d:%02d"
msgstr "%d:%02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
#: gtk/gtkprintbackend.c:643 gtk/gtkwindow.c:6219
#: gtk/gtkprintbackend.c:643 gtk/gtkwindow.c:6227
msgid "_OK"
msgstr "_Гаразд"
@@ -2942,7 +2952,7 @@ msgstr "_Додати до закладок"
#: gtk/gtkplacessidebar.c:3244
msgid "_Remove"
msgstr "В_лучити"
msgstr "Ви_лучити"
#: gtk/gtkplacessidebar.c:3260 gtk/gtkplacesview.c:1692
msgid "_Mount"
@@ -3504,12 +3514,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:6206
#: gtk/gtkwindow.c:6214
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Бажаєте використовувати інспектор GTK?"
#: gtk/gtkwindow.c:6208
#: gtk/gtkwindow.c:6216
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@@ -3520,7 +3530,7 @@ msgstr ""
"редагувати внутрішні частини будь-які програми GTK. Його використання може "
"спричинити збої в програмі."
#: gtk/gtkwindow.c:6213
#: gtk/gtkwindow.c:6221
msgid "Dont show this message again"
msgstr "Не показувати це повідомлення надалі"
@@ -3596,7 +3606,6 @@ msgid "Show"
msgstr "Показати"
#: gtk/inspector/clipboard.c:228
#| msgid "Copy to clipboard"
msgid "Hover to load"
msgstr "Наведення для завантаження"
@@ -3617,8 +3626,7 @@ msgstr "віддалений"
#: gtk/inspector/clipboard.ui:31
msgid "Drag and hold here"
msgstr ""
"Перетягніть і затримайте тут"
msgstr "Перетягніть і затримайте тут"
#: gtk/inspector/clipboard.ui:75 gtk/inspector/window.ui:574
msgid "Clipboard"
@@ -1 +1 @@
invalid5.ui:3:1 Required GTK version 5.10, current version is 4.5
invalid5.ui:3:1 Required GTK version 5.10, current version is 4.6