Compare commits
108 Commits
4.3.2
...
line-spacing
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fedf63c9c | |||
| d1213c6e66 | |||
| 4cc7977d36 | |||
| e5e7f5dd88 | |||
| 8ff94ea1f2 | |||
| 053bd0cd31 | |||
| a3ce574193 | |||
| ef92adc87d | |||
| ca547b8716 | |||
| 04ea51e843 | |||
| f7dc0dda4e | |||
| 8713843022 | |||
| 6563b05d60 | |||
| d119c55b72 | |||
| 253e25a73c | |||
| c63774967f | |||
| bbc36448fb | |||
| 5df323fb64 | |||
| 0f2c5f13be | |||
| 58180ad3be | |||
| fb0229890b | |||
| 9099888398 | |||
| 882855f865 | |||
| f59d2ae89d | |||
| 7c3a53a171 | |||
| 1e22572716 | |||
| 8a25f54e1f | |||
| c51f2fc0ec | |||
| 2a528df977 | |||
| 84684bd56e | |||
| e1606ce8eb | |||
| 47072e0441 | |||
| 915c229396 | |||
| 0bf46b4845 | |||
| a7a2dbc3ea | |||
| 7e8f586859 | |||
| bb9dccd773 | |||
| 7b743e662e | |||
| 769dc53c05 | |||
| 1a4554daf3 | |||
| 6c0633ef61 | |||
| 4d020a3875 | |||
| 316cc55e69 | |||
| 95f2634ea9 | |||
| 95c032f531 | |||
| 744955753f | |||
| ae5e7dc65d | |||
| ed41c46926 | |||
| a460fb2734 | |||
| 39ddce6ba3 | |||
| 8da7e3bdc3 | |||
| eff53c023a | |||
| 99e4a6a2d6 | |||
| c06817b951 | |||
| e765aaa3f4 | |||
| 1728aa581c | |||
| c50475de34 | |||
| 06348a8517 | |||
| c4dbb8f01e | |||
| e67b2cb54b | |||
| 908b1e5e12 | |||
| 539391ce6c | |||
| 23e79d2eb2 | |||
| 0c7b1431d7 | |||
| b6c0155836 | |||
| 76d67b586c | |||
| 914edb1472 | |||
| dbf5033f94 | |||
| cc6ecc8b62 | |||
| b7e6922605 | |||
| 05eaffb9f2 | |||
| 67b568f464 | |||
| 19b534f7de | |||
| db8b3419c2 | |||
| 0f5ba5192a | |||
| 108c423d70 | |||
| dded10a396 | |||
| 1b080826db | |||
| 910f23ea19 | |||
| f1b50baba1 | |||
| 4453597946 | |||
| 192bfa10cb | |||
| 0781429dc5 | |||
| d760332f00 | |||
| 131be5f2e8 | |||
| 57a95c540c | |||
| 09deb1d757 | |||
| 5c4aba4b9c | |||
| 6a5d555f58 | |||
| f5dc71021f | |||
| 87e2a02e0c | |||
| 264d592012 | |||
| 0ad5094119 | |||
| 4390f8102b | |||
| 92129a2011 | |||
| 54dffa07f3 | |||
| 1cff4bb27a | |||
| 8087250476 | |||
| 485dc052ca | |||
| 45d39c2802 | |||
| 3b4b1c6878 | |||
| ff4f07d76f | |||
| fb6c8cd466 | |||
| 8464b0484f | |||
| bee58fd09d | |||
| d25557a5ef | |||
| da3ca6604b | |||
| 74cba6c3b2 |
+7
-8
@@ -7,6 +7,7 @@ stages:
|
||||
- analysis
|
||||
- docs
|
||||
- flatpak
|
||||
- publish
|
||||
- deploy
|
||||
|
||||
.cache-paths: &cache-paths
|
||||
@@ -57,6 +58,7 @@ style-check-diff:
|
||||
- "${CI_PROJECT_DIR}/_build/report*.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report*.html"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
|
||||
- "${CI_PROJECT_DIR}/_build_hello/meson-logs"
|
||||
@@ -336,14 +338,11 @@ reference:
|
||||
paths:
|
||||
- _reference
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
publish-docs:
|
||||
stage: publish
|
||||
needs: ['reference']
|
||||
script:
|
||||
- mv _reference/ public/
|
||||
- cp .gitlab-ci/pages/* public/
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=docs-gtk-org https://gitlab.gnome.org/api/v4/projects/665/trigger/pipeline"
|
||||
only:
|
||||
- master
|
||||
refs:
|
||||
- master
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 MiB |
@@ -696,6 +696,37 @@ on_range_to_changed (GtkSpinButton *to)
|
||||
gtk_spin_button_set_value (from, v2);
|
||||
}
|
||||
|
||||
static GdkContentProvider *
|
||||
on_picture_drag_prepare (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
gpointer unused)
|
||||
{
|
||||
GtkWidget *picture;
|
||||
|
||||
picture = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
return gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, gtk_picture_get_paintable (GTK_PICTURE (picture)));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_picture_drop (GtkDropTarget *dest,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y,
|
||||
gpointer unused)
|
||||
{
|
||||
GtkWidget *picture;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
picture = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
|
||||
paintable = g_value_get_object (value);
|
||||
|
||||
gtk_picture_set_paintable (GTK_PICTURE (picture), paintable);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
info_bar_response (GtkWidget *infobar, int response_id)
|
||||
{
|
||||
@@ -1182,7 +1213,7 @@ populate_flowbox (GtkWidget *flowbox)
|
||||
GtkWidget *child;
|
||||
int i;
|
||||
const char *resources[] = {
|
||||
"sunset.jpg", "snowy.jpg", "portland-rose.jpg"
|
||||
"sunset.jpg", "portland-rose.jpg", "beach.jpg", "nyc.jpg"
|
||||
};
|
||||
|
||||
if (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (flowbox), "populated")))
|
||||
@@ -2040,6 +2071,8 @@ activate (GApplication *app)
|
||||
"on_page_combo_changed", (GCallback)on_page_combo_changed,
|
||||
"on_range_from_changed", (GCallback)on_range_from_changed,
|
||||
"on_range_to_changed", (GCallback)on_range_to_changed,
|
||||
"on_picture_drag_prepare", (GCallback)on_picture_drag_prepare,
|
||||
"on_picture_drop", (GCallback)on_picture_drop,
|
||||
"tab_close_cb", (GCallback)tab_close_cb,
|
||||
"increase_icon_size", (GCallback)increase_icon_size,
|
||||
"decrease_icon_size", (GCallback)decrease_icon_size,
|
||||
|
||||
@@ -115,7 +115,8 @@
|
||||
<gresource prefix="/org/gtk/WidgetFactory4">
|
||||
<file>gtk-logo.webm</file>
|
||||
<file>sunset.jpg</file>
|
||||
<file>snowy.jpg</file>
|
||||
<file>portland-rose.jpg</file>
|
||||
<file>nyc.jpg</file>
|
||||
<file>beach.jpg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -1051,22 +1051,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="hexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="valign">start</property>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="label" translatable="yes"><b>Video</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkVideo">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="autoplay">1</property>
|
||||
<property name="loop">1</property>
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/gtk-logo.webm</property>
|
||||
@@ -1075,66 +1062,78 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<object class="GtkFrame">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="label" translatable="yes"><b>Text Styles</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="propagate-natural-height">1</property>
|
||||
<property name="propagate-natural-width">1</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Large Title</property>
|
||||
<style><class name="large-title"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 1</property>
|
||||
<style><class name="title-1"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 2</property>
|
||||
<style><class name="title-2"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 3</property>
|
||||
<style><class name="title-3"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 4</property>
|
||||
<style><class name="title-4"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Heading</property>
|
||||
<style><class name="heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Body</property>
|
||||
<style><class name="body"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption Heading</property>
|
||||
<style><class name="caption-heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption</property>
|
||||
<style><class name="caption"/></style>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Large Title</property>
|
||||
<style><class name="large-title"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 1</property>
|
||||
<style><class name="title-1"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 2</property>
|
||||
<style><class name="title-2"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 3</property>
|
||||
<style><class name="title-3"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 4</property>
|
||||
<style><class name="title-4"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Heading</property>
|
||||
<style><class name="heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Body</property>
|
||||
<style><class name="body"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption Heading</property>
|
||||
<style><class name="caption-heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption</property>
|
||||
<style><class name="caption"/></style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -1251,8 +1250,21 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="box6">
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="GtkPicture">
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/sunset.jpg</property>
|
||||
<child>
|
||||
<object class="GtkDragSource">
|
||||
<property name="actions">copy</property>
|
||||
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropTarget">
|
||||
<property name="actions">copy</property>
|
||||
<property name="formats">GdkTexture</property>
|
||||
<signal name="drop" handler="on_picture_drop" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="tab">
|
||||
@@ -1265,8 +1277,21 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="box7">
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="GtkPicture">
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/nyc.jpg</property>
|
||||
<child>
|
||||
<object class="GtkDragSource">
|
||||
<property name="actions">copy</property>
|
||||
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropTarget">
|
||||
<property name="actions">copy</property>
|
||||
<property name="formats">GdkTexture</property>
|
||||
<signal name="drop" handler="on_picture_drop" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="tab">
|
||||
@@ -1278,10 +1303,22 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="position">2</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="box8">
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="GtkPicture">
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/beach.jpg</property>
|
||||
<child>
|
||||
<object class="GtkDragSource">
|
||||
<property name="actions">copy</property>
|
||||
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropTarget">
|
||||
<property name="actions">copy</property>
|
||||
<property name="formats">GdkTexture</property>
|
||||
<signal name="drop" handler="on_picture_drop" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="tab">
|
||||
@@ -1299,7 +1336,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="box9">
|
||||
<object class="GtkBox" id="box8">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
@@ -13,7 +13,7 @@ devhelp = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -13,7 +13,7 @@ devhelp = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -14,7 +14,7 @@ search_index = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[dependencies."cairo-1.0"]
|
||||
name = "Cairo"
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
expand_content_md_files = [
|
||||
]
|
||||
|
||||
gdk4_toml = configure_file(input: 'gdk4.toml.in', output: 'gdk4.toml', configuration: toml_conf)
|
||||
gdk4x11_toml = configure_file(input: 'gdk4-x11.toml.in', output: 'gdk4-x11.toml', configuration: toml_conf)
|
||||
gdk4wayland_toml = configure_file(input: 'gdk4-wayland.toml.in', output: 'gdk4-wayland.toml', configuration: toml_conf)
|
||||
|
||||
if get_option('gtk_doc')
|
||||
gdk4_toml = configure_file(
|
||||
input: 'gdk4.toml.in',
|
||||
output: 'gdk4.toml',
|
||||
configuration: toml_conf,
|
||||
install: true,
|
||||
install_dir: docs_dir / 'gdk4',
|
||||
)
|
||||
|
||||
custom_target('gdk4-doc',
|
||||
input: [ gdk4_toml, gdk_gir[0] ],
|
||||
output: 'gdk4',
|
||||
@@ -28,6 +32,14 @@ if get_option('gtk_doc')
|
||||
)
|
||||
|
||||
if x11_enabled
|
||||
gdk4x11_toml = configure_file(
|
||||
input: 'gdk4-x11.toml.in',
|
||||
output: 'gdk4-x11.toml',
|
||||
configuration: toml_conf,
|
||||
install: true,
|
||||
install_dir: docs_dir / 'gdk4-x11',
|
||||
)
|
||||
|
||||
custom_target('gdk4-x11-doc',
|
||||
input: [ gdk4x11_toml, gdk_x11_gir[0] ],
|
||||
output: 'gdk4-x11',
|
||||
@@ -52,6 +64,14 @@ if get_option('gtk_doc')
|
||||
endif
|
||||
|
||||
if wayland_enabled
|
||||
gdk4wayland_toml = configure_file(
|
||||
input: 'gdk4-wayland.toml.in',
|
||||
output: 'gdk4-wayland.toml',
|
||||
configuration: toml_conf,
|
||||
install: true,
|
||||
install_dir: docs_dir / 'gdk4-wayland',
|
||||
)
|
||||
|
||||
custom_target('gdk4-wayland-doc',
|
||||
input: [ gdk4wayland_toml, gdk_wayland_gir[0] ],
|
||||
output: 'gdk4-wayland',
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
|
||||
// A map between namespaces and base URLs for their online documentation
|
||||
baseURLs = [
|
||||
[ 'Gdk', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://gnome.pages.gitlab.gnome.org/gtk/gsk4/' ],
|
||||
[ 'Gtk', 'https://gnome.pages.gitlab.gnome.org/gtk/gtk4/' ],
|
||||
[ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
|
||||
[ 'PangoCairo', 'https://gnome.pages.gitlab.gnome.org/pango/pangocairo/' ],
|
||||
[ 'GLib', 'https://docs.gtk.org/glib/' ],
|
||||
[ 'GObject', 'https://docs.gtk.org/gobject/' ],
|
||||
[ 'Gio', 'https://docs.gtk.org/gio/' ],
|
||||
[ 'Gdk', 'https://docs.gtk.org/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://docs.gtk.org/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://docs.gtk.org/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://docs.gtk.org/gsk4/' ],
|
||||
[ 'Gtk', 'https://docs.gtk.org/gtk4/' ],
|
||||
[ 'Pango', 'https://docs.gtk.org/Pango/' ],
|
||||
[ 'PangoCairo', 'https://docs.gtk.org/PangoCairo/' ],
|
||||
]
|
||||
|
||||
@@ -14,7 +14,7 @@ search_index = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable/"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[dependencies."Graphene-1.0"]
|
||||
name = "Graphene"
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
gsk4_toml = configure_file(input: 'gsk4.toml.in', output: 'gsk4.toml', configuration: toml_conf)
|
||||
|
||||
if get_option('gtk_doc')
|
||||
gsk4_toml = configure_file(
|
||||
input: 'gsk4.toml.in',
|
||||
output: 'gsk4.toml',
|
||||
configuration: toml_conf,
|
||||
install: true,
|
||||
install_dir: docs_dir / 'gsk4',
|
||||
)
|
||||
|
||||
custom_target('gsk4-doc',
|
||||
input: [ gsk4_toml, gsk_gir[0] ],
|
||||
output: 'gsk4',
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
|
||||
// A map between namespaces and base URLs for their online documentation
|
||||
baseURLs = [
|
||||
[ 'Gdk', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://gnome.pages.gitlab.gnome.org/gtk/gsk4/' ],
|
||||
[ 'Gtk', 'https://gnome.pages.gitlab.gnome.org/gtk/gtk4/' ],
|
||||
[ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
|
||||
[ 'PangoCairo', 'https://gnome.pages.gitlab.gnome.org/pango/pangocairo/' ],
|
||||
[ 'GLib', 'https://docs.gtk.org/glib/' ],
|
||||
[ 'GObject', 'https://docs.gtk.org/gobject/' ],
|
||||
[ 'Gio', 'https://docs.gtk.org/gio/' ],
|
||||
[ 'Gdk', 'https://docs.gtk.org/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://docs.gtk.org/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://docs.gtk.org/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://docs.gtk.org/gsk4/' ],
|
||||
[ 'Gtk', 'https://docs.gtk.org/gtk4/' ],
|
||||
[ 'Pango', 'https://docs.gtk.org/Pango/' ],
|
||||
[ 'PangoCairo', 'https://docs.gtk.org/PangoCairo/' ],
|
||||
]
|
||||
|
||||
@@ -14,7 +14,7 @@ search_index = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[dependencies."Graphene-1.0"]
|
||||
name = "Graphene"
|
||||
|
||||
@@ -27,9 +27,15 @@ expand_content_md_files = [
|
||||
'visual_index.md'
|
||||
]
|
||||
|
||||
gtk4_toml = configure_file(input: 'gtk4.toml.in', output: 'gtk4.toml', configuration: toml_conf)
|
||||
|
||||
if get_option('gtk_doc')
|
||||
gtk4_toml = configure_file(
|
||||
input: 'gtk4.toml.in',
|
||||
output: 'gtk4.toml',
|
||||
configuration: toml_conf,
|
||||
install: true,
|
||||
install_dir: docs_dir / 'gtk4',
|
||||
)
|
||||
|
||||
custom_target('gtk4-doc',
|
||||
input: [ gtk4_toml, gtk_gir[0] ],
|
||||
output: 'gtk4',
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
|
||||
// A map between namespaces and base URLs for their online documentation
|
||||
baseURLs = [
|
||||
[ 'Gdk', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://gnome.pages.gitlab.gnome.org/gtk/gsk4/' ],
|
||||
[ 'Gtk', 'https://gnome.pages.gitlab.gnome.org/gtk/gtk4/' ],
|
||||
[ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
|
||||
[ 'PangoCairo', 'https://gnome.pages.gitlab.gnome.org/pango/pangocairo/' ],
|
||||
[ 'GLib', 'https://docs.gtk.org/glib/' ],
|
||||
[ 'GObject', 'https://docs.gtk.org/gobject/' ],
|
||||
[ 'Gio', 'https://docs.gtk.org/gio/' ],
|
||||
[ 'Gdk', 'https://docs.gtk.org/gdk4/' ],
|
||||
[ 'GdkWayland', 'https://docs.gtk.org/gdk4-wayland/' ],
|
||||
[ 'GdkX11', 'https://docs.gtk.org/gdk4-x11/' ],
|
||||
[ 'Gsk', 'https://docs.gtk.org/gsk4/' ],
|
||||
[ 'Gtk', 'https://docs.gtk.org/gtk4/' ],
|
||||
[ 'Pango', 'https://docs.gtk.org/Pango/' ],
|
||||
[ 'PangoCairo', 'https://docs.gtk.org/PangoCairo/' ],
|
||||
]
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include <gdk/gdktextureprivate.h>
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
@@ -463,7 +464,7 @@ gdk_broadway_display_flush_in_idle (GdkDisplay *display)
|
||||
if (broadway_display->idle_flush_id == 0)
|
||||
{
|
||||
broadway_display->idle_flush_id = g_idle_add (flush_idle, g_object_ref (display));
|
||||
g_source_set_name_by_id (broadway_display->idle_flush_id, "[gtk] flush_idle");
|
||||
gdk_source_set_static_name_by_id (broadway_display->idle_flush_id, "[gtk] flush_idle");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,4 +57,11 @@ guint gdk_parse_debug_var (const char *variable,
|
||||
# define g_memdup2(mem,size) g_memdup((mem),(size))
|
||||
#endif
|
||||
|
||||
void gdk_source_set_static_name_by_id (guint tag,
|
||||
const char *name);
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 69, 1)
|
||||
#define g_source_set_static_name(source, name) g_source_set_name ((source), (name))
|
||||
#endif
|
||||
|
||||
#endif /* __GDK__PRIVATE_H__ */
|
||||
|
||||
@@ -414,3 +414,17 @@ gdk_find_base_dir (const char *text,
|
||||
return dir;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_source_set_static_name_by_id (guint tag,
|
||||
const char *name)
|
||||
{
|
||||
GSource *source;
|
||||
|
||||
g_return_if_fail (tag > 0);
|
||||
|
||||
source = g_main_context_find_source_by_id (NULL, tag);
|
||||
if (source == NULL)
|
||||
return;
|
||||
|
||||
g_source_set_static_name (source, name);
|
||||
}
|
||||
|
||||
+76
-8
@@ -179,6 +179,76 @@ gdk_content_formats_new_for_gtype (GType type)
|
||||
return gdk_content_formats_new_take (data, 1, NULL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_content_formats_parse:
|
||||
* @string: the string to parse
|
||||
*
|
||||
* Parses the given @string into `GdkContentFormats` and
|
||||
* returns the formats.
|
||||
*
|
||||
* Strings printed via [method@Gdk.ContentFormats.to_string]
|
||||
* can be read in again successfully using this function.
|
||||
*
|
||||
* If @string does not describe valid content formats, %NULL
|
||||
* is returned.
|
||||
*
|
||||
* Returns: (nullable): the content formats if @string is valid
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
GdkContentFormats *
|
||||
gdk_content_formats_parse (const char *string)
|
||||
{
|
||||
GdkContentFormatsBuilder *builder;
|
||||
char **split;
|
||||
gsize i;
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
|
||||
split = g_strsplit_set (string, "\t\n\f\r ", -1); /* same as g_ascii_isspace() */
|
||||
builder = gdk_content_formats_builder_new ();
|
||||
|
||||
/* first the GTypes */
|
||||
for (i = 0; split[i] != NULL; i++)
|
||||
{
|
||||
GType type;
|
||||
|
||||
if (split[i][0] == 0)
|
||||
continue;
|
||||
|
||||
type = g_type_from_name (split[i]);
|
||||
if (type != 0)
|
||||
gdk_content_formats_builder_add_gtype (builder, type);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* then the mime types */
|
||||
for (; split[i] != NULL; i++)
|
||||
{
|
||||
const char *mime_type;
|
||||
|
||||
if (split[i][0] == 0)
|
||||
continue;
|
||||
|
||||
mime_type = gdk_intern_mime_type (split[i]);
|
||||
if (mime_type)
|
||||
gdk_content_formats_builder_add_mime_type (builder, mime_type);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (split[i] != NULL)
|
||||
{
|
||||
g_strfreev (split);
|
||||
gdk_content_formats_builder_unref (builder);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_strfreev (split);
|
||||
return gdk_content_formats_builder_free_to_formats (builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_content_formats_ref:
|
||||
* @formats: a `GdkContentFormats`
|
||||
@@ -227,10 +297,8 @@ gdk_content_formats_unref (GdkContentFormats *formats)
|
||||
*
|
||||
* Prints the given @formats into a string for human consumption.
|
||||
*
|
||||
* This is meant for debugging and logging.
|
||||
*
|
||||
* The form of the representation may change at any time and is
|
||||
* not guaranteed to stay identical.
|
||||
* The result of this function can later be parsed with
|
||||
* [func@Gdk.ContentFormats.parse].
|
||||
*/
|
||||
void
|
||||
gdk_content_formats_print (GdkContentFormats *formats,
|
||||
@@ -241,20 +309,18 @@ gdk_content_formats_print (GdkContentFormats *formats,
|
||||
g_return_if_fail (formats != NULL);
|
||||
g_return_if_fail (string != NULL);
|
||||
|
||||
g_string_append (string, "{ ");
|
||||
for (i = 0; i < formats->n_gtypes; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
g_string_append (string, ", ");
|
||||
g_string_append (string, " ");
|
||||
g_string_append (string, g_type_name (formats->gtypes[i]));
|
||||
}
|
||||
for (i = 0; i < formats->n_mime_types; i++)
|
||||
{
|
||||
if (i > 0 || formats->n_gtypes > 0)
|
||||
g_string_append (string, ", ");
|
||||
g_string_append (string, " ");
|
||||
g_string_append (string, formats->mime_types[i]);
|
||||
}
|
||||
g_string_append (string, " }");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -263,6 +329,8 @@ gdk_content_formats_print (GdkContentFormats *formats,
|
||||
*
|
||||
* Prints the given @formats into a human-readable string.
|
||||
*
|
||||
* The resulting string can be parsed with [func@Gdk.ContentFormats.parse].
|
||||
*
|
||||
* This is a small wrapper around [method@Gdk.ContentFormats.print]
|
||||
* to help when debugging.
|
||||
*
|
||||
|
||||
@@ -40,6 +40,8 @@ GdkContentFormats * gdk_content_formats_new (const char
|
||||
guint n_mime_types);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkContentFormats * gdk_content_formats_new_for_gtype (GType type);
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
GdkContentFormats * gdk_content_formats_parse (const char *string);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkContentFormats * gdk_content_formats_ref (GdkContentFormats *formats);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkframeclockprivate.h"
|
||||
#include "gdk.h"
|
||||
#include "gdk-private.h"
|
||||
#include "gdkprofilerprivate.h"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
@@ -307,12 +308,15 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle,
|
||||
|
||||
if (priv->flush_idle_id == 0 && RUN_FLUSH_IDLE (priv))
|
||||
{
|
||||
GSource *source;
|
||||
|
||||
priv->flush_idle_id = g_timeout_add_full (GDK_PRIORITY_EVENTS + 1,
|
||||
min_interval,
|
||||
gdk_frame_clock_flush_idle,
|
||||
g_object_ref (clock_idle),
|
||||
(GDestroyNotify) g_object_unref);
|
||||
g_source_set_name_by_id (priv->flush_idle_id, "[gtk] gdk_frame_clock_flush_idle");
|
||||
source = g_main_context_find_source_by_id (NULL, priv->flush_idle_id);
|
||||
g_source_set_static_name (source, "[gtk] gdk_frame_clock_flush_idle");
|
||||
}
|
||||
|
||||
if (!priv->in_paint_idle &&
|
||||
@@ -324,7 +328,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle,
|
||||
gdk_frame_clock_paint_idle,
|
||||
g_object_ref (clock_idle),
|
||||
(GDestroyNotify) g_object_unref);
|
||||
g_source_set_name_by_id (priv->paint_idle_id, "[gtk] gdk_frame_clock_paint_idle");
|
||||
gdk_source_set_static_name_by_id (priv->paint_idle_id, "[gtk] gdk_frame_clock_paint_idle");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,6 +856,8 @@ gdk_gl_context_set_is_legacy (GdkGLContext *context,
|
||||
* is not, this function will return %FALSE.
|
||||
*
|
||||
* Returns: %TRUE if the two GL contexts are compatible.
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_is_shared (GdkGLContext *self,
|
||||
|
||||
@@ -78,6 +78,13 @@ gdk_toplevel_default_show_window_menu (GdkToplevel *toplevel,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_toplevel_default_titlebar_gesture (GdkToplevel *toplevel,
|
||||
GdkTitlebarGesture gesture)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_toplevel_default_supports_edge_constraints (GdkToplevel *toplevel)
|
||||
{
|
||||
@@ -114,6 +121,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
iface->supports_edge_constraints = gdk_toplevel_default_supports_edge_constraints;
|
||||
iface->inhibit_system_shortcuts = gdk_toplevel_default_inhibit_system_shortcuts;
|
||||
iface->restore_system_shortcuts = gdk_toplevel_default_restore_system_shortcuts;
|
||||
iface->titlebar_gesture = gdk_toplevel_default_titlebar_gesture;
|
||||
|
||||
/**
|
||||
* GdkToplevel:state: (attributes org.gtk.Property.get=gdk_toplevel_get_state)
|
||||
@@ -716,3 +724,13 @@ gdk_toplevel_begin_move (GdkToplevel *toplevel,
|
||||
x, y,
|
||||
timestamp);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_toplevel_titlebar_gesture (GdkToplevel *toplevel,
|
||||
GdkTitlebarGesture gesture)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_TOPLEVEL (toplevel), FALSE);
|
||||
|
||||
return GDK_TOPLEVEL_GET_IFACE (toplevel)->titlebar_gesture (toplevel,
|
||||
gesture);
|
||||
}
|
||||
|
||||
@@ -115,6 +115,13 @@ typedef enum
|
||||
GDK_TOPLEVEL_STATE_LEFT_RESIZABLE = 1 << 15
|
||||
} GdkToplevelState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_TITLEBAR_GESTURE_DOUBLE_CLICK = 1,
|
||||
GDK_TITLEBAR_GESTURE_RIGHT_CLICK = 2,
|
||||
GDK_TITLEBAR_GESTURE_MIDDLE_CLICK = 3
|
||||
} GdkTitlebarGesture;
|
||||
|
||||
|
||||
#define GDK_TYPE_TOPLEVEL (gdk_toplevel_get_type ())
|
||||
|
||||
@@ -196,6 +203,10 @@ void gdk_toplevel_begin_move (GdkToplevel *toplevel,
|
||||
double y,
|
||||
guint32 timestamp);
|
||||
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
gboolean gdk_toplevel_titlebar_gesture (GdkToplevel *toplevel,
|
||||
GdkTitlebarGesture gesture);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_TOPLEVEL_H__ */
|
||||
|
||||
@@ -38,6 +38,8 @@ struct _GdkToplevelInterface
|
||||
double x,
|
||||
double y,
|
||||
guint32 timestamp);
|
||||
gboolean (* titlebar_gesture) (GdkToplevel *toplevel,
|
||||
GdkTitlebarGesture gesture);
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
||||
@@ -197,7 +197,7 @@ gdk_display_link_source_new (void)
|
||||
gdk_display_link_source_frame_cb,
|
||||
source);
|
||||
|
||||
g_source_set_name (source, "[gdk] quartz frame clock");
|
||||
g_source_set_static_name (source, "[gdk] quartz frame clock");
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include "gdkmacosdevice-private.h"
|
||||
#include "gdkmacoscursor-private.h"
|
||||
@@ -161,7 +162,7 @@ gdk_macos_drag_drop_done (GdkDrag *drag,
|
||||
gdk_macos_zoomback_timeout,
|
||||
zb,
|
||||
(GDestroyNotify) gdk_macos_zoomback_destroy);
|
||||
g_source_set_name_by_id (id, "[gtk] gdk_macos_zoomback_timeout");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] gdk_macos_zoomback_timeout");
|
||||
g_object_unref (drag);
|
||||
}
|
||||
|
||||
@@ -242,9 +243,11 @@ gdk_macos_drag_drop_performed (GdkDrag *drag,
|
||||
|
||||
g_assert (GDK_IS_MACOS_DRAG (self));
|
||||
|
||||
g_object_ref (self);
|
||||
drag_ungrab (self);
|
||||
g_signal_emit_by_name (drag, "dnd-finished");
|
||||
gdk_drag_drop_done (drag, TRUE);
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1063,7 +1063,7 @@ _gdk_macos_event_source_new (GdkMacosDisplay *display)
|
||||
event_poll_fd.fd = -1;
|
||||
|
||||
source = g_source_new (&event_funcs, sizeof (GdkMacosEventSource));
|
||||
g_source_set_name (source, "GDK Quartz event source");
|
||||
g_source_set_static_name (source, "GDK Quartz event source");
|
||||
g_source_add_poll (source, &event_poll_fd);
|
||||
g_source_set_priority (source, GDK_PRIORITY_EVENTS);
|
||||
g_source_set_can_recurse (source, TRUE);
|
||||
|
||||
@@ -460,6 +460,7 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
pointer->cursor_timeout_id == 0)
|
||||
{
|
||||
guint id;
|
||||
GSource *source;
|
||||
|
||||
gdk_wayland_pointer_stop_cursor_animation (pointer);
|
||||
|
||||
@@ -467,7 +468,8 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
id = g_timeout_add (next_image_delay,
|
||||
(GSourceFunc) gdk_wayland_device_update_surface_cursor,
|
||||
device);
|
||||
g_source_set_name_by_id (id, "[gtk] gdk_wayland_device_update_surface_cursor");
|
||||
source = g_main_context_find_source_by_id (NULL, id);
|
||||
g_source_set_static_name (source, "[gtk] gdk_wayland_device_update_surface_cursor");
|
||||
pointer->cursor_timeout_id = id;
|
||||
}
|
||||
else
|
||||
@@ -2218,7 +2220,7 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
timeout = (seat->repeat_deadline - now) / 1000L;
|
||||
|
||||
seat->repeat_timer = g_timeout_add (timeout, keyboard_repeat, seat);
|
||||
g_source_set_name_by_id (seat->repeat_timer, "[gtk] keyboard_repeat");
|
||||
gdk_source_set_static_name_by_id (seat->repeat_timer, "[gtk] keyboard_repeat");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
#define MIN_SYSTEM_BELL_DELAY_MS 20
|
||||
|
||||
#define GTK_SHELL1_VERSION 4
|
||||
#define GTK_SHELL1_VERSION 5
|
||||
#define OUTPUT_VERSION_WITH_DONE 2
|
||||
#define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3
|
||||
#define XDG_ACTIVATION_VERSION 1
|
||||
|
||||
@@ -290,8 +290,10 @@ data_source_dnd_finished (void *data,
|
||||
{
|
||||
GdkDrag *drag = data;
|
||||
|
||||
g_object_ref (drag);
|
||||
g_signal_emit_by_name (drag, "dnd-finished");
|
||||
gdk_drag_drop_done (drag, TRUE);
|
||||
g_object_unref (drag);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -4190,6 +4190,65 @@ gdk_wayland_surface_show_window_menu (GdkSurface *surface,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
translate_gesture (GdkTitlebarGesture gesture,
|
||||
enum gtk_surface1_gesture *out_gesture)
|
||||
{
|
||||
switch (gesture)
|
||||
{
|
||||
case GDK_TITLEBAR_GESTURE_DOUBLE_CLICK:
|
||||
*out_gesture = GTK_SURFACE1_GESTURE_DOUBLE_CLICK;
|
||||
break;
|
||||
|
||||
case GDK_TITLEBAR_GESTURE_RIGHT_CLICK:
|
||||
*out_gesture = GTK_SURFACE1_GESTURE_RIGHT_CLICK;
|
||||
break;
|
||||
|
||||
case GDK_TITLEBAR_GESTURE_MIDDLE_CLICK:
|
||||
*out_gesture = GTK_SURFACE1_GESTURE_MIDDLE_CLICK;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning ("Not handling unknown titlebar gesture %u", gesture);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_surface_titlebar_gesture (GdkSurface *surface,
|
||||
GdkTitlebarGesture gesture)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
struct gtk_surface1 *gtk_surface = impl->display_server.gtk_surface;
|
||||
enum gtk_surface1_gesture gtk_gesture;
|
||||
GdkSeat *seat;
|
||||
struct wl_seat *wl_seat;
|
||||
uint32_t serial;
|
||||
|
||||
if (!gtk_surface)
|
||||
return FALSE;
|
||||
|
||||
if (gtk_surface1_get_version (gtk_surface) < GTK_SURFACE1_TITLEBAR_GESTURE_SINCE_VERSION)
|
||||
return FALSE;
|
||||
|
||||
if (!translate_gesture (gesture, >k_gesture))
|
||||
return FALSE;
|
||||
|
||||
seat = gdk_display_get_default_seat (surface->display);
|
||||
wl_seat = gdk_wayland_seat_get_wl_seat (seat);
|
||||
|
||||
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat), NULL);
|
||||
|
||||
gtk_surface1_titlebar_gesture (impl->display_server.gtk_surface,
|
||||
serial,
|
||||
wl_seat,
|
||||
gtk_gesture);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_surface_supports_edge_constraints (GdkSurface *surface)
|
||||
{
|
||||
@@ -4987,6 +5046,13 @@ gdk_wayland_toplevel_show_window_menu (GdkToplevel *toplevel,
|
||||
return gdk_wayland_surface_show_window_menu (GDK_SURFACE (toplevel), event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_toplevel_titlebar_gesture (GdkToplevel *toplevel,
|
||||
GdkTitlebarGesture gesture)
|
||||
{
|
||||
return gdk_wayland_surface_titlebar_gesture (GDK_SURFACE (toplevel), gesture);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_toplevel_supports_edge_constraints (GdkToplevel *toplevel)
|
||||
{
|
||||
@@ -5065,6 +5131,7 @@ gdk_wayland_toplevel_iface_init (GdkToplevelInterface *iface)
|
||||
iface->lower = gdk_wayland_toplevel_lower;
|
||||
iface->focus = gdk_wayland_toplevel_focus;
|
||||
iface->show_window_menu = gdk_wayland_toplevel_show_window_menu;
|
||||
iface->titlebar_gesture = gdk_wayland_toplevel_titlebar_gesture;
|
||||
iface->supports_edge_constraints = gdk_wayland_toplevel_supports_edge_constraints;
|
||||
iface->inhibit_system_shortcuts = gdk_wayland_toplevel_inhibit_system_shortcuts;
|
||||
iface->restore_system_shortcuts = gdk_wayland_toplevel_restore_system_shortcuts;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<protocol name="gtk">
|
||||
|
||||
<interface name="gtk_shell1" version="4">
|
||||
<interface name="gtk_shell1" version="5">
|
||||
<description summary="gtk specific extensions">
|
||||
gtk_shell is a protocol extension providing additional features for
|
||||
clients implementing it.
|
||||
@@ -35,7 +35,7 @@
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="gtk_surface1" version="4">
|
||||
<interface name="gtk_surface1" version="5">
|
||||
<request name="set_dbus_properties">
|
||||
<arg name="application_id" type="string" allow-null="true"/>
|
||||
<arg name="app_menu_path" type="string" allow-null="true"/>
|
||||
@@ -85,6 +85,23 @@
|
||||
|
||||
<!-- Version 4 additions -->
|
||||
<request name="release" type="destructor" since="4"/>
|
||||
|
||||
<!-- Version 5 additions -->
|
||||
<enum name="gesture" since="5">
|
||||
<entry name="double_click" value="1"/>
|
||||
<entry name="right_click" value="2"/>
|
||||
<entry name="middle_click" value="3"/>
|
||||
</enum>
|
||||
|
||||
<enum name="error" since="5">
|
||||
<entry name="invalid_gesture" value="0"/>
|
||||
</enum>
|
||||
|
||||
<request name="titlebar_gesture" since="5">
|
||||
<arg name="serial" type="uint"/>
|
||||
<arg name="seat" type="object" interface="wl_seat"/>
|
||||
<arg name="gesture" type="uint" enum="gesture"/>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
</protocol>
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
@@ -2196,7 +2198,7 @@ gdk_win32_drag_drop_done (GdkDrag *drag,
|
||||
id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
|
||||
gdk_drag_anim_timeout, anim,
|
||||
(GDestroyNotify) gdk_drag_anim_destroy);
|
||||
g_source_set_name_by_id (id, "[gtk] gdk_drag_anim_timeout");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] gdk_drag_anim_timeout");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "gdkdisplay-win32.h"
|
||||
//#include "gdkselection-win32.h"
|
||||
#include "gdkdragprivate.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <windowsx.h>
|
||||
|
||||
@@ -502,7 +503,7 @@ _gdk_events_init (GdkDisplay *display)
|
||||
#endif
|
||||
|
||||
source = g_source_new (&event_funcs, sizeof (GdkWin32EventSource));
|
||||
g_source_set_name (source, "GDK Win32 event source");
|
||||
g_source_set_static_name (source, "GDK Win32 event source");
|
||||
g_source_set_priority (source, GDK_PRIORITY_EVENTS);
|
||||
|
||||
event_source = (GdkWin32EventSource *)source;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "gdkintl.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkdisplay-x11.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <glib.h>
|
||||
#ifdef HAVE_DESKTOPAPPINFO
|
||||
@@ -219,7 +220,7 @@ startup_timeout (void *data)
|
||||
std->timeout_id = 0;
|
||||
else {
|
||||
std->timeout_id = g_timeout_add_seconds ((min_timeout + 500)/1000, startup_timeout, std);
|
||||
g_source_set_name_by_id (std->timeout_id, "[gtk] startup_timeout");
|
||||
gdk_source_set_static_name_by_id (std->timeout_id, "[gtk] startup_timeout");
|
||||
}
|
||||
|
||||
/* always remove this one, but we may have reinstalled another one. */
|
||||
@@ -256,7 +257,7 @@ add_startup_timeout (GdkX11Screen *screen,
|
||||
if (data->timeout_id == 0) {
|
||||
data->timeout_id = g_timeout_add_seconds (STARTUP_TIMEOUT_LENGTH_SECONDS,
|
||||
startup_timeout, data);
|
||||
g_source_set_name_by_id (data->timeout_id, "[gtk] startup_timeout");
|
||||
gdk_source_set_static_name_by_id (data->timeout_id, "[gtk] startup_timeout");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -46,6 +46,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
#include "gdkasync.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkdisplay-x11.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <X11/Xlibint.h>
|
||||
|
||||
@@ -171,7 +172,7 @@ send_event_handler (Display *dpy,
|
||||
{
|
||||
guint id;
|
||||
id = g_idle_add (callback_idle, state);
|
||||
g_source_set_name_by_id (id, "[gtk] callback_idle");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] callback_idle");
|
||||
}
|
||||
|
||||
DeqAsyncHandler(state->dpy, &state->async);
|
||||
@@ -707,7 +708,7 @@ roundtrip_handler (Display *dpy,
|
||||
{
|
||||
guint id;
|
||||
id = g_idle_add (roundtrip_callback_idle, state);
|
||||
g_source_set_name_by_id (id, "[gtk] roundtrip_callback_idle");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] roundtrip_callback_idle");
|
||||
}
|
||||
|
||||
DeqAsyncHandler(state->dpy, &state->async);
|
||||
|
||||
@@ -204,6 +204,9 @@ static void
|
||||
gdk_x11_display_init (GdkX11Display *self)
|
||||
{
|
||||
self->monitors = g_list_store_new (GDK_TYPE_MONITOR);
|
||||
self->program_class = g_strdup (g_get_prgname ());
|
||||
if (self->program_class && self->program_class[0])
|
||||
self->program_class[0] = g_ascii_toupper (self->program_class[0]);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -884,8 +884,10 @@ gdk_x11_drag_handle_finished (GdkDisplay *display,
|
||||
if (drag_x11->version == 5)
|
||||
drag_x11->drop_failed = xevent->xclient.data.l[1] == 0;
|
||||
|
||||
g_object_ref (drag);
|
||||
g_signal_emit_by_name (drag, "dnd-finished");
|
||||
gdk_drag_drop_done (drag, !drag_x11->drop_failed);
|
||||
g_object_unref (drag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1862,7 +1864,7 @@ gdk_x11_drag_drop_done (GdkDrag *drag,
|
||||
id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
|
||||
gdk_drag_anim_timeout, anim,
|
||||
(GDestroyNotify) gdk_drag_anim_destroy);
|
||||
g_source_set_name_by_id (id, "[gtk] gdk_drag_anim_timeout");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] gdk_drag_anim_timeout");
|
||||
g_object_unref (drag);
|
||||
}
|
||||
|
||||
|
||||
+70
-17
@@ -30,7 +30,7 @@
|
||||
#include "gdk/gdktextureprivate.h"
|
||||
#include "gdk/gdk-private.h"
|
||||
|
||||
#include <cairo-ft.h>
|
||||
#include <hb-ot.h>
|
||||
|
||||
static inline void
|
||||
gsk_cairo_rectangle (cairo_t *cr,
|
||||
@@ -4377,6 +4377,15 @@ gsk_text_node_draw (GskRenderNode *node,
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
/* We steal one of the bits in PangoGlyphVisAttr */
|
||||
|
||||
G_STATIC_ASSERT (sizeof (PangoGlyphVisAttr) == 4);
|
||||
|
||||
#define COLOR_GLYPH_BIT 2
|
||||
#define GLYPH_IS_COLOR(g) (((*(guint32*)&(g)->attr) & COLOR_GLYPH_BIT) != 0)
|
||||
#define GLYPH_SET_COLOR(g) (*(guint32*)(&(g)->attr) |= COLOR_GLYPH_BIT)
|
||||
#define GLYPH_CLEAR_COLOR(g) (*(guint32*)(&(g)->attr) &= ~COLOR_GLYPH_BIT)
|
||||
|
||||
static void
|
||||
gsk_text_node_diff (GskRenderNode *node1,
|
||||
GskRenderNode *node2,
|
||||
@@ -4401,7 +4410,8 @@ gsk_text_node_diff (GskRenderNode *node1,
|
||||
info1->geometry.width == info2->geometry.width &&
|
||||
info1->geometry.x_offset == info2->geometry.x_offset &&
|
||||
info1->geometry.y_offset == info2->geometry.y_offset &&
|
||||
info1->attr.is_cluster_start == info2->attr.is_cluster_start)
|
||||
info1->attr.is_cluster_start == info2->attr.is_cluster_start &&
|
||||
GLYPH_IS_COLOR (info1) == GLYPH_IS_COLOR (info2))
|
||||
continue;
|
||||
|
||||
gsk_render_node_diff_impossible (node1, node2, region);
|
||||
@@ -4415,20 +4425,43 @@ gsk_text_node_diff (GskRenderNode *node1,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
font_has_color_glyphs (const PangoFont *font)
|
||||
font_has_color_glyphs (PangoFont *font)
|
||||
{
|
||||
cairo_scaled_font_t *scaled_font;
|
||||
gboolean has_color = FALSE;
|
||||
hb_face_t *face = hb_font_get_face (pango_font_get_hb_font (font));
|
||||
|
||||
scaled_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *)font);
|
||||
if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_FT)
|
||||
return hb_ot_color_has_layers (face) ||
|
||||
hb_ot_color_has_png (face) ||
|
||||
hb_ot_color_has_svg (face);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
glyph_has_color (PangoFont *font,
|
||||
guint glyph)
|
||||
{
|
||||
hb_font_t *hb_font = pango_font_get_hb_font (font);
|
||||
hb_face_t *face = hb_font_get_face (hb_font);
|
||||
hb_blob_t *blob;
|
||||
|
||||
if (hb_ot_color_glyph_get_layers (face, glyph, 0, NULL, NULL) > 0)
|
||||
return TRUE;
|
||||
|
||||
blob = hb_ot_color_glyph_reference_png (hb_font, glyph);
|
||||
if (blob)
|
||||
{
|
||||
FT_Face ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
|
||||
has_color = (FT_HAS_COLOR (ft_face) != 0);
|
||||
cairo_ft_scaled_font_unlock_face (scaled_font);
|
||||
guint length = hb_blob_get_length (blob);
|
||||
hb_blob_destroy (blob);
|
||||
return length > 0;
|
||||
}
|
||||
|
||||
return has_color;
|
||||
blob = hb_ot_color_glyph_reference_svg (face, glyph);
|
||||
if (blob)
|
||||
{
|
||||
guint length = hb_blob_get_length (blob);
|
||||
hb_blob_destroy (blob);
|
||||
return length > 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4454,6 +4487,9 @@ gsk_text_node_new (PangoFont *font,
|
||||
GskTextNode *self;
|
||||
GskRenderNode *node;
|
||||
PangoRectangle ink_rect;
|
||||
PangoGlyphInfo *glyph_infos;
|
||||
gboolean has_color_glyphs;
|
||||
int n;
|
||||
|
||||
pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
|
||||
pango_extents_to_pixels (&ink_rect, NULL);
|
||||
@@ -4466,19 +4502,36 @@ gsk_text_node_new (PangoFont *font,
|
||||
node = (GskRenderNode *) self;
|
||||
|
||||
self->font = g_object_ref (font);
|
||||
self->has_color_glyphs = font_has_color_glyphs (font);
|
||||
self->color = *color;
|
||||
self->offset = *offset;
|
||||
self->glyphs = g_malloc_n (glyphs->num_glyphs, sizeof (PangoGlyphInfo));
|
||||
self->has_color_glyphs = FALSE;
|
||||
|
||||
/* skip empty glyphs */
|
||||
self->num_glyphs = 0;
|
||||
glyph_infos = g_malloc_n (glyphs->num_glyphs, sizeof (PangoGlyphInfo));
|
||||
has_color_glyphs = font_has_color_glyphs (font);
|
||||
|
||||
n = 0;
|
||||
for (int i = 0; i < glyphs->num_glyphs; i++)
|
||||
{
|
||||
if (glyphs->glyphs[i].glyph != PANGO_GLYPH_EMPTY)
|
||||
self->glyphs[self->num_glyphs++] = glyphs->glyphs[i];
|
||||
/* skip empty glyphs */
|
||||
if (glyphs->glyphs[i].glyph == PANGO_GLYPH_EMPTY)
|
||||
continue;
|
||||
|
||||
glyph_infos[n] = glyphs->glyphs[i];
|
||||
GLYPH_CLEAR_COLOR (&glyph_infos[n]);
|
||||
|
||||
if (has_color_glyphs &&
|
||||
glyph_has_color (font, glyph_infos[n].glyph))
|
||||
{
|
||||
self->has_color_glyphs = TRUE;
|
||||
GLYPH_SET_COLOR (&glyph_infos[n]);
|
||||
}
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
self->glyphs = glyph_infos;
|
||||
self->num_glyphs = n;
|
||||
|
||||
graphene_rect_init (&node->bounds,
|
||||
offset->x + ink_rect.x - 1,
|
||||
offset->y + ink_rect.y - 1,
|
||||
|
||||
@@ -165,8 +165,7 @@ render_glyph (cairo_surface_t *surface,
|
||||
const GskNglGlyphValue *value)
|
||||
{
|
||||
cairo_t *cr;
|
||||
PangoGlyphString glyph_string;
|
||||
PangoGlyphInfo glyph_info;
|
||||
cairo_glyph_t glyph;
|
||||
|
||||
g_assert (surface != NULL);
|
||||
g_assert (scaled_font != NULL);
|
||||
@@ -175,18 +174,11 @@ render_glyph (cairo_surface_t *surface,
|
||||
cairo_set_scaled_font (cr, scaled_font);
|
||||
cairo_set_source_rgba (cr, 1, 1, 1, 1);
|
||||
|
||||
glyph_info.glyph = key->glyph;
|
||||
glyph_info.geometry.width = value->ink_rect.width * 1024;
|
||||
if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG)
|
||||
glyph_info.geometry.x_offset = 256 * key->xshift;
|
||||
else
|
||||
glyph_info.geometry.x_offset = 256 * key->xshift - value->ink_rect.x * 1024;
|
||||
glyph_info.geometry.y_offset = 256 * key->yshift - value->ink_rect.y * 1024;
|
||||
glyph.index = key->glyph;
|
||||
glyph.x = 0.25 * key->xshift - value->ink_rect.x;
|
||||
glyph.y = 0.25 * key->yshift - value->ink_rect.y;
|
||||
|
||||
glyph_string.num_glyphs = 1;
|
||||
glyph_string.glyphs = &glyph_info;
|
||||
|
||||
pango_cairo_show_glyph_string (cr, key->font, &glyph_string);
|
||||
cairo_show_glyphs (cr, &glyph, 1);
|
||||
cairo_destroy (cr);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
|
||||
+19
-11
@@ -1397,7 +1397,7 @@ gsk_ngl_render_job_visit_color_node (GskNglRenderJob *job,
|
||||
GskNglCommandBatch *batch;
|
||||
|
||||
rgba = gsk_color_node_get_color (node);
|
||||
if (gdk_rgba_is_clear (rgba))
|
||||
if (RGBA_IS_CLEAR (rgba))
|
||||
return;
|
||||
|
||||
rgba_to_half (rgba, color);
|
||||
@@ -2835,6 +2835,9 @@ compute_phase_and_pos (float value, float *pos)
|
||||
}
|
||||
}
|
||||
|
||||
#define COLOR_GLYPH_BIT 2
|
||||
#define GLYPH_IS_COLOR(g) (((*(guint32*)&(g)->attr) & COLOR_GLYPH_BIT) != 0)
|
||||
|
||||
static inline void
|
||||
gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
|
||||
const GskRenderNode *node,
|
||||
@@ -2855,7 +2858,9 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
|
||||
guint last_texture = 0;
|
||||
GskNglDrawVertex *vertices;
|
||||
guint used = 0;
|
||||
guint16 c[4] = { FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE };
|
||||
guint16 nc[4] = { FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE };
|
||||
guint16 cc[4];
|
||||
const guint16 *c;
|
||||
const PangoGlyphInfo *gi;
|
||||
guint i;
|
||||
int yshift;
|
||||
@@ -2864,16 +2869,11 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
|
||||
if (num_glyphs == 0)
|
||||
return;
|
||||
|
||||
/* If the font has color glyphs, we don't need to recolor anything.
|
||||
* We tell the shader by setting the color to vec4(-1).
|
||||
*/
|
||||
if (force_color || !gsk_text_node_has_color_glyphs (node))
|
||||
{
|
||||
if (gdk_rgba_is_clear (color))
|
||||
return;
|
||||
if ((force_color || !gsk_text_node_has_color_glyphs (node)) &&
|
||||
RGBA_IS_CLEAR (color))
|
||||
return;
|
||||
|
||||
rgba_to_half (color, c);
|
||||
}
|
||||
rgba_to_half (color, cc);
|
||||
|
||||
lookup.font = (PangoFont *)font;
|
||||
lookup.scale = (guint) (text_scale * 1024);
|
||||
@@ -2897,6 +2897,14 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
|
||||
|
||||
lookup.glyph = gi->glyph;
|
||||
|
||||
/* If the glyph has color, we don't need to recolor anything.
|
||||
* We tell the shader by setting the color to vec4(-1).
|
||||
*/
|
||||
if (!force_color && GLYPH_IS_COLOR (gi))
|
||||
c = nc;
|
||||
else
|
||||
c = cc;
|
||||
|
||||
cx = (float)(x_position + gi->geometry.x_offset) / PANGO_SCALE;
|
||||
lookup.xshift = compute_phase_and_pos (x + cx, &cx);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
#include "a11y/atspi/atspi-accessible.h"
|
||||
#include "a11y/atspi/atspi-application.h"
|
||||
@@ -612,7 +613,7 @@ gtk_at_spi_root_queue_register (GtkAtSpiRoot *self,
|
||||
return;
|
||||
|
||||
self->register_id = g_idle_add (root_register, self);
|
||||
g_source_set_name_by_id (self->register_id, "[gtk] ATSPI root registration");
|
||||
gdk_source_set_static_name_by_id (self->register_id, "[gtk] ATSPI root registration");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,64 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtk/gtkcomposetable.h"
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* This program reads a Compose file and generates files with sequences,
|
||||
* character data, and definitions for the builtin compose table of GTK.
|
||||
* Run it like this:
|
||||
*
|
||||
* compose-parse Compose sequences chars gtkcomposedata.h
|
||||
*
|
||||
* The GTK build expects the output files to be in the source tree, in
|
||||
* the gtk/compose directory.
|
||||
*/
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkComposeTable *table;
|
||||
GError *error = NULL;
|
||||
GString *str;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
if (argc < 5)
|
||||
{
|
||||
g_print ("Usage: compose-parse INPUT OUTPUT1 OUTPUT2 OUTPUT3\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
table = gtk_compose_table_parse (argv[1], NULL);
|
||||
if (!table)
|
||||
g_error ("Failed to parse %s", argv[1]);
|
||||
|
||||
/* data_size is the size in guint16 */
|
||||
if (!g_file_set_contents (argv[2], (char *)table->data, 2 * table->data_size, &error))
|
||||
g_error ("%s", error->message);
|
||||
|
||||
if (!g_file_set_contents (argv[3], table->char_data, table->n_chars + 1, &error))
|
||||
g_error ("%s", error->message);
|
||||
|
||||
str = g_string_new ("");
|
||||
g_string_append (str,
|
||||
"#ifndef __GTK_COMPOSE_DATA__\n"
|
||||
"#define __GTK_COMPOSE_DATA__\n"
|
||||
"\n");
|
||||
g_string_append_printf (str,
|
||||
"#define MAX_SEQ_LEN %d\n", table->max_seq_len);
|
||||
g_string_append_printf (str,
|
||||
"#define N_INDEX_SIZE %d\n", table->n_index_size);
|
||||
g_string_append_printf (str,
|
||||
"#define DATA_SIZE %d\n", table->data_size);
|
||||
g_string_append_printf (str,
|
||||
"#define N_CHARS %d\n", table->n_chars);
|
||||
g_string_append (str,
|
||||
"\n"
|
||||
"#endif\n");
|
||||
|
||||
if (!g_file_set_contents (argv[4], str->str, str->len, &error))
|
||||
g_error ("%s", error->message);
|
||||
|
||||
g_string_free (str, TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,984 +0,0 @@
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# compose-parse.py, version 1.4
|
||||
#
|
||||
# multifunction script that helps manage the compose sequence table in GTK+ (gtk/gtkimcontextsimple.c)
|
||||
# the script produces statistics and information about the whole process, run with --help for more.
|
||||
#
|
||||
# You may need to switch your python installation to utf-8, if you get 'ascii' codec errors.
|
||||
#
|
||||
# Complain to Simos Xenitellis (simos@gnome.org, http://simos.info/blog) for this craft.
|
||||
|
||||
from re import findall, match, split, sub
|
||||
from string import atoi
|
||||
from unicodedata import normalize
|
||||
from urllib import urlretrieve
|
||||
from os.path import isfile, getsize
|
||||
from copy import copy
|
||||
|
||||
import sys
|
||||
import getopt
|
||||
|
||||
# We grab files off the web, left and right.
|
||||
URL_COMPOSE = 'http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre'
|
||||
URL_KEYSYMSTXT = "http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt"
|
||||
URL_GDKKEYSYMSH = "http://git.gnome.org/browse/gtk%2B/plain/gdk/gdkkeysyms.h"
|
||||
URL_UNICODEDATATXT = 'http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt'
|
||||
FILENAME_COMPOSE_SUPPLEMENTARY = 'gtk-compose-lookaside.txt'
|
||||
FILENAME_COMPOSE_NEGATIVE_SUPPLEMENTARY = 'gtk-compose-remove.txt'
|
||||
|
||||
# We currently support keysyms of size 2; once upstream xorg gets sorted,
|
||||
# we might produce some tables with size 2 and some with size 4.
|
||||
SIZEOFINT = 2
|
||||
|
||||
# Current max compose sequence length; in case it gets increased.
|
||||
WIDTHOFCOMPOSETABLE = 5
|
||||
|
||||
keysymdatabase = {}
|
||||
keysymunicodedatabase = {}
|
||||
unicodedatabase = {}
|
||||
|
||||
headerfile_start = """/* GTK - The GIMP Tool Kit
|
||||
* Copyright (C) 2007, 2008 GNOME Foundation
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* File auto-generated from script found at http://bugzilla.gnome.org/show_bug.cgi?id=321896
|
||||
* using the input files
|
||||
* Input : http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre
|
||||
* Input : http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
|
||||
* Input : http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
|
||||
*
|
||||
* This table is optimised for space and requires special handling to access the content.
|
||||
* This table is used solely by http://svn.gnome.org/viewcvs/gtk%2B/trunk/gtk/gtkimcontextsimple.c
|
||||
*
|
||||
* The resulting file is placed at http://svn.gnome.org/viewcvs/gtk%2B/trunk/gtk/gtkimcontextsimpleseqs.h
|
||||
* This file is described in bug report http://bugzilla.gnome.org/show_bug.cgi?id=321896
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 2007, 2008. 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/.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_IM_CONTEXT_SIMPLE_SEQS_H__
|
||||
#define __GTK_IM_CONTEXT_SIMPLE_SEQS_H__
|
||||
|
||||
/* === These are the original comments of the file; we keep for historical purposes ===
|
||||
*
|
||||
* The following table was generated from the X compose tables include with
|
||||
* XFree86 4.0 using a set of Perl scripts. Contact Owen Taylor <otaylor@redhat.com>
|
||||
* to obtain the relevant perl scripts.
|
||||
*
|
||||
* The following compose letter letter sequences conflicted
|
||||
* Dstroke/dstroke and ETH/eth; resolved to Dstroke (Croatian, Vietnamese, Lappish), over
|
||||
* ETH (Icelandic, Faroese, old English, IPA) [ D- -D d- -d ]
|
||||
* Amacron/amacron and ordfeminine; resolved to ordfeminine [ _A A_ a_ _a ]
|
||||
* Amacron/amacron and Atilde/atilde; resolved to atilde [ -A A- a- -a ]
|
||||
* Omacron/Omacron and masculine; resolved to masculine [ _O O_ o_ _o ]
|
||||
* Omacron/omacron and Otilde/atilde; resolved to otilde [ -O O- o- -o ]
|
||||
*
|
||||
* [ Amacron and Omacron are in Latin-4 (Baltic). ordfeminine and masculine are used for
|
||||
* spanish. atilde and otilde are used at least for Portuguese ]
|
||||
*
|
||||
* at and Aring; resolved to Aring [ AA ]
|
||||
* guillemotleft and caron; resolved to guillemotleft [ << ]
|
||||
* ogonek and cedilla; resolved to cedilla [ ,, ]
|
||||
*
|
||||
* This probably should be resolved by first checking an additional set of compose tables
|
||||
* that depend on the locale or selected input method.
|
||||
*/
|
||||
|
||||
static const guint16 gtk_compose_seqs_compact[] = {"""
|
||||
|
||||
headerfile_end = """};
|
||||
|
||||
#endif /* __GTK_IM_CONTEXT_SIMPLE_SEQS_H__ */
|
||||
"""
|
||||
|
||||
def stringtohex(str): return atoi(str, 16)
|
||||
|
||||
def factorial(n):
|
||||
if n <= 1:
|
||||
return 1
|
||||
else:
|
||||
return n * factorial(n-1)
|
||||
|
||||
def uniq(*args) :
|
||||
""" Performs a uniq operation on a list or lists """
|
||||
theInputList = []
|
||||
for theList in args:
|
||||
theInputList += theList
|
||||
theFinalList = []
|
||||
for elem in theInputList:
|
||||
if elem not in theFinalList:
|
||||
theFinalList.append(elem)
|
||||
return theFinalList
|
||||
|
||||
|
||||
|
||||
def all_permutations(seq):
|
||||
""" Borrowed from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252178 """
|
||||
""" Produces all permutations of the items of a list """
|
||||
if len(seq) <=1:
|
||||
yield seq
|
||||
else:
|
||||
for perm in all_permutations(seq[1:]):
|
||||
for i in range(len(perm)+1):
|
||||
#nb str[0:1] works in both string and list contexts
|
||||
yield perm[:i] + seq[0:1] + perm[i:]
|
||||
|
||||
def usage():
|
||||
print """compose-parse available parameters:
|
||||
-h, --help this craft
|
||||
-s, --statistics show overall statistics (both algorithmic, non-algorithmic)
|
||||
-a, --algorithmic show sequences saved with algorithmic optimisation
|
||||
-g, --gtk show entries that go to GTK+
|
||||
-u, --unicodedatatxt show compose sequences derived from UnicodeData.txt (from unicode.org)
|
||||
-v, --verbose show verbose output
|
||||
-p, --plane1 show plane1 compose sequences
|
||||
-n, --numeric when used with --gtk, create file with numeric values only
|
||||
-e, --gtk-expanded when used with --gtk, create file that repeats first column; not usable in GTK+
|
||||
|
||||
Default is to show statistics.
|
||||
"""
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "pvgashune", ["help", "algorithmic", "statistics", "unicodedatatxt",
|
||||
"stats", "gtk", "verbose", "plane1", "numeric", "gtk-expanded"])
|
||||
except:
|
||||
usage()
|
||||
sys.exit(2)
|
||||
|
||||
opt_statistics = False
|
||||
opt_algorithmic = False
|
||||
opt_gtk = False
|
||||
opt_unicodedatatxt = False
|
||||
opt_verbose = False
|
||||
opt_plane1 = False
|
||||
opt_numeric = False
|
||||
opt_gtkexpanded = False
|
||||
|
||||
for o, a in opts:
|
||||
if o in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit()
|
||||
if o in ("-s", "--statistics"):
|
||||
opt_statistics = True
|
||||
if o in ("-a", "--algorithmic"):
|
||||
opt_algorithmic = True
|
||||
if o in ("-g", "--gtk"):
|
||||
opt_gtk = True
|
||||
if o in ("-u", "--unicodedatatxt"):
|
||||
opt_unicodedatatxt = True
|
||||
if o in ("-v", "--verbose"):
|
||||
opt_verbose = True
|
||||
if o in ("-p", "--plane1"):
|
||||
opt_plane1 = True
|
||||
if o in ("-n", "--numeric"):
|
||||
opt_numeric = True
|
||||
if o in ("-e", "--gtk-expanded"):
|
||||
opt_gtkexpanded = True
|
||||
|
||||
if not opt_algorithmic and not opt_gtk and not opt_unicodedatatxt:
|
||||
opt_statistics = True
|
||||
|
||||
def download_hook(blocks_transferred, block_size, file_size):
|
||||
""" A download hook to provide some feedback when downloading """
|
||||
if blocks_transferred == 0:
|
||||
if file_size > 0:
|
||||
if opt_verbose:
|
||||
print "Downloading", file_size, "bytes: ",
|
||||
else:
|
||||
if opt_verbose:
|
||||
print "Downloading: ",
|
||||
sys.stdout.write('#')
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def download_file(url):
|
||||
""" Downloads a file provided a URL. Returns the filename. """
|
||||
""" Borks on failure """
|
||||
localfilename = url.split('/')[-1]
|
||||
if not isfile(localfilename) or getsize(localfilename) <= 0:
|
||||
if opt_verbose:
|
||||
print "Downloading ", url, "..."
|
||||
try:
|
||||
urlretrieve(url, localfilename, download_hook)
|
||||
except IOError, (errno, strerror):
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
sys.exit(-1)
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
print " done."
|
||||
else:
|
||||
if opt_verbose:
|
||||
print "Using cached file for ", url
|
||||
return localfilename
|
||||
|
||||
def process_gdkkeysymsh():
|
||||
""" Opens the gdkkeysyms.h file from GTK+/gdk/gdkkeysyms.h """
|
||||
""" Fills up keysymdb with contents """
|
||||
filename_gdkkeysymsh = download_file(URL_GDKKEYSYMSH)
|
||||
try:
|
||||
gdkkeysymsh = open(filename_gdkkeysymsh, 'r')
|
||||
except IOError, (errno, strerror):
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
sys.exit(-1)
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
|
||||
""" Parse the gdkkeysyms.h file and place contents in keysymdb """
|
||||
linenum_gdkkeysymsh = 0
|
||||
keysymdb = {}
|
||||
for line in gdkkeysymsh.readlines():
|
||||
linenum_gdkkeysymsh += 1
|
||||
line = line.strip()
|
||||
if line == "" or not match('^#define GDK_KEY_', line):
|
||||
continue
|
||||
components = split('\s+', line)
|
||||
if len(components) < 3:
|
||||
print "Invalid line %(linenum)d in %(filename)s: %(line)s"\
|
||||
% {'linenum': linenum_gdkkeysymsh, 'filename': filename_gdkkeysymsh, 'line': line}
|
||||
print "Was expecting 3 items in the line"
|
||||
sys.exit(-1)
|
||||
if not match('^GDK_KEY_', components[1]):
|
||||
print "Invalid line %(linenum)d in %(filename)s: %(line)s"\
|
||||
% {'linenum': linenum_gdkkeysymsh, 'filename': filename_gdkkeysymsh, 'line': line}
|
||||
print "Was expecting a keysym starting with GDK_KEY_"
|
||||
sys.exit(-1)
|
||||
if match('^0x[0-9a-fA-F]+$', components[2]):
|
||||
unival = long(components[2][2:], 16)
|
||||
if unival == 0:
|
||||
continue
|
||||
keysymdb[components[1][8:]] = unival
|
||||
else:
|
||||
print "Invalid line %(linenum)d in %(filename)s: %(line)s"\
|
||||
% {'linenum': linenum_gdkkeysymsh, 'filename': filename_gdkkeysymsh, 'line': line}
|
||||
print "Was expecting a hexadecimal number at the end of the line"
|
||||
sys.exit(-1)
|
||||
gdkkeysymsh.close()
|
||||
|
||||
""" Patch up the keysymdb with some of our own stuff """
|
||||
|
||||
""" This is for a missing keysym from the currently upstream file """
|
||||
###keysymdb['dead_stroke'] = 0x338
|
||||
|
||||
""" This is for a missing keysym from the currently upstream file """
|
||||
###keysymdb['dead_belowring'] = 0x323
|
||||
###keysymdb['dead_belowmacron'] = 0x331
|
||||
###keysymdb['dead_belowcircumflex'] = 0x32d
|
||||
###keysymdb['dead_belowtilde'] = 0x330
|
||||
###keysymdb['dead_belowbreve'] = 0x32e
|
||||
###keysymdb['dead_belowdiaeresis'] = 0x324
|
||||
|
||||
""" This is^Wwas preferential treatment for Greek """
|
||||
# keysymdb['dead_tilde'] = 0x342
|
||||
""" This is^was preferential treatment for Greek """
|
||||
#keysymdb['combining_tilde'] = 0x342
|
||||
|
||||
""" Fixing VoidSymbol """
|
||||
keysymdb['VoidSymbol'] = 0xFFFF
|
||||
|
||||
return keysymdb
|
||||
|
||||
def process_keysymstxt():
|
||||
""" Grabs and opens the keysyms.txt file that Markus Kuhn maintains """
|
||||
""" This file keeps a record between keysyms <-> unicode chars """
|
||||
filename_keysymstxt = download_file(URL_KEYSYMSTXT)
|
||||
try:
|
||||
keysymstxt = open(filename_keysymstxt, 'r')
|
||||
except IOError, (errno, strerror):
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
sys.exit(-1)
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
|
||||
""" Parse the keysyms.txt file and place content in keysymdb """
|
||||
linenum_keysymstxt = 0
|
||||
keysymdb = {}
|
||||
for line in keysymstxt.readlines():
|
||||
linenum_keysymstxt += 1
|
||||
line = line.strip()
|
||||
if line == "" or match('^#', line):
|
||||
continue
|
||||
components = split('\s+', line)
|
||||
if len(components) < 5:
|
||||
print "Invalid line %(linenum)d in %(filename)s: %(line)s'"\
|
||||
% {'linenum': linenum_keysymstxt, 'filename': filename_keysymstxt, 'line': line}
|
||||
print "Was expecting 5 items in the line"
|
||||
sys.exit(-1)
|
||||
if match('^U[0-9a-fA-F]+$', components[1]):
|
||||
unival = long(components[1][1:], 16)
|
||||
if unival == 0:
|
||||
continue
|
||||
keysymdb[components[4]] = unival
|
||||
keysymstxt.close()
|
||||
|
||||
""" Patch up the keysymdb with some of our own stuff """
|
||||
""" This is for a missing keysym from the currently upstream file """
|
||||
keysymdb['dead_belowring'] = 0x323
|
||||
keysymdb['dead_belowmacron'] = 0x331
|
||||
keysymdb['dead_belowcircumflex'] = 0x32d
|
||||
keysymdb['dead_belowtilde'] = 0x330
|
||||
keysymdb['dead_belowbreve'] = 0x32e
|
||||
keysymdb['dead_belowdiaeresis'] = 0x324
|
||||
|
||||
""" This is preferential treatment for Greek """
|
||||
""" => we get more savings if used for Greek """
|
||||
# keysymdb['dead_tilde'] = 0x342
|
||||
""" This is preferential treatment for Greek """
|
||||
# keysymdb['combining_tilde'] = 0x342
|
||||
|
||||
""" This is for a missing keysym from Markus Kuhn's db """
|
||||
keysymdb['dead_stroke'] = 0x338
|
||||
""" This is for a missing keysym from Markus Kuhn's db """
|
||||
keysymdb['Oslash'] = 0x0d8
|
||||
""" This is for a missing keysym from Markus Kuhn's db """
|
||||
keysymdb['Ssharp'] = 0x1e9e
|
||||
|
||||
""" This is for a missing (recently added) keysym """
|
||||
keysymdb['dead_psili'] = 0x313
|
||||
""" This is for a missing (recently added) keysym """
|
||||
keysymdb['dead_dasia'] = 0x314
|
||||
|
||||
""" Allows to import Multi_key sequences """
|
||||
keysymdb['Multi_key'] = 0xff20
|
||||
|
||||
keysymdb['zerosubscript'] = 0x2080
|
||||
keysymdb['onesubscript'] = 0x2081
|
||||
keysymdb['twosubscript'] = 0x2082
|
||||
keysymdb['threesubscript'] = 0x2083
|
||||
keysymdb['foursubscript'] = 0x2084
|
||||
keysymdb['fivesubscript'] = 0x2085
|
||||
keysymdb['sixsubscript'] = 0x2086
|
||||
keysymdb['sevensubscript'] = 0x2087
|
||||
keysymdb['eightsubscript'] = 0x2088
|
||||
keysymdb['ninesubscript'] = 0x2089
|
||||
keysymdb['dead_doublegrave'] = 0x030F
|
||||
keysymdb['dead_invertedbreve'] = 0x0311
|
||||
keysymdb['dead_belowcomma'] = 0xfe6e
|
||||
keysymdb['dead_currency'] = 0xfe6f
|
||||
keysymdb['dead_greek'] = 0xfe8c
|
||||
|
||||
return keysymdb
|
||||
|
||||
def keysymvalue(keysym, file = "n/a", linenum = 0):
|
||||
""" Extracts a value from the keysym """
|
||||
""" Find the value of keysym, using the data from keysyms """
|
||||
""" Use file and linenum to when reporting errors """
|
||||
if keysym == "":
|
||||
return 0
|
||||
if keysymdatabase.has_key(keysym):
|
||||
return keysymdatabase[keysym]
|
||||
elif keysym[0] == 'U' and match('[0-9a-fA-F]+$', keysym[1:]):
|
||||
return atoi(keysym[1:], 16)
|
||||
elif keysym[:2] == '0x' and match('[0-9a-fA-F]+$', keysym[2:]):
|
||||
return atoi(keysym[2:], 16)
|
||||
else:
|
||||
print 'keysymvalue: UNKNOWN{%(keysym)s}' % { "keysym": keysym }
|
||||
#return -1
|
||||
sys.exit(-1)
|
||||
|
||||
def keysymunicodevalue(keysym, file = "n/a", linenum = 0):
|
||||
""" Extracts a value from the keysym """
|
||||
""" Find the value of keysym, using the data from keysyms """
|
||||
""" Use file and linenum to when reporting errors """
|
||||
if keysym == "":
|
||||
return 0
|
||||
if keysymunicodedatabase.has_key(keysym):
|
||||
return keysymunicodedatabase[keysym]
|
||||
elif keysym[0] == 'U' and match('[0-9a-fA-F]+$', keysym[1:]):
|
||||
return atoi(keysym[1:], 16)
|
||||
elif keysym[:2] == '0x' and match('[0-9a-fA-F]+$', keysym[2:]):
|
||||
return atoi(keysym[2:], 16)
|
||||
else:
|
||||
print 'keysymunicodevalue: UNKNOWN{%(keysym)s}' % { "keysym": keysym }
|
||||
sys.exit(-1)
|
||||
|
||||
def rename_combining(seq):
|
||||
filtered_sequence = []
|
||||
for ks in seq:
|
||||
if findall('^combining_', ks):
|
||||
ks = sub('^combining_', 'dead_', ks)
|
||||
if ks == 'dead_double_grave':
|
||||
ks = 'dead_doublegrave'
|
||||
if ks == 'dead_inverted_breve':
|
||||
ks = 'dead_invertedbreve'
|
||||
filtered_sequence.append(ks)
|
||||
return filtered_sequence
|
||||
|
||||
|
||||
keysymunicodedatabase = process_keysymstxt()
|
||||
keysymdatabase = process_gdkkeysymsh()
|
||||
|
||||
""" Grab and open the compose file from upstream """
|
||||
filename_compose = download_file(URL_COMPOSE)
|
||||
try:
|
||||
composefile = open(filename_compose, 'r')
|
||||
except IOError, (errno, strerror):
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
sys.exit(-1)
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
|
||||
""" Look if there is a lookaside (supplementary) compose file in the current
|
||||
directory, and if so, open, then merge with upstream Compose file.
|
||||
"""
|
||||
xorg_compose_sequences_raw = []
|
||||
for seq in composefile.readlines():
|
||||
xorg_compose_sequences_raw.append(seq)
|
||||
|
||||
try:
|
||||
composefile_lookaside = open(FILENAME_COMPOSE_NEGATIVE_SUPPLEMENTARY, 'r')
|
||||
for seq in composefile_lookaside.readlines():
|
||||
xorg_compose_sequences_raw.remove(seq)
|
||||
except IOError, (errno, strerror):
|
||||
if opt_verbose:
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
print "Did not find negative lookaside compose file. Continuing..."
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
|
||||
try:
|
||||
composefile_lookaside = open(FILENAME_COMPOSE_SUPPLEMENTARY, 'r')
|
||||
for seq in composefile_lookaside.readlines():
|
||||
xorg_compose_sequences_raw.append(seq)
|
||||
except IOError, (errno, strerror):
|
||||
if opt_verbose:
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
print "Did not find lookaside compose file. Continuing..."
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
|
||||
""" Parse the compose file in xorg_compose_sequences"""
|
||||
xorg_compose_sequences = []
|
||||
xorg_compose_sequences_algorithmic = []
|
||||
linenum_compose = 0
|
||||
comment_nest_depth = 0
|
||||
for line in xorg_compose_sequences_raw:
|
||||
linenum_compose += 1
|
||||
line = line.strip()
|
||||
if match("^XCOMM", line) or match("^#", line):
|
||||
continue
|
||||
|
||||
line = sub(r"\/\*([^\*]*|[\*][^/])\*\/", "", line)
|
||||
|
||||
comment_start = line.find("/*")
|
||||
|
||||
if comment_start >= 0:
|
||||
if comment_nest_depth == 0:
|
||||
line = line[:comment_start]
|
||||
else:
|
||||
line = ""
|
||||
|
||||
comment_nest_depth += 1
|
||||
else:
|
||||
comment_end = line.find("*/")
|
||||
|
||||
if comment_end >= 0:
|
||||
comment_nest_depth -= 1
|
||||
|
||||
if comment_nest_depth < 0:
|
||||
print "Invalid comment %(linenum_compose)d in %(filename)s: \
|
||||
Closing '*/' without opening '/*'" % { "linenum_compose": linenum_compose, "filename": filename_compose }
|
||||
exit(-1)
|
||||
|
||||
if comment_nest_depth > 0:
|
||||
line = ""
|
||||
else:
|
||||
line = line[comment_end + 2:]
|
||||
|
||||
if line is "":
|
||||
continue
|
||||
|
||||
#line = line[:-1]
|
||||
components = split(':', line, 1)
|
||||
if len(components) != 2:
|
||||
print "Invalid line %(linenum_compose)d in %(filename)s: No sequence\
|
||||
/value pair found" % { "linenum_compose": linenum_compose, "filename": filename_compose }
|
||||
exit(-1)
|
||||
(seq, val ) = split(':', line, 1)
|
||||
seq = seq.strip()
|
||||
val = val.strip()
|
||||
raw_sequence = findall('\w+', seq)
|
||||
values = split('\s+', val)
|
||||
unichar_temp = split('"', values[0])
|
||||
unichar_utf8 = unichar_temp[1]
|
||||
if len(values) == 1:
|
||||
continue
|
||||
codepointstr = values[1]
|
||||
if values[1] == '#':
|
||||
# No codepoints that are >1 characters yet.
|
||||
continue
|
||||
if raw_sequence[0][0] == 'U' and match('[0-9a-fA-F]+$', raw_sequence[0][1:]):
|
||||
raw_sequence[0] = '0x' + raw_sequence[0][1:]
|
||||
if match('^U[0-9a-fA-F]+$', codepointstr):
|
||||
codepoint = long(codepointstr[1:], 16)
|
||||
elif keysymunicodedatabase.has_key(codepointstr):
|
||||
#if keysymdatabase[codepointstr] != keysymunicodedatabase[codepointstr]:
|
||||
#print "DIFFERENCE: 0x%(a)X 0x%(b)X" % { "a": keysymdatabase[codepointstr], "b": keysymunicodedatabase[codepointstr]},
|
||||
#print raw_sequence, codepointstr
|
||||
codepoint = keysymunicodedatabase[codepointstr]
|
||||
else:
|
||||
unichar = unicode(unichar_utf8, 'utf-8')
|
||||
codepoint = ord(unichar)
|
||||
sequence = rename_combining(raw_sequence)
|
||||
reject_this = False
|
||||
for i in sequence:
|
||||
if keysymvalue(i) > 0xFFFF:
|
||||
reject_this = True
|
||||
if opt_plane1:
|
||||
print sequence
|
||||
break
|
||||
if keysymvalue(i) < 0:
|
||||
reject_this = True
|
||||
break
|
||||
if reject_this:
|
||||
continue
|
||||
if "U0342" in sequence or \
|
||||
"U0313" in sequence or \
|
||||
"U0314" in sequence or \
|
||||
"0x0313" in sequence or \
|
||||
"0x0342" in sequence or \
|
||||
"0x0314" in sequence:
|
||||
continue
|
||||
if codepoint > 0xFFFF:
|
||||
if opt_verbose:
|
||||
print "Ignore the line greater than guint16:\n%s" % line
|
||||
continue
|
||||
#for i in range(len(sequence)):
|
||||
# if sequence[i] == "0x0342":
|
||||
# sequence[i] = "dead_tilde"
|
||||
if "Multi_key" not in sequence:
|
||||
""" Ignore for now >0xFFFF keysyms """
|
||||
if codepoint < 0xFFFF:
|
||||
original_sequence = copy(sequence)
|
||||
stats_sequence = copy(sequence)
|
||||
base = sequence.pop()
|
||||
basechar = keysymvalue(base, filename_compose, linenum_compose)
|
||||
|
||||
if basechar < 0xFFFF:
|
||||
counter = 1
|
||||
unisequence = []
|
||||
not_normalised = True
|
||||
skipping_this = False
|
||||
for i in range(0, len(sequence)):
|
||||
""" If the sequence has dead_tilde and is for Greek, we don't do algorithmically
|
||||
because of lack of dead_perispomeni (i.e. conflict)
|
||||
"""
|
||||
bc = basechar
|
||||
"""if sequence[-1] == "dead_tilde" and (bc >= 0x370 and bc <= 0x3ff) or (bc >= 0x1f00 and bc <= 0x1fff):
|
||||
skipping_this = True
|
||||
break
|
||||
if sequence[-1] == "dead_horn" and (bc >= 0x370 and bc <= 0x3ff) or (bc >= 0x1f00 and bc <= 0x1fff):
|
||||
skipping_this = True
|
||||
break
|
||||
if sequence[-1] == "dead_ogonek" and (bc >= 0x370 and bc <= 0x3ff) or (bc >= 0x1f00 and bc <= 0x1fff):
|
||||
skipping_this = True
|
||||
break
|
||||
if sequence[-1] == "dead_psili":
|
||||
sequence[i] = "dead_horn"
|
||||
if sequence[-1] == "dead_dasia":
|
||||
sequence[-1] = "dead_ogonek"
|
||||
"""
|
||||
unisequence.append(unichr(keysymunicodevalue(sequence.pop(), filename_compose, linenum_compose)))
|
||||
|
||||
if skipping_this:
|
||||
unisequence = []
|
||||
for perm in all_permutations(unisequence):
|
||||
# print counter, original_sequence, unichr(basechar) + "".join(perm)
|
||||
# print counter, map(unichr, perm)
|
||||
normalized = normalize('NFC', unichr(basechar) + "".join(perm))
|
||||
if len(normalized) == 1:
|
||||
# print 'Base: %(base)s [%(basechar)s], produces [%(unichar)s] (0x%(codepoint)04X)' \
|
||||
# % { "base": base, "basechar": unichr(basechar), "unichar": unichar, "codepoint": codepoint },
|
||||
# print "Normalized: [%(normalized)s] SUCCESS %(c)d" % { "normalized": normalized, "c": counter }
|
||||
stats_sequence_data = map(keysymunicodevalue, stats_sequence)
|
||||
stats_sequence_data.append(normalized)
|
||||
xorg_compose_sequences_algorithmic.append(stats_sequence_data)
|
||||
not_normalised = False
|
||||
break;
|
||||
counter += 1
|
||||
if not_normalised:
|
||||
original_sequence.append(codepoint)
|
||||
xorg_compose_sequences.append(original_sequence)
|
||||
""" print xorg_compose_sequences[-1] """
|
||||
|
||||
else:
|
||||
print "Error in base char !?!"
|
||||
exit(-2)
|
||||
else:
|
||||
print "OVER", sequence
|
||||
exit(-1)
|
||||
else:
|
||||
sequence.append(codepoint)
|
||||
xorg_compose_sequences.append(sequence)
|
||||
""" print xorg_compose_sequences[-1] """
|
||||
|
||||
def sequence_cmp(x, y):
|
||||
if keysymvalue(x[0]) > keysymvalue(y[0]):
|
||||
return 1
|
||||
elif keysymvalue(x[0]) < keysymvalue(y[0]):
|
||||
return -1
|
||||
elif len(x) > len(y):
|
||||
return 1
|
||||
elif len(x) < len(y):
|
||||
return -1
|
||||
elif keysymvalue(x[1]) > keysymvalue(y[1]):
|
||||
return 1
|
||||
elif keysymvalue(x[1]) < keysymvalue(y[1]):
|
||||
return -1
|
||||
elif len(x) < 4:
|
||||
return 0
|
||||
elif keysymvalue(x[2]) > keysymvalue(y[2]):
|
||||
return 1
|
||||
elif keysymvalue(x[2]) < keysymvalue(y[2]):
|
||||
return -1
|
||||
elif len(x) < 5:
|
||||
return 0
|
||||
elif keysymvalue(x[3]) > keysymvalue(y[3]):
|
||||
return 1
|
||||
elif keysymvalue(x[3]) < keysymvalue(y[3]):
|
||||
return -1
|
||||
elif len(x) < 6:
|
||||
return 0
|
||||
elif keysymvalue(x[4]) > keysymvalue(y[4]):
|
||||
return 1
|
||||
elif keysymvalue(x[4]) < keysymvalue(y[4]):
|
||||
return -1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def sequence_unicode_cmp(x, y):
|
||||
if keysymunicodevalue(x[0]) > keysymunicodevalue(y[0]):
|
||||
return 1
|
||||
elif keysymunicodevalue(x[0]) < keysymunicodevalue(y[0]):
|
||||
return -1
|
||||
elif len(x) > len(y):
|
||||
return 1
|
||||
elif len(x) < len(y):
|
||||
return -1
|
||||
elif keysymunicodevalue(x[1]) > keysymunicodevalue(y[1]):
|
||||
return 1
|
||||
elif keysymunicodevalue(x[1]) < keysymunicodevalue(y[1]):
|
||||
return -1
|
||||
elif len(x) < 4:
|
||||
return 0
|
||||
elif keysymunicodevalue(x[2]) > keysymunicodevalue(y[2]):
|
||||
return 1
|
||||
elif keysymunicodevalue(x[2]) < keysymunicodevalue(y[2]):
|
||||
return -1
|
||||
elif len(x) < 5:
|
||||
return 0
|
||||
elif keysymunicodevalue(x[3]) > keysymunicodevalue(y[3]):
|
||||
return 1
|
||||
elif keysymunicodevalue(x[3]) < keysymunicodevalue(y[3]):
|
||||
return -1
|
||||
elif len(x) < 6:
|
||||
return 0
|
||||
elif keysymunicodevalue(x[4]) > keysymunicodevalue(y[4]):
|
||||
return 1
|
||||
elif keysymunicodevalue(x[4]) < keysymunicodevalue(y[4]):
|
||||
return -1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def sequence_algorithmic_cmp(x, y):
|
||||
if len(x) < len(y):
|
||||
return -1
|
||||
elif len(x) > len(y):
|
||||
return 1
|
||||
else:
|
||||
for i in range(len(x)):
|
||||
if x[i] < y[i]:
|
||||
return -1
|
||||
elif x[i] > y[i]:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
xorg_compose_sequences.sort(sequence_cmp)
|
||||
|
||||
xorg_compose_sequences_uniqued = []
|
||||
first_time = True
|
||||
item = None
|
||||
for next_item in xorg_compose_sequences:
|
||||
if first_time:
|
||||
first_time = False
|
||||
item = next_item
|
||||
if sequence_unicode_cmp(item, next_item) != 0:
|
||||
xorg_compose_sequences_uniqued.append(item)
|
||||
item = next_item
|
||||
|
||||
xorg_compose_sequences = copy(xorg_compose_sequences_uniqued)
|
||||
|
||||
counter_multikey = 0
|
||||
for item in xorg_compose_sequences:
|
||||
if findall('Multi_key', "".join(item[:-1])) != []:
|
||||
counter_multikey += 1
|
||||
|
||||
xorg_compose_sequences_algorithmic.sort(sequence_algorithmic_cmp)
|
||||
xorg_compose_sequences_algorithmic_uniqued = uniq(xorg_compose_sequences_algorithmic)
|
||||
|
||||
firstitem = ""
|
||||
num_first_keysyms = 0
|
||||
zeroes = 0
|
||||
num_entries = 0
|
||||
num_algorithmic_greek = 0
|
||||
for sequence in xorg_compose_sequences:
|
||||
if keysymvalue(firstitem) != keysymvalue(sequence[0]):
|
||||
firstitem = sequence[0]
|
||||
num_first_keysyms += 1
|
||||
zeroes += 6 - len(sequence) + 1
|
||||
num_entries += 1
|
||||
|
||||
for sequence in xorg_compose_sequences_algorithmic_uniqued:
|
||||
ch = ord(sequence[-1:][0])
|
||||
if ch >= 0x370 and ch <= 0x3ff or ch >= 0x1f00 and ch <= 0x1fff:
|
||||
num_algorithmic_greek += 1
|
||||
|
||||
|
||||
if opt_algorithmic:
|
||||
for sequence in xorg_compose_sequences_algorithmic_uniqued:
|
||||
letter = "".join(sequence[-1:])
|
||||
print '0x%(cp)04X, %(uni)s, seq: [ <0x%(base)04X>,' % { 'cp': ord(unicode(letter)), 'uni': letter.encode('utf-8'), 'base': sequence[-2] },
|
||||
for elem in sequence[:-2]:
|
||||
print "<0x%(keysym)04X>," % { 'keysym': elem },
|
||||
""" Yeah, verified... We just want to keep the output similar to -u, so we can compare/sort easily """
|
||||
print "], recomposed as", letter.encode('utf-8'), "verified"
|
||||
|
||||
def num_of_keysyms(seq):
|
||||
return len(seq) - 1
|
||||
|
||||
def convert_UnotationToHex(arg):
|
||||
if isinstance(arg, str):
|
||||
if match('^U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]$', arg):
|
||||
return sub('^U', '0x', arg)
|
||||
return arg
|
||||
|
||||
def addprefix_GDK(arg):
|
||||
if match('^0x', arg):
|
||||
return '%(arg)s, ' % { 'arg': arg }
|
||||
elif match('^U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]$', arg.upper()):
|
||||
keysym = ''
|
||||
for k, c in keysymunicodedatabase.items():
|
||||
if c == keysymvalue(arg):
|
||||
keysym = k
|
||||
break
|
||||
if keysym != '':
|
||||
return 'GDK_KEY_%(arg)s, ' % { 'arg': keysym }
|
||||
else:
|
||||
return '0x%(arg)04X, ' % { 'arg': keysymvalue(arg) }
|
||||
else:
|
||||
return 'GDK_KEY_%(arg)s, ' % { 'arg': arg }
|
||||
|
||||
if opt_gtk:
|
||||
first_keysym = ""
|
||||
sequence = []
|
||||
compose_table = []
|
||||
ct_second_part = []
|
||||
ct_sequence_width = 2
|
||||
start_offset = num_first_keysyms * (WIDTHOFCOMPOSETABLE+1)
|
||||
we_finished = False
|
||||
counter = 0
|
||||
|
||||
sequence_iterator = iter(xorg_compose_sequences)
|
||||
sequence = sequence_iterator.next()
|
||||
while True:
|
||||
first_keysym = sequence[0] # Set the first keysym
|
||||
compose_table.append([first_keysym, 0, 0, 0, 0, 0])
|
||||
while sequence[0] == first_keysym:
|
||||
compose_table[counter][num_of_keysyms(sequence)-1] += 1
|
||||
try:
|
||||
sequence = sequence_iterator.next()
|
||||
except StopIteration:
|
||||
we_finished = True
|
||||
break
|
||||
if we_finished:
|
||||
break
|
||||
counter += 1
|
||||
|
||||
ct_index = start_offset
|
||||
for line_num in range(len(compose_table)):
|
||||
for i in range(WIDTHOFCOMPOSETABLE):
|
||||
occurrences = compose_table[line_num][i+1]
|
||||
compose_table[line_num][i+1] = ct_index
|
||||
ct_index += occurrences * (i+2)
|
||||
|
||||
for sequence in xorg_compose_sequences:
|
||||
ct_second_part.append(map(convert_UnotationToHex, sequence))
|
||||
|
||||
print headerfile_start
|
||||
for i in compose_table:
|
||||
if opt_gtkexpanded:
|
||||
print "0x%(ks)04X," % { "ks": keysymvalue(i[0]) },
|
||||
print '%(str)s' % { 'str': "".join(map(lambda x : str(x) + ", ", i[1:])) }
|
||||
elif not match('^0x', i[0]):
|
||||
print 'GDK_KEY_%(str)s' % { 'str': "".join(map(lambda x : str(x) + ", ", i)) }
|
||||
else:
|
||||
print '%(str)s' % { 'str': "".join(map(lambda x : str(x) + ", ", i)) }
|
||||
for i in ct_second_part:
|
||||
if opt_numeric:
|
||||
for ks in i[1:][:-1]:
|
||||
print '0x%(seq)04X, ' % { 'seq': keysymvalue(ks) },
|
||||
print '0x%(cp)04X, ' % { 'cp':i[-1] }
|
||||
"""
|
||||
for ks in i[:-1]:
|
||||
print '0x%(seq)04X, ' % { 'seq': keysymvalue(ks) },
|
||||
print '0x%(cp)04X, ' % { 'cp':i[-1] }
|
||||
"""
|
||||
elif opt_gtkexpanded:
|
||||
print '%(seq)s0x%(cp)04X, ' % { 'seq': "".join(map(addprefix_GDK, i[:-1])), 'cp':i[-1] }
|
||||
else:
|
||||
print '%(seq)s0x%(cp)04X, ' % { 'seq': "".join(map(addprefix_GDK, i[:-1][1:])), 'cp':i[-1] }
|
||||
print headerfile_end
|
||||
|
||||
def redecompose(codepoint):
|
||||
(name, decomposition, combiningclass) = unicodedatabase[codepoint]
|
||||
if decomposition[0] == '' or decomposition[0] == '0':
|
||||
return [codepoint]
|
||||
if match('<\w+>', decomposition[0]):
|
||||
numdecomposition = map(stringtohex, decomposition[1:])
|
||||
return map(redecompose, numdecomposition)
|
||||
numdecomposition = map(stringtohex, decomposition)
|
||||
return map(redecompose, numdecomposition)
|
||||
|
||||
def process_unicodedata_file(verbose = False):
|
||||
""" Grab from wget http://www.unicode.org/Public/UNIDATA/UnicodeData.txt """
|
||||
filename_unicodedatatxt = download_file(URL_UNICODEDATATXT)
|
||||
try:
|
||||
unicodedatatxt = open(filename_unicodedatatxt, 'r')
|
||||
except IOError, (errno, strerror):
|
||||
print "I/O error(%s): %s" % (errno, strerror)
|
||||
sys.exit(-1)
|
||||
except:
|
||||
print "Unexpected error: ", sys.exc_info()[0]
|
||||
sys.exit(-1)
|
||||
for line in unicodedatatxt.readlines():
|
||||
if line[0] == "" or line[0] == '#':
|
||||
continue
|
||||
line = line[:-1]
|
||||
uniproperties = split(';', line)
|
||||
codepoint = stringtohex(uniproperties[0])
|
||||
""" We don't do Plane 1 or CJK blocks. The latter require reading additional files. """
|
||||
if codepoint > 0xFFFF or (codepoint >= 0x4E00 and codepoint <= 0x9FFF) or (codepoint >= 0xF900 and codepoint <= 0xFAFF):
|
||||
continue
|
||||
name = uniproperties[1]
|
||||
category = uniproperties[2]
|
||||
combiningclass = uniproperties[3]
|
||||
decomposition = uniproperties[5]
|
||||
unicodedatabase[codepoint] = [name, split('\s+', decomposition), combiningclass]
|
||||
|
||||
counter_combinations = 0
|
||||
counter_combinations_greek = 0
|
||||
counter_entries = 0
|
||||
counter_entries_greek = 0
|
||||
|
||||
for item in unicodedatabase.keys():
|
||||
(name, decomposition, combiningclass) = unicodedatabase[item]
|
||||
if decomposition[0] == '':
|
||||
continue
|
||||
print name, "is empty"
|
||||
elif match('<\w+>', decomposition[0]):
|
||||
continue
|
||||
print name, "has weird", decomposition[0]
|
||||
else:
|
||||
sequence = map(stringtohex, decomposition)
|
||||
chrsequence = map(unichr, sequence)
|
||||
normalized = normalize('NFC', "".join(chrsequence))
|
||||
|
||||
""" print name, sequence, "Combining: ", "".join(chrsequence), normalized, len(normalized), """
|
||||
decomposedsequence = []
|
||||
for subseq in map(redecompose, sequence):
|
||||
for seqitem in subseq:
|
||||
if isinstance(seqitem, list):
|
||||
for i in seqitem:
|
||||
if isinstance(i, list):
|
||||
for j in i:
|
||||
decomposedsequence.append(j)
|
||||
else:
|
||||
decomposedsequence.append(i)
|
||||
else:
|
||||
decomposedsequence.append(seqitem)
|
||||
recomposedchar = normalize('NFC', "".join(map(unichr, decomposedsequence)))
|
||||
if len(recomposedchar) == 1 and len(decomposedsequence) > 1:
|
||||
counter_entries += 1
|
||||
counter_combinations += factorial(len(decomposedsequence)-1)
|
||||
ch = item
|
||||
if ch >= 0x370 and ch <= 0x3ff or ch >= 0x1f00 and ch <= 0x1fff:
|
||||
counter_entries_greek += 1
|
||||
counter_combinations_greek += factorial(len(decomposedsequence)-1)
|
||||
if verbose:
|
||||
print "0x%(cp)04X, %(uni)c, seq:" % { 'cp':item, 'uni':unichr(item) },
|
||||
print "[",
|
||||
for elem in decomposedsequence:
|
||||
print '<0x%(hex)04X>,' % { 'hex': elem },
|
||||
print "], recomposed as", recomposedchar,
|
||||
if unichr(item) == recomposedchar:
|
||||
print "verified"
|
||||
|
||||
if verbose == False:
|
||||
print "Unicode statistics from UnicodeData.txt"
|
||||
print "Number of entries that can be algorithmically produced :", counter_entries
|
||||
print " of which are for Greek :", counter_entries_greek
|
||||
print "Number of compose sequence combinations requiring :", counter_combinations
|
||||
print " of which are for Greek :", counter_combinations_greek
|
||||
print "Note: We do not include partial compositions, "
|
||||
print "thus the slight discrepancy in the figures"
|
||||
print
|
||||
|
||||
if opt_unicodedatatxt:
|
||||
process_unicodedata_file(True)
|
||||
|
||||
if opt_statistics:
|
||||
print
|
||||
print "Total number of compose sequences (from file) :", len(xorg_compose_sequences) + len(xorg_compose_sequences_algorithmic)
|
||||
print " of which can be expressed algorithmically :", len(xorg_compose_sequences_algorithmic)
|
||||
print " of which cannot be expressed algorithmically :", len(xorg_compose_sequences)
|
||||
print " of which have Multi_key :", counter_multikey
|
||||
print
|
||||
print "Algorithmic (stats for Xorg Compose file)"
|
||||
print "Number of sequences off due to algo from file (len(array)) :", len(xorg_compose_sequences_algorithmic)
|
||||
print "Number of sequences off due to algo (uniq(sort(array))) :", len(xorg_compose_sequences_algorithmic_uniqued)
|
||||
print " of which are for Greek :", num_algorithmic_greek
|
||||
print
|
||||
process_unicodedata_file()
|
||||
print "Not algorithmic (stats from Xorg Compose file)"
|
||||
print "Number of sequences :", len(xorg_compose_sequences)
|
||||
print "Flat array looks like :", len(xorg_compose_sequences), "rows of 6 integers (2 bytes per int, or 12 bytes per row)"
|
||||
print "Flat array would have taken up (in bytes) :", num_entries * 2 * 6, "bytes from the GTK+ library"
|
||||
print "Number of items in flat array :", len(xorg_compose_sequences) * 6
|
||||
print " of which are zeroes :", zeroes, "or ", (100 * zeroes) / (len(xorg_compose_sequences) * 6), " per cent"
|
||||
print "Number of different first items :", num_first_keysyms
|
||||
print "Number of max bytes (if using flat array) :", num_entries * 2 * 6
|
||||
print "Number of savings :", zeroes * 2 - num_first_keysyms * 2 * 5
|
||||
print
|
||||
print "Memory needs if both algorithmic+optimised table in latest Xorg compose file"
|
||||
print " :", num_entries * 2 * 6 - zeroes * 2 + num_first_keysyms * 2 * 5
|
||||
print
|
||||
print "Existing (old) implementation in GTK+"
|
||||
print "Number of sequences in old gtkimcontextsimple.c :", 691
|
||||
print "The existing (old) implementation in GTK+ takes up :", 691 * 2 * 12, "bytes"
|
||||
@@ -1,405 +0,0 @@
|
||||
#
|
||||
# This file contains the compose sequences that GTK+ used to have until GTK+ 2.12
|
||||
# but are not found anymore at the upstream Compose file at X.Org.
|
||||
# When updating gtkimcontextsimpleseqs.h with compose-parse.py,
|
||||
# we include this file as well. There are 15 conflicts currently
|
||||
# in the compose sequences, and we currently favour the sequences from
|
||||
# this file (against the upstream X.Org file). For more, see
|
||||
# http://bugzilla.gnome.org/show_bug.cgi?id=557420
|
||||
#
|
||||
|
||||
<Greek_accentdieresis> <Greek_iota> : "ἴ" U0390
|
||||
<Greek_accentdieresis> <Greek_upsilon> : "ΐ" U03B0
|
||||
<Multi_key> <B> <period> : "Ḃ" U1E02
|
||||
<Multi_key> <b> <period> : "ḃ" U1E03
|
||||
<Multi_key> <D> <period> : "Ḋ" U1E0A
|
||||
<Multi_key> <d> <period> : "ḋ" U1E0B
|
||||
<Multi_key> <F> <period> : "Ḟ" U1E1E
|
||||
<Multi_key> <f> <period> : "ḟ" U1E1F
|
||||
<Multi_key> <M> <period> : "Ṁ" U1E40
|
||||
<Multi_key> <S> <period> : "Ṡ" U1E60
|
||||
<Multi_key> <P> <period> : "Ṗ" U1E56
|
||||
<Multi_key> <p> <period> : "ṗ" U1E57
|
||||
<Multi_key> <s> <period> : "ṡ" U1E61
|
||||
<Multi_key> <T> <period> : "Ṫ" U1E6A
|
||||
<Multi_key> <t> <period> : "ṫ" U1E6B
|
||||
<Multi_key> <e> <period> : "ė" U0117
|
||||
<Multi_key> <C> <bar> : "¢" U00A2
|
||||
<Multi_key> <bar> <C> : "¢" U00A2
|
||||
<Multi_key> <minus> <l> : "£" U00A3
|
||||
<Multi_key> <equal> <l> : "£" U00A3
|
||||
<Multi_key> <L> <equal> : "£" U00A3
|
||||
<Multi_key> <l> <minus> : "£" U00A3
|
||||
<Multi_key> <l> <equal> : "£" U00A3
|
||||
<Multi_key> <0> <X> : "¤" U00A4
|
||||
<Multi_key> <0> <x> : "¤" U00A4
|
||||
<Multi_key> <O> <X> : "¤" U00A4
|
||||
<Multi_key> <O> <x> : "¤" U00A4
|
||||
<Multi_key> <X> <0> : "¤" U00A4
|
||||
<Multi_key> <X> <O> : "¤" U00A4
|
||||
<Multi_key> <X> <o> : "¤" U00A4
|
||||
<Multi_key> <o> <X> : "¤" U00A4
|
||||
<Multi_key> <x> <0> : "¤" U00A4
|
||||
<Multi_key> <x> <O> : "¤" U00A4
|
||||
<Multi_key> <minus> <Y> : "¥" U00A5
|
||||
<Multi_key> <minus> <y> : "¥" U00A5
|
||||
<Multi_key> <equal> <y> : "¥" U00A5
|
||||
<Multi_key> <Y> <minus> : "¥" U00A5
|
||||
<Multi_key> <y> <minus> : "¥" U00A5
|
||||
<Multi_key> <y> <equal> : "¥" U00A5
|
||||
<Multi_key> <0> <S> : "§" U00A7
|
||||
<Multi_key> <0> <s> : "§" U00A7
|
||||
<Multi_key> <O> <S> : "§" U00A7
|
||||
<Multi_key> <S> <exclam> : "§" U00A7
|
||||
<Multi_key> <S> <0> : "§" U00A7
|
||||
<Multi_key> <S> <O> : "§" U00A7
|
||||
<Multi_key> <s> <exclam> : "§" U00A7
|
||||
<Multi_key> <s> <0> : "§" U00A7
|
||||
<Multi_key> <quotedbl> <quotedbl> : "¨" U00A8
|
||||
<Multi_key> <parenleft> <c> : "©" U00A9
|
||||
<Multi_key> <0> <C> : "©" U00A9
|
||||
<Multi_key> <0> <c> : "©" U00A9
|
||||
<Multi_key> <C> <0> : "©" U00A9
|
||||
<Multi_key> <C> <O> : "©" U00A9
|
||||
<Multi_key> <C> <o> : "©" U00A9
|
||||
<Multi_key> <c> <0> : "©" U00A9
|
||||
<Multi_key> <A> <underscore> : "ª" U00AA
|
||||
<Multi_key> <a> <underscore> : "ª" U00AA
|
||||
<Multi_key> <C> <comma> : "Ç" U00C7
|
||||
<Multi_key> <minus> <minus> <space> : "" U00AD
|
||||
<Multi_key> <parenleft> <r> : "®" U00AE
|
||||
<Multi_key> <R> <O> : "®" U00AE
|
||||
<Multi_key> <minus> <asciicircum> : "¯" U00AF
|
||||
<Multi_key> <asciicircum> <minus> : "¯" U00AF
|
||||
<Multi_key> <asciicircum> <underscore> : "¯" U00AF
|
||||
<Multi_key> <underscore> <asciicircum> : "¯" U00AF
|
||||
<Multi_key> <underscore> <underscore> : "¯" U00AF
|
||||
<Multi_key> <asterisk> <0> : "°" U00B0
|
||||
<Multi_key> <0> <asterisk> : "°" U00B0
|
||||
<Multi_key> <0> <asciicircum> : "°" U00B0
|
||||
<Multi_key> <minus> <plus> : "±" U00B1
|
||||
<Multi_key> <2> <S> : "²" U00B2
|
||||
<Multi_key> <2> <asciicircum> : "²" U00B2
|
||||
<Multi_key> <2> <s> : "²" U00B2
|
||||
<Multi_key> <S> <2> : "²" U00B2
|
||||
<Multi_key> <s> <2> : "²" U00B2
|
||||
<Multi_key> <3> <S> : "³" U00B3
|
||||
<Multi_key> <3> <asciicircum> : "³" U00B3
|
||||
<Multi_key> <3> <s> : "³" U00B3
|
||||
<Multi_key> <S> <3> : "³" U00B3
|
||||
<Multi_key> <s> <3> : "³" U00B3
|
||||
<Multi_key> <apostrophe> <apostrophe> : "´" U00B4
|
||||
<Multi_key> <slash> <U> : "µ" U00B5
|
||||
<Multi_key> <slash> <u> : "µ" U00B5
|
||||
<Multi_key> <U> <slash> : "µ" U00B5
|
||||
<Multi_key> <u> <slash> : "µ" U00B5
|
||||
<Multi_key> <exclam> <P> : "¶" U00B6
|
||||
<Multi_key> <exclam> <p> : "¶" U00B6
|
||||
<Multi_key> <period> <asciicircum> : "·" U00B7
|
||||
<Multi_key> <asciicircum> <period> : "·" U00B7
|
||||
<Multi_key> <comma> <comma> : "¸" U00B8
|
||||
<Multi_key> <1> <S> : "¹" U00B9
|
||||
<Multi_key> <1> <asciicircum> : "¹" U00B9
|
||||
<Multi_key> <1> <s> : "¹" U00B9
|
||||
<Multi_key> <S> <1> : "¹" U00B9
|
||||
<Multi_key> <s> <1> : "¹" U00B9
|
||||
<Multi_key> <O> <underscore> : "º" U00BA
|
||||
<Multi_key> <o> <underscore> : "º" U00BA
|
||||
<Multi_key> <A> <grave> : "À" U00C0
|
||||
<Multi_key> <A> <apostrophe> : "Á" U00C1
|
||||
<Multi_key> <A> <acute> : "Á" U00C1
|
||||
<Multi_key> <greater> <A> : "Â" U00C2
|
||||
<Multi_key> <A> <greater> : "Â" U00C2
|
||||
<Multi_key> <A> <asciicircum> : "Â" U00C2
|
||||
<Multi_key> <minus> <A> : "Ã" U00C3
|
||||
<Multi_key> <A> <minus> : "Ã" U00C3
|
||||
<Multi_key> <A> <asciitilde> : "Ã" U00C3
|
||||
<Multi_key> <A> <quotedbl> : "Ä" U00C4
|
||||
<Multi_key> <A> <diaeresis> : "Ä" U00C4
|
||||
<Multi_key> <diaeresis> <A> : "Ä" U00C4
|
||||
<Multi_key> <asterisk> <A> : "Å" U00C5
|
||||
<Multi_key> <A> <asterisk> : "Å" U00C5
|
||||
<Multi_key> <A> <A> : "Å" U00C5
|
||||
<Multi_key> <space> <less> : "ˇ" U02C7
|
||||
<Multi_key> <less> <space> : "ˇ" U02C7
|
||||
<Multi_key> <E> <grave> : "È" U00C8
|
||||
<Multi_key> <E> <apostrophe> : "É" U00C9
|
||||
<Multi_key> <E> <acute> : "É" U00C9
|
||||
<Multi_key> <greater> <E> : "Ê" U00CA
|
||||
<Multi_key> <E> <greater> : "Ê" U00CA
|
||||
<Multi_key> <E> <asciicircum> : "Ê" U00CA
|
||||
<Multi_key> <E> <quotedbl> : "Ë" U00CB
|
||||
<Multi_key> <E> <diaeresis> : "Ë" U00CB
|
||||
<Multi_key> <diaeresis> <E> : "Ë" U00CB
|
||||
<Multi_key> <I> <grave> : "Ì" U00CC
|
||||
<Multi_key> <I> <apostrophe> : "Í" U00CD
|
||||
<Multi_key> <I> <acute> : "Í" U00CD
|
||||
<Multi_key> <greater> <I> : "Î" U00CE
|
||||
<Multi_key> <I> <greater> : "Î" U00CE
|
||||
<Multi_key> <I> <asciicircum> : "Î" U00CE
|
||||
<Multi_key> <I> <quotedbl> : "Ï" U00CF
|
||||
<Multi_key> <I> <diaeresis> : "Ï" U00CF
|
||||
<Multi_key> <diaeresis> <I> : "Ï" U00CF
|
||||
<Multi_key> <minus> <N> : "Ñ" U00D1
|
||||
<Multi_key> <N> <minus> : "Ñ" U00D1
|
||||
<Multi_key> <N> <asciitilde> : "Ñ" U00D1
|
||||
<Multi_key> <O> <grave> : "Ò" U00D2
|
||||
<Multi_key> <O> <apostrophe> : "Ó" U00D3
|
||||
<Multi_key> <O> <acute> : "Ó" U00D3
|
||||
<Multi_key> <greater> <O> : "Ô" U00D4
|
||||
<Multi_key> <O> <greater> : "Ô" U00D4
|
||||
<Multi_key> <O> <asciicircum> : "Ô" U00D4
|
||||
<Multi_key> <minus> <O> : "Õ" U00D5
|
||||
<Multi_key> <O> <minus> : "Õ" U00D5
|
||||
<Multi_key> <O> <asciitilde> : "Õ" U00D5
|
||||
<Multi_key> <O> <quotedbl> : "Ö" U00D6
|
||||
<Multi_key> <O> <diaeresis> : "Ö" U00D6
|
||||
<Multi_key> <diaeresis> <O> : "Ö" U00D6
|
||||
<Multi_key> <space> <parenleft> : "˘" U02D8
|
||||
<Multi_key> <parenleft> <space> : "˘" U02D8
|
||||
<Multi_key> <U> <grave> : "Ù" U00D9
|
||||
<Multi_key> <U> <apostrophe> : "Ú" U00DA
|
||||
<Multi_key> <U> <acute> : "Ú" U00DA
|
||||
<Multi_key> <greater> <U> : "Û" U00DB
|
||||
<Multi_key> <U> <greater> : "Û" U00DB
|
||||
<Multi_key> <U> <asciicircum> : "Û" U00DB
|
||||
<Multi_key> <U> <quotedbl> : "Ü" U00DC
|
||||
<Multi_key> <U> <diaeresis> : "Ü" U00DC
|
||||
<Multi_key> <diaeresis> <U> : "Ü" U00DC
|
||||
<Multi_key> <Y> <apostrophe> : "Ý" U00DD
|
||||
<Multi_key> <Y> <acute> : "Ý" U00DD
|
||||
<Multi_key> <a> <grave> : "à" U00E0
|
||||
<Multi_key> <a> <apostrophe> : "á" U00E1
|
||||
<Multi_key> <a> <acute> : "á" U00E1
|
||||
<Multi_key> <greater> <a> : "â" U00E2
|
||||
<Multi_key> <a> <greater> : "â" U00E2
|
||||
<Multi_key> <a> <asciicircum> : "â" U00E2
|
||||
<Multi_key> <minus> <a> : "ā" U0101
|
||||
<Multi_key> <a> <minus> : "ā" U0101
|
||||
<Multi_key> <a> <asciitilde> : "ã" U00E3
|
||||
<Multi_key> <a> <quotedbl> : "ä" U00E4
|
||||
<Multi_key> <a> <diaeresis> : "ä" U00E4
|
||||
<Multi_key> <diaeresis> <a> : "ä" U00E4
|
||||
<Multi_key> <asterisk> <a> : "å" U00E5
|
||||
<Multi_key> <a> <asterisk> : "å" U00E5
|
||||
<Multi_key> <a> <a> : "å" U00E5
|
||||
<Multi_key> <c> <comma> : "ç" U00E7
|
||||
<Multi_key> <e> <grave> : "è" U00E8
|
||||
<Multi_key> <e> <apostrophe> : "é" U00E9
|
||||
<Multi_key> <e> <acute> : "é" U00E9
|
||||
<Multi_key> <greater> <e> : "ê" U00EA
|
||||
<Multi_key> <e> <greater> : "ê" U00EA
|
||||
<Multi_key> <e> <asciicircum> : "ê" U00EA
|
||||
<Multi_key> <e> <quotedbl> : "ë" U00EB
|
||||
<Multi_key> <e> <diaeresis> : "ë" U00EB
|
||||
<Multi_key> <diaeresis> <e> : "ë" U00EB
|
||||
<Multi_key> <i> <grave> : "ì" U00EC
|
||||
<Multi_key> <i> <apostrophe> : "í" U00ED
|
||||
<Multi_key> <i> <acute> : "í" U00ED
|
||||
<Multi_key> <greater> <i> : "î" U00EE
|
||||
<Multi_key> <i> <greater> : "î" U00EE
|
||||
<Multi_key> <i> <asciicircum> : "î" U00EE
|
||||
<Multi_key> <i> <quotedbl> : "ï" U00EF
|
||||
<Multi_key> <i> <diaeresis> : "ï" U00EF
|
||||
<Multi_key> <diaeresis> <i> : "ï" U00EF
|
||||
<Multi_key> <minus> <n> : "ñ" U00F1
|
||||
<Multi_key> <n> <minus> : "ñ" U00F1
|
||||
<Multi_key> <n> <asciitilde> : "ñ" U00F1
|
||||
<Multi_key> <o> <grave> : "ò" U00F2
|
||||
<Multi_key> <o> <apostrophe> : "ó" U00F3
|
||||
<Multi_key> <o> <acute> : "ó" U00F3
|
||||
<Multi_key> <greater> <o> : "ô" U00F4
|
||||
<Multi_key> <o> <greater> : "ô" U00F4
|
||||
<Multi_key> <o> <asciicircum> : "ô" U00F4
|
||||
<Multi_key> <minus> <o> : "ō" U014D
|
||||
<Multi_key> <o> <minus> : "ō" U014D
|
||||
<Multi_key> <o> <asciitilde> : "õ" U00F5
|
||||
<Multi_key> <o> <quotedbl> : "ö" U00F6
|
||||
<Multi_key> <o> <diaeresis> : "ö" U00F6
|
||||
<Multi_key> <diaeresis> <o> : "ö" U00F6
|
||||
<Multi_key> <o> <slash> : "ø" U00F8
|
||||
<Multi_key> <u> <grave> : "ù" U00F9
|
||||
<Multi_key> <u> <apostrophe> : "ú" U00FA
|
||||
<Multi_key> <u> <acute> : "ú" U00FA
|
||||
<Multi_key> <greater> <u> : "û" U00FB
|
||||
<Multi_key> <u> <greater> : "û" U00FB
|
||||
<Multi_key> <u> <asciicircum> : "û" U00FB
|
||||
<Multi_key> <u> <quotedbl> : "ü" U00FC
|
||||
<Multi_key> <u> <diaeresis> : "ü" U00FC
|
||||
<Multi_key> <diaeresis> <u> : "ü" U00FC
|
||||
<Multi_key> <y> <apostrophe> : "ý" U00FD
|
||||
<Multi_key> <y> <acute> : "ý" U00FD
|
||||
<Multi_key> <y> <quotedbl> : "ÿ" U00FF
|
||||
<Multi_key> <y> <diaeresis> : "ÿ" U00FF
|
||||
<Multi_key> <diaeresis> <y> : "ÿ" U00FF
|
||||
<Multi_key> <parenleft> <A> : "Ă" U0102
|
||||
<Multi_key> <A> <parenleft> : "Ă" U0102
|
||||
<Multi_key> <parenleft> <a> : "ă" U0103
|
||||
<Multi_key> <a> <parenleft> : "ă" U0103
|
||||
<Multi_key> <comma> <A> : "Ą" U0104
|
||||
<Multi_key> <A> <comma> : "Ą" U0104
|
||||
<Multi_key> <comma> <a> : "ą" U0105
|
||||
<Multi_key> <a> <comma> : "ą" U0105
|
||||
<Multi_key> <C> <apostrophe> : "Ć" U0106
|
||||
<Multi_key> <c> <apostrophe> : "ć" U0107
|
||||
<Multi_key> <C> <period> : "Ċ" U010A
|
||||
<Multi_key> <c> <period> : "ċ" U010B
|
||||
<Multi_key> <less> <C> : "Č" U010C
|
||||
<Multi_key> <C> <less> : "Č" U010C
|
||||
<Multi_key> <less> <c> : "č" U010D
|
||||
<Multi_key> <c> <less> : "č" U010D
|
||||
<Multi_key> <less> <D> : "Ď" U010E
|
||||
<Multi_key> <D> <less> : "Ď" U010E
|
||||
<Multi_key> <less> <d> : "ď" U010F
|
||||
<Multi_key> <d> <less> : "ď" U010F
|
||||
<Multi_key> <minus> <D> : "Đ" U0110
|
||||
<Multi_key> <D> <minus> : "Đ" U0110
|
||||
<Multi_key> <minus> <d> : "đ" U0111
|
||||
<Multi_key> <minus> <E> : "Ē" U0112
|
||||
<Multi_key> <E> <minus> : "Ē" U0112
|
||||
<Multi_key> <E> <underscore> : "Ē" U0112
|
||||
<Multi_key> <minus> <e> : "ē" U0113
|
||||
<Multi_key> <e> <minus> : "ē" U0113
|
||||
<Multi_key> <e> <underscore> : "ē" U0113
|
||||
<Multi_key> <E> <period> : "Ė" U0116
|
||||
<Multi_key> <E> <comma> : "Ę" U0118
|
||||
<Multi_key> <e> <comma> : "ę" U0119
|
||||
<Multi_key> <less> <E> : "Ě" U011A
|
||||
<Multi_key> <E> <less> : "Ě" U011A
|
||||
<Multi_key> <less> <e> : "ě" U011B
|
||||
<Multi_key> <e> <less> : "ě" U011B
|
||||
<Multi_key> <parenleft> <G> : "Ğ" U011E
|
||||
<Multi_key> <G> <parenleft> : "Ğ" U011E
|
||||
<Multi_key> <G> <U> : "Ğ" U011E
|
||||
<Multi_key> <G> <breve> : "Ğ" U011E
|
||||
<Multi_key> <breve> <G> : "Ğ" U011E
|
||||
<Multi_key> <parenleft> <g> : "ğ" U011F
|
||||
<Multi_key> <g> <parenleft> : "ğ" U011F
|
||||
<Multi_key> <g> <U> : "ğ" U011F
|
||||
<Multi_key> <g> <breve> : "ğ" U011F
|
||||
<Multi_key> <breve> <g> : "ğ" U011F
|
||||
<Multi_key> <G> <period> : "Ġ" U0120
|
||||
<Multi_key> <g> <period> : "ġ" U0121
|
||||
<Multi_key> <G> <comma> : "Ģ" U0122
|
||||
<Multi_key> <g> <comma> : "ģ" U0123
|
||||
<Multi_key> <I> <asciitilde> : "Ĩ" U0128
|
||||
<Multi_key> <i> <asciitilde> : "ĩ" U0129
|
||||
<Multi_key> <minus> <I> : "Ī" U012A
|
||||
<Multi_key> <I> <minus> : "Ī" U012A
|
||||
<Multi_key> <I> <underscore> : "Ī" U012A
|
||||
<Multi_key> <minus> <i> : "ī" U012B
|
||||
<Multi_key> <i> <minus> : "ī" U012B
|
||||
<Multi_key> <i> <underscore> : "ī" U012B
|
||||
<Multi_key> <comma> <I> : "Į" U012E
|
||||
<Multi_key> <I> <comma> : "Į" U012E
|
||||
<Multi_key> <I> <period> : "İ" U0130
|
||||
<Multi_key> <period> <i> : "ı" U0131
|
||||
<Multi_key> <K> <comma> : "Ķ" U0136
|
||||
<Multi_key> <k> <comma> : "ķ" U0137
|
||||
<Multi_key> <L> <apostrophe> : "Ĺ" U0139
|
||||
<Multi_key> <l> <apostrophe> : "ĺ" U013A
|
||||
<Multi_key> <L> <comma> : "Ļ" U013B
|
||||
<Multi_key> <l> <comma> : "ļ" U013C
|
||||
<Multi_key> <less> <L> : "Ľ" U013D
|
||||
<Multi_key> <L> <less> : "Ľ" U013D
|
||||
<Multi_key> <less> <l> : "ľ" U013E
|
||||
<Multi_key> <l> <less> : "ľ" U013E
|
||||
<Multi_key> <L> <slash> : "Ł" U0141
|
||||
<Multi_key> <l> <slash> : "ł" U0142
|
||||
<Multi_key> <N> <apostrophe> : "Ń" U0143
|
||||
<Multi_key> <n> <apostrophe> : "ń" U0144
|
||||
<Multi_key> <N> <comma> : "Ņ" U0145
|
||||
<Multi_key> <n> <comma> : "ņ" U0146
|
||||
<Multi_key> <less> <N> : "Ň" U0147
|
||||
<Multi_key> <N> <less> : "Ň" U0147
|
||||
<Multi_key> <less> <n> : "ň" U0148
|
||||
<Multi_key> <n> <less> : "ň" U0148
|
||||
<Multi_key> <R> <apostrophe> : "Ŕ" U0154
|
||||
<Multi_key> <r> <apostrophe> : "ŕ" U0155
|
||||
<Multi_key> <R> <comma> : "Ŗ" U0156
|
||||
<Multi_key> <r> <comma> : "ŗ" U0157
|
||||
<Multi_key> <less> <R> : "Ř" U0158
|
||||
<Multi_key> <R> <less> : "Ř" U0158
|
||||
<Multi_key> <less> <r> : "ř" U0159
|
||||
<Multi_key> <r> <less> : "ř" U0159
|
||||
<Multi_key> <S> <apostrophe> : "Ś" U015A
|
||||
<Multi_key> <s> <apostrophe> : "ś" U015B
|
||||
<Multi_key> <O> <slash> : "Ø" U00D8
|
||||
<Multi_key> <S> <comma> : "Ş" U015E
|
||||
<Multi_key> <S> <cedilla> : "Ş" U015E
|
||||
<Multi_key> <s> <comma> : "ş" U015F
|
||||
<Multi_key> <s> <cedilla> : "ş" U015F
|
||||
<Multi_key> <less> <S> : "Š" U0160
|
||||
<Multi_key> <S> <less> : "Š" U0160
|
||||
<Multi_key> <less> <s> : "š" U0161
|
||||
<Multi_key> <s> <less> : "š" U0161
|
||||
<Multi_key> <less> <T> : "Ť" U0164
|
||||
<Multi_key> <T> <less> : "Ť" U0164
|
||||
<Multi_key> <less> <t> : "ť" U0165
|
||||
<Multi_key> <t> <less> : "ť" U0165
|
||||
<Multi_key> <T> <minus> : "Ŧ" U0166
|
||||
<Multi_key> <T> <slash> : "Ŧ" U0166
|
||||
<Multi_key> <t> <minus> : "ŧ" U0167
|
||||
<Multi_key> <t> <slash> : "ŧ" U0167
|
||||
<Multi_key> <U> <asciitilde> : "Ũ" U0168
|
||||
<Multi_key> <u> <asciitilde> : "ũ" U0169
|
||||
<Multi_key> <minus> <U> : "Ū" U016A
|
||||
<Multi_key> <U> <minus> : "Ū" U016A
|
||||
<Multi_key> <U> <underscore> : "Ū" U016A
|
||||
<Multi_key> <minus> <u> : "ū" U016B
|
||||
<Multi_key> <u> <minus> : "ū" U016B
|
||||
<Multi_key> <u> <underscore> : "ū" U016B
|
||||
<Multi_key> <asterisk> <U> : "Ů" U016E
|
||||
<Multi_key> <U> <asterisk> : "Ů" U016E
|
||||
<Multi_key> <asterisk> <u> : "ů" U016F
|
||||
<Multi_key> <u> <asterisk> : "ů" U016F
|
||||
<Multi_key> <comma> <U> : "Ų" U0172
|
||||
<Multi_key> <U> <comma> : "Ų" U0172
|
||||
<Multi_key> <comma> <u> : "ų" U0173
|
||||
<Multi_key> <u> <comma> : "ų" U0173
|
||||
<Multi_key> <W> <asciicircum> : "Ŵ" U0174
|
||||
<Multi_key> <w> <asciicircum> : "ŵ" U0175
|
||||
<Multi_key> <Y> <asciicircum> : "Ŷ" U0176
|
||||
<Multi_key> <y> <asciicircum> : "ŷ" U0177
|
||||
<Multi_key> <Y> <quotedbl> : "Ÿ" U0178
|
||||
<Multi_key> <Y> <diaeresis> : "Ÿ" U0178
|
||||
<Multi_key> <diaeresis> <Y> : "Ÿ" U0178
|
||||
<Multi_key> <Z> <apostrophe> : "Ź" U0179
|
||||
<Multi_key> <z> <apostrophe> : "ź" U017A
|
||||
<Multi_key> <Z> <period> : "Ż" U017B
|
||||
<Multi_key> <z> <period> : "ż" U017C
|
||||
<Multi_key> <less> <Z> : "Ž" U017D
|
||||
<Multi_key> <Z> <less> : "Ž" U017D
|
||||
<Multi_key> <v> <Z> : "Ž" U017D
|
||||
<Multi_key> <less> <z> : "ž" U017E
|
||||
<Multi_key> <v> <z> : "ž" U017E
|
||||
<Multi_key> <z> <less> : "ž" U017E
|
||||
<dead_acute> <dead_diaeresis> <space> : "΅" U0385
|
||||
<dead_diaeresis> <dead_acute> <space> : "΅" U0385
|
||||
<Multi_key> <quotedbl> <apostrophe> <space> : "΅" U0385
|
||||
<Multi_key> <apostrophe> <quotedbl> <space> : "΅" U0385
|
||||
<Multi_key> <Greek_ALPHA> <apostrophe> : "Ά" U0386
|
||||
<Multi_key> <m> <period> : "ṁ" U1E41
|
||||
<Multi_key> <Greek_EPSILON> <apostrophe> : "Έ" U0388
|
||||
<Multi_key> <Greek_ETA> <apostrophe> : "Ή" U0389
|
||||
<Multi_key> <Greek_IOTA> <apostrophe> : "Ί" U038A
|
||||
<Multi_key> <Greek_OMICRON> <apostrophe> : "Ό" U038C
|
||||
<Multi_key> <Greek_UPSILON> <apostrophe> : "Ύ" U038E
|
||||
<Multi_key> <Greek_OMEGA> <apostrophe> : "Ώ" U038F
|
||||
<dead_diaeresis> <dead_acute> <Greek_iota> : "ΐ" U0390
|
||||
<Multi_key> <quotedbl> <apostrophe> <Greek_iota> : "ΐ" U0390
|
||||
<Multi_key> <comma> <i> : "į" U012F
|
||||
<Multi_key> <i> <comma> : "į" U012F
|
||||
<Multi_key> <Greek_IOTA> <quotedbl> : "Ϊ" U03AA
|
||||
<Multi_key> <Greek_UPSILON> <quotedbl> : "Ϋ" U03AB
|
||||
<Multi_key> <Greek_alpha> <apostrophe> : "ά" U03AC
|
||||
<Multi_key> <Greek_epsilon> <apostrophe> : "έ" U03AD
|
||||
<Multi_key> <Greek_eta> <apostrophe> : "ή" U03AE
|
||||
<Multi_key> <Greek_iota> <apostrophe> : "ί" U03AF
|
||||
<dead_diaeresis> <dead_acute> <Greek_upsilon> : "ΰ" U03B0
|
||||
<Multi_key> <quotedbl> <apostrophe> <Greek_upsilon> : "ΰ" U03B0
|
||||
<Multi_key> <Greek_iota> <quotedbl> : "ϊ" U03CA
|
||||
<Multi_key> <Greek_upsilon> <quotedbl> : "ϋ" U03CB
|
||||
<Multi_key> <Greek_omicron> <apostrophe> : "ό" U03CC
|
||||
<Multi_key> <Greek_upsilon> <apostrophe> : "ύ" U03CD
|
||||
<Multi_key> <Greek_omega> <apostrophe> : "ώ" U03CE
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __GTK_COMPOSE_DATA__
|
||||
#define __GTK_COMPOSE_DATA__
|
||||
|
||||
#define MAX_SEQ_LEN 5
|
||||
#define N_INDEX_SIZE 30
|
||||
#define DATA_SIZE 16447
|
||||
#define N_CHARS 1241
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
compose_parse = executable('compose-parse',
|
||||
sources: 'compose-parse.c',
|
||||
c_args: gtk_cargs + common_cflags,
|
||||
include_directories: [confinc, gtkinc],
|
||||
dependencies: libgtk_static_dep,
|
||||
install: false,
|
||||
)
|
||||
Binary file not shown.
@@ -84,6 +84,8 @@ for f in get_files('inspector', '.ui'):
|
||||
xml += '''
|
||||
<file>inspector/inspector.css</file>
|
||||
<file>emoji/en.data</file>
|
||||
<file>compose/sequences</file>
|
||||
<file>compose/chars</file>
|
||||
</gresource>
|
||||
</gresources>'''
|
||||
|
||||
|
||||
@@ -2242,6 +2242,23 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
|
||||
ret = FALSE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GDK_TYPE_CONTENT_FORMATS))
|
||||
{
|
||||
GdkContentFormats *formats;
|
||||
|
||||
formats = gdk_content_formats_parse (string);
|
||||
if (formats)
|
||||
g_value_take_boxed (value, formats);
|
||||
else
|
||||
{
|
||||
g_set_error (error,
|
||||
GTK_BUILDER_ERROR,
|
||||
GTK_BUILDER_ERROR_INVALID_VALUE,
|
||||
"Could not parse GdkContentFormats '%s'",
|
||||
string);
|
||||
ret = FALSE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GSK_TYPE_TRANSFORM))
|
||||
{
|
||||
GskTransform *transform;
|
||||
|
||||
+1
-1
@@ -791,7 +791,7 @@ gtk_real_button_activate (GtkButton *button)
|
||||
if (gtk_widget_get_realized (widget) && !priv->activate_timeout)
|
||||
{
|
||||
priv->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT, button_activate_timeout, button);
|
||||
g_source_set_name_by_id (priv->activate_timeout, "[gtk] button_activate_timeout");
|
||||
gdk_source_set_static_name_by_id (priv->activate_timeout, "[gtk] button_activate_timeout");
|
||||
|
||||
gtk_widget_add_css_class (GTK_WIDGET (button), "keyboard-activating");
|
||||
priv->button_down = TRUE;
|
||||
|
||||
@@ -420,9 +420,6 @@ gtk_check_button_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
GtkCheckButton *self = GTK_CHECK_BUTTON (widget);
|
||||
GtkCheckButton *active_button;
|
||||
|
||||
active_button = get_group_active_button (self);
|
||||
|
||||
if (gtk_widget_is_focus (widget))
|
||||
{
|
||||
@@ -471,9 +468,7 @@ gtk_check_button_focus (GtkWidget *widget,
|
||||
if (new_focus)
|
||||
{
|
||||
gtk_widget_grab_focus (new_focus);
|
||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (new_focus), TRUE);
|
||||
if (active_button && active_button != (GtkCheckButton *)new_focus)
|
||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (active_button), FALSE);
|
||||
gtk_widget_activate (new_focus);
|
||||
}
|
||||
|
||||
g_ptr_array_free (child_array, TRUE);
|
||||
@@ -482,6 +477,9 @@ gtk_check_button_focus (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkCheckButton *active_button;
|
||||
|
||||
active_button = get_group_active_button (self);
|
||||
if (active_button && active_button != self)
|
||||
return FALSE;
|
||||
|
||||
@@ -498,7 +496,10 @@ gtk_check_button_real_activate (GtkCheckButton *self)
|
||||
if (priv->active && (priv->group_prev || priv->group_next))
|
||||
return;
|
||||
|
||||
gtk_check_button_set_active (self, !gtk_check_button_get_active (self));
|
||||
if (priv->action_helper)
|
||||
gtk_action_helper_activate (priv->action_helper);
|
||||
else
|
||||
gtk_check_button_set_active (self, !gtk_check_button_get_active (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+837
-548
File diff suppressed because it is too large
Load Diff
+52
-30
@@ -26,50 +26,72 @@ G_BEGIN_DECLS
|
||||
typedef struct _GtkComposeTable GtkComposeTable;
|
||||
typedef struct _GtkComposeTableCompact GtkComposeTableCompact;
|
||||
|
||||
/* The layout of the data is as follows:
|
||||
*
|
||||
* The first part of the data contains rows of length max_seq_len + 1,
|
||||
* where the first element is the item of the sequence, and the
|
||||
* following elements are offsets to the data for sequences that
|
||||
* start with the first item of length 2, ..., max_seq_len.
|
||||
*
|
||||
* The second part of the data contains the rest of the sequence
|
||||
* data. It does not have a fixed stride. For each sequence, we
|
||||
* put seq[2], ..., seq[len - 1], followed by the encoded value
|
||||
* for this sequence.
|
||||
*
|
||||
* The values are encoded as follows:
|
||||
*
|
||||
* If the value is a single Unicode character smaler than 0x8000,
|
||||
* then we place it directly. Otherwise, we put the UTF8-encoded
|
||||
* value in the char_data array, and use offset | 0x8000 as the
|
||||
* encoded value.
|
||||
*/
|
||||
struct _GtkComposeTable
|
||||
{
|
||||
guint16 *data;
|
||||
char *char_data;
|
||||
int max_seq_len;
|
||||
int n_seqs;
|
||||
int n_index_size;
|
||||
int data_size;
|
||||
int n_chars;
|
||||
int n_sequences;
|
||||
guint32 id;
|
||||
};
|
||||
|
||||
struct _GtkComposeTableCompact
|
||||
{
|
||||
const guint16 *data;
|
||||
int max_seq_len;
|
||||
int n_index_size;
|
||||
int n_index_stride;
|
||||
};
|
||||
GtkComposeTable * gtk_compose_table_new_with_file (const char *compose_file);
|
||||
GtkComposeTable * gtk_compose_table_parse (const char *compose_file,
|
||||
gboolean *found_include);
|
||||
GtkComposeTable * gtk_compose_table_new_with_data (const guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs);
|
||||
|
||||
GtkComposeTable * gtk_compose_table_new_with_file (const char *compose_file);
|
||||
GSList * gtk_compose_table_list_add_array (GSList *compose_tables,
|
||||
const guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs);
|
||||
GSList * gtk_compose_table_list_add_file (GSList *compose_tables,
|
||||
const char *compose_file);
|
||||
typedef void (* GtkComposeSequenceCallback) (gunichar *sequence,
|
||||
int len,
|
||||
const char *value,
|
||||
gpointer data);
|
||||
|
||||
gboolean gtk_compose_table_check (const GtkComposeTable *table,
|
||||
const guint16 *compose_buffer,
|
||||
int n_compose,
|
||||
gboolean *compose_finish,
|
||||
gboolean *compose_match,
|
||||
GString *output);
|
||||
void gtk_compose_table_foreach (const GtkComposeTable *table,
|
||||
GtkComposeSequenceCallback callback,
|
||||
gpointer data);
|
||||
|
||||
gboolean gtk_compose_table_compact_check (const GtkComposeTableCompact *table,
|
||||
const guint16 *compose_buffer,
|
||||
int n_compose,
|
||||
gboolean *compose_finish,
|
||||
gboolean *compose_match,
|
||||
gunichar *output_char);
|
||||
gboolean gtk_compose_table_check (const GtkComposeTable *table,
|
||||
const guint *compose_buffer,
|
||||
int n_compose,
|
||||
gboolean *compose_finish,
|
||||
gboolean *compose_match,
|
||||
GString *output);
|
||||
|
||||
gboolean gtk_check_algorithmically (const guint16 *compose_buffer,
|
||||
int n_compose,
|
||||
gunichar *output);
|
||||
void gtk_compose_table_get_prefix (const GtkComposeTable *table,
|
||||
const guint *compose_buffer,
|
||||
int n_compose,
|
||||
int *prefix);
|
||||
|
||||
gboolean gtk_check_algorithmically (const guint *compose_buffer,
|
||||
int n_compose,
|
||||
GString *output);
|
||||
|
||||
guint32 gtk_compose_table_data_hash (const guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+16
-5
@@ -344,7 +344,7 @@ gtk_drop_target_accept (GtkDropTarget *self,
|
||||
if (self->formats == NULL)
|
||||
return TRUE;
|
||||
|
||||
return gdk_content_formats_match (self->formats, gdk_drop_get_formats (drop));
|
||||
return gdk_content_formats_match_gtype (self->formats, gdk_drop_get_formats (drop)) != G_TYPE_INVALID;
|
||||
}
|
||||
|
||||
static GdkDragAction
|
||||
@@ -544,6 +544,12 @@ gtk_drop_target_set_property (GObject *object,
|
||||
gtk_drop_target_set_actions (self, g_value_get_flags (value));
|
||||
break;
|
||||
|
||||
case PROP_FORMATS:
|
||||
self->formats = g_value_dup_boxed (value);
|
||||
if (self->formats == NULL)
|
||||
self->formats = gdk_content_formats_new (NULL, 0);
|
||||
break;
|
||||
|
||||
case PROP_PRELOAD:
|
||||
gtk_drop_target_set_preload (self, g_value_get_boolean (value));
|
||||
break;
|
||||
@@ -661,7 +667,7 @@ gtk_drop_target_class_init (GtkDropTargetClass *class)
|
||||
P_("Formats"),
|
||||
P_("The supported formats"),
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
GTK_PARAM_READABLE);
|
||||
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
/**
|
||||
* GtkDropTarget:preload: (attributes org.gtk.Property.get=gtk_drop_target_get_preload org.gtk.Property.set=gtk_drop_target_set_preload)
|
||||
@@ -843,7 +849,6 @@ gtk_drop_target_class_init (GtkDropTargetClass *class)
|
||||
static void
|
||||
gtk_drop_target_init (GtkDropTarget *self)
|
||||
{
|
||||
self->formats = gdk_content_formats_new (NULL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -864,13 +869,19 @@ gtk_drop_target_new (GType type,
|
||||
GdkDragAction actions)
|
||||
{
|
||||
GtkDropTarget *result;
|
||||
GdkContentFormats *formats;
|
||||
|
||||
if (type != G_TYPE_INVALID)
|
||||
formats = gdk_content_formats_new_for_gtype (type);
|
||||
else
|
||||
formats = NULL;
|
||||
|
||||
result = g_object_new (GTK_TYPE_DROP_TARGET,
|
||||
"formats", formats,
|
||||
"actions", actions,
|
||||
NULL);
|
||||
|
||||
if (type != G_TYPE_INVALID)
|
||||
gtk_drop_target_set_gtypes (result, &type, 1);
|
||||
g_clear_pointer (&formats, gdk_content_formats_unref);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
|
||||
populate_recent_section (chooser);
|
||||
|
||||
chooser->populate_idle = g_idle_add (populate_emoji_chooser, chooser);
|
||||
g_source_set_name_by_id (chooser->populate_idle, "[gtk] populate_emoji_chooser");
|
||||
gdk_source_set_static_name_by_id (chooser->populate_idle, "[gtk] populate_emoji_chooser");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1982,7 +1982,7 @@ gtk_entry_completion_changed (GtkWidget *widget,
|
||||
g_timeout_add (COMPLETION_TIMEOUT,
|
||||
gtk_entry_completion_timeout,
|
||||
completion);
|
||||
g_source_set_name_by_id (completion->completion_timeout, "[gtk] gtk_entry_completion_timeout");
|
||||
gdk_source_set_static_name_by_id (completion->completion_timeout, "[gtk] gtk_entry_completion_timeout");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -2048,7 +2048,7 @@ completion_inserted_text_callback (GtkEntryBuffer *buffer,
|
||||
g_cclosure_new_object (G_CALLBACK (check_completion_callback),
|
||||
G_OBJECT (completion)));
|
||||
g_source_attach (completion->check_completion_idle, NULL);
|
||||
g_source_set_name (completion->check_completion_idle, "[gtk] check_completion_callback");
|
||||
g_source_set_static_name (completion->check_completion_idle, "[gtk] check_completion_callback");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ void _gtk_entry_completion_connect (GtkEntryCompletion *completion,
|
||||
GtkEntry *entry);
|
||||
void _gtk_entry_completion_disconnect (GtkEntryCompletion *completion);
|
||||
|
||||
GtkIMContext * _gtk_entry_get_im_context (GtkEntry *entry);
|
||||
GtkEventController * gtk_entry_get_key_controller (GtkEntry *entry);
|
||||
GtkText *gtk_entry_get_text_widget (GtkEntry *entry);
|
||||
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ gtk_expander_drag_enter (GtkDropControllerMotion *motion,
|
||||
if (!expander->expanded && !expander->expand_timer)
|
||||
{
|
||||
expander->expand_timer = g_timeout_add (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
|
||||
g_source_set_name_by_id (expander->expand_timer, "[gtk] expand_timeout");
|
||||
gdk_source_set_static_name_by_id (expander->expand_timer, "[gtk] expand_timeout");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2234,7 +2234,7 @@ location_entry_changed_cb (GtkEditable *editable,
|
||||
impl->location_changed_id = g_timeout_add (LOCATION_CHANGED_TIMEOUT,
|
||||
location_changed_timeout_cb,
|
||||
impl);
|
||||
g_source_set_name_by_id (impl->location_changed_id, "[gtk] location_changed_timeout_cb");
|
||||
gdk_source_set_static_name_by_id (impl->location_changed_id, "[gtk] location_changed_timeout_cb");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3822,7 +3822,7 @@ load_setup_timer (GtkFileChooserWidget *impl)
|
||||
g_assert (impl->load_state != LOAD_PRELOAD);
|
||||
|
||||
impl->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
|
||||
g_source_set_name_by_id (impl->load_timeout_id, "[gtk] load_timeout_cb");
|
||||
gdk_source_set_static_name_by_id (impl->load_timeout_id, "[gtk] load_timeout_cb");
|
||||
impl->load_state = LOAD_PRELOAD;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "gtktreednd.h"
|
||||
#include "gtktreemodel.h"
|
||||
#include "gtkfilter.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
/*** Structure: how GtkFileSystemModel works
|
||||
*
|
||||
@@ -1095,7 +1096,7 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da
|
||||
thaw_func,
|
||||
model,
|
||||
NULL);
|
||||
g_source_set_name_by_id (model->dir_thaw_source, "[gtk] thaw_func");
|
||||
gdk_source_set_static_name_by_id (model->dir_thaw_source, "[gtk] thaw_func");
|
||||
}
|
||||
|
||||
for (walk = files; walk; walk = walk->next)
|
||||
|
||||
@@ -267,7 +267,7 @@ gtk_filter_list_model_start_filtering (GtkFilterListModel *self,
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
|
||||
g_assert (self->pending_cb == 0);
|
||||
self->pending_cb = g_idle_add (gtk_filter_list_model_run_filter_cb, self);
|
||||
g_source_set_name_by_id (self->pending_cb, "[gtk] gtk_filter_list_model_run_filter_cb");
|
||||
gdk_source_set_static_name_by_id (self->pending_cb, "[gtk] gtk_filter_list_model_run_filter_cb");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+43
-34
@@ -386,15 +386,18 @@ user_filter_cb (gpointer item,
|
||||
|
||||
ret = FALSE;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
langs = pango_fc_font_get_languages (PANGO_FC_FONT (font));
|
||||
for (i = 0; langs[i]; i++)
|
||||
{
|
||||
if (langs[i] == self->filter_language)
|
||||
{
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
if (langs)
|
||||
for (i = 0; langs[i]; i++)
|
||||
{
|
||||
if (langs[i] == self->filter_language)
|
||||
{
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref (font);
|
||||
@@ -600,17 +603,20 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
|
||||
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. */
|
||||
for (i = 0; languages[i]; i++)
|
||||
{
|
||||
if (languages[i] == default_lang || languages[i] == alt_default)
|
||||
{
|
||||
lang = default_lang;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
if (languages)
|
||||
for (i = 0; languages[i]; i++)
|
||||
{
|
||||
if (languages[i] == default_lang || languages[i] == alt_default)
|
||||
{
|
||||
lang = default_lang;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
|
||||
/* Otherwise, we make a list of representative languages */
|
||||
langs = g_hash_table_new (NULL, NULL);
|
||||
@@ -1066,28 +1072,31 @@ add_languages_from_font (GtkFontChooserWidget *self,
|
||||
PangoLanguage **langs;
|
||||
int i;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
langs = pango_fc_font_get_languages (PANGO_FC_FONT (font));
|
||||
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_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);
|
||||
|
||||
@@ -146,7 +146,7 @@ _gtk_gesture_click_update_timeout (GtkGestureClick *gesture)
|
||||
g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
|
||||
|
||||
priv->double_click_timeout_id = g_timeout_add (double_click_time, _double_click_timeout_cb, gesture);
|
||||
g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk] _double_click_timeout_cb");
|
||||
gdk_source_set_static_name_by_id (priv->double_click_timeout_id, "[gtk] _double_click_timeout_cb");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -150,7 +150,7 @@ gtk_gesture_long_press_begin (GtkGesture *gesture,
|
||||
gtk_gesture_get_point (gesture, sequence,
|
||||
&priv->initial_x, &priv->initial_y);
|
||||
priv->timeout_id = g_timeout_add (delay, _gtk_gesture_long_press_timeout, gesture);
|
||||
g_source_set_name_by_id (priv->timeout_id, "[gtk] _gtk_gesture_long_press_timeout");
|
||||
gdk_source_set_static_name_by_id (priv->timeout_id, "[gtk] _gtk_gesture_long_press_timeout");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -95,13 +95,13 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
|
||||
goto out;
|
||||
|
||||
last_event = gtk_gesture_get_last_event (gesture, sequences->data);
|
||||
phase = gdk_touchpad_event_get_gesture_phase (last_event);
|
||||
|
||||
if (gdk_event_get_event_type (last_event) == GDK_TOUCHPAD_PINCH &&
|
||||
(phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN ||
|
||||
phase == GDK_TOUCHPAD_GESTURE_PHASE_UPDATE ||
|
||||
phase == GDK_TOUCHPAD_GESTURE_PHASE_END))
|
||||
if (gdk_event_get_event_type (last_event) == GDK_TOUCHPAD_PINCH)
|
||||
{
|
||||
phase = gdk_touchpad_event_get_gesture_phase (last_event);
|
||||
if (phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL)
|
||||
goto out;
|
||||
|
||||
*angle = priv->accum_touchpad_angle;
|
||||
}
|
||||
else
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ gtk_icon_helper_paintable_get_current_image (GdkPaintable *paintable)
|
||||
if (self->paintable == NULL)
|
||||
return NULL;
|
||||
|
||||
return gtk_icon_helper_paintable_get_current_image (self->paintable);
|
||||
return gdk_paintable_get_current_image (self->paintable);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
+1
-1
@@ -1342,7 +1342,7 @@ queue_theme_changed (GtkIconTheme *self)
|
||||
theme_changed_idle__mainthread_unlocked,
|
||||
gtk_icon_theme_ref_ref (self->ref),
|
||||
(GDestroyNotify)gtk_icon_theme_ref_unref);
|
||||
g_source_set_name_by_id (self->theme_changed_idle, "[gtk] theme_changed_idle");
|
||||
gdk_source_set_static_name_by_id (self->theme_changed_idle, "[gtk] theme_changed_idle");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1831,7 +1831,7 @@ gtk_icon_view_motion (GtkEventController *controller,
|
||||
|
||||
if (icon_view->priv->scroll_timeout_id == 0) {
|
||||
icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, icon_view);
|
||||
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] rubberband_scroll_timeout");
|
||||
gdk_source_set_static_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] rubberband_scroll_timeout");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -6065,7 +6065,7 @@ gtk_icon_view_drag_motion (GtkDropTargetAsync *dest,
|
||||
if (icon_view->priv->scroll_timeout_id == 0)
|
||||
{
|
||||
icon_view->priv->scroll_timeout_id = g_timeout_add (50, drag_scroll_timeout, icon_view);
|
||||
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] drag_scroll_timeout");
|
||||
gdk_source_set_static_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] drag_scroll_timeout");
|
||||
}
|
||||
|
||||
if (target == GTK_TYPE_TREE_ROW_DATA)
|
||||
|
||||
+206
-126
@@ -40,15 +40,21 @@
|
||||
*
|
||||
* `GtkIMContextSimple` is an input method supporting table-based input methods.
|
||||
*
|
||||
* `GtkIMContextSimple` has a built-in table of compose sequences that is
|
||||
* derived from the X11 Compose files.
|
||||
* ## Compose sequences
|
||||
*
|
||||
* `GtkIMContextSimple` reads additional compose sequences from the first of the
|
||||
* `GtkIMContextSimple` reads compose sequences from the first of the
|
||||
* following files that is found: ~/.config/gtk-4.0/Compose, ~/.XCompose,
|
||||
* /usr/share/X11/locale/$locale/Compose (for locales that have a nontrivial
|
||||
* Compose file). The syntax of these files is described in the Compose(5)
|
||||
* manual page.
|
||||
*
|
||||
* If none of these files is found, `GtkIMContextSimple` uses a built-in table
|
||||
* of compose sequences that is derived from the X11 Compose files.
|
||||
*
|
||||
* Note that compose sequences typically start with the Compose_key, which is
|
||||
* often not available as a dedicated key on keyboards. Keyboard layouts may
|
||||
* map this keysym to other keys, such as the right Control key.
|
||||
*
|
||||
* ## Unicode characters
|
||||
*
|
||||
* `GtkIMContextSimple` also supports numeric entry of Unicode characters
|
||||
@@ -60,11 +66,20 @@
|
||||
* Ctrl-Shift-u 1 2 3 Enter
|
||||
*
|
||||
* yields U+0123 LATIN SMALL LETTER G WITH CEDILLA, i.e. ģ.
|
||||
*
|
||||
* ## Dead keys
|
||||
*
|
||||
* `GtkIMContextSimple` supports dead keys. For example, typing
|
||||
*
|
||||
* dead_acute a
|
||||
*
|
||||
* yields U+00E! LATIN SMALL LETTER_A WITH ACUTE, i.e. á. Note that this
|
||||
* depends on the keyboard layout including dead keys.
|
||||
*/
|
||||
|
||||
struct _GtkIMContextSimplePrivate
|
||||
{
|
||||
guint16 *compose_buffer;
|
||||
guint *compose_buffer;
|
||||
int compose_buffer_len;
|
||||
GString *tentative_match;
|
||||
int tentative_match_len;
|
||||
@@ -74,22 +89,36 @@ struct _GtkIMContextSimplePrivate
|
||||
guint modifiers_dropped : 1;
|
||||
};
|
||||
|
||||
/* From the values below, the value 30 means the number of different first keysyms
|
||||
* that exist in the Compose file (from Xorg). When running compose-parse.py without
|
||||
* parameters, you get the count that you can put here. Needed when updating the
|
||||
* gtkimcontextsimpleseqs.h header file (contains the compose sequences).
|
||||
*/
|
||||
const GtkComposeTableCompact gtk_compose_table_compact = {
|
||||
gtk_compose_seqs_compact,
|
||||
5,
|
||||
30,
|
||||
6
|
||||
#include "gtk/compose/gtkcomposedata.h"
|
||||
|
||||
GtkComposeTable builtin_compose_table = {
|
||||
NULL,
|
||||
NULL,
|
||||
MAX_SEQ_LEN,
|
||||
N_INDEX_SIZE,
|
||||
DATA_SIZE,
|
||||
N_CHARS,
|
||||
0
|
||||
};
|
||||
|
||||
static void
|
||||
init_builtin_table (void)
|
||||
{
|
||||
GBytes *bytes;
|
||||
|
||||
bytes = g_resources_lookup_data ("/org/gtk/libgtk/compose/sequences", 0, NULL);
|
||||
builtin_compose_table.data = (guint16 *) g_bytes_get_data (bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
bytes = g_resources_lookup_data ("/org/gtk/libgtk/compose/chars", 0, NULL);
|
||||
builtin_compose_table.char_data = (char *) g_bytes_get_data (bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
G_LOCK_DEFINE_STATIC (global_tables);
|
||||
static GSList *global_tables;
|
||||
|
||||
static const guint16 gtk_compose_ignore[] = {
|
||||
static const guint gtk_compose_ignore[] = {
|
||||
0, /* Yes, XKB will send us key press events with NoSymbol :( */
|
||||
GDK_KEY_Overlay1_Enable,
|
||||
GDK_KEY_Overlay2_Enable,
|
||||
@@ -146,6 +175,7 @@ gtk_im_context_simple_class_init (GtkIMContextSimpleClass *class)
|
||||
im_context_class->get_preedit_string = gtk_im_context_simple_get_preedit_string;
|
||||
gobject_class->finalize = gtk_im_context_simple_finalize;
|
||||
|
||||
init_builtin_table ();
|
||||
init_compose_table_async (NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -163,6 +193,75 @@ get_x11_compose_file_dir (void)
|
||||
return compose_file_dir;
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_compose_table_find (gconstpointer data1,
|
||||
gconstpointer data2)
|
||||
{
|
||||
const GtkComposeTable *compose_table = (const GtkComposeTable *) data1;
|
||||
guint32 hash = (guint32) GPOINTER_TO_INT (data2);
|
||||
return compose_table->id != hash;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_compose_table_from_file (const char *compose_file)
|
||||
{
|
||||
guint hash;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
G_LOCK (global_tables);
|
||||
|
||||
hash = g_str_hash (compose_file);
|
||||
if (!g_slist_find_custom (global_tables, GINT_TO_POINTER (hash), gtk_compose_table_find))
|
||||
{
|
||||
GtkComposeTable *table;
|
||||
|
||||
table = gtk_compose_table_new_with_file (compose_file);
|
||||
|
||||
if (table)
|
||||
{
|
||||
ret = TRUE;
|
||||
global_tables = g_slist_prepend (global_tables, table);
|
||||
}
|
||||
}
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
add_builtin_compose_table (void)
|
||||
{
|
||||
G_LOCK (global_tables);
|
||||
|
||||
global_tables = g_slist_prepend (global_tables, &builtin_compose_table);
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
}
|
||||
|
||||
static void
|
||||
add_compose_table_from_data (guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs)
|
||||
{
|
||||
guint hash;
|
||||
|
||||
G_LOCK (global_tables);
|
||||
|
||||
hash = gtk_compose_table_data_hash (data, max_seq_len, n_seqs);
|
||||
if (!g_slist_find_custom (global_tables, GINT_TO_POINTER (hash), gtk_compose_table_find))
|
||||
{
|
||||
GtkComposeTable *table;
|
||||
|
||||
table = gtk_compose_table_new_with_data (data, max_seq_len, n_seqs);
|
||||
|
||||
if (table)
|
||||
global_tables = g_slist_prepend (global_tables, table);
|
||||
}
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_simple_init_compose_table (void)
|
||||
{
|
||||
@@ -171,6 +270,7 @@ gtk_im_context_simple_init_compose_table (void)
|
||||
const char *locale;
|
||||
char **langs = NULL;
|
||||
char **lang = NULL;
|
||||
gboolean added;
|
||||
const char * const sys_langs[] = { "el_gr", "fi_fi", "pt_br", NULL };
|
||||
const char * const *sys_lang = NULL;
|
||||
char *x11_compose_file_dir = get_x11_compose_file_dir ();
|
||||
@@ -178,12 +278,10 @@ gtk_im_context_simple_init_compose_table (void)
|
||||
path = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "Compose", NULL);
|
||||
if (g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
G_LOCK (global_tables);
|
||||
global_tables = gtk_compose_table_list_add_file (global_tables, path);
|
||||
G_UNLOCK (global_tables);
|
||||
|
||||
added = add_compose_table_from_file (path);
|
||||
g_free (path);
|
||||
return;
|
||||
if (added)
|
||||
return;
|
||||
}
|
||||
g_clear_pointer (&path, g_free);
|
||||
|
||||
@@ -194,11 +292,10 @@ gtk_im_context_simple_init_compose_table (void)
|
||||
path = g_build_filename (home, ".XCompose", NULL);
|
||||
if (g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
G_LOCK (global_tables);
|
||||
global_tables = gtk_compose_table_list_add_file (global_tables, path);
|
||||
G_UNLOCK (global_tables);
|
||||
added = add_compose_table_from_file (path);
|
||||
g_free (path);
|
||||
return;
|
||||
if (added)
|
||||
return;
|
||||
}
|
||||
g_clear_pointer (&path, g_free);
|
||||
|
||||
@@ -241,11 +338,13 @@ gtk_im_context_simple_init_compose_table (void)
|
||||
|
||||
if (path != NULL)
|
||||
{
|
||||
G_LOCK (global_tables);
|
||||
global_tables = gtk_compose_table_list_add_file (global_tables, path);
|
||||
G_UNLOCK (global_tables);
|
||||
added = add_compose_table_from_file (path);
|
||||
g_free (path);
|
||||
}
|
||||
g_clear_pointer (&path, g_free);
|
||||
if (added)
|
||||
return;
|
||||
|
||||
add_builtin_compose_table ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -284,8 +383,8 @@ gtk_im_context_simple_init (GtkIMContextSimple *context_simple)
|
||||
|
||||
priv = context_simple->priv = gtk_im_context_simple_get_instance_private (context_simple);
|
||||
|
||||
priv->compose_buffer_len = gtk_compose_table_compact.max_seq_len + 1;
|
||||
priv->compose_buffer = g_new0 (guint16, priv->compose_buffer_len);
|
||||
priv->compose_buffer_len = builtin_compose_table.max_seq_len + 1;
|
||||
priv->compose_buffer = g_new0 (guint, priv->compose_buffer_len);
|
||||
priv->tentative_match = g_string_new ("");
|
||||
priv->tentative_match_len = 0;
|
||||
}
|
||||
@@ -445,18 +544,22 @@ is_dead_key (guint keysym)
|
||||
return GDK_KEY_dead_grave <= keysym && keysym <= GDK_KEY_dead_greek;
|
||||
}
|
||||
|
||||
static gunichar
|
||||
dead_key_to_unicode (guint keysym,
|
||||
gboolean *need_space)
|
||||
static void
|
||||
append_dead_key (GString *string,
|
||||
guint keysym)
|
||||
{
|
||||
/* Sadly, not all the dead keysyms have spacing mark equivalents
|
||||
* in Unicode. For those that don't, we use space + the non-spacing
|
||||
* mark as an approximation
|
||||
* in Unicode. For those that don't, we use NBSP + the non-spacing
|
||||
* mark as an approximation.
|
||||
*/
|
||||
switch (keysym)
|
||||
{
|
||||
#define CASE(keysym, unicode, sp) \
|
||||
case GDK_KEY_dead_##keysym: *need_space = sp; return unicode;
|
||||
#define CASE(keysym, unicode, sp) \
|
||||
case GDK_KEY_dead_##keysym: \
|
||||
if (sp) \
|
||||
g_string_append_unichar (string, 0xA0); \
|
||||
g_string_append_unichar (string, unicode); \
|
||||
break;
|
||||
|
||||
CASE (grave, 0x60, 0);
|
||||
CASE (acute, 0xb4, 0);
|
||||
@@ -507,8 +610,7 @@ dead_key_to_unicode (guint keysym,
|
||||
CASE (capital_schwa, 0x1dea, 1);
|
||||
#undef CASE
|
||||
default:
|
||||
*need_space = FALSE;
|
||||
return gdk_keyval_to_unicode (keysym);
|
||||
g_string_append_unichar (string, gdk_keyval_to_unicode (keysym));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,7 +625,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
guint keyval;
|
||||
|
||||
context = GTK_IM_CONTEXT (context_simple);
|
||||
|
||||
|
||||
priv->in_compose_sequence = FALSE;
|
||||
|
||||
/* No compose sequences found, check first if we have a partial
|
||||
@@ -533,12 +635,12 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
{
|
||||
int len = priv->tentative_match_len;
|
||||
int i;
|
||||
guint16 *compose_buffer;
|
||||
guint *compose_buffer;
|
||||
char *str;
|
||||
|
||||
compose_buffer = alloca (sizeof (guint16) * priv->compose_buffer_len);
|
||||
compose_buffer = alloca (sizeof (guint) * priv->compose_buffer_len);
|
||||
|
||||
memcpy (compose_buffer, priv->compose_buffer, sizeof (guint16) * priv->compose_buffer_len);
|
||||
memcpy (compose_buffer, priv->compose_buffer, sizeof (guint) * priv->compose_buffer_len);
|
||||
|
||||
str = g_strdup (priv->tentative_match->str);
|
||||
gtk_im_context_simple_commit_string (context_simple, str);
|
||||
@@ -576,7 +678,6 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
|
||||
if (n_compose > 1 && i >= n_compose - 1)
|
||||
{
|
||||
gboolean need_space;
|
||||
GString *s;
|
||||
|
||||
s = g_string_new ("");
|
||||
@@ -585,15 +686,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
{
|
||||
/* dead keys are never *really* dead */
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
ch = dead_key_to_unicode (priv->compose_buffer[j], &need_space);
|
||||
if (ch)
|
||||
{
|
||||
if (need_space)
|
||||
g_string_append_c (s, ' ');
|
||||
g_string_append_unichar (s, ch);
|
||||
}
|
||||
}
|
||||
append_dead_key (s, priv->compose_buffer[j]);
|
||||
|
||||
ch = gdk_keyval_to_unicode (priv->compose_buffer[i]);
|
||||
if (ch != 0 && ch != ' ' && !g_unichar_iscntrl (ch))
|
||||
@@ -603,14 +696,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
|
||||
}
|
||||
else
|
||||
{
|
||||
ch = dead_key_to_unicode (priv->compose_buffer[0], &need_space);
|
||||
if (ch)
|
||||
{
|
||||
if (need_space)
|
||||
g_string_append_c (s, ' ');
|
||||
g_string_append_unichar (s, ch);
|
||||
}
|
||||
|
||||
append_dead_key (s, priv->compose_buffer[0]);
|
||||
gtk_im_context_simple_commit_string (context_simple, s->str);
|
||||
|
||||
for (i = 1; i < n_compose; i++)
|
||||
@@ -722,7 +808,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
int i;
|
||||
gboolean compose_finish;
|
||||
gboolean compose_match;
|
||||
gunichar output_char;
|
||||
guint keyval, state;
|
||||
|
||||
while (priv->compose_buffer[n_compose] != 0 && n_compose < priv->compose_buffer_len)
|
||||
@@ -902,16 +987,22 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (is_escape)
|
||||
{
|
||||
if (priv->in_hex_sequence || priv->in_compose_sequence)
|
||||
{
|
||||
gtk_im_context_simple_reset (context);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->in_hex_sequence)
|
||||
{
|
||||
if (hex_keyval && n_compose < 6)
|
||||
priv->compose_buffer[n_compose++] = hex_keyval;
|
||||
else if (is_escape)
|
||||
{
|
||||
gtk_im_context_simple_reset (context);
|
||||
return TRUE;
|
||||
}
|
||||
else if (!is_hex_end)
|
||||
{
|
||||
/* non-hex character in hex sequence, or sequence too long */
|
||||
@@ -924,7 +1015,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
if (n_compose + 1 == priv->compose_buffer_len)
|
||||
{
|
||||
priv->compose_buffer_len += 1;
|
||||
priv->compose_buffer = g_renew (guint16, priv->compose_buffer, priv->compose_buffer_len);
|
||||
priv->compose_buffer = g_renew (guint, priv->compose_buffer, priv->compose_buffer_len);
|
||||
}
|
||||
|
||||
priv->compose_buffer[n_compose++] = keyval;
|
||||
@@ -972,6 +1063,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
else /* Then, check for compose sequences */
|
||||
{
|
||||
gboolean success = FALSE;
|
||||
int prefix = 0;
|
||||
GString *output;
|
||||
|
||||
output = g_string_new ("");
|
||||
@@ -1010,21 +1102,29 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
success = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
int table_prefix;
|
||||
|
||||
gtk_compose_table_get_prefix ((GtkComposeTable *)tmp_list->data,
|
||||
priv->compose_buffer, n_compose,
|
||||
&table_prefix);
|
||||
|
||||
prefix = MAX (prefix, table_prefix);
|
||||
}
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
|
||||
g_string_free (output, TRUE);
|
||||
|
||||
if (success)
|
||||
return TRUE;
|
||||
{
|
||||
g_string_free (output, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gtk_compose_table_compact_check (>k_compose_table_compact,
|
||||
priv->compose_buffer, n_compose,
|
||||
&compose_finish, &compose_match,
|
||||
&output_char))
|
||||
if (gtk_check_algorithmically (priv->compose_buffer, n_compose, output))
|
||||
{
|
||||
if (!priv->in_compose_sequence)
|
||||
{
|
||||
@@ -1032,37 +1132,29 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
g_signal_emit_by_name (context_simple, "preedit-start");
|
||||
}
|
||||
|
||||
if (compose_finish)
|
||||
{
|
||||
if (compose_match)
|
||||
gtk_im_context_simple_commit_char (context_simple, output_char);
|
||||
}
|
||||
if (output->len > 0)
|
||||
gtk_im_context_simple_commit_string (context_simple, output->str);
|
||||
else
|
||||
{
|
||||
if (compose_match)
|
||||
{
|
||||
g_string_set_size (priv->tentative_match, 0);
|
||||
g_string_append_unichar (priv->tentative_match, output_char);
|
||||
priv->tentative_match_len = n_compose;
|
||||
}
|
||||
g_signal_emit_by_name (context_simple, "preedit-changed");
|
||||
}
|
||||
g_signal_emit_by_name (context_simple, "preedit-changed");
|
||||
|
||||
g_string_free (output, TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gtk_check_algorithmically (priv->compose_buffer, n_compose, &output_char))
|
||||
{
|
||||
if (!priv->in_compose_sequence)
|
||||
{
|
||||
priv->in_compose_sequence = TRUE;
|
||||
g_signal_emit_by_name (context_simple, "preedit-start");
|
||||
}
|
||||
g_string_free (output, TRUE);
|
||||
|
||||
if (output_char)
|
||||
gtk_im_context_simple_commit_char (context_simple, output_char);
|
||||
else
|
||||
g_signal_emit_by_name (context_simple, "preedit-changed");
|
||||
/* If we get here, no Compose sequence matched.
|
||||
* Only beep if we were in a sequence before.
|
||||
*/
|
||||
if (prefix > 0)
|
||||
{
|
||||
for (i = prefix; i < n_compose; i++)
|
||||
priv->compose_buffer[i] = 0;
|
||||
|
||||
beep_surface (gdk_event_get_surface (event));
|
||||
|
||||
g_signal_emit_by_name (context_simple, "preedit-changed");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1126,28 +1218,23 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
|
||||
if (priv->compose_buffer[i] == GDK_KEY_Multi_key)
|
||||
{
|
||||
/* We only show the Compose key visibly when it is the
|
||||
* only glyph in the preedit, or when it occurs in the
|
||||
* only glyph in the preedit, or when the sequence contains
|
||||
* multiple Compose keys, or when it occurs in the
|
||||
* middle of the sequence. Sadly, the official character,
|
||||
* U+2384, COMPOSITION SYMBOL, is bit too distracting, so
|
||||
* we use U+00B7, MIDDLE DOT.
|
||||
*/
|
||||
if (priv->compose_buffer[1] == 0 || i > 0)
|
||||
if (priv->compose_buffer[1] == 0 || i > 0 ||
|
||||
priv->compose_buffer[i + 1] == GDK_KEY_Multi_key)
|
||||
g_string_append (s, "·");
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch;
|
||||
gboolean need_space;
|
||||
|
||||
if (is_dead_key (priv->compose_buffer[i]))
|
||||
{
|
||||
ch = dead_key_to_unicode (priv->compose_buffer[i], &need_space);
|
||||
if (ch)
|
||||
{
|
||||
if (need_space)
|
||||
g_string_append_c (s, ' ');
|
||||
g_string_append_unichar (s, ch);
|
||||
}
|
||||
append_dead_key (s, priv->compose_buffer[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1203,21 +1290,18 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
|
||||
* The table must be sorted in dictionary order on the
|
||||
* numeric value of the key symbol fields. (Values beyond
|
||||
* the length of the sequence should be zero.)
|
||||
**/
|
||||
*
|
||||
* Deprecated: 4.4: Use gtk_im_context_simple_add_compose_file()
|
||||
*/
|
||||
void
|
||||
gtk_im_context_simple_add_table (GtkIMContextSimple *context_simple,
|
||||
guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs)
|
||||
guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_IM_CONTEXT_SIMPLE (context_simple));
|
||||
|
||||
G_LOCK (global_tables);
|
||||
|
||||
global_tables = gtk_compose_table_list_add_array (global_tables,
|
||||
data, max_seq_len, n_seqs);
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
add_compose_table_from_data (data, max_seq_len, n_seqs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1233,9 +1317,5 @@ gtk_im_context_simple_add_compose_file (GtkIMContextSimple *context_simple,
|
||||
{
|
||||
g_return_if_fail (GTK_IS_IM_CONTEXT_SIMPLE (context_simple));
|
||||
|
||||
G_LOCK (global_tables);
|
||||
|
||||
global_tables = gtk_compose_table_list_add_file (global_tables, compose_file);
|
||||
|
||||
G_UNLOCK (global_tables);
|
||||
add_compose_table_from_file (compose_file);
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ GType gtk_im_context_simple_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkIMContext *gtk_im_context_simple_new (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_4_FOR(gtk_im_context_simple_add_compose_file)
|
||||
void gtk_im_context_simple_add_table (GtkIMContextSimple *context_simple,
|
||||
guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs);
|
||||
guint16 *data,
|
||||
int max_seq_len,
|
||||
int n_seqs);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_im_context_simple_add_compose_file (GtkIMContextSimple *context_simple,
|
||||
const char *compose_file);
|
||||
|
||||
+78
-1
@@ -264,6 +264,7 @@ struct _GtkLabel
|
||||
|
||||
float xalign;
|
||||
float yalign;
|
||||
float line_spacing;
|
||||
|
||||
guint mnemonics_visible : 1;
|
||||
guint jtype : 2;
|
||||
@@ -391,6 +392,7 @@ enum {
|
||||
PROP_XALIGN,
|
||||
PROP_YALIGN,
|
||||
PROP_EXTRA_MENU,
|
||||
PROP_LINE_SPACING,
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
@@ -514,6 +516,9 @@ gtk_label_set_property (GObject *object,
|
||||
case PROP_EXTRA_MENU:
|
||||
gtk_label_set_extra_menu (self, g_value_get_object (value));
|
||||
break;
|
||||
case PROP_LINE_SPACING:
|
||||
gtk_label_set_line_spacing (self, g_value_get_float (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -584,6 +589,9 @@ gtk_label_get_property (GObject *object,
|
||||
case PROP_EXTRA_MENU:
|
||||
g_value_set_object (value, gtk_label_get_extra_menu (self));
|
||||
break;
|
||||
case PROP_LINE_SPACING:
|
||||
g_value_set_float (value, gtk_label_get_line_spacing (self));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -600,6 +608,7 @@ gtk_label_init (GtkLabel *self)
|
||||
|
||||
self->xalign = 0.5;
|
||||
self->yalign = 0.5;
|
||||
self->line_spacing = 0.0;
|
||||
|
||||
self->jtype = GTK_JUSTIFY_LEFT;
|
||||
self->wrap = FALSE;
|
||||
@@ -2457,6 +2466,20 @@ gtk_label_class_init (GtkLabelClass *class)
|
||||
G_TYPE_MENU_MODEL,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkLabel:line-spacing: (attributes org.gtk.Property.get=gtk_label_get_line_spacing org.gtk.Property.set=gtk_label_set_line_spacing)
|
||||
*
|
||||
* The line spacing factor that is applied between consecutive lines.
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
label_props[PROP_LINE_SPACING] =
|
||||
g_param_spec_float ("line-spacing",
|
||||
P_("Linespacing"),
|
||||
P_("The factor for spacing between lines"),
|
||||
0.0, 10.0, 0.0,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, label_props);
|
||||
|
||||
/**
|
||||
@@ -3187,7 +3210,7 @@ strip_ulines (const char *text,
|
||||
}
|
||||
|
||||
*q = *p;
|
||||
if (after_uline && *accel_key == 0)
|
||||
if (after_uline && *p != '_' && *accel_key == 0)
|
||||
*accel_key = g_utf8_get_char (p);
|
||||
|
||||
q++;
|
||||
@@ -4005,6 +4028,7 @@ gtk_label_ensure_layout (GtkLabel *self)
|
||||
pango_layout_set_alignment (self->layout, align);
|
||||
pango_layout_set_ellipsize (self->layout, self->ellipsize);
|
||||
pango_layout_set_wrap (self->layout, self->wrap_mode);
|
||||
pango_layout_set_line_spacing (self->layout, self->line_spacing);
|
||||
pango_layout_set_single_paragraph_mode (self->layout, self->single_line_mode);
|
||||
if (self->lines > 0)
|
||||
pango_layout_set_height (self->layout, - self->lines);
|
||||
@@ -5778,3 +5802,56 @@ gtk_label_get_extra_menu (GtkLabel *self)
|
||||
|
||||
return self->extra_menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_label_set_line_spacing: (attributes org.gtk.Method.set_property=line-spacing)
|
||||
* @self: a `GtkLabel`
|
||||
* @factor: the new line spacing factor
|
||||
*
|
||||
* Sets a factor for line spacing.
|
||||
*
|
||||
* Typical values are: 0, 1, 1.5, 2. The default values is 0.
|
||||
*
|
||||
* If @factor is non-zero, lines are placed so that
|
||||
*
|
||||
* baseline2 = baseline1 + factor * height2
|
||||
*
|
||||
* where height2 is the line height of the second line
|
||||
* (as determined by the font(s)).
|
||||
*
|
||||
* If @factor is zero (the default), no spacing is applied.
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
void
|
||||
gtk_label_set_line_spacing (GtkLabel *self,
|
||||
float factor)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_LABEL (self));
|
||||
|
||||
if (self->line_spacing == factor)
|
||||
return;
|
||||
|
||||
self->line_spacing = factor;
|
||||
|
||||
gtk_label_clear_layout (self);
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), label_props[PROP_LINE_SPACING]);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_label_get_line_spacing: (attributes org.gtk.Method.get_property=line-spacing)
|
||||
* @self: a `GtkLabel`
|
||||
*
|
||||
* Gets the line spacing factor of @self.
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
float
|
||||
gtk_label_get_line_spacing (GtkLabel *self)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_LABEL (self), 0.0);
|
||||
|
||||
return self->line_spacing;
|
||||
}
|
||||
|
||||
@@ -172,6 +172,12 @@ void gtk_label_set_extra_menu (GtkLabel *self,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GMenuModel * gtk_label_get_extra_menu (GtkLabel *self);
|
||||
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
void gtk_label_set_line_spacing (GtkLabel *self,
|
||||
float factor);
|
||||
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
float gtk_label_get_line_spacing (GtkLabel *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLabel, g_object_unref)
|
||||
|
||||
|
||||
+5
-5
@@ -1433,14 +1433,14 @@ gtk_list_store_clear (GtkListStore *list_store)
|
||||
|
||||
/**
|
||||
* gtk_list_store_iter_is_valid:
|
||||
* @list_store: A `GtkListStore`.
|
||||
* @iter: A `GtkTreeIter`
|
||||
*
|
||||
* > This function is slow. Only use it for debugging and/or testing
|
||||
* > purposes.
|
||||
* @list_store: a list store
|
||||
* @iter: the iterator to check
|
||||
*
|
||||
* Checks if the given iter is a valid iter for this `GtkListStore`.
|
||||
*
|
||||
* This function is slow. Only use it for debugging and/or testing
|
||||
* purposes.
|
||||
*
|
||||
* Returns: %TRUE if the iter is valid, %FALSE if the iter is invalid.
|
||||
**/
|
||||
gboolean
|
||||
|
||||
+1
-1
@@ -868,7 +868,7 @@ gtk_main_sync (void)
|
||||
|
||||
store.store_loop = g_main_loop_new (NULL, TRUE);
|
||||
store.timeout_id = g_timeout_add_seconds (10, (GSourceFunc) sync_timed_out_cb, &store);
|
||||
g_source_set_name_by_id (store.timeout_id, "[gtk] gtk_main_sync clipboard store timeout");
|
||||
gdk_source_set_static_name_by_id (store.timeout_id, "[gtk] gtk_main_sync clipboard store timeout");
|
||||
|
||||
if (g_main_loop_is_running (store.store_loop))
|
||||
g_main_loop_run (store.store_loop);
|
||||
|
||||
+22
-2
@@ -34,6 +34,7 @@
|
||||
#include "gtkbuiltiniconprivate.h"
|
||||
#include "gtkgizmoprivate.h"
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
typedef GtkBoxClass GtkMenuSectionBoxClass;
|
||||
|
||||
@@ -175,7 +176,7 @@ gtk_menu_section_box_schedule_separator_sync (GtkMenuSectionBox *box)
|
||||
box->separator_sync_idle = g_idle_add_full (G_PRIORITY_HIGH_IDLE, /* before resize... */
|
||||
gtk_menu_section_box_handle_sync_separators,
|
||||
box, NULL);
|
||||
g_source_set_name_by_id (box->separator_sync_idle, "[gtk] menu section box handle sync separators");
|
||||
gdk_source_set_static_name_by_id (box->separator_sync_idle, "[gtk] menu section box handle sync separators");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,6 +309,25 @@ submenu_hidden (GtkPopoverMenu *popover,
|
||||
gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
|
||||
}
|
||||
|
||||
/* We're using the gizmo as an easy single child container, not as
|
||||
* a custom widget to draw some visual indicators (like markers).
|
||||
* As such its default focus functions blocks focus through the children,
|
||||
* so we need to handle it correctly here so that custom widgets inside
|
||||
* menus can be focused.
|
||||
*/
|
||||
static gboolean
|
||||
custom_widget_focus (GtkGizmo *gizmo,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
return gtk_widget_focus_child (GTK_WIDGET (gizmo), direction);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
custom_widget_grab_focus (GtkGizmo *gizmo)
|
||||
{
|
||||
return gtk_widget_grab_focus_child (GTK_WIDGET (gizmo));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_section_box_insert_func (GtkMenuTrackerItem *item,
|
||||
int position,
|
||||
@@ -368,7 +388,7 @@ gtk_menu_section_box_insert_func (GtkMenuTrackerItem *item,
|
||||
{
|
||||
const char *id = gtk_menu_tracker_item_get_custom (item);
|
||||
|
||||
widget = gtk_gizmo_new ("widget", NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
widget = gtk_gizmo_new ("widget", NULL, NULL, NULL, NULL, custom_widget_focus, custom_widget_grab_focus);
|
||||
gtk_widget_set_layout_manager (widget, gtk_bin_layout_new ());
|
||||
|
||||
if (g_hash_table_lookup (box->custom_slots, id))
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "gtkshortcutcontroller.h"
|
||||
#include "gtkshortcut.h"
|
||||
#include "gtkaccessibleprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
/*< private >
|
||||
* GtkModelButton:
|
||||
@@ -1363,7 +1364,7 @@ start_open (GtkModelButton *button)
|
||||
return;
|
||||
|
||||
button->open_timeout = g_timeout_add (OPEN_TIMEOUT, open_submenu, button);
|
||||
g_source_set_name_by_id (button->open_timeout, "[gtk] open_submenu");
|
||||
gdk_source_set_static_name_by_id (button->open_timeout, "[gtk] open_submenu");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+4
-4
@@ -3052,7 +3052,7 @@ gtk_notebook_motion (GtkEventController *controller,
|
||||
notebook->dnd_timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
|
||||
scroll_notebook_timer,
|
||||
notebook);
|
||||
g_source_set_name_by_id (notebook->dnd_timer, "[gtk] scroll_notebook_timer");
|
||||
gdk_source_set_static_name_by_id (notebook->dnd_timer, "[gtk] scroll_notebook_timer");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4018,7 +4018,7 @@ gtk_notebook_tab_drop_enter (GtkEventController *controller,
|
||||
notebook->switch_page = page;
|
||||
|
||||
notebook->switch_page_timer = g_timeout_add (TIMEOUT_EXPAND, gtk_notebook_switch_page_timeout, notebook);
|
||||
g_source_set_name_by_id (notebook->switch_page_timer, "[gtk] gtk_notebook_switch_page_timeout");
|
||||
gdk_source_set_static_name_by_id (notebook->switch_page_timer, "[gtk] gtk_notebook_switch_page_timeout");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4189,7 +4189,7 @@ gtk_notebook_timer (GtkNotebook *notebook)
|
||||
notebook->timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
|
||||
(GSourceFunc) gtk_notebook_timer,
|
||||
notebook);
|
||||
g_source_set_name_by_id (notebook->timer, "[gtk] gtk_notebook_timer");
|
||||
gdk_source_set_static_name_by_id (notebook->timer, "[gtk] gtk_notebook_timer");
|
||||
}
|
||||
else
|
||||
retval = TRUE;
|
||||
@@ -4206,7 +4206,7 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
|
||||
notebook->timer = g_timeout_add (TIMEOUT_INITIAL,
|
||||
(GSourceFunc) gtk_notebook_timer,
|
||||
notebook);
|
||||
g_source_set_name_by_id (notebook->timer, "[gtk] gtk_notebook_timer");
|
||||
gdk_source_set_static_name_by_id (notebook->timer, "[gtk] gtk_notebook_timer");
|
||||
notebook->need_timer = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+57
-3
@@ -715,7 +715,7 @@ gtk_popover_schedule_mnemonics_visible (GtkPopover *popover)
|
||||
|
||||
priv->mnemonics_display_timeout_id =
|
||||
g_timeout_add (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, popover);
|
||||
g_source_set_name_by_id (priv->mnemonics_display_timeout_id, "[gtk] popover_schedule_mnemonics_visible_cb");
|
||||
gdk_source_set_static_name_by_id (priv->mnemonics_display_timeout_id, "[gtk] popover_schedule_mnemonics_visible_cb");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -972,6 +972,59 @@ gtk_popover_unrealize (GtkWidget *widget)
|
||||
g_clear_object (&priv->surface);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_popover_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
if (!gtk_widget_get_visible (widget))
|
||||
return FALSE;
|
||||
|
||||
/* This code initially comes from gtkpopovermenu.c */
|
||||
if (gtk_widget_get_first_child (widget) == NULL)
|
||||
{
|
||||
/* Empty popover, so nothing to Tab through. */
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Move focus normally, but when nothing can be focused in this direction then we cycle around. */
|
||||
if (gtk_widget_focus_move (widget, direction))
|
||||
return TRUE;
|
||||
|
||||
if (gtk_popover_get_autohide (GTK_POPOVER (widget)))
|
||||
{
|
||||
GtkWidget *p = gtk_root_get_focus (gtk_widget_get_root (widget));
|
||||
|
||||
/* In the case where the popover doesn't have any focusable child (like
|
||||
* the GtkTreePopover for combo boxes) then the focus will end up out of
|
||||
* the popover, hence creating an infinite loop below. To avoid this, just
|
||||
* say we had focus and stop here.
|
||||
*/
|
||||
if (!gtk_widget_is_ancestor (p, widget) && p != widget)
|
||||
return TRUE;
|
||||
|
||||
/* Cycle around with (Shift+)Tab */
|
||||
if (direction == GTK_DIR_TAB_FORWARD || direction == GTK_DIR_TAB_BACKWARD)
|
||||
{
|
||||
for (;
|
||||
p != widget;
|
||||
p = gtk_widget_get_parent (p))
|
||||
{
|
||||
/* Unfocus everything in the popover. */
|
||||
gtk_widget_set_focus_child (p, NULL);
|
||||
}
|
||||
}
|
||||
/* Focus again from scratch */
|
||||
gtk_widget_focus_move (widget, direction);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_popover_show (GtkWidget *widget)
|
||||
{
|
||||
@@ -1734,6 +1787,7 @@ gtk_popover_class_init (GtkPopoverClass *klass)
|
||||
widget_class->unrealize = gtk_popover_unrealize;
|
||||
widget_class->map = gtk_popover_map;
|
||||
widget_class->unmap = gtk_popover_unmap;
|
||||
widget_class->focus = gtk_popover_focus;
|
||||
widget_class->show = gtk_popover_show;
|
||||
widget_class->hide = gtk_popover_hide;
|
||||
widget_class->measure = gtk_popover_measure;
|
||||
@@ -2175,8 +2229,8 @@ gtk_popover_get_position (GtkPopover *popover)
|
||||
* Sets whether @popover is modal.
|
||||
*
|
||||
* A modal popover will grab the keyboard focus on it when being
|
||||
* displayed. Clicking outside the popover area or pressing Esc
|
||||
* will dismiss the popover.
|
||||
* displayed. Focus will wrap around within the popover. Clicking
|
||||
* outside the popover area or pressing Esc will dismiss the popover.
|
||||
*
|
||||
* Called this function on an already showing popup with a new
|
||||
* autohide value different from the current one, will cause the
|
||||
|
||||
+13
-4
@@ -480,12 +480,21 @@ gtk_popover_menu_focus (GtkWidget *widget,
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
else if (direction == GTK_DIR_UP || direction == GTK_DIR_DOWN)
|
||||
/* Cycle around with up/down arrows and (Shift+)Tab when modal */
|
||||
else if (gtk_popover_get_autohide (GTK_POPOVER (menu)))
|
||||
{
|
||||
GtkWidget *p;
|
||||
GtkWidget *p = gtk_root_get_focus (gtk_widget_get_root (widget));
|
||||
|
||||
/* In the case where the popover doesn't have any focusable child, if
|
||||
* the menu doesn't have any item for example, then the focus will end
|
||||
* up out of the popover, hence creating an infinite loop below. To
|
||||
* avoid this, just say we had focus and stop here.
|
||||
*/
|
||||
if (!gtk_widget_is_ancestor (p, widget) && p != widget)
|
||||
return TRUE;
|
||||
|
||||
/* cycle around */
|
||||
for (p = gtk_root_get_focus (gtk_widget_get_root (widget));
|
||||
for (;
|
||||
p != widget;
|
||||
p = gtk_widget_get_parent (p))
|
||||
{
|
||||
@@ -493,7 +502,7 @@ gtk_popover_menu_focus (GtkWidget *widget,
|
||||
}
|
||||
if (gtk_widget_focus_move (widget, direction))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -539,7 +539,7 @@ win32_poll_status_timeout (GtkPrintOperation *op)
|
||||
op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
|
||||
(GSourceFunc)win32_poll_status_timeout,
|
||||
op);
|
||||
g_source_set_name_by_id (op_win32->timeout_id, "[gtk] win32_poll_status_timeout");
|
||||
gdk_source_set_static_name_by_id (op_win32->timeout_id, "[gtk] win32_poll_status_timeout");
|
||||
}
|
||||
g_object_unref (op);
|
||||
return FALSE;
|
||||
@@ -583,7 +583,7 @@ win32_end_run (GtkPrintOperation *op,
|
||||
op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
|
||||
(GSourceFunc)win32_poll_status_timeout,
|
||||
op);
|
||||
g_source_set_name_by_id (op_win32->timeout_id, "[gtk] win32_poll_status_timeout");
|
||||
gdk_source_set_static_name_by_id (op_win32->timeout_id, "[gtk] win32_poll_status_timeout");
|
||||
}
|
||||
else
|
||||
/* Dunno what happened, pretend its finished */
|
||||
|
||||
@@ -631,7 +631,7 @@ preview_ready (GtkPrintOperationPreview *preview,
|
||||
preview_print_idle,
|
||||
pop,
|
||||
preview_print_idle_done);
|
||||
g_source_set_name_by_id (id, "[gtk] preview_print_idle");
|
||||
gdk_source_set_static_name_by_id (id, "[gtk] preview_print_idle");
|
||||
}
|
||||
|
||||
|
||||
@@ -2895,7 +2895,7 @@ print_pages (GtkPrintOperation *op,
|
||||
g_timeout_add (SHOW_PROGRESS_TIME,
|
||||
(GSourceFunc) show_progress_timeout,
|
||||
data);
|
||||
g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk] show_progress_timeout");
|
||||
gdk_source_set_static_name_by_id (priv->show_progress_timeout_id, "[gtk] show_progress_timeout");
|
||||
|
||||
data->progress = progress;
|
||||
}
|
||||
@@ -2964,7 +2964,7 @@ print_pages (GtkPrintOperation *op,
|
||||
print_pages_idle,
|
||||
data,
|
||||
print_pages_idle_done);
|
||||
g_source_set_name_by_id (priv->print_pages_idle_id, "[gtk] print_pages_idle");
|
||||
gdk_source_set_static_name_by_id (priv->print_pages_idle_id, "[gtk] print_pages_idle");
|
||||
|
||||
/* Recursive main loop to make sure we don't exit on sync operations */
|
||||
if (priv->is_sync)
|
||||
|
||||
@@ -1803,7 +1803,7 @@ schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
|
||||
return;
|
||||
|
||||
dialog->mark_conflicts_id = g_idle_add (mark_conflicts_callback, dialog);
|
||||
g_source_set_name_by_id (dialog->mark_conflicts_id, "[gtk] mark_conflicts_callback");
|
||||
gdk_source_set_static_name_by_id (dialog->mark_conflicts_id, "[gtk] mark_conflicts_callback");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+2
-2
@@ -2758,7 +2758,7 @@ initial_timeout (gpointer data)
|
||||
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
|
||||
|
||||
priv->timer->timeout_id = g_timeout_add (TIMEOUT_REPEAT, second_timeout, range);
|
||||
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk] second_timeout");
|
||||
gdk_source_set_static_name_by_id (priv->timer->timeout_id, "[gtk] second_timeout");
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -2774,7 +2774,7 @@ gtk_range_add_step_timer (GtkRange *range,
|
||||
priv->timer = g_new (GtkRangeStepTimer, 1);
|
||||
|
||||
priv->timer->timeout_id = g_timeout_add (TIMEOUT_INITIAL, initial_timeout, range);
|
||||
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk] initial_timeout");
|
||||
gdk_source_set_static_name_by_id (priv->timer->timeout_id, "[gtk] initial_timeout");
|
||||
priv->timer->step = step;
|
||||
|
||||
gtk_range_scroll (range, priv->timer->step);
|
||||
|
||||
@@ -1388,7 +1388,7 @@ gtk_recent_manager_changed (GtkRecentManager *manager)
|
||||
if (manager->priv->changed_timeout == 0)
|
||||
{
|
||||
manager->priv->changed_timeout = g_timeout_add (250, emit_manager_changed, manager);
|
||||
g_source_set_name_by_id (manager->priv->changed_timeout, "[gtk] emit_manager_changed");
|
||||
gdk_source_set_static_name_by_id (manager->priv->changed_timeout, "[gtk] emit_manager_changed");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1216,7 +1216,7 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
|
||||
else if (indicator_close && !on_other_scrollbar)
|
||||
{
|
||||
indicator->over_timeout_id = g_timeout_add (30, enable_over_timeout_cb, indicator);
|
||||
g_source_set_name_by_id (indicator->over_timeout_id, "[gtk] enable_over_timeout_cb");
|
||||
gdk_source_set_static_name_by_id (indicator->over_timeout_id, "[gtk] enable_over_timeout_cb");
|
||||
}
|
||||
else
|
||||
indicator_set_over (indicator, FALSE);
|
||||
@@ -1412,8 +1412,8 @@ scrolled_window_scroll (GtkScrolledWindow *scrolled_window,
|
||||
{
|
||||
priv->scroll_events_overshoot_id =
|
||||
g_timeout_add (50, start_scroll_deceleration_cb, scrolled_window);
|
||||
g_source_set_name_by_id (priv->scroll_events_overshoot_id,
|
||||
"[gtk] start_scroll_deceleration_cb");
|
||||
gdk_source_set_static_name_by_id (priv->scroll_events_overshoot_id,
|
||||
"[gtk] start_scroll_deceleration_cb");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3638,7 +3638,7 @@ indicator_set_fade (Indicator *indicator,
|
||||
if (visible && indicator->conceil_timer == 0)
|
||||
{
|
||||
indicator->conceil_timer = g_timeout_add (INDICATOR_FADE_OUT_TIME, maybe_hide_indicator, indicator);
|
||||
g_source_set_name_by_id (indicator->conceil_timer, "[gtk] maybe_hide_indicator");
|
||||
gdk_source_set_static_name_by_id (indicator->conceil_timer, "[gtk] maybe_hide_indicator");
|
||||
}
|
||||
if (!visible && indicator->conceil_timer != 0)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ gtk_search_engine_model_start (GtkSearchEngine *engine)
|
||||
return;
|
||||
|
||||
model->idle = g_idle_add (do_search, engine);
|
||||
g_source_set_name_by_id (model->idle, "[gtk] gtk_search_engine_model_start");
|
||||
gdk_source_set_static_name_by_id (model->idle, "[gtk] gtk_search_engine_model_start");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -519,7 +519,7 @@ reset_timeout (GtkSearchEntry *entry)
|
||||
entry->delayed_changed_id = g_timeout_add (DELAYED_TIMEOUT_ID,
|
||||
gtk_search_entry_changed_timeout_cb,
|
||||
entry);
|
||||
g_source_set_name_by_id (entry->delayed_changed_id, "[gtk] gtk_search_entry_changed_timeout_cb");
|
||||
gdk_source_set_static_name_by_id (entry->delayed_changed_id, "[gtk] gtk_search_entry_changed_timeout_cb");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+1
-1
@@ -414,7 +414,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
||||
g_param_spec_boolean ("gtk-split-cursor",
|
||||
P_("Split Cursor"),
|
||||
P_("Whether two cursors should be displayed for mixed left-to-right and right-to-left text"),
|
||||
TRUE,
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE));
|
||||
g_assert (result == PROP_SPLIT_CURSOR);
|
||||
|
||||
|
||||
+2
-2
@@ -906,7 +906,7 @@ start_spinning (GtkSpinButton *spin,
|
||||
spin->timer = g_timeout_add (TIMEOUT_INITIAL,
|
||||
(GSourceFunc) gtk_spin_button_timer,
|
||||
(gpointer) spin);
|
||||
g_source_set_name_by_id (spin->timer, "[gtk] gtk_spin_button_timer");
|
||||
gdk_source_set_static_name_by_id (spin->timer, "[gtk] gtk_spin_button_timer");
|
||||
}
|
||||
gtk_spin_button_real_spin (spin, click_child == spin->up_button ? step : -step);
|
||||
}
|
||||
@@ -1318,7 +1318,7 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
|
||||
spin_button->timer = g_timeout_add (TIMEOUT_REPEAT,
|
||||
(GSourceFunc) gtk_spin_button_timer,
|
||||
spin_button);
|
||||
g_source_set_name_by_id (spin_button->timer, "[gtk] gtk_spin_button_timer");
|
||||
gdk_source_set_static_name_by_id (spin_button->timer, "[gtk] gtk_spin_button_timer");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -245,7 +245,7 @@ gtk_stack_switcher_drag_enter (GtkDropControllerMotion *motion,
|
||||
guint switch_timer = g_timeout_add (TIMEOUT_EXPAND,
|
||||
gtk_stack_switcher_switch_timeout,
|
||||
button);
|
||||
g_source_set_name_by_id (switch_timer, "[gtk] gtk_stack_switcher_switch_timeout");
|
||||
gdk_source_set_static_name_by_id (switch_timer, "[gtk] gtk_stack_switcher_switch_timeout");
|
||||
g_object_set_data_full (G_OBJECT (button), "-gtk-switch-timer", GUINT_TO_POINTER (switch_timer), clear_timer);
|
||||
}
|
||||
}
|
||||
|
||||
+31
-30
@@ -3636,7 +3636,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
|
||||
password_hint->source_id = g_timeout_add (password_hint_timeout,
|
||||
(GSourceFunc)gtk_text_remove_password_hint,
|
||||
self);
|
||||
g_source_set_name_by_id (password_hint->source_id, "[gtk] gtk_text_remove_password_hint");
|
||||
gdk_source_set_static_name_by_id (password_hint->source_id, "[gtk] gtk_text_remove_password_hint");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5049,39 +5049,40 @@ gtk_text_move_visually (GtkText *self,
|
||||
int index;
|
||||
PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
|
||||
const char *text;
|
||||
gboolean split_cursor;
|
||||
gboolean strong;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
|
||||
|
||||
index = g_utf8_offset_to_pointer (text, start) - text;
|
||||
|
||||
|
||||
g_object_get (gtk_widget_get_settings (GTK_WIDGET (self)),
|
||||
"gtk-split-cursor", &split_cursor,
|
||||
NULL);
|
||||
|
||||
if (split_cursor)
|
||||
strong = TRUE;
|
||||
else
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkSeat *seat;
|
||||
GdkDevice *keyboard = NULL;
|
||||
PangoDirection direction = PANGO_DIRECTION_LTR;
|
||||
|
||||
display = gtk_widget_get_display (GTK_WIDGET (self));
|
||||
seat = gdk_display_get_default_seat (display);
|
||||
if (seat)
|
||||
keyboard = gdk_seat_get_keyboard (seat);
|
||||
if (keyboard)
|
||||
direction = gdk_device_get_direction (keyboard);
|
||||
|
||||
strong = direction == priv->resolved_dir;
|
||||
}
|
||||
|
||||
while (count != 0)
|
||||
{
|
||||
int new_index, new_trailing;
|
||||
gboolean split_cursor;
|
||||
gboolean strong;
|
||||
|
||||
g_object_get (gtk_widget_get_settings (GTK_WIDGET (self)),
|
||||
"gtk-split-cursor", &split_cursor,
|
||||
NULL);
|
||||
|
||||
if (split_cursor)
|
||||
strong = TRUE;
|
||||
else
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkSeat *seat;
|
||||
GdkDevice *keyboard = NULL;
|
||||
PangoDirection direction = PANGO_DIRECTION_LTR;
|
||||
|
||||
display = gtk_widget_get_display (GTK_WIDGET (self));
|
||||
seat = gdk_display_get_default_seat (display);
|
||||
if (seat)
|
||||
keyboard = gdk_seat_get_keyboard (seat);
|
||||
if (keyboard)
|
||||
direction = gdk_device_get_direction (keyboard);
|
||||
|
||||
strong = direction == priv->resolved_dir;
|
||||
}
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
@@ -5098,11 +5099,11 @@ gtk_text_move_visually (GtkText *self,
|
||||
index = 0;
|
||||
else if (new_index != G_MAXINT)
|
||||
index = new_index;
|
||||
|
||||
|
||||
while (new_trailing--)
|
||||
index = g_utf8_next_char (text + index) - text;
|
||||
}
|
||||
|
||||
|
||||
return g_utf8_pointer_to_offset (text, text + index);
|
||||
}
|
||||
|
||||
@@ -6285,7 +6286,7 @@ gtk_text_selection_bubble_popup_set (GtkText *self)
|
||||
|
||||
priv->selection_bubble_timeout_id =
|
||||
g_timeout_add (50, gtk_text_selection_bubble_popup_show, self);
|
||||
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk] gtk_text_selection_bubble_popup_cb");
|
||||
gdk_source_set_static_name_by_id (priv->selection_bubble_timeout_id, "[gtk] gtk_text_selection_bubble_popup_cb");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -387,6 +387,9 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
|
||||
if (tag->priv->pixels_inside_wrap_set)
|
||||
dest->pixels_inside_wrap = vals->pixels_inside_wrap;
|
||||
|
||||
if (tag->priv->line_spacing_set)
|
||||
dest->line_spacing = vals->line_spacing;
|
||||
|
||||
if (tag->priv->tabs_set)
|
||||
{
|
||||
if (dest->tabs)
|
||||
@@ -457,6 +460,7 @@ _gtk_text_tag_affects_size (GtkTextTag *tag)
|
||||
priv->pixels_above_lines_set ||
|
||||
priv->pixels_below_lines_set ||
|
||||
priv->pixels_inside_wrap_set ||
|
||||
priv->line_spacing_set ||
|
||||
priv->tabs_set ||
|
||||
priv->underline_set ||
|
||||
priv->overline_set ||
|
||||
|
||||
@@ -147,6 +147,8 @@ struct _GtkTextAttributes
|
||||
int pixels_below_lines;
|
||||
int pixels_inside_wrap;
|
||||
|
||||
float line_spacing;
|
||||
|
||||
int letter_spacing;
|
||||
|
||||
guint invisible : 1;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtktextiterprivate.h"
|
||||
#include "gtktextlinedisplaycacheprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
#define DEFAULT_MRU_SIZE 250
|
||||
#define BLOW_CACHE_TIMEOUT_SEC 20
|
||||
@@ -141,7 +142,7 @@ gtk_text_line_display_cache_delay_eviction (GtkTextLineDisplayCache *cache)
|
||||
gtk_text_line_display_cache_blow_cb,
|
||||
cache);
|
||||
cache->evict_source = g_main_context_find_source_by_id (NULL, tag);
|
||||
g_source_set_name (cache->evict_source, "[gtk+] gtk_text_line_display_cache_blow_cb");
|
||||
g_source_set_static_name (cache->evict_source, "[gtk+] gtk_text_line_display_cache_blow_cb");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user