Compare commits

..

1 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
35 changed files with 634 additions and 637 deletions
+6 -2
View File
@@ -45,7 +45,9 @@
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="label" translatable="yes">Font Features</property>
<property name="attributes" translatable="yes">0 -1 weight bold</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
@@ -73,7 +75,9 @@
<object class="GtkLabel" id="variations_heading">
<property name="label" translatable="yes">Font Variations</property>
<property name="xalign">0</property>
<property name="attributes" translatable="yes">0 -1 weight bold</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
+4 -1
View File
@@ -286,7 +286,7 @@ requires that GTK is compiled with support for that backend.
The following backends can be selected, provided they are
included in the GDK libraries you are using:
`macos`
`quartz`
: Selects the native Quartz backend
`win32`
@@ -336,6 +336,9 @@ using and the GDK backend supports them:
`gl`
: Selects the "gl" OpenGL renderer
`ngl`
: Selects the "ngl" OpenGL renderer
`vulkan`
: Selects the Vulkan renderer
+2 -1
View File
@@ -185,7 +185,8 @@ gdk_gl_context_dispose (GObject *gobject)
if (priv->egl_context != NULL)
{
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_surface_get_display (surface);
EGLDisplay *egl_display = gdk_display_get_egl_display (display);
if (eglGetCurrentContext () == priv->egl_context)
+1 -2
View File
@@ -383,8 +383,7 @@ gdk_gl_texture_determine_format (GdkGLTexture *self)
* which will happen when the GdkTexture object is finalized, or due to
* an explicit call of [method@Gdk.GLTexture.release].
*
* Return value: (transfer full) (type GdkGLTexture): A newly-created
* `GdkTexture`
* Return value: (transfer full): A newly-created `GdkTexture`
*/
GdkTexture *
gdk_gl_texture_new (GdkGLContext *context,
+2 -2
View File
@@ -133,10 +133,10 @@ gdk_memory_sanitize (GBytes *bytes,
*
* Creates a new texture for a blob of image data.
*
* The `GBytes` must contain @stride × @height pixels
* The `GBytes` must contain @stride x @height pixels
* in the given format.
*
* Returns: (type GdkMemoryTexture): A newly-created `GdkTexture`
* Returns: A newly-created `GdkTexture`
*/
GdkTexture *
gdk_memory_texture_new (int width,
+9 -9
View File
@@ -25,14 +25,14 @@
* multiple frames, and will be used for a long time.
*
* There are various ways to create `GdkTexture` objects from a
* [class@GdkPixbuf.Pixbuf], or a Cairo surface, or other pixel data.
* `GdkPixbuf`, or a Cairo surface, or other pixel data.
*
* The ownership of the pixel data is transferred to the `GdkTexture`
* instance; you can only make a copy of it, via [method@Gdk.Texture.download].
*
* `GdkTexture` is an immutable object: That means you cannot change
* anything about it other than increasing the reference count via
* [method@GObject.Object.ref], and consequently, it is a thread-safe object.
* g_object_ref().
*/
#include "config.h"
@@ -346,7 +346,7 @@ gdk_texture_init (GdkTexture *self)
*
* Creates a new texture object representing the surface.
*
* @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`.
* @surface must be an image surface with format CAIRO_FORMAT_ARGB32.
*
* Returns: a new `GdkTexture`
*/
@@ -384,7 +384,7 @@ gdk_texture_new_for_surface (cairo_surface_t *surface)
* Creates a new texture object representing the `GdkPixbuf`.
*
* This function is threadsafe, so that you can e.g. use GTask
* and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
* and g_task_run_in_thread() to avoid blocking the main thread
* while loading a big image.
*
* Returns: a new `GdkTexture`
@@ -430,7 +430,7 @@ gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf)
* [ctor@Gdk.Texture.new_from_file] to load it.
*
* This function is threadsafe, so that you can e.g. use GTask
* and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
* and g_task_run_in_thread() to avoid blocking the main thread
* while loading a big image.
*
* Return value: A newly-created `GdkTexture`
@@ -472,7 +472,7 @@ gdk_texture_new_from_resource (const char *resource_path)
* If %NULL is returned, then @error will be set.
*
* This function is threadsafe, so that you can e.g. use GTask
* and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
* and g_task_run_in_thread() to avoid blocking the main thread
* while loading a big image.
*
* Return value: A newly-created `GdkTexture`
@@ -565,7 +565,7 @@ gdk_texture_new_from_bytes_pixbuf (GBytes *bytes,
* If %NULL is returned, then @error will be set.
*
* This function is threadsafe, so that you can e.g. use GTask
* and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
* and g_task_run_in_thread() to avoid blocking the main thread
* while loading a big image.
*
* Return value: A newly-created `GdkTexture`
@@ -611,7 +611,7 @@ gdk_texture_new_from_bytes (GBytes *bytes,
* If %NULL is returned, then @error will be set.
*
* This function is threadsafe, so that you can e.g. use GTask
* and [method@Gio.Task.run_in_thread] to avoid blocking the main thread
* and g_task_run_in_thread() to avoid blocking the main thread
* while loading a big image.
*
* Return value: A newly-created `GdkTexture`
@@ -796,7 +796,7 @@ gdk_texture_get_render_data (GdkTexture *self,
*
* This is a utility function intended for debugging and testing.
* If you want more control over formats, proper error handling or
* want to store to a [iface@Gio.File] or other location, you might want to
* want to store to a `GFile` or other location, you might want to
* use [method@Gdk.Texture.save_to_png_bytes] or look into the
* gdk-pixbuf library.
*
+16
View File
@@ -222,7 +222,11 @@ gdk_load_png (GBytes *bytes,
case PNG_COLOR_TYPE_RGB_ALPHA:
if (depth == 8)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
format = GDK_MEMORY_R8G8B8A8;
#elif G_BYTE_ORDER == G_BIG_ENDIAN
format = GDK_MEMORY_A8B8G8R8;
#endif
}
else
{
@@ -232,7 +236,11 @@ gdk_load_png (GBytes *bytes,
case PNG_COLOR_TYPE_RGB:
if (depth == 8)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
format = GDK_MEMORY_R8G8B8;
#elif G_BYTE_ORDER == G_BIG_ENDIAN
format = GDK_MEMORY_B8G8R8;
#endif
}
else if (depth == 16)
{
@@ -317,14 +325,22 @@ gdk_save_png (GdkTexture *texture)
case GDK_MEMORY_A8R8G8B8:
case GDK_MEMORY_R8G8B8A8:
case GDK_MEMORY_A8B8G8R8:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
format = GDK_MEMORY_R8G8B8A8;
#elif G_BYTE_ORDER == G_BIG_ENDIAN
format = GDK_MEMORY_A8B8G8R8;
#endif
png_format = PNG_COLOR_TYPE_RGB_ALPHA;
depth = 8;
break;
case GDK_MEMORY_R8G8B8:
case GDK_MEMORY_B8G8R8:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
format = GDK_MEMORY_R8G8B8;
#elif G_BYTE_ORDER == G_BIG_ENDIAN
format = GDK_MEMORY_B8G8R8;
#endif
png_format = PNG_COLOR_TYPE_RGB;
depth = 8;
break;
+22 -16
View File
@@ -118,6 +118,7 @@ struct _GdkWaylandSurface
unsigned int mapped : 1;
unsigned int awaiting_frame : 1;
unsigned int awaiting_frame_frozen : 1;
unsigned int is_drag_surface : 1;
int pending_buffer_offset_x;
int pending_buffer_offset_y;
@@ -779,22 +780,11 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
return;
}
if (!impl->display_server.outputs)
scale = 1;
for (l = impl->display_server.outputs; l != NULL; l = l->next)
{
scale = impl->scale;
}
else
{
scale = 1;
for (l = impl->display_server.outputs; l != NULL; l = l->next)
{
struct wl_output *output = l->data;
uint32_t output_scale;
output_scale = gdk_wayland_display_get_output_scale (display_wayland,
output);
scale = MAX (scale, output_scale);
}
guint32 output_scale = gdk_wayland_display_get_output_scale (display_wayland, l->data);
scale = MAX (scale, output_scale);
}
/* Notify app that scale changed */
@@ -2835,12 +2825,27 @@ find_grab_input_seat (GdkSurface *surface,
return NULL;
}
static gboolean
should_be_mapped (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
/* Don't map crazy temp that GTK uses for internal X11 shenanigans. */
if (GDK_IS_DRAG_SURFACE (surface) && surface->x < 0 && surface->y < 0)
return FALSE;
if (impl->is_drag_surface)
return FALSE;
return TRUE;
}
static void
gdk_wayland_surface_map_toplevel (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!GDK_IS_WAYLAND_TOPLEVEL (surface))
if (!should_be_mapped (surface))
return;
if (impl->mapped)
@@ -4698,6 +4703,7 @@ create_dnd_surface (GdkDisplay *display)
GDK_SURFACE_TEMP,
NULL,
0, 0, 100, 100);
GDK_WAYLAND_SURFACE (surface)->is_drag_surface = TRUE;
return surface;
}
+1 -6
View File
@@ -289,15 +289,10 @@ gsk_renderer_is_realized (GskRenderer *renderer)
*
* Since GTK 4.6, the surface may be `NULL`, which allows using
* renderers without having to create a surface.
*
* Note that it is mandatory to call [method@Gsk.Renderer.unrealize] before
* destroying the renderer.
*
* Returns: Whether the renderer was successfully realized
*/
gboolean
gsk_renderer_realize (GskRenderer *renderer,
GdkSurface *surface,
GdkSurface *surface,
GError **error)
{
GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
+9 -9
View File
@@ -20,7 +20,7 @@
* GskRenderNode: (ref-func gsk_render_node_ref) (unref-func gsk_render_node_unref) (set-value-func gsk_value_set_render_node) (get-value-func gsk_value_get_render_node)
*
* `GskRenderNode` is the basic block in a scene graph to be
* rendered using [class@Gsk.Renderer].
* rendered using `GskRenderer`.
*
* Each node has a parent, except the top-level node; each node may have
* children nodes.
@@ -424,7 +424,7 @@ gsk_render_node_get_bounds (GskRenderNode *node,
*
* Typically, you'll use this function to implement fallback rendering
* of `GskRenderNode`s on an intermediate Cairo context, instead of using
* the drawing context associated to a [class@Gdk.Surface]'s rendering buffer.
* the drawing context associated to a `GdkSurface`'s rendering buffer.
*
* For advanced nodes that cannot be supported using Cairo, in particular
* for nodes doing 3D operations, this function may fail.
@@ -565,8 +565,8 @@ gsk_render_node_diff (GskRenderNode *node1,
* @filename: (type filename): the file to save it to.
* @error: Return location for a potential error
*
* This function is equivalent to calling [method@Gsk.RenderNode.serialize]
* followed by [func@GLib.file_set_contents].
* This function is equivalent to calling gsk_render_node_serialize()
* followed by g_file_set_contents().
*
* See those two functions for details on the arguments.
*
@@ -603,7 +603,7 @@ gsk_render_node_write_to_file (GskRenderNode *node,
* @error_func: (nullable) (scope call): Callback on parsing errors
* @user_data: (closure error_func): user_data for @error_func
*
* Loads data previously created via [method@Gsk.RenderNode.serialize].
* Loads data previously created via gsk_render_node_serialize().
*
* For a discussion of the supported format, see that function.
*
@@ -623,12 +623,12 @@ gsk_render_node_deserialize (GBytes *bytes,
/**
* gsk_value_set_render_node:
* @value: a [struct@GObject.Value] initialized with type `GSK_TYPE_RENDER_NODE`
* @value: a `GValue` initialized with type `GSK_TYPE_RENDER_NODE`
* @node: a `GskRenderNode`
*
* Stores the given `GskRenderNode` inside `value`.
*
* The [struct@GObject.Value] will acquire a reference to the `node`.
* The `GValue` will acquire a reference to the `node`.
*
* Since: 4.6
*/
@@ -659,7 +659,7 @@ gsk_value_set_render_node (GValue *value,
/**
* gsk_value_take_render_node:
* @value: a [struct@GObject.Value] initialized with type `GSK_TYPE_RENDER_NODE`
* @value: a `GValue` initialized with type `GSK_TYPE_RENDER_NODE`
* @node: (transfer full) (nullable): a `GskRenderNode`
*
* Stores the given `GskRenderNode` inside `value`.
@@ -713,7 +713,7 @@ gsk_value_get_render_node (const GValue *value)
/**
* gsk_value_dup_render_node:
* @value: a [struct@GObject.Value] initialized with type `GSK_TYPE_RENDER_NODE`
* @value: a `GValue` initialized with type `GSK_TYPE_RENDER_NODE`
*
* Retrieves the `GskRenderNode` stored inside the given `value`, and acquires
* a reference to it.
+1 -1
View File
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
* Defines a part of a CSS document.
*
* Because sections are nested into one another, you can use
* [method@CssSection.get_parent] to get the containing region.
* gtk_css_section_get_parent() to get the containing region.
*/
typedef struct _GtkCssSection GtkCssSection;
+11 -11
View File
@@ -44,10 +44,10 @@
/**
* GtkActionableInterface:
* @get_action_name: virtual function for [method@Actionable.get_action_name]
* @set_action_name: virtual function for [method@Actionable.set_action_name]
* @get_action_target_value: virtual function for [method@Actionable.get_action_target_value]
* @set_action_target_value: virtual function for [method@Actionable.set_action_target_value]
* @get_action_name: virtual function for gtk_actionable_get_action_name()
* @set_action_name: virtual function for gtk_actionable_set_action_name()
* @get_action_target_value: virtual function for gtk_actionable_get_action_target_value()
* @set_action_target_value: virtual function for gtk_actionable_set_action_target_value()
*
* The interface vtable for `GtkActionable`.
**/
@@ -100,8 +100,8 @@ gtk_actionable_get_action_name (GtkActionable *actionable)
* located) within the hierarchy of a `GtkApplicationWindow`.
*
* Names are of the form “win.save” or “app.quit” for actions on the
* containing [class@ApplicationWindow] or its associated [class@Application],
* respectively. This is the same form used for actions in the [class@Gio.Menu]
* containing `GtkApplicationWindow` or its associated `GtkApplication`,
* respectively. This is the same form used for actions in the `GMenu`
* associated with the window.
*/
void
@@ -134,7 +134,7 @@ gtk_actionable_get_action_target_value (GtkActionable *actionable)
/**
* gtk_actionable_set_action_target_value: (attributes org.gtk.Method.set_property=action-target)
* @actionable: a `GtkActionable` widget
* @target_value: (nullable): a [struct@GLib.Variant] to set as the target value
* @target_value: (nullable): a `GVariant` to set as the target value
*
* Sets the target value of an actionable widget.
*
@@ -145,7 +145,7 @@ gtk_actionable_get_action_target_value (GtkActionable *actionable)
* Second, it is used to determine if the widget should be rendered as
* “active” — the widget is active if the state is equal to the given target.
*
* Consider the example of associating a set of buttons with a [iface@Gio.Action]
* Consider the example of associating a set of buttons with a `GAction`
* with string state in a typical “radio button” situation. Each button
* will be associated with the same action, but with a different target
* value for that action. Clicking on a particular button will activate
@@ -168,12 +168,12 @@ gtk_actionable_set_action_target_value (GtkActionable *actionable,
/**
* gtk_actionable_set_action_target:
* @actionable: a `GtkActionable` widget
* @format_string: a [struct@GLib.Variant] format string
* @format_string: a GVariant format string
* @...: arguments appropriate for @format_string
*
* Sets the target of an actionable widget.
*
* This is a convenience function that calls [ctor@GLib.Variant.new] for
* This is a convenience function that calls g_variant_new() for
* @format_string and uses the result to call
* [method@Gtk.Actionable.set_action_target_value].
*
@@ -202,7 +202,7 @@ gtk_actionable_set_action_target (GtkActionable *actionable,
* actionable widget.
*
* @detailed_action_name is a string in the format accepted by
* [func@Gio.Action.parse_detailed_name].
* g_action_parse_detailed_name().
*/
void
gtk_actionable_set_detailed_action_name (GtkActionable *actionable,
-34
View File
@@ -2322,40 +2322,6 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
{
g_value_take_boxed (value, g_bytes_new (string, strlen (string)));
}
else if (G_VALUE_HOLDS (value, PANGO_TYPE_FONT_DESCRIPTION))
{
PangoFontDescription *desc;
desc = pango_font_description_from_string (string);
if (desc)
g_value_take_boxed (value, desc);
else
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse '%s' as a %s",
string, G_VALUE_TYPE_NAME (value));
ret = FALSE;
}
}
else if (G_VALUE_HOLDS (value, PANGO_TYPE_ATTR_LIST))
{
PangoAttrList *attrs;
attrs = pango_attr_list_from_string (string);
if (attrs)
g_value_take_boxed (value, attrs);
else
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse '%s' as a %s",
string, G_VALUE_TYPE_NAME (value));
ret = FALSE;
}
}
else
{
g_set_error (error,
+66 -188
View File
@@ -65,25 +65,6 @@ enum {
NUM_PROPERTIES
};
typedef struct _QueuedEvent QueuedEvent;
struct _QueuedEvent
{
GtkDirectoryList *list;
GFile *file;
GFileInfo *info;
GFileMonitorEvent event;
};
static void
free_queued_event (gpointer data)
{
QueuedEvent *event = data;
g_clear_object (&event->file);
g_clear_object (&event->info);
g_free (event);
}
struct _GtkDirectoryList
{
GObject parent_instance;
@@ -97,7 +78,6 @@ struct _GtkDirectoryList
GCancellable *cancellable;
GError *error; /* Error while loading */
GSequence *items; /* Use GPtrArray or GListStore here? */
GQueue events;
};
struct _GtkDirectoryListClass
@@ -160,6 +140,7 @@ gtk_directory_list_set_property (GObject *object,
case PROP_ATTRIBUTES:
gtk_directory_list_set_attributes (self, g_value_get_string (value));
break;
case PROP_FILE:
gtk_directory_list_set_file (self, g_value_get_object (value));
break;
@@ -257,9 +238,6 @@ gtk_directory_list_dispose (GObject *object)
g_clear_error (&self->error);
g_clear_pointer (&self->items, g_sequence_free);
g_queue_foreach (&self->events, (GFunc) free_queued_event, NULL);
g_queue_clear (&self->events);
G_OBJECT_CLASS (gtk_directory_list_parent_class)->dispose (object);
}
@@ -353,7 +331,6 @@ gtk_directory_list_init (GtkDirectoryList *self)
self->items = g_sequence_new (g_object_unref);
self->io_priority = G_PRIORITY_DEFAULT;
self->monitored = TRUE;
g_queue_init (&self->events);
}
/**
@@ -542,123 +519,24 @@ gtk_directory_list_start_loading (GtkDirectoryList *self)
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_LOADING]);
}
static GSequenceIter *
find_file (GSequence *sequence,
GFile *file)
{
GSequenceIter *iter;
for (iter = g_sequence_get_begin_iter (sequence);
!g_sequence_iter_is_end (iter);
iter = g_sequence_iter_next (iter))
{
GFileInfo *item = G_FILE_INFO (g_sequence_get (iter));
GFile *f = G_FILE (g_file_info_get_attribute_object (item, "standard::file"));
if (g_file_equal (f, file))
return iter;
}
return NULL;
}
static gboolean
handle_event (QueuedEvent *event)
{
GtkDirectoryList *self = event->list;
GFile *file = event->file;
GFileInfo *info = event->info;
GSequenceIter *iter;
unsigned int position;
switch ((int)event->event)
{
case G_FILE_MONITOR_EVENT_MOVED_IN:
case G_FILE_MONITOR_EVENT_CREATED:
if (!info)
return FALSE;
g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
iter = find_file (self->items, file);
if (iter)
{
position = g_sequence_iter_get_position (iter);
g_sequence_set (iter, g_object_ref (info));
g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 1);
}
else
{
position = g_sequence_get_length (self->items);
g_sequence_append (self->items, g_object_ref (info));
g_list_model_items_changed (G_LIST_MODEL (self), position, 0, 1);
}
break;
case G_FILE_MONITOR_EVENT_MOVED_OUT:
case G_FILE_MONITOR_EVENT_DELETED:
iter = find_file (self->items, file);
if (iter)
{
position = g_sequence_iter_get_position (iter);
g_sequence_remove (iter);
g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 0);
}
break;
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
if (!info)
return FALSE;
g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
iter = find_file (self->items, file);
if (iter)
{
position = g_sequence_iter_get_position (iter);
g_sequence_set (iter, g_object_ref (info));
g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 1);
}
break;
default:
g_assert_not_reached ();
}
return TRUE;
}
static void
handle_events (GtkDirectoryList *self)
{
QueuedEvent *event;
do
{
event = g_queue_peek_tail (&self->events);
if (!event)
return;
if (!handle_event (event))
return;
event = g_queue_pop_tail (&self->events);
free_queued_event (event);
}
while (TRUE);
}
static void
got_new_file_info_cb (GObject *source,
GAsyncResult *res,
gpointer data)
{
QueuedEvent *event = data;
GtkDirectoryList *self = event->list;
GFile *file = event->file;
GFile *file = G_FILE (source);
GtkDirectoryList *self = GTK_DIRECTORY_LIST (data);
GFileInfo *info;
guint position;
event->info = g_file_query_info_finish (file, res, NULL);
handle_events (self);
info = g_file_query_info_finish (file, res, NULL);
if (!info)
return;
g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
position = g_sequence_get_length (self->items);
g_sequence_append (self->items, info);
g_list_model_items_changed (G_LIST_MODEL (self), position, 0, 1);
}
static void
@@ -666,12 +544,53 @@ got_existing_file_info_cb (GObject *source,
GAsyncResult *res,
gpointer data)
{
QueuedEvent *event = data;
GtkDirectoryList *self = event->list;
GFile *file = event->file;
GFile *file = G_FILE (source);
GtkDirectoryList *self = GTK_DIRECTORY_LIST (data);
GFileInfo *info;
GSequenceIter *iter;
event->info = g_file_query_info_finish (file, res, NULL);
handle_events (self);
info = g_file_query_info_finish (file, res, NULL);
if (!info)
return;
g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
for (iter = g_sequence_get_begin_iter (self->items);
!g_sequence_iter_is_end (iter);
iter = g_sequence_iter_next (iter))
{
GFileInfo *item = g_sequence_get (iter);
GFile *f = G_FILE (g_file_info_get_attribute_object (item, "standard::file"));
if (g_file_equal (f, file))
{
guint position = g_sequence_iter_get_position (iter);
g_sequence_set (iter, g_object_ref (info));
g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 1);
break;
}
}
}
static void
gtk_directory_list_remove_file (GtkDirectoryList *self,
GFile *file)
{
GSequenceIter *iter;
for (iter = g_sequence_get_begin_iter (self->items);
!g_sequence_iter_is_end (iter);
iter = g_sequence_iter_next (iter))
{
GFileInfo *item = g_sequence_get (iter);
GFile *f = G_FILE (g_file_info_get_attribute_object (item, "standard::file"));
if (g_file_equal (f, file))
{
guint position = g_sequence_iter_get_position (iter);
g_sequence_remove (iter);
g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 0);
break;
}
}
}
static void
@@ -682,74 +601,30 @@ directory_changed (GFileMonitor *monitor,
gpointer data)
{
GtkDirectoryList *self = GTK_DIRECTORY_LIST (data);
QueuedEvent *ev;
switch (event)
{
case G_FILE_MONITOR_EVENT_MOVED_IN:
case G_FILE_MONITOR_EVENT_CREATED:
ev = g_new0 (QueuedEvent, 1);
ev->list = self;
ev->event = event;
ev->file = g_object_ref (file);
g_queue_push_head (&self->events, ev);
g_file_query_info_async (file,
self->attributes,
G_FILE_QUERY_INFO_NONE,
self->io_priority,
self->cancellable,
got_new_file_info_cb,
ev);
self);
break;
case G_FILE_MONITOR_EVENT_MOVED_OUT:
case G_FILE_MONITOR_EVENT_DELETED:
ev = g_new0 (QueuedEvent, 1);
ev->list = self;
ev->event = event;
ev->file = g_object_ref (file);
g_queue_push_head (&self->events, ev);
handle_events (self);
gtk_directory_list_remove_file (self, file);
break;
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
ev = g_new0 (QueuedEvent, 1);
ev->list = self;
ev->event = event;
ev->file = g_object_ref (file);
g_queue_push_head (&self->events, ev);
g_file_query_info_async (file,
self->attributes,
G_FILE_QUERY_INFO_NONE,
self->io_priority,
self->cancellable,
got_existing_file_info_cb,
ev);
break;
case G_FILE_MONITOR_EVENT_RENAMED:
ev = g_new0 (QueuedEvent, 1);
ev->list = self;
ev->event = G_FILE_MONITOR_EVENT_DELETED;
ev->file = g_object_ref (file);
g_queue_push_head (&self->events, ev);
ev = g_new0 (QueuedEvent, 1);
ev->list = self;
ev->event = G_FILE_MONITOR_EVENT_CREATED;
ev->file = g_object_ref (other_file);
g_queue_push_head (&self->events, ev);
g_file_query_info_async (other_file,
self->attributes,
G_FILE_QUERY_INFO_NONE,
self->io_priority,
self->cancellable,
got_existing_file_info_cb,
ev);
self);
break;
case G_FILE_MONITOR_EVENT_CHANGED:
@@ -757,6 +632,9 @@ directory_changed (GFileMonitor *monitor,
case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
case G_FILE_MONITOR_EVENT_UNMOUNTED:
case G_FILE_MONITOR_EVENT_MOVED:
case G_FILE_MONITOR_EVENT_RENAMED:
case G_FILE_MONITOR_EVENT_MOVED_IN:
case G_FILE_MONITOR_EVENT_MOVED_OUT:
default:
break;
}
@@ -766,7 +644,7 @@ static void
gtk_directory_list_start_monitoring (GtkDirectoryList *self)
{
g_assert (self->monitor == NULL);
self->monitor = g_file_monitor_directory (self->file, G_FILE_MONITOR_WATCH_MOVES, NULL, NULL);
self->monitor = g_file_monitor_directory (self->file, G_FILE_MONITOR_NONE, NULL, NULL);
g_signal_connect (self->monitor, "changed", G_CALLBACK (directory_changed), self);
}
+1
View File
@@ -66,6 +66,7 @@
#include <hb-ot.h>
#include "language-names.h"
#include "script-names.h"
#include "open-type-layout.h"
/**
-4
View File
@@ -833,10 +833,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
*
* If set to %TRUE the widget will allocate and enable a depth buffer for the
* target framebuffer.
*
* Setting this property will enable GL's depth testing as a side effect. If
* you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)`
* in your `GtkGLArea::render` handler.
*/
obj_props[PROP_HAS_DEPTH_BUFFER] =
g_param_spec_boolean ("has-depth-buffer",
+1 -8
View File
@@ -4993,15 +4993,8 @@ gtk_icon_view_unselect_path (GtkIconView *icon_view,
* want to convert the returned list into a list of `GtkTreeRowReferences`.
* To do this, you can use gtk_tree_row_reference_new().
*
* To free the return value, use `g_list_free_full`:
* To free the return value, use:
* |[<!-- language="C" -->
* GtkWidget *icon_view = gtk_icon_view_new ();
* // Use icon_view
*
* GList *list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (icon_view));
*
* // use list
*
* g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
* ]|
*
+1 -1
View File
@@ -1186,7 +1186,7 @@ my_pango_layout_get_width_for_height (PangoLayout *layout,
pango_layout_get_size (layout, &text_width, &text_height);
text_width = PANGO_PIXELS_CEIL (text_width);
if (text_width > mid)
min = text_width;
min = mid = text_width;
else if (text_height > for_height)
min = mid + 1;
else
+3 -9
View File
@@ -753,15 +753,9 @@ gtk_is_initialized (void)
* you can use it to update the default text direction as follows:
*
* |[<!-- language="C" -->
* #include <locale.h>
*
* static void
* update_locale (const char *new_locale)
* {
* setlocale (LC_ALL, new_locale);
* GtkTextDirection direction = gtk_get_locale_direction ();
* gtk_widget_set_default_direction (direction);
* }
* setlocale (LC_ALL, new_locale);
* direction = gtk_get_locale_direction ();
* gtk_widget_set_default_direction (direction);
* ]|
*
* Returns: the `GtkTextDirection` of the current locale
+5 -5
View File
@@ -28,7 +28,7 @@
*
* These buttons and sensors have no implicit meaning, and by default they
* perform no action. `GtkPadController` is provided to map those to
* [iface@Gio.Action] objects, thus letting the application give them a more
* `GAction` objects, thus letting the application give them a more
* semantic meaning.
*
* Buttons and sensors are not constrained to triggering a single action,
@@ -41,10 +41,10 @@
* different modes. See [method@Gdk.DevicePad.get_n_groups] and
* [method@Gdk.DevicePad.get_group_n_modes].
*
* Each of the actions that a given button/strip/ring performs for a given mode
* is defined by a [struct@Gtk.PadActionEntry]. It contains an action name that
* will be looked up in the given [iface@Gio.ActionGroup] and activated whenever
* the specified input element and mode are triggered.
* Each of the actions that a given button/strip/ring performs for a given
* mode is defined by a [struct@Gtk.PadActionEntry]. It contains an action
* name that will be looked up in the given `GActionGroup` and activated
* whenever the specified input element and mode are triggered.
*
* A simple example of `GtkPadController` usage: Assigning button 1 in all
* modes and pad devices to an "invert-selection" action:
+1 -1
View File
@@ -36,7 +36,7 @@ typedef struct _GtkRequestedSize GtkRequestedSize;
*
* Represents a request of a screen object in a given orientation. These
* are primarily used in container implementations when allocating a natural
* size for children calling. See [func@distribute_natural_allocation].
* size for children calling. See gtk_distribute_natural_allocation().
*/
struct _GtkRequestedSize
{
+34 -29
View File
@@ -46,14 +46,14 @@
/**
* GtkSnapshot:
*
* `GtkSnapshot` assists in creating [class@Gsk.RenderNode]s for widgets.
* `GtkSnapshot` assists in creating `GskRenderNodes` for widgets.
*
* It functions in a similar way to a cairo context, and maintains a stack
* of render nodes and their associated transformations.
*
* The node at the top of the stack is the one that `gtk_snapshot_append_()`
* functions operate on. Use the `gtk_snapshot_push_()` functions and
* [method@Snapshot.pop] to change the current node.
* The node at the top of the stack is the one that gtk_snapshot_append_
* functions operate on. Use the gtk_snapshot_push_ functions and
* gtk_snapshot_pop() to change the current node.
*
* The typical way to obtain a `GtkSnapshot` object is as an argument to
* the [vfunc@Gtk.Widget.snapshot] vfunc. If you need to create your own
@@ -302,7 +302,7 @@ gtk_snapshot_new (void)
* Returns the node that was constructed by @snapshot
* and frees @snapshot.
*
* Returns: (transfer full): a newly-created [class@Gsk.RenderNode]
* Returns: (transfer full): a newly-created `GskRenderNode`
*/
GskRenderNode *
gtk_snapshot_free_to_node (GtkSnapshot *snapshot)
@@ -324,7 +324,7 @@ gtk_snapshot_free_to_node (GtkSnapshot *snapshot)
* Returns a paintable for the node that was
* constructed by @snapshot and frees @snapshot.
*
* Returns: (transfer full): a newly-created [iface@Gdk.Paintable]
* Returns: (transfer full): a newly-created `GdkPaintable`
*/
GdkPaintable *
gtk_snapshot_free_to_paintable (GtkSnapshot *snapshot,
@@ -955,11 +955,11 @@ gtk_snapshot_collect_gl_shader_texture (GtkSnapshot *snapshot,
* @bounds: the rectangle to render into
* @take_args: (transfer full): Data block with arguments for the shader.
*
* Push a [class@Gsk.GLShaderNode].
* Push a `GskGLShaderNode`.
*
* The node uses the given [class@Gsk.GLShader] and uniform values
* Additionally this takes a list of @n_children other nodes
* which will be passed to the [class@Gsk.GLShaderNode].
* which will be passed to the `GskGLShaderNode`.
*
* The @take_args argument is a block of data to use for uniform
* arguments, as per types and offsets defined by the @shader.
@@ -1495,7 +1495,7 @@ gtk_snapshot_pop_collect (GtkSnapshot *snapshot)
*
* After calling this function, it is no longer possible to
* add more nodes to @snapshot. The only function that should
* be called after this is [method@GObject.Object.unref].
* be called after this is g_object_unref().
*
* Returns: (transfer full): the constructed `GskRenderNode`
*/
@@ -1530,7 +1530,7 @@ gtk_snapshot_to_node (GtkSnapshot *snapshot)
*
* After calling this function, it is no longer possible to
* add more nodes to @snapshot. The only function that should
* be called after this is [method@GObject.Object.unref].
* be called after this is g_object_unref().
*
* Returns: (transfer full): a new `GdkPaintable`
*/
@@ -1585,7 +1585,7 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
* @snapshot: a `GtkSnapshot`
*
* Removes the top element from the stack of render nodes and
* adds it to the nearest [class@Gsk.GLShaderNode] below it.
* adds it to the nearest `GskGLShaderNode` below it.
*
* This must be called the same number of times as the number
* of textures is needed for the shader in
@@ -1610,12 +1610,12 @@ gtk_snapshot_gl_shader_pop_texture (GtkSnapshot *snapshot)
*
* When [method@Gtk.Snapshot.restore] is called, @snapshot will
* be restored to the saved state. Multiple calls to
* [method@Snapshot.save] and [class@Snapshot.restore] can be nested;
* each call to `gtk_snapshot_restore()` restores the state from
* the matching paired `gtk_snapshot_save()`.
* gtk_snapshot_save() and gtk_snapshot_restore() can be nested;
* each call to gtk_snapshot_restore() restores the state from
* the matching paired gtk_snapshot_save().
*
* It is necessary to clear all saved states with corresponding
* calls to `gtk_snapshot_restore()`.
* calls to gtk_snapshot_restore().
*/
void
gtk_snapshot_save (GtkSnapshot *snapshot)
@@ -1633,7 +1633,7 @@ gtk_snapshot_save (GtkSnapshot *snapshot)
* @snapshot: a `GtkSnapshot`
*
* Restores @snapshot to the state saved by a preceding call to
* [method@Snapshot.save] and removes that state from the stack of
* gtk_snapshot_save() and removes that state from the stack of
* saved states.
*/
void
@@ -1882,7 +1882,7 @@ gtk_snapshot_append_node (GtkSnapshot *snapshot,
* @snapshot: a `GtkSnapshot`
* @bounds: the bounds for the new node
*
* Creates a new [class@Gsk.CairoNode] and appends it to the current
* Creates a new `GskCairoNode` and appends it to the current
* render node of @snapshot, without changing the current node.
*
* Returns: a `cairo_t` suitable for drawing the contents of
@@ -1918,7 +1918,7 @@ gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
/**
* gtk_snapshot_append_texture:
* @snapshot: a `GtkSnapshot`
* @texture: the texture to render
* @texture: the `GdkTexture` to render
* @bounds: the bounds for the new node
*
* Creates a new render node drawing the @texture
@@ -1948,7 +1948,7 @@ gtk_snapshot_append_texture (GtkSnapshot *snapshot,
/**
* gtk_snapshot_append_color:
* @snapshot: a `GtkSnapshot`
* @color: the color to draw
* @color: the `GdkRGBA` to draw
* @bounds: the bounds for the new node
*
* Creates a new render node drawing the @color into the
@@ -1982,7 +1982,7 @@ gtk_snapshot_append_color (GtkSnapshot *snapshot,
/**
* gtk_snapshot_render_background:
* @snapshot: a `GtkSnapshot`
* @context: the style context that defines the background
* @context: the `GtkStyleContext` to use
* @x: X origin of the rectangle
* @y: Y origin of the rectangle
* @width: rectangle width
@@ -2014,7 +2014,7 @@ gtk_snapshot_render_background (GtkSnapshot *snapshot,
/**
* gtk_snapshot_render_frame:
* @snapshot: a `GtkSnapshot`
* @context: the style context that defines the frame
* @context: the `GtkStyleContext` to use
* @x: X origin of the rectangle
* @y: Y origin of the rectangle
* @width: rectangle width
@@ -2046,7 +2046,7 @@ gtk_snapshot_render_frame (GtkSnapshot *snapshot,
/**
* gtk_snapshot_render_focus:
* @snapshot: a `GtkSnapshot`
* @context: the style context that defines the focus ring
* @context: the `GtkStyleContext` to use
* @x: X origin of the rectangle
* @y: Y origin of the rectangle
* @width: rectangle width
@@ -2078,7 +2078,7 @@ gtk_snapshot_render_focus (GtkSnapshot *snapshot,
/**
* gtk_snapshot_render_layout:
* @snapshot: a `GtkSnapshot`
* @context: the style context that defines the text
* @context: the `GtkStyleContext` to use
* @x: X origin of the rectangle
* @y: Y origin of the rectangle
* @layout: the `PangoLayout` to render
@@ -2152,7 +2152,8 @@ gtk_snapshot_append_text (GtkSnapshot *snapshot,
* @bounds: the rectangle to render the linear gradient into
* @start_point: the point at which the linear gradient will begin
* @end_point: the point at which the linear gradient will finish
* @stops: (array length=n_stops): the color stops defining the gradient
* @stops: (array length=n_stops): a pointer to an array of `GskColorStop`
* defining the gradient
* @n_stops: the number of elements in @stops
*
* Appends a linear gradient node with the given stops to @snapshot.
@@ -2219,7 +2220,8 @@ gtk_snapshot_append_linear_gradient (GtkSnapshot *snapshot,
* @bounds: the rectangle to render the linear gradient into
* @start_point: the point at which the linear gradient will begin
* @end_point: the point at which the linear gradient will finish
* @stops: (array length=n_stops): the color stops defining the gradient
* @stops: (array length=n_stops): a pointer to an array of `GskColorStop`
* defining the gradient
* @n_stops: the number of elements in @stops
*
* Appends a repeating linear gradient node with the given stops to @snapshot.
@@ -2287,7 +2289,8 @@ gtk_snapshot_append_repeating_linear_gradient (GtkSnapshot *snapshot,
* @center: the center point of the conic gradient
* @rotation: the clockwise rotation in degrees of the starting angle.
* 0 means the starting angle is the top.
* @stops: (array length=n_stops): the color stops defining the gradient
* @stops: (array length=n_stops): a pointer to an array of `GskColorStop`
* defining the gradient
* @n_stops: the number of elements in @stops
*
* Appends a conic gradient node with the given stops to @snapshot.
@@ -2349,7 +2352,8 @@ gtk_snapshot_append_conic_gradient (GtkSnapshot *snapshot,
* @vradius: the vertical radius
* @start: the start position (on the horizontal axis)
* @end: the end position (on the horizontal axis)
* @stops: (array length=n_stops): the color stops defining the gradient
* @stops: (array length=n_stops): a pointer to an array of `GskColorStop`
* defining the gradient
* @n_stops: the number of elements in @stops
*
* Appends a radial gradient node with the given stops to @snapshot.
@@ -2422,7 +2426,8 @@ gtk_snapshot_append_radial_gradient (GtkSnapshot *snapshot,
* @vradius: the vertical radius
* @start: the start position (on the horizontal axis)
* @end: the end position (on the horizontal axis)
* @stops: (array length=n_stops): the color stops defining the gradient
* @stops: (array length=n_stops): a pointer to an array of `GskColorStop`
* defining the gradient
* @n_stops: the number of elements in @stops
*
* Appends a repeating radial gradient node with the given stops to @snapshot.
@@ -2488,7 +2493,7 @@ gtk_snapshot_append_repeating_radial_gradient (GtkSnapshot *snapshot,
/**
* gtk_snapshot_append_border:
* @snapshot: a `GtkSnapshot`
* @outline: the outline of the border
* @outline: a `GskRoundedRect` describing the outline of the border
* @border_width: (array fixed-size=4): the stroke width of the border on
* the top, right, bottom and left side respectively.
* @border_color: (array fixed-size=4): the color used on the top, right,
+2 -38
View File
@@ -231,13 +231,8 @@ struct _GtkTextViewPrivate
guint first_validate_idle; /* Idle to revalidate onscreen portion, runs before resize */
guint incremental_validate_idle; /* Idle to revalidate offscreen portions, runs after redraw */
/* Mark for drop target */
GtkTextMark *dnd_mark;
/* Mark for selection of drag source */
GtkTextMark *dnd_drag_begin_mark;
GtkTextMark *dnd_drag_end_mark;
GtkIMContext *im_context;
GtkWidget *popup_menu;
GMenuModel *extra_menu;
@@ -8061,26 +8056,8 @@ static void
dnd_finished_cb (GdkDrag *drag,
GtkTextView *self)
{
GtkTextBuffer *buffer = self->priv->buffer;
if (self->priv->dnd_drag_begin_mark)
{
if (gdk_drag_get_selected_action (drag) == GDK_ACTION_MOVE)
{
{
GtkTextIter begin, end;
gtk_text_buffer_get_iter_at_mark (buffer, &begin, self->priv->dnd_drag_begin_mark);
gtk_text_buffer_get_iter_at_mark (buffer, &end, self->priv->dnd_drag_end_mark);
gtk_text_buffer_delete (buffer, &begin, &end);
}
}
gtk_text_buffer_delete_mark (buffer, self->priv->dnd_drag_begin_mark);
gtk_text_buffer_delete_mark (buffer, self->priv->dnd_drag_end_mark);
self->priv->dnd_drag_begin_mark = NULL;
self->priv->dnd_drag_end_mark = NULL;
}
if (gdk_drag_get_selected_action (drag) == GDK_ACTION_MOVE)
gtk_text_buffer_delete_selection (self->priv->buffer, TRUE, self->priv->editable);
self->priv->drag = NULL;
}
@@ -8090,16 +8067,6 @@ dnd_cancel_cb (GdkDrag *drag,
GdkDragCancelReason reason,
GtkTextView *self)
{
GtkTextBuffer *buffer = self->priv->buffer;
if (self->priv->dnd_drag_begin_mark)
{
gtk_text_buffer_delete_mark (buffer, self->priv->dnd_drag_begin_mark);
gtk_text_buffer_delete_mark (buffer, self->priv->dnd_drag_end_mark);
self->priv->dnd_drag_begin_mark = NULL;
self->priv->dnd_drag_end_mark = NULL;
}
self->priv->drag = NULL;
}
@@ -8141,9 +8108,6 @@ gtk_text_view_start_selection_dnd (GtkTextView *text_view,
paintable = gtk_text_util_create_rich_drag_icon (widget, buffer, &start, &end);
gtk_drag_icon_set_from_paintable (drag, paintable, 0, 0);
g_object_unref (paintable);
text_view->priv->dnd_drag_begin_mark = gtk_text_buffer_create_mark (buffer, NULL, &start, TRUE);
text_view->priv->dnd_drag_end_mark = gtk_text_buffer_create_mark (buffer, NULL, &end, TRUE);
}
text_view->priv->drag = drag;
+9 -14
View File
@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
@@ -55,7 +55,7 @@
* To simply switch the state of a toggle button, use
* [method@Gtk.ToggleButton.toggled].
*
* ## Grouping
* # Grouping
*
* Toggle buttons can be grouped together, to form mutually exclusive
* groups - only one of the buttons can be toggled at a time, and toggling
@@ -63,25 +63,20 @@
*
* To add a `GtkToggleButton` to a group, use [method@Gtk.ToggleButton.set_group].
*
* ## CSS nodes
* # CSS nodes
*
* `GtkToggleButton` has a single CSS node with name button. To differentiate
* it from a plain `GtkButton`, it gets the `.toggle` style class.
* it from a plain `GtkButton`, it gets the .toggle style class.
*
* ## Creating two `GtkToggleButton` widgets.
*
* ```c
* static void
* output_state (GtkToggleButton *source,
* gpointer user_data)
* static void output_state (GtkToggleButton *source, gpointer user_data)
* {
* g_print ("Toggle button "%s" is active: %s",
* gtk_button_get_label (GTK_BUTTON (source)),
* gtk_toggle_button_get_active (source) ? "Yes" : "No");
* printf ("Active: %d\n", gtk_toggle_button_get_active (source));
* }
*
* static void
* make_toggles (void)
* void make_toggles (void)
* {
* GtkWidget *window, *toggle1, *toggle2;
* GtkWidget *box;
@@ -90,7 +85,7 @@
* window = gtk_window_new ();
* box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
*
* text = "Hi, Im toggle button one";
* text = "Hi, Im a toggle button.";
* toggle1 = gtk_toggle_button_new_with_label (text);
*
* g_signal_connect (toggle1, "toggled",
@@ -98,7 +93,7 @@
* NULL);
* gtk_box_append (GTK_BOX (box), toggle1);
*
* text = "Hi, Im toggle button two";
* text = "Hi, Im a toggle button.";
* toggle2 = gtk_toggle_button_new_with_label (text);
* g_signal_connect (toggle2, "toggled",
* G_CALLBACK (output_state),
+5 -5
View File
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
/**
* GTK_MAJOR_VERSION:
*
* Like [func@get_major_version], but from the headers used at
* Like gtk_get_major_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
@@ -45,7 +45,7 @@ G_BEGIN_DECLS
/**
* GTK_MINOR_VERSION:
*
* Like [func@get_minor_version], but from the headers used at
* Like gtk_get_minor_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
@@ -54,7 +54,7 @@ G_BEGIN_DECLS
/**
* GTK_MICRO_VERSION:
*
* Like [func@get_micro_version], but from the headers used at
* Like gtk_get_micro_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
@@ -63,7 +63,7 @@ G_BEGIN_DECLS
/**
* GTK_BINARY_AGE:
*
* Like [func@get_binary_age], but from the headers used at
* Like gtk_get_binary_age(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
@@ -72,7 +72,7 @@ G_BEGIN_DECLS
/**
* GTK_INTERFACE_AGE:
*
* Like [func@get_interface_age], but from the headers used at
* Like gtk_get_interface_age(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
+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
+1
View File
@@ -1101,6 +1101,7 @@ if harfbuzz_dep.found() and pangoft_dep.found()
gtk_deps += [ harfbuzz_dep, pangoft_dep ]
gtk_sources += files([
'language-names.c',
'script-names.c',
])
endif
+214
View File
@@ -0,0 +1,214 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <hb-ot.h>
#include "script-names.h"
static struct {
GUnicodeScript script;
hb_script_t hb_script;
const char *name;
} scripts[] =
{
{ G_UNICODE_SCRIPT_COMMON, HB_SCRIPT_COMMON, NULL },
{ G_UNICODE_SCRIPT_INHERITED, HB_SCRIPT_INHERITED, NULL },
{ G_UNICODE_SCRIPT_ARABIC, HB_SCRIPT_ARABIC, NC_("Script", "Arabic") },
{ G_UNICODE_SCRIPT_ARMENIAN, HB_SCRIPT_ARMENIAN, NC_("Script", "Armenian") },
{ G_UNICODE_SCRIPT_BENGALI, HB_SCRIPT_BENGALI, NC_("Script", "Bengali") },
{ G_UNICODE_SCRIPT_BOPOMOFO, HB_SCRIPT_BOPOMOFO, NC_("Script", "Bopomofo") },
{ G_UNICODE_SCRIPT_CHEROKEE, HB_SCRIPT_CHEROKEE, NC_("Script", "Cherokee") },
{ G_UNICODE_SCRIPT_COPTIC, HB_SCRIPT_COPTIC, NC_("Script", "Coptic") },
{ G_UNICODE_SCRIPT_CYRILLIC, HB_SCRIPT_CYRILLIC, NC_("Script", "Cyrillic") },
{ G_UNICODE_SCRIPT_DESERET, HB_SCRIPT_DESERET, NC_("Script", "Deseret") },
{ G_UNICODE_SCRIPT_DEVANAGARI, HB_SCRIPT_DEVANAGARI, NC_("Script", "Devanagari") },
{ G_UNICODE_SCRIPT_ETHIOPIC, HB_SCRIPT_ETHIOPIC, NC_("Script", "Ethiopic") },
{ G_UNICODE_SCRIPT_GEORGIAN, HB_SCRIPT_GEORGIAN, NC_("Script", "Georgian") },
{ G_UNICODE_SCRIPT_GOTHIC, HB_SCRIPT_GOTHIC, NC_("Script", "Gothic") },
{ G_UNICODE_SCRIPT_GREEK, HB_SCRIPT_GREEK, NC_("Script", "Greek") },
{ G_UNICODE_SCRIPT_GUJARATI, HB_SCRIPT_GUJARATI, NC_("Script", "Gujarati") },
{ G_UNICODE_SCRIPT_GURMUKHI, HB_SCRIPT_GURMUKHI, NC_("Script", "Gurmukhi") },
{ G_UNICODE_SCRIPT_HAN, HB_SCRIPT_HAN, NC_("Script", "Han") },
{ G_UNICODE_SCRIPT_HANGUL, HB_SCRIPT_HANGUL, NC_("Script", "Hangul") },
{ G_UNICODE_SCRIPT_HEBREW, HB_SCRIPT_HEBREW, NC_("Script", "Hebrew") },
{ G_UNICODE_SCRIPT_HIRAGANA, HB_SCRIPT_HIRAGANA, NC_("Script", "Hiragana") },
{ G_UNICODE_SCRIPT_KANNADA, HB_SCRIPT_KANNADA, NC_("Script", "Kannada") },
{ G_UNICODE_SCRIPT_KATAKANA, HB_SCRIPT_KATAKANA, NC_("Script", "Katakana") },
{ G_UNICODE_SCRIPT_KHMER, HB_SCRIPT_KHMER, NC_("Script", "Khmer") },
{ G_UNICODE_SCRIPT_LAO, HB_SCRIPT_LAO, NC_("Script", "Lao") },
{ G_UNICODE_SCRIPT_LATIN, HB_SCRIPT_LATIN, NC_("Script", "Latin") },
{ G_UNICODE_SCRIPT_MALAYALAM, HB_SCRIPT_MALAYALAM, NC_("Script", "Malayalam") },
{ G_UNICODE_SCRIPT_MONGOLIAN, HB_SCRIPT_MONGOLIAN, NC_("Script", "Mongolian") },
{ G_UNICODE_SCRIPT_MYANMAR, HB_SCRIPT_MYANMAR, NC_("Script", "Myanmar") },
{ G_UNICODE_SCRIPT_OGHAM, HB_SCRIPT_OGHAM, NC_("Script", "Ogham") },
{ G_UNICODE_SCRIPT_OLD_ITALIC, HB_SCRIPT_OLD_ITALIC, NC_("Script", "Old Italic") },
{ G_UNICODE_SCRIPT_ORIYA, HB_SCRIPT_ORIYA, NC_("Script", "Oriya") },
{ G_UNICODE_SCRIPT_RUNIC, HB_SCRIPT_RUNIC, NC_("Script", "Runic") },
{ G_UNICODE_SCRIPT_SINHALA, HB_SCRIPT_SINHALA, NC_("Script", "Sinhala") },
{ G_UNICODE_SCRIPT_SYRIAC, HB_SCRIPT_SYRIAC, NC_("Script", "Syriac") },
{ G_UNICODE_SCRIPT_TAMIL, HB_SCRIPT_TAMIL, NC_("Script", "Tamil") },
{ G_UNICODE_SCRIPT_TELUGU, HB_SCRIPT_TELUGU, NC_("Script", "Telugu") },
{ G_UNICODE_SCRIPT_THAANA, HB_SCRIPT_THAANA, NC_("Script", "Thaana") },
{ G_UNICODE_SCRIPT_THAI, HB_SCRIPT_THAI, NC_("Script", "Thai") },
{ G_UNICODE_SCRIPT_TIBETAN, HB_SCRIPT_TIBETAN, NC_("Script", "Tibetan") },
{ G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, HB_SCRIPT_CANADIAN_ABORIGINAL, NC_("Script", "Canadian Aboriginal") },
{ G_UNICODE_SCRIPT_YI, HB_SCRIPT_YI, NC_("Script", "Yi") },
{ G_UNICODE_SCRIPT_TAGALOG, HB_SCRIPT_TAGALOG, NC_("Script", "Tagalog") },
{ G_UNICODE_SCRIPT_HANUNOO, HB_SCRIPT_HANUNOO, NC_("Script", "Hanunoo") },
{ G_UNICODE_SCRIPT_BUHID, HB_SCRIPT_BUHID, NC_("Script", "Buhid") },
{ G_UNICODE_SCRIPT_TAGBANWA, HB_SCRIPT_TAGBANWA, NC_("Script", "Tagbanwa") },
{ G_UNICODE_SCRIPT_BRAILLE, HB_SCRIPT_BRAILLE, NC_("Script", "Braille") },
{ G_UNICODE_SCRIPT_CYPRIOT, HB_SCRIPT_CYPRIOT, NC_("Script", "Cypriot") },
{ G_UNICODE_SCRIPT_LIMBU, HB_SCRIPT_LIMBU, NC_("Script", "Limbu") },
{ G_UNICODE_SCRIPT_OSMANYA, HB_SCRIPT_OSMANYA, NC_("Script", "Osmanya") },
{ G_UNICODE_SCRIPT_SHAVIAN, HB_SCRIPT_SHAVIAN, NC_("Script", "Shavian") },
{ G_UNICODE_SCRIPT_LINEAR_B, HB_SCRIPT_LINEAR_B, NC_("Script", "Linear B") },
{ G_UNICODE_SCRIPT_TAI_LE, HB_SCRIPT_TAI_LE, NC_("Script", "Tai Le") },
{ G_UNICODE_SCRIPT_UGARITIC, HB_SCRIPT_UGARITIC, NC_("Script", "Ugaritic") },
{ G_UNICODE_SCRIPT_NEW_TAI_LUE, HB_SCRIPT_NEW_TAI_LUE, NC_("Script", "New Tai Lue") },
{ G_UNICODE_SCRIPT_BUGINESE, HB_SCRIPT_BUGINESE, NC_("Script", "Buginese") },
{ G_UNICODE_SCRIPT_GLAGOLITIC, HB_SCRIPT_GLAGOLITIC, NC_("Script", "Glagolitic") },
{ G_UNICODE_SCRIPT_TIFINAGH, HB_SCRIPT_TIFINAGH, NC_("Script", "Tifinagh") },
{ G_UNICODE_SCRIPT_SYLOTI_NAGRI, HB_SCRIPT_SYLOTI_NAGRI, NC_("Script", "Syloti Nagri") },
{ G_UNICODE_SCRIPT_OLD_PERSIAN, HB_SCRIPT_OLD_PERSIAN, NC_("Script", "Old Persian") },
{ G_UNICODE_SCRIPT_KHAROSHTHI, HB_SCRIPT_KHAROSHTHI, NC_("Script", "Kharoshthi") },
{ G_UNICODE_SCRIPT_UNKNOWN, HB_SCRIPT_UNKNOWN, NC_("Script", "Unknown") },
{ G_UNICODE_SCRIPT_BALINESE, HB_SCRIPT_BALINESE, NC_("Script", "Balinese") },
{ G_UNICODE_SCRIPT_CUNEIFORM, HB_SCRIPT_CUNEIFORM, NC_("Script", "Cuneiform") },
{ G_UNICODE_SCRIPT_PHOENICIAN, HB_SCRIPT_PHOENICIAN, NC_("Script", "Phoenician") },
{ G_UNICODE_SCRIPT_PHAGS_PA, HB_SCRIPT_PHAGS_PA, NC_("Script", "Phags-pa") },
{ G_UNICODE_SCRIPT_NKO, HB_SCRIPT_NKO, NC_("Script", "N'Ko") },
{ G_UNICODE_SCRIPT_KAYAH_LI, HB_SCRIPT_KAYAH_LI, NC_("Script", "Kayah Li") },
{ G_UNICODE_SCRIPT_LEPCHA, HB_SCRIPT_LEPCHA, NC_("Script", "Lepcha") },
{ G_UNICODE_SCRIPT_REJANG, HB_SCRIPT_REJANG, NC_("Script", "Rejang") },
{ G_UNICODE_SCRIPT_SUNDANESE, HB_SCRIPT_SUNDANESE, NC_("Script", "Sundanese") },
{ G_UNICODE_SCRIPT_SAURASHTRA, HB_SCRIPT_SAURASHTRA, NC_("Script", "Saurashtra") },
{ G_UNICODE_SCRIPT_CHAM, HB_SCRIPT_CHAM, NC_("Script", "Cham") },
{ G_UNICODE_SCRIPT_OL_CHIKI, HB_SCRIPT_OL_CHIKI, NC_("Script", "Ol Chiki") },
{ G_UNICODE_SCRIPT_VAI, HB_SCRIPT_VAI, NC_("Script", "Vai") },
{ G_UNICODE_SCRIPT_CARIAN, HB_SCRIPT_CARIAN, NC_("Script", "Carian") },
{ G_UNICODE_SCRIPT_LYCIAN, HB_SCRIPT_LYCIAN, NC_("Script", "Lycian") },
{ G_UNICODE_SCRIPT_LYDIAN, HB_SCRIPT_LYDIAN, NC_("Script", "Lydian") },
{ G_UNICODE_SCRIPT_AVESTAN, HB_SCRIPT_AVESTAN, NC_("Script", "Avestan") },
{ G_UNICODE_SCRIPT_BAMUM, HB_SCRIPT_BAMUM, NC_("Script", "Bamum") },
{ G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS, NC_("Script", "Egyptian Hieroglyphs") },
{ G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC, HB_SCRIPT_IMPERIAL_ARAMAIC, NC_("Script", "Imperial Aramaic") },
{ G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI, HB_SCRIPT_INSCRIPTIONAL_PAHLAVI, NC_("Script", "Inscriptional Pahlavi") },
{ G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN, HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, NC_("Script", "Inscriptional Parthian") },
{ G_UNICODE_SCRIPT_JAVANESE, HB_SCRIPT_JAVANESE, NC_("Script", "Javanese") },
{ G_UNICODE_SCRIPT_KAITHI, HB_SCRIPT_KAITHI, NC_("Script", "Kaithi") },
{ G_UNICODE_SCRIPT_LISU, HB_SCRIPT_LISU, NC_("Script", "Lisu") },
{ G_UNICODE_SCRIPT_MEETEI_MAYEK, HB_SCRIPT_MEETEI_MAYEK, NC_("Script", "Meetei Mayek") },
{ G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN, HB_SCRIPT_OLD_SOUTH_ARABIAN, NC_("Script", "Old South Arabian") },
{ G_UNICODE_SCRIPT_OLD_TURKIC, HB_SCRIPT_OLD_TURKIC, NC_("Script", "Old Turkic") },
{ G_UNICODE_SCRIPT_SAMARITAN, HB_SCRIPT_SAMARITAN, NC_("Script", "Samaritan") },
{ G_UNICODE_SCRIPT_TAI_THAM, HB_SCRIPT_TAI_THAM, NC_("Script", "Tai Tham") },
{ G_UNICODE_SCRIPT_TAI_VIET, HB_SCRIPT_TAI_VIET, NC_("Script", "Tai Viet") },
{ G_UNICODE_SCRIPT_BATAK, HB_SCRIPT_BATAK, NC_("Script", "Batak") },
{ G_UNICODE_SCRIPT_BRAHMI, HB_SCRIPT_BRAHMI, NC_("Script", "Brahmi") },
{ G_UNICODE_SCRIPT_MANDAIC, HB_SCRIPT_MANDAIC, NC_("Script", "Mandaic") },
{ G_UNICODE_SCRIPT_CHAKMA, HB_SCRIPT_CHAKMA, NC_("Script", "Chakma") },
{ G_UNICODE_SCRIPT_MEROITIC_CURSIVE, HB_SCRIPT_MEROITIC_CURSIVE, NC_("Script", "Meroitic Cursive") },
{ G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, HB_SCRIPT_MEROITIC_HIEROGLYPHS, NC_("Script", "Meroitic Hieroglyphs") },
{ G_UNICODE_SCRIPT_MIAO, HB_SCRIPT_MIAO, NC_("Script", "Miao") },
{ G_UNICODE_SCRIPT_SHARADA, HB_SCRIPT_SHARADA, NC_("Script", "Sharada") },
{ G_UNICODE_SCRIPT_SORA_SOMPENG, HB_SCRIPT_SORA_SOMPENG, NC_("Script", "Sora Sompeng") },
{ G_UNICODE_SCRIPT_TAKRI, HB_SCRIPT_TAKRI, NC_("Script", "Takri") },
{ G_UNICODE_SCRIPT_BASSA_VAH, HB_SCRIPT_BASSA_VAH, NC_("Script", "Bassa") },
{ G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN, HB_SCRIPT_CAUCASIAN_ALBANIAN, NC_("Script", "Caucasian Albanian") },
{ G_UNICODE_SCRIPT_DUPLOYAN, HB_SCRIPT_DUPLOYAN, NC_("Script", "Duployan") },
{ G_UNICODE_SCRIPT_ELBASAN, HB_SCRIPT_ELBASAN, NC_("Script", "Elbasan") },
{ G_UNICODE_SCRIPT_GRANTHA, HB_SCRIPT_GRANTHA, NC_("Script", "Grantha") },
{ G_UNICODE_SCRIPT_KHOJKI, HB_SCRIPT_KHOJKI, NC_("Script", "Khojki") },
{ G_UNICODE_SCRIPT_KHUDAWADI, HB_SCRIPT_KHUDAWADI, NC_("Script", "Khudawadi, Sindhi") },
{ G_UNICODE_SCRIPT_LINEAR_A, HB_SCRIPT_LINEAR_A, NC_("Script", "Linear A") },
{ G_UNICODE_SCRIPT_MAHAJANI, HB_SCRIPT_MAHAJANI, NC_("Script", "Mahajani") },
{ G_UNICODE_SCRIPT_MANICHAEAN, HB_SCRIPT_MANICHAEAN, NC_("Script", "Manichaean") },
{ G_UNICODE_SCRIPT_MENDE_KIKAKUI, HB_SCRIPT_MENDE_KIKAKUI, NC_("Script", "Mende Kikakui") },
{ G_UNICODE_SCRIPT_MODI, HB_SCRIPT_MODI, NC_("Script", "Modi") },
{ G_UNICODE_SCRIPT_MRO, HB_SCRIPT_MRO, NC_("Script", "Mro") },
{ G_UNICODE_SCRIPT_NABATAEAN, HB_SCRIPT_NABATAEAN, NC_("Script", "Nabataean") },
{ G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN, HB_SCRIPT_OLD_NORTH_ARABIAN, NC_("Script", "Old North Arabian") },
{ G_UNICODE_SCRIPT_OLD_PERMIC, HB_SCRIPT_OLD_PERMIC, NC_("Script", "Old Permic") },
{ G_UNICODE_SCRIPT_PAHAWH_HMONG, HB_SCRIPT_PAHAWH_HMONG, NC_("Script", "Pahawh Hmong") },
{ G_UNICODE_SCRIPT_PALMYRENE, HB_SCRIPT_PALMYRENE, NC_("Script", "Palmyrene") },
{ G_UNICODE_SCRIPT_PAU_CIN_HAU, HB_SCRIPT_PAU_CIN_HAU, NC_("Script", "Pau Cin Hau") },
{ G_UNICODE_SCRIPT_PSALTER_PAHLAVI, HB_SCRIPT_PSALTER_PAHLAVI, NC_("Script", "Psalter Pahlavi") },
{ G_UNICODE_SCRIPT_SIDDHAM, HB_SCRIPT_SIDDHAM, NC_("Script", "Siddham") },
{ G_UNICODE_SCRIPT_TIRHUTA, HB_SCRIPT_TIRHUTA, NC_("Script", "Tirhuta") },
{ G_UNICODE_SCRIPT_WARANG_CITI, HB_SCRIPT_WARANG_CITI, NC_("Script", "Warang Citi") },
{ G_UNICODE_SCRIPT_AHOM, HB_SCRIPT_AHOM, NC_("Script", "Ahom") },
{ G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS, HB_SCRIPT_ANATOLIAN_HIEROGLYPHS, NC_("Script", "Anatolian Hieroglyphs") },
{ G_UNICODE_SCRIPT_HATRAN, HB_SCRIPT_HATRAN, NC_("Script", "Hatran") },
{ G_UNICODE_SCRIPT_MULTANI, HB_SCRIPT_MULTANI, NC_("Script", "Multani") },
{ G_UNICODE_SCRIPT_OLD_HUNGARIAN, HB_SCRIPT_OLD_HUNGARIAN, NC_("Script", "Old Hungarian") },
{ G_UNICODE_SCRIPT_SIGNWRITING, HB_SCRIPT_SIGNWRITING, NC_("Script", "Signwriting") },
{ G_UNICODE_SCRIPT_ADLAM, HB_SCRIPT_ADLAM, NC_("Script", "Adlam") },
{ G_UNICODE_SCRIPT_BHAIKSUKI, HB_SCRIPT_BHAIKSUKI, NC_("Script", "Bhaiksuki") },
{ G_UNICODE_SCRIPT_MARCHEN, HB_SCRIPT_MARCHEN, NC_("Script", "Marchen") },
{ G_UNICODE_SCRIPT_NEWA, HB_SCRIPT_NEWA, NC_("Script", "Newa") },
{ G_UNICODE_SCRIPT_OSAGE, HB_SCRIPT_OSAGE, NC_("Script", "Osage") },
{ G_UNICODE_SCRIPT_TANGUT, HB_SCRIPT_TANGUT, NC_("Script", "Tangut") },
{ G_UNICODE_SCRIPT_MASARAM_GONDI, HB_SCRIPT_MASARAM_GONDI, NC_("Script", "Masaram Gondi") },
{ G_UNICODE_SCRIPT_NUSHU, HB_SCRIPT_NUSHU, NC_("Script", "Nushu") },
{ G_UNICODE_SCRIPT_SOYOMBO, HB_SCRIPT_SOYOMBO, NC_("Script", "Soyombo") },
{ G_UNICODE_SCRIPT_ZANABAZAR_SQUARE, HB_SCRIPT_ZANABAZAR_SQUARE, NC_("Script", "Zanabazar Square") },
{ G_UNICODE_SCRIPT_DOGRA, HB_SCRIPT_DOGRA, NC_("Script", "Dogra") },
{ G_UNICODE_SCRIPT_GUNJALA_GONDI, HB_SCRIPT_GUNJALA_GONDI, NC_("Script", "Gunjala Gondi") },
{ G_UNICODE_SCRIPT_HANIFI_ROHINGYA, HB_SCRIPT_HANIFI_ROHINGYA, NC_("Script", "Hanifi Rohingya") },
{ G_UNICODE_SCRIPT_MAKASAR, HB_SCRIPT_MAKASAR, NC_("Script", "Makasar") },
{ G_UNICODE_SCRIPT_MEDEFAIDRIN, HB_SCRIPT_MEDEFAIDRIN, NC_("Script", "Medefaidrin") },
{ G_UNICODE_SCRIPT_OLD_SOGDIAN, HB_SCRIPT_OLD_SOGDIAN, NC_("Script", "Old Sogdian") },
{ G_UNICODE_SCRIPT_SOGDIAN, HB_SCRIPT_SOGDIAN, NC_("Script", "Sogdian") },
#if HB_VERSION_ATLEAST(2,4,0)
{ G_UNICODE_SCRIPT_ELYMAIC, HB_SCRIPT_ELYMAIC, NC_("Script", "Elym") },
{ G_UNICODE_SCRIPT_NANDINAGARI, HB_SCRIPT_NANDINAGARI, NC_("Script", "Nand") },
{ G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG, HB_SCRIPT_NYIAKENG_PUACHUE_HMONG, NC_("Script", "Rohg") },
{ G_UNICODE_SCRIPT_WANCHO, HB_SCRIPT_WANCHO, NC_("Script", "Wcho") },
#else
{ G_UNICODE_SCRIPT_ELYMAIC, HB_SCRIPT_INVALID, NC_("Script", "Elym") },
{ G_UNICODE_SCRIPT_NANDINAGARI, HB_SCRIPT_INVALID, NC_("Script", "Nand") },
{ G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG, HB_SCRIPT_INVALID, NC_("Script", "Rohg") },
{ G_UNICODE_SCRIPT_WANCHO, HB_SCRIPT_INVALID, NC_("Script", "Wcho") },
#endif
#if HB_VERSION_ATLEAST(2,6,7)
{ G_UNICODE_SCRIPT_CHORASMIAN, HB_SCRIPT_CHORASMIAN, NC_("Script", "Chorasmian") },
{ G_UNICODE_SCRIPT_DIVES_AKURU, HB_SCRIPT_DIVES_AKURU, NC_("Script", "Dives Akuru") },
{ G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT, HB_SCRIPT_KHITAN_SMALL_SCRIPT, NC_("Script", "Khitan small script") },
{ G_UNICODE_SCRIPT_YEZIDI, HB_SCRIPT_YEZIDI, NC_("Script", "Yezidi") },
#else
{ G_UNICODE_SCRIPT_CHORASMIAN, HB_SCRIPT_INVALID, NC_("Script", "Chorasmian") },
{ G_UNICODE_SCRIPT_DIVES_AKURU, HB_SCRIPT_INVALID, NC_("Script", "Dives Akuru") },
{ G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT, HB_SCRIPT_INVALID, NC_("Script", "Khitan small script") },
{ G_UNICODE_SCRIPT_YEZIDI, HB_SCRIPT_INVALID, NC_("Script", "Yezidi") },
#endif
};
const char *
get_script_name (GUnicodeScript script)
{
int i;
for (i = 0; i < G_N_ELEMENTS (scripts); i++)
{
if (scripts[i].script == script)
return g_dpgettext2 (GETTEXT_PACKAGE, "Script", scripts[i].name);
}
return NULL;
}
const char *
get_script_name_for_tag (guint32 tag)
{
int i;
for (i = 0; i < G_N_ELEMENTS (scripts); i++)
{
if (scripts[i].hb_script == hb_script_from_iso15924_tag (tag))
return g_dpgettext2 (GETTEXT_PACKAGE, "Script", scripts[i].name);
}
return NULL;
}
+13
View File
@@ -0,0 +1,13 @@
#ifndef SCRIPT_NAMES_H
#define SCRIPT_NAMES_H
#include <glib.h>
G_BEGIN_DECLS
const char * get_script_name (GUnicodeScript script);
const char * get_script_name_for_tag (guint32 tag);
G_END_DECLS
#endif
+1 -1
View File
@@ -897,7 +897,7 @@ if not meson.is_cross_build()
gnome.post_install(
glib_compile_schemas: true,
gio_querymodules: gio_module_dirs,
gtk_update_icon_cache: get_option('demos'),
gtk_update_icon_cache: true,
)
else
meson.add_install_script('build-aux/meson/post-install.py',
+1 -1
View File
@@ -4076,7 +4076,7 @@ msgstr "Afegeix nodes de depuració"
#: gtk/inspector/recorder.ui:42
msgid "Highlight event sequences"
msgstr "Ressalta les seqüències d'esdeveniments"
msgstr "Ressalta les seqüencies d'esdeveniments"
#: gtk/inspector/recorder.ui:51
msgid "Use a dark background"
+175 -234
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -649,7 +649,6 @@ main (int argc, char *argv[])
gsk_renderer_unrealize (gl_renderer);
g_clear_object (&gl_renderer);
}
gdk_gl_context_clear_current ();
return result;
}
-1
View File
@@ -108,7 +108,6 @@ texture_threads (void)
g_clear_pointer (&loop, g_main_loop_unref);
g_clear_object (&gl_renderer);
g_main_context_release (NULL);
gdk_gl_context_clear_current ();
}
int
+1 -1
View File
@@ -552,7 +552,7 @@ main (int argc, char **argv)
* is the same as the reftest data, because we're using the
* "file" property of GtkImage as a relative path in builder files.
*/
g_assert (chdir (basedir) == 0);
chdir (basedir);
g_log_set_writer_func (log_writer, NULL, NULL);