Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Clasen 3200efcbde Add gtk_builder_cscope_add_callback
This is a convenience method for the common case
that symbols are used under their own name.
2022-06-30 16:13:55 -04:00
92 changed files with 4700 additions and 6044 deletions
-1
View File
@@ -346,7 +346,6 @@ reference:
- _reference
publish-docs:
image: fedora:latest
stage: publish
needs: ['reference']
script:
+1
View File
@@ -19,6 +19,7 @@ flatpak build ${builddir} meson \
--buildtype=release \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dprint-backends=file \
-Dbuild-tests=false \
-Dbuild-examples=false \
-Dintrospection=disabled \
-81
View File
@@ -1,84 +1,3 @@
Overview of Changes in 4.7.1, 12-07-2022
========================================
* GtkInscription:
- A new label-like widget for use in list views
* GtkColorChooser:
- Style improvements
* GtkFontChooser:
- Improve support for OpenType features a bit
* GtkLabel:
- Allow selectable labels to be activated via mnemonic
* GtkTextView:
- Implement GetCharacterExtents for accessibility
* GtkStack:
- Fix a poblem with stack page accessibility
* GtkListView:
- Cull listitems that are out of view
- Make all our list models implement ::n-items and
::item-type properties
* Translations:
- Stop translating property nicks and blurbs
- Fix extracting translations from ui files
* Debugging:
- Support GTK_DEBUG=invert-text-dir
- Allow inspecting inspectors
- Replace GTK_USE_PORTAL with GDK_DEBUG=portals
- Improve responsiveness of the inspector
* CSS:
- Allow fractional letterspacing
* Theme:
- Improve legibility of selectable labels
* Demos:
- Improve the font features demo
- Add demos for GtkInscription
* Wayland:
- Freeze popups when hidden
- Only send smooth scroll events for tablet tools
- Make scaled cursor image have the right size
- Fix problems with the activation protocol
- Don't force the HighContrast icon theme
- Support xdg_toplevel.bounds
* X11:
- Always update the shadoe size
* Windows:
- Improve touchpad support by using DirectManipulation
- Add more directories to the builtin hicolor icon theme
* Translation updates:
Basque
Catalan
Chinese (China)
Galician
German
Lithuanian
Nepali
Occitan
Persian
Polish
Portuguese
Russian
Serbian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in 4.7.0, 07-05-2022
========================================
+5 -4
View File
@@ -54,7 +54,8 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dtests=false"
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources" : [
{
@@ -104,8 +105,8 @@
"sources": [
{
"type": "archive",
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2",
"sha256": "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39"
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2",
"sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
}
]
},
@@ -185,7 +186,7 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dvulkan=disabled",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
+3 -2
View File
@@ -54,7 +54,8 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dtests=false"
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources" : [
{
@@ -114,7 +115,7 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dvulkan=disabled",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
@@ -54,7 +54,8 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dtests=false"
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources" : [
{
@@ -114,7 +115,7 @@
"builddir" : true,
"config-opts" : [
"--libdir=/app/lib",
"-Dvulkan=disabled",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
@@ -361,11 +361,11 @@ save_cb (GtkWidget *button,
}
static void
constraint_editor_window_dispose (GObject *object)
constraint_editor_window_finalize (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_WINDOW_TYPE);
//ConstraintEditorWindow *self = (ConstraintEditorWindow *)object;
G_OBJECT_CLASS (constraint_editor_window_parent_class)->dispose (object);
G_OBJECT_CLASS (constraint_editor_window_parent_class)->finalize (object);
}
static int child_counter;
@@ -497,7 +497,7 @@ constraint_editor_window_class_init (ConstraintEditorWindowClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = constraint_editor_window_dispose;
object_class->finalize = constraint_editor_window_finalize;
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gtk/gtk4/constraint-editor/constraint-editor-window.ui");
+1 -2
View File
@@ -607,11 +607,10 @@ constraint_editor_dispose (GObject *object)
{
ConstraintEditor *self = (ConstraintEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->model);
g_clear_object (&self->constraint);
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_TYPE);
G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object);
}
+1 -2
View File
@@ -294,10 +294,9 @@ guide_editor_dispose (GObject *object)
{
GuideEditor *self = (GuideEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->guide);
gtk_widget_dispose_template (GTK_WIDGET (self), GUIDE_EDITOR_TYPE);
G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object);
}
-2
View File
@@ -504,8 +504,6 @@ demo_application_window_dispose (GObject *object)
demo_application_window_store_state (window);
gtk_widget_dispose_template (GTK_WIDGET (window), demo_application_window_get_type ());
G_OBJECT_CLASS (demo_application_window_parent_class)->dispose (object);
}
+10 -7
View File
@@ -341,13 +341,16 @@ do_clipboard (GtkWidget *do_widget)
GtkWidget *button;
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, copy_button_clicked);
gtk_builder_cscope_add_callback (scope, paste_button_clicked);
gtk_builder_cscope_add_callback (scope, source_changed_cb);
gtk_builder_cscope_add_callback (scope, text_changed_cb);
gtk_builder_cscope_add_callback (scope, open_file_cb);
gtk_builder_cscope_add_callback (scope, on_drop);
gtk_builder_cscope_add_callback (scope, drag_prepare);
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
"copy_button_clicked", G_CALLBACK (copy_button_clicked),
"paste_button_clicked", G_CALLBACK (paste_button_clicked),
"source_changed_cb", G_CALLBACK (source_changed_cb),
"text_changed_cb", G_CALLBACK (text_changed_cb),
"open_file_cb", G_CALLBACK (open_file_cb),
"on_drop", G_CALLBACK (on_drop),
"drag_prepare", G_CALLBACK (drag_prepare),
NULL);
builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope);
gtk_builder_add_from_resource (builder, "/clipboard/clipboard.ui", NULL);
+1 -1
View File
@@ -376,7 +376,7 @@
<file>glarea-gles.vs.glsl</file>
</gresource>
<gresource prefix="/font_features">
<file>font_features.ui</file>
<file>font-features.ui</file>
<file>fontplane.c</file>
</gresource>
<gresource prefix="/spinbutton">
+1 -2
View File
@@ -37,8 +37,7 @@ demo3_widget_dispose (GObject *object)
Demo3Widget *self = DEMO3_WIDGET (object);
g_clear_object (&self->paintable);
gtk_widget_dispose_template (GTK_WIDGET (self), DEMO3_TYPE_WIDGET);
g_clear_pointer (&self->menu, gtk_widget_unparent);
G_OBJECT_CLASS (demo3_widget_parent_class)->dispose (object);
}
+6 -3
View File
@@ -90,9 +90,12 @@ do_errorstates (GtkWidget *do_widget)
toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget));
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, validate_more_details);
gtk_builder_cscope_add_callback (scope, mode_switch_state_set);
gtk_builder_cscope_add_callback (scope, level_scale_value_changed);
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
"validate_more_details", G_CALLBACK (validate_more_details),
"mode_switch_state_set", G_CALLBACK (mode_switch_state_set),
"level_scale_value_changed", G_CALLBACK (level_scale_value_changed),
NULL);
builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope);
gtk_builder_expose_object (builder, "toplevel", G_OBJECT (toplevel));
+190
View File
@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window">
<property name="default-width">600</property>
<property name="default-height">500</property>
<property name="title">Font Explorer</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<child>
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFontButton" id="font">
<property name="receives-default">1</property>
<property name="font">Sans 12</property>
<property name="level">family|style|size|variations|features</property>
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="label" translatable="yes">Font Features</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
<object class="GtkBox" id="feature_list">
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBox" id="script_lang">
<property name="margin-top">10</property>
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel" id="variations_heading">
<property name="label" translatable="yes">Font Variations</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
<object class="GtkGrid" id="variations_grid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="view"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
<property name="spacing">20</property>
<child>
<object class="GtkStack" id="stack">
<child>
<object class="GtkStackPage">
<property name="name">label</property>
<property name="child">
<object class="GtkLabel" id="label">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="valign">start</property>
<property name="selectable">1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkEntry" id="entry">
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
<signal name="activate" handler="font_features_stop_edit"/>
<property name="valign">start</property>
<property name="width-chars">50</property>
</object>
</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="settings">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="description">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkToggleButton" id="edit_toggle">
<property name="icon-name">document-edit-symbolic</property>
<property name="halign">end</property>
<property name="valign">end</property>
<signal name="toggled" handler="font_features_toggle_edit"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
File diff suppressed because it is too large Load Diff
-65
View File
@@ -1,65 +0,0 @@
--- demos/gtk-demo/font_features.c
+++ demos/gtk-demo/font_features.c
@@ -434,7 +434,7 @@ static void
update_display (void)
{
GString *s;
- const char *text;
+ char *text;
gboolean has_feature;
GtkTreeIter iter;
GtkTreeModel *model;
@@ -452,8 +452,12 @@ update_display (void)
gboolean do_waterfall;
GString *waterfall;
char *palette;
+ GtkTextBuffer *buffer;
+ GtkTextIter start_iter, end_iter;
- text = gtk_editable_get_text (GTK_EDITABLE (demo->the_entry));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
+ gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter);
+ text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
text_len = strlen (text);
do_waterfall = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (demo->waterfall_toggle));
@@ -631,6 +635,8 @@ update_display (void)
pango2_font_description_free (desc);
g_free (features);
pango2_attr_list_unref (attrs);
+
+ g_free (text);
}
static Pango2Font *
@@ -1603,8 +1609,12 @@ font_features_toggle_edit (void)
{
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (demo->stack)), "entry") != 0)
{
+ GtkTextBuffer *buffer;
+ GtkTextIter start, end;
g_free (demo->text);
- demo->text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (demo->the_entry)));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
+ demo->text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_stack_set_visible_child_name (GTK_STACK (demo->stack), "entry");
gtk_widget_grab_focus (demo->the_entry);
gtk_adjustment_set_value (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (demo->swin)), 0);
@@ -1632,7 +1642,7 @@ entry_key_press (GtkEventController *controller,
{
if (keyval == GDK_KEY_Escape)
{
- gtk_editable_set_text (GTK_EDITABLE (entry), demo->text);
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry)), demo->text, -1);
return GDK_EVENT_STOP;
}
@@ -1701,7 +1711,6 @@ do_font_features (GtkWidget *do_widget)
basic_value_changed (demo->line_height_adjustment, demo->line_height_entry);
controller = gtk_event_controller_key_new ();
- g_object_set_data_full (G_OBJECT (demo->the_entry), "controller", g_object_ref (controller), g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), demo->the_entry);
gtk_widget_add_controller (demo->the_entry, controller);
-454
View File
@@ -1,454 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAdjustment" id="size_adjustment">
<property name="lower">7</property>
<property name="upper">100</property>
<property name="value">14</property>
<property name="step_increment">0.5</property>
<property name="page_increment">10</property>
<signal name="value-changed" handler="basic_value_changed" object="size_entry" swapped="false"/>
</object>
<object class="GtkAdjustment" id="letterspacing_adjustment">
<property name="lower">-1024</property>
<property name="upper">8192</property>
<property name="value">0</property>
<property name="step_increment">1</property>
<property name="page_increment">512</property>
<signal name="value-changed" handler="basic_value_changed" object="letterspacing_entry" swapped="false"/>
</object>
<object class="GtkAdjustment" id="line_height_adjustment">
<property name="lower">0.75</property>
<property name="upper">2.5</property>
<property name="value">1.0</property>
<property name="step_increment">0.1</property>
<property name="page_increment">1</property>
<signal name="value-changed" handler="basic_value_changed" object="line_height_entry" swapped="false"/>
</object>
<object class="GtkWindow" id="window">
<property name="default-width">600</property>
<property name="default-height">500</property>
<property name="title">Font Explorer</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<child>
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_basic" swapped="no"/>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
<signal name="clicked" handler="font_features_reset_variations" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFontButton" id="font">
<property name="receives-default">1</property>
<property name="font">Sans 12</property>
<property name="level">family|style</property>
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
</object>
</child>
<child>
<object class="GtkGrid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
<child>
<object class="GtkLabel">
<property name="label">Size</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale" id="size_scale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">size_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="size_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="size_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Letterspacing</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">letterspacing_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="letterspacing_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="letterspacing_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Line Height</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">line_height_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="line_height_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="line_height_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Foreground</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkColorButton" id="foreground">
<property name="valign">baseline</property>
<property name="rgba">black</property>
<signal name="notify::rgba" handler="color_set_cb"/>
<layout>
<property name="column">1</property>
<property name="row">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Background</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkColorButton" id="background">
<property name="valign">baseline</property>
<property name="rgba">white</property>
<signal name="notify::rgba" handler="color_set_cb"/>
<layout>
<property name="column">1</property>
<property name="row">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">object-flip-vertical-symbolic</property>
<property name="halign">start</property>
<property name="valign">center</property>
<style>
<class name="circular"/>
</style>
<signal name="clicked" handler="swap_colors"/>
<layout>
<property name="column">2</property>
<property name="row">3</property>
<property name="row-span">2</property>
</layout>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="label" translatable="yes">OpenType Features</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<style>
<class name="title-4"/>
</style>
</object>
</child>
<child>
<object class="GtkBox" id="feature_list">
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBox" id="script_lang">
<property name="tooltip-text" translatable="yes">Language System</property>
<property name="margin-top">10</property>
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel" id="variations_heading">
<property name="label" translatable="yes">Variation Axes</property>
<property name="xalign">0</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<style>
<class name="title-4"/>
</style>
</object>
</child>
<child>
<object class="GtkGrid" id="variations_grid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="view"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
<property name="spacing">20</property>
<child>
<object class="GtkScrolledWindow" id="swin">
<property name="hscrollbar-policy">automatic</property>
<property name="vscrollbar-policy">automatic</property>
<property name="propagate-natural-height">1</property>
<property name="vexpand">1</property>
<style>
<class name="font_features_background"/>
</style>
<child>
<object class="GtkStack" id="stack">
<child>
<object class="GtkStackPage">
<property name="name">label</property>
<property name="child">
<object class="GtkLabel" id="label">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="valign">start</property>
<property name="selectable">1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkTextView" id="entry">
<property name="buffer">
<object class="GtkTextBuffer">
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
</object>
</property>
<property name="valign">fill</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="settings">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Alphabet</property>
<signal name="clicked" handler="set_text_alphabet"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Paragraph</property>
<signal name="clicked" handler="set_text_paragraph"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="description">
<property name="wrap">1</property>
<property name="wrap-mode">char</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<style>
<class name="linked"/>
</style>
<property name="valign">end</property>
<child>
<object class="GtkToggleButton" id="plain_toggle">
<property name="label" translatable="yes">Plain</property>
<property name="active">1</property>
<property name="valign">baseline</property>
<signal name="toggled" handler="font_features_toggle_plain"/>
</object>
</child>
<child>
<object class="GtkToggleButton" id="waterfall_toggle">
<property name="label" translatable="yes">Waterfall</property>
<property name="valign">baseline</property>
<property name="group">plain_toggle</property>
<signal name="toggled" handler="font_features_toggle_plain"/>
<signal name="notify::active" handler="font_features_notify_waterfall"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkToggleButton" id="edit_toggle">
<property name="group">waterfall_toggle</property>
<property name="icon-name">document-edit-symbolic</property>
<property name="halign">end</property>
<property name="valign">end</property>
<signal name="clicked" handler="font_features_toggle_edit"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+1 -9
View File
@@ -260,19 +260,12 @@ gtk_message_row_state_flags_changed (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_message_row_parent_class)->state_flags_changed (widget, previous_state_flags);
}
static void
gtk_message_row_dispose (GObject *obj)
{
gtk_widget_dispose_template (GTK_WIDGET (obj), GTK_TYPE_MESSAGE_ROW);
G_OBJECT_CLASS (gtk_message_row_parent_class)->dispose (obj);
}
static void
gtk_message_row_finalize (GObject *obj)
{
GtkMessageRowPrivate *priv = GTK_MESSAGE_ROW (obj)->priv;
g_object_unref (priv->message);
G_OBJECT_CLASS (gtk_message_row_parent_class)->finalize (obj);
G_OBJECT_CLASS (gtk_message_row_parent_class)->finalize(obj);
}
static void
@@ -281,7 +274,6 @@ gtk_message_row_class_init (GtkMessageRowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gtk_message_row_dispose;
object_class->finalize = gtk_message_row_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui");
+2 -1
View File
@@ -42,7 +42,8 @@ do_listbox_controls (GtkWidget *do_widget)
GtkBuilder *builder;
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, row_activated);
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope),
"row_activated", G_CALLBACK (row_activated));
builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope);
+4 -4
View File
@@ -356,10 +356,10 @@ do_listview_settings (GtkWidget *do_widget)
g_type_ensure (SETTINGS_TYPE_KEY);
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, search_enabled);
gtk_builder_cscope_add_callback (scope, search_changed);
gtk_builder_cscope_add_callback (scope, stop_search);
gtk_builder_cscope_add_callback (scope, item_value_changed);
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_enabled", (GCallback)search_enabled);
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_changed", (GCallback)search_changed);
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "stop_search", (GCallback)stop_search);
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "item_value_changed", (GCallback)item_value_changed);
builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope);
-9
View File
@@ -409,14 +409,6 @@ icon_browser_window_init (IconBrowserWindow *win)
g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win);
}
static void
icon_browser_window_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), ICON_BROWSER_WINDOW_TYPE);
G_OBJECT_CLASS (icon_browser_window_parent_class)->dispose (object);
}
static void
icon_browser_window_finalize (GObject *object)
{
@@ -432,7 +424,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = icon_browser_window_dispose;
object_class->finalize = icon_browser_window_finalize;
g_type_ensure (IB_TYPE_ICON);
-9
View File
@@ -873,14 +873,6 @@ dark_mode_cb (GtkToggleButton *button,
NULL);
}
static void
node_editor_window_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), NODE_EDITOR_WINDOW_TYPE);
G_OBJECT_CLASS (node_editor_window_parent_class)->dispose (object);
}
static void
node_editor_window_finalize (GObject *object)
{
@@ -975,7 +967,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = node_editor_window_dispose;
object_class->finalize = node_editor_window_finalize;
gtk_widget_class_set_template_from_resource (widget_class,
+20 -18
View File
@@ -2081,24 +2081,26 @@ activate (GApplication *app)
builder = gtk_builder_new ();
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, on_entry_icon_release);
gtk_builder_cscope_add_callback (scope, on_scale_button_value_changed);
gtk_builder_cscope_add_callback (scope, on_record_button_toggled);
gtk_builder_cscope_add_callback (scope, on_page_combo_changed);
gtk_builder_cscope_add_callback (scope, on_range_from_changed);
gtk_builder_cscope_add_callback (scope, on_range_to_changed);
gtk_builder_cscope_add_callback (scope, on_picture_drag_prepare);
gtk_builder_cscope_add_callback (scope, on_picture_drop);
gtk_builder_cscope_add_callback (scope, tab_close_cb);
gtk_builder_cscope_add_callback (scope, increase_icon_size);
gtk_builder_cscope_add_callback (scope, decrease_icon_size);
gtk_builder_cscope_add_callback (scope, osd_frame_pressed);
gtk_builder_cscope_add_callback (scope, age_entry_changed);
gtk_builder_cscope_add_callback (scope, validate_more_details);
gtk_builder_cscope_add_callback (scope, mode_switch_state_set);
gtk_builder_cscope_add_callback (scope, level_scale_value_changed);
gtk_builder_cscope_add_callback (scope, transition_speed_changed);
gtk_builder_cscope_add_callback (scope, reset_icon_size);
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
"on_entry_icon_release", (GCallback)on_entry_icon_release,
"on_scale_button_value_changed", (GCallback)on_scale_button_value_changed,
"on_record_button_toggled", (GCallback)on_record_button_toggled,
"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,
"reset_icon_size", (GCallback)reset_icon_size,
"osd_frame_pressed", (GCallback)osd_frame_pressed,
"age_entry_changed", (GCallback)age_entry_changed,
"validate_more_details", (GCallback)validate_more_details,
"mode_switch_state_set", (GCallback)mode_switch_state_set,
"level_scale_value_changed", (GCallback)level_scale_value_changed,
"transition_speed_changed", (GCallback)transition_speed_changed,
NULL);
gtk_builder_set_scope (builder, scope);
g_object_unref (scope);
if (!gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", &error))
+13 -6
View File
@@ -117,7 +117,6 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)" },
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals" },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
{ "gl-software", GDK_DEBUG_GL_SOFTWARE, "Force OpenGL software rendering" },
{ "gl-texture-rect", GDK_DEBUG_GL_TEXTURE_RECT, "Use OpenGL texture rectangle extension" },
@@ -361,13 +360,21 @@ gdk_running_in_sandbox (void)
gboolean
gdk_should_use_portal (void)
{
if (GDK_DISPLAY_DEBUG_CHECK (NULL, PORTALS))
return TRUE;
static const char *use_portal = NULL;
if (gdk_running_in_sandbox ())
return TRUE;
if (G_UNLIKELY (use_portal == NULL))
{
if (gdk_running_in_sandbox ())
use_portal = "1";
else
{
use_portal = g_getenv ("GTK_USE_PORTAL");
if (!use_portal)
use_portal = "";
}
}
return FALSE;
return use_portal[0] == '1';
}
PangoDirection
+13 -14
View File
@@ -38,20 +38,19 @@ typedef enum {
GDK_DEBUG_CLIPBOARD = 1 << 10,
/* flags below are influencing behavior */
GDK_DEBUG_NOGRABS = 1 << 11,
GDK_DEBUG_PORTALS = 1 << 12,
GDK_DEBUG_GL_DISABLE = 1 << 13,
GDK_DEBUG_GL_SOFTWARE = 1 << 14,
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 15,
GDK_DEBUG_GL_LEGACY = 1 << 16,
GDK_DEBUG_GL_GLES = 1 << 17,
GDK_DEBUG_GL_DEBUG = 1 << 18,
GDK_DEBUG_GL_EGL = 1 << 19,
GDK_DEBUG_GL_GLX = 1 << 20,
GDK_DEBUG_GL_WGL = 1 << 21,
GDK_DEBUG_VULKAN_DISABLE = 1 << 22,
GDK_DEBUG_VULKAN_VALIDATE = 1 << 23,
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 24,
GDK_DEBUG_HIGH_DEPTH = 1 << 25,
GDK_DEBUG_GL_DISABLE = 1 << 12,
GDK_DEBUG_GL_SOFTWARE = 1 << 13,
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 14,
GDK_DEBUG_GL_LEGACY = 1 << 15,
GDK_DEBUG_GL_GLES = 1 << 16,
GDK_DEBUG_GL_DEBUG = 1 << 17,
GDK_DEBUG_GL_EGL = 1 << 18,
GDK_DEBUG_GL_GLX = 1 << 19,
GDK_DEBUG_GL_WGL = 1 << 20,
GDK_DEBUG_VULKAN_DISABLE = 1 << 21,
GDK_DEBUG_VULKAN_VALIDATE = 1 << 22,
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23,
GDK_DEBUG_HIGH_DEPTH = 1 << 24,
} GdkDebugFlags;
extern guint _gdk_debug_flags;
-3
View File
@@ -373,9 +373,6 @@ gdk_frame_clock_flush_idle (void *data)
else
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
g_clear_handle_id (&priv->paint_idle_id, g_source_remove);
gdk_frame_clock_paint_idle (data);
return FALSE;
}
+4 -9
View File
@@ -2793,19 +2793,14 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface,
impl = GDK_X11_SURFACE (surface);
/* Refine our fallback answer a bit using local information */
rect->x = impl->abs_x;
rect->y = impl->abs_y;
rect->width = surface->width;
rect->height = surface->height;
rect->x = impl->abs_x * impl->surface_scale;
rect->y = impl->abs_y * impl->surface_scale;
rect->width = surface->width * impl->surface_scale;
rect->height = surface->height * impl->surface_scale;
if (GDK_SURFACE_DESTROYED (surface) || impl->override_redirect)
return;
rect->x *= impl->surface_scale;
rect->y *= impl->surface_scale;
rect->width *= impl->surface_scale;
rect->height *= impl->surface_scale;
nvroots = 0;
vroots = NULL;
-7
View File
@@ -47,13 +47,6 @@
* the full width of the box, even if the children at either side take
* up different amounts of space.
*
* # GtkActionBar as GtkBuildable
*
* The `GtkActionBar` implementation of the `GtkBuildable` interface supports
* adding children at the start or end sides by specifying start or end as
* the type attribute of a `<child>` element, or setting the center widget
* by specifying center value.
*
* # CSS nodes
*
* ```
+5 -7
View File
@@ -85,24 +85,22 @@ static GParamSpec *properties[N_PROPS] = { NULL, };
static void
gtk_builder_list_item_factory_setup (GtkListItemFactory *factory,
GObject *item,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
GtkBuilderListItemFactory *self = GTK_BUILDER_LIST_ITEM_FACTORY (factory);
GtkBuilder *builder;
GError *error = NULL;
GTK_LIST_ITEM_FACTORY_CLASS (gtk_builder_list_item_factory_parent_class)->setup (factory, item, bind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_builder_list_item_factory_parent_class)->setup (factory, widget, list_item);
builder = gtk_builder_new ();
gtk_builder_set_current_object (builder, item);
gtk_builder_set_current_object (builder, G_OBJECT (list_item));
if (self->scope)
gtk_builder_set_scope (builder, self->scope);
if (!gtk_builder_extend_with_template (builder, G_OBJECT (item), G_OBJECT_TYPE (item),
if (!gtk_builder_extend_with_template (builder, G_OBJECT (list_item), G_OBJECT_TYPE (list_item),
(const char *)g_bytes_get_data (self->data, NULL),
g_bytes_get_size (self->data),
&error))
+1 -1
View File
@@ -1495,7 +1495,7 @@ parse_signal (ParserData *data,
return;
}
if (!g_signal_parse_name (name, object_info->type, &id, &detail, TRUE))
if (!g_signal_parse_name (name, object_info->type, &id, &detail, FALSE))
{
g_set_error (error,
GTK_BUILDER_ERROR,
+1 -1
View File
@@ -436,7 +436,7 @@ gtk_builder_cscope_new (void)
* Adds the @callback_symbol to the scope of @builder under its
* own name.
*
* This is a convenience wrapper of [method@Gtk.BuilderCScope.add_callback_symbol].
* This is a convenience wrapper of [method@Gtk.BuilderCSope.add_callback_symbol].
*
* Since: 4.8
*/
+15 -25
View File
@@ -43,13 +43,10 @@ G_DEFINE_TYPE (GtkColumnListItemFactory, gtk_column_list_item_factory, GTK_TYPE_
static void
gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
GObject *item,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
GtkColumnListItemFactory *self = GTK_COLUMN_LIST_ITEM_FACTORY (factory);
GtkListItemWidget *widget = data;
GListModel *columns;
guint i;
@@ -57,7 +54,7 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
gtk_widget_set_layout_manager (GTK_WIDGET (widget),
gtk_column_view_layout_new (self->view));
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->setup (factory, item, bind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->setup (factory, widget, list_item);
columns = gtk_column_view_get_columns (self->view);
@@ -66,7 +63,7 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
GtkColumnViewColumn *column = g_list_model_get_item (columns, i);
gtk_column_list_item_factory_add_column (self,
widget,
list_item->owner,
column,
FALSE);
@@ -76,15 +73,12 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
static void
gtk_column_list_item_factory_teardown (GtkListItemFactory *factory,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
GtkListItemWidget *widget = data;
GtkWidget *child;
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->teardown (factory, item, unbind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->teardown (factory, widget, list_item);
while ((child = gtk_widget_get_first_child (GTK_WIDGET (widget))))
{
@@ -94,25 +88,21 @@ gtk_column_list_item_factory_teardown (GtkListItemFactory *factory,
static void
gtk_column_list_item_factory_update (GtkListItemFactory *factory,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected)
{
GtkListItem *list_item = GTK_LIST_ITEM (item);
GtkWidget *child;
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->update (factory, item, unbind, bind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->update (factory, widget, list_item, position, item, selected);
for (child = gtk_widget_get_first_child (GTK_WIDGET (list_item->owner));
for (child = gtk_widget_get_first_child (GTK_WIDGET (widget));
child;
child = gtk_widget_get_next_sibling (child))
{
gtk_list_item_widget_update (GTK_LIST_ITEM_WIDGET (child),
gtk_list_item_get_position (list_item),
gtk_list_item_get_item (list_item),
gtk_list_item_get_selected (list_item));
gtk_list_item_widget_update (GTK_LIST_ITEM_WIDGET (child), position, item, selected);
}
}
+1 -1
View File
@@ -596,7 +596,7 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
GtkTextDecorationStyle decoration_style;
const GdkRGBA *color;
const GdkRGBA *decoration_color;
double letter_spacing;
int letter_spacing;
/* text-decoration */
decoration_line = _gtk_css_text_decoration_line_value_get (style->font_variant->text_decoration_line);
+2 -11
View File
@@ -249,14 +249,6 @@ gtk_emoji_chooser_finalize (GObject *object)
G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->finalize (object);
}
static void
gtk_emoji_chooser_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_EMOJI_CHOOSER);
G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->dispose (object);
}
static void
scroll_to_section (EmojiSection *section)
{
@@ -874,7 +866,7 @@ filter_func (GtkFlowBoxChild *child,
goto out;
term_tokens = g_str_tokenize_and_fold (text, "en", NULL);
g_variant_get_child (emoji_data, 1, "&s", &name);
name_tokens = g_str_tokenize_and_fold (name, "en", NULL);
g_variant_get_child (emoji_data, 2, "^a&s", &keywords);
@@ -1211,7 +1203,6 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = gtk_emoji_chooser_finalize;
object_class->dispose = gtk_emoji_chooser_dispose;
widget_class->show = gtk_emoji_chooser_show;
widget_class->map = gtk_emoji_chooser_map;
@@ -1287,7 +1278,7 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
* @direction: 1 to scroll forward, -1 to scroll back
*
* Scrolls to the next or previous section.
*/
*/
gtk_widget_class_install_action (widget_class, "scroll.section", "i",
gtk_emoji_chooser_scroll_section);
+3 -1
View File
@@ -380,7 +380,9 @@ gtk_file_chooser_dialog_activate_response (GtkWidget *widget,
static void
gtk_file_chooser_dialog_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_FILE_CHOOSER_DIALOG);
GtkFileChooserDialogPrivate *priv = gtk_file_chooser_dialog_get_instance_private (GTK_FILE_CHOOSER_DIALOG (object));
g_clear_pointer ((GtkWidget **)&priv->widget, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->dispose (object);
}
+7 -9
View File
@@ -515,7 +515,7 @@ static GSList *get_selected_infos (GtkFileChooserWidget *impl);
static void search_setup_widgets (GtkFileChooserWidget *impl);
static void search_stop_searching (GtkFileChooserWidget *impl,
gboolean remove_query);
static void search_clear_model (GtkFileChooserWidget *impl,
static void search_clear_model (GtkFileChooserWidget *impl,
gboolean remove_from_treeview);
static void search_entry_activate_cb (GtkFileChooserWidget *impl);
static void search_entry_stop_cb (GtkFileChooserWidget *impl);
@@ -720,8 +720,8 @@ error_creating_folder_dialog (GtkFileChooserWidget *impl,
GFile *file,
GError *error)
{
error_dialog (impl,
_("The folder could not be created"),
error_dialog (impl,
_("The folder could not be created"),
error);
}
@@ -3122,11 +3122,10 @@ gtk_file_chooser_widget_dispose (GObject *object)
GtkFileChooserWidget *impl = (GtkFileChooserWidget *) object;
cancel_all_operations (impl);
/* browse_files_popover is not a template child */
g_clear_pointer (&impl->rename_file_popover, gtk_widget_unparent);
g_clear_pointer (&impl->browse_files_popover, gtk_widget_unparent);
g_clear_pointer (&impl->bookmarks_manager, _gtk_bookmarks_manager_free);
g_clear_object (&impl->extra_widget);
g_clear_pointer (&impl->bookmarks_manager, _gtk_bookmarks_manager_free);
if (impl->external_entry && impl->location_entry == impl->external_entry)
{
@@ -3134,10 +3133,9 @@ gtk_file_chooser_widget_dispose (GObject *object)
location_entry_disconnect (impl);
impl->external_entry = NULL;
}
remove_settings_signal (impl);
gtk_widget_dispose_template (GTK_WIDGET (impl), GTK_TYPE_FILE_CHOOSER_WIDGET);
g_clear_pointer (&impl->box, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->dispose (object);
}
@@ -6260,7 +6258,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserWidget *impl)
case SAVE_ENTRY:
goto save_entry;
case NOT_REACHED:
case NOT_REACHED:
default:
g_assert_not_reached ();
}
+37 -3
View File
@@ -1206,8 +1206,43 @@ pango_font_description_to_css (PangoFontDescription *desc,
}
}
if (set & PANGO_FONT_MASK_WEIGHT)
g_string_append_printf (s, "font-weight: %d; ", pango_font_description_get_weight (desc));
{
switch (pango_font_description_get_weight (desc))
{
case PANGO_WEIGHT_THIN:
g_string_append (s, "font-weight: 100; ");
break;
case PANGO_WEIGHT_ULTRALIGHT:
g_string_append (s, "font-weight: 200; ");
break;
case PANGO_WEIGHT_LIGHT:
case PANGO_WEIGHT_SEMILIGHT:
g_string_append (s, "font-weight: 300; ");
break;
case PANGO_WEIGHT_BOOK:
case PANGO_WEIGHT_NORMAL:
g_string_append (s, "font-weight: 400; ");
break;
case PANGO_WEIGHT_MEDIUM:
g_string_append (s, "font-weight: 500; ");
break;
case PANGO_WEIGHT_SEMIBOLD:
g_string_append (s, "font-weight: 600; ");
break;
case PANGO_WEIGHT_BOLD:
g_string_append (s, "font-weight: 700; ");
break;
case PANGO_WEIGHT_ULTRABOLD:
g_string_append (s, "font-weight: 800; ");
break;
case PANGO_WEIGHT_HEAVY:
case PANGO_WEIGHT_ULTRAHEAVY:
g_string_append (s, "font-weight: 900; ");
break;
default:
break;
}
}
if (set & PANGO_FONT_MASK_STRETCH)
{
switch (pango_font_description_get_stretch (desc))
@@ -1234,7 +1269,6 @@ pango_font_description_to_css (PangoFontDescription *desc,
g_string_append (s, "font-stretch: expanded; ");
break;
case PANGO_STRETCH_EXTRA_EXPANDED:
g_string_append (s, "font-stretch: extra-expanded; ");
break;
case PANGO_STRETCH_ULTRA_EXPANDED:
g_string_append (s, "font-stretch: ultra-expanded; ");
+3 -3
View File
@@ -229,10 +229,10 @@ gtk_font_chooser_dialog_dispose (GObject *object)
dialog);
}
/* tweak_button is not a template child */
g_clear_pointer (&dialog->select_button, gtk_widget_unparent);
g_clear_pointer (&dialog->cancel_button, gtk_widget_unparent);
g_clear_pointer (&dialog->tweak_button, gtk_widget_unparent);
gtk_widget_dispose_template (GTK_WIDGET (dialog), GTK_TYPE_FONT_CHOOSER_DIALOG);
g_clear_pointer (&dialog->fontchooser, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_font_chooser_dialog_parent_class)->dispose (object);
}
+19 -106
View File
@@ -116,8 +116,6 @@ struct _GtkFontChooserWidget
GtkWidget *size_label;
GtkWidget *size_spin;
GtkWidget *size_slider;
GtkWidget *size_label2;
GtkWidget *size_spin2;
GtkWidget *size_slider2;
GtkWidget *axis_grid;
@@ -915,8 +913,6 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_label);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_spin);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_slider);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_label2);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_spin2);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, size_slider2);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, stack);
gtk_widget_class_bind_template_child (widget_class, GtkFontChooserWidget, grid);
@@ -1784,30 +1780,15 @@ typedef struct {
GtkWidget *example;
} FeatureItem;
static char *
static const char *
get_feature_display_name (hb_tag_t tag)
{
int i;
char buf[5] = { 0, };
hb_tag_to_string (tag, buf);
if (buf[0] == 's' && buf[1] == 's' && g_ascii_isdigit (buf[2]) && g_ascii_isdigit (buf[3]))
{
int num = (buf[2] - '0') * 10 + (buf[3] - '0');
return g_strdup_printf (g_dpgettext2 (NULL, "OpenType layout", "Stylistic Set %d"), num);
}
if (buf[0] == 'c' && buf[1] == 'v' && g_ascii_isdigit (buf[2]) && g_ascii_isdigit (buf[3]))
{
int num = (buf[2] - '0') * 10 + (buf[3] - '0');
return g_strdup_printf (g_dpgettext2 (NULL, "OpenType layout", "Character Variant %d"), num);
}
for (i = 0; i < G_N_ELEMENTS (open_type_layout_features); i++)
{
if (tag == open_type_layout_features[i].tag)
return g_strdup (g_dpgettext2 (NULL, "OpenType layout", open_type_layout_features[i].name));
return g_dpgettext2 (NULL, "OpenType layout", open_type_layout_features[i].name);
}
return NULL;
@@ -1873,12 +1854,7 @@ find_affected_text (GtkFontChooserWidget *fontchooser,
hb_ot_layout_script_find_language (hb_face, HB_OT_TAG_GSUB, script_index, lang_tag, &lang_index);
G_GNUC_END_IGNORE_DEPRECATIONS
if (hb_ot_layout_language_find_feature (hb_face,
HB_OT_TAG_GSUB,
script_index,
lang_index,
feature_tag,
&feature_index))
if (hb_ot_layout_language_find_feature (hb_face, HB_OT_TAG_GSUB, script_index, lang_index, feature_tag, &feature_index))
{
unsigned int lookup_indexes[32];
unsigned int lookup_count = 32;
@@ -1893,27 +1869,22 @@ find_affected_text (GtkFontChooserWidget *fontchooser,
lookup_indexes);
if (count > 0)
{
hb_set_t *glyphs_before = NULL;
hb_set_t *glyphs_after = NULL;
hb_set_t *glyphs_output = NULL;
hb_set_t *glyphs_input;
hb_set_t* glyphs_before = NULL;
hb_set_t* glyphs_input = NULL;
hb_set_t* glyphs_after = NULL;
hb_set_t* glyphs_output = NULL;
hb_codepoint_t gid;
char buf[5] = { 0, };
hb_tag_to_string (feature_tag, buf);
glyphs_input = hb_set_create ();
glyphs_input = hb_set_create ();
for (int i = 0; i < count; i++)
{
hb_ot_layout_lookup_collect_glyphs (hb_face,
HB_OT_TAG_GSUB,
lookup_indexes[i],
glyphs_before,
glyphs_input,
glyphs_after,
glyphs_output);
}
// XXX For now, just look at first index
hb_ot_layout_lookup_collect_glyphs (hb_face,
HB_OT_TAG_GSUB,
lookup_indexes[0],
glyphs_before,
glyphs_input,
glyphs_after,
glyphs_output);
if (!fontchooser->glyphmap)
{
@@ -1927,7 +1898,6 @@ find_affected_text (GtkFontChooserWidget *fontchooser,
}
}
gid = HB_SET_VALUE_INVALID;
while (hb_set_next (glyphs_input, &gid))
{
hb_codepoint_t ch;
@@ -1952,53 +1922,6 @@ find_affected_text (GtkFontChooserWidget *fontchooser,
return g_string_free (chars, FALSE);
}
static void
update_feature_label (GtkFontChooserWidget *fontchooser,
FeatureItem *item,
hb_font_t *hb_font,
hb_tag_t script_tag,
hb_tag_t lang_tag)
{
hb_face_t *hb_face;
unsigned int script_index, lang_index, feature_index;
hb_ot_name_id_t id;
unsigned int len;
char *label;
hb_face = hb_font_get_face (hb_font);
if (!(g_str_has_prefix (item->name, "ss") || g_str_has_prefix (item->name, "cv")) ||
!g_ascii_isdigit (item->name[2]) || !g_ascii_isdigit (item->name[3]))
return;
hb_ot_layout_table_find_script (hb_face, HB_OT_TAG_GSUB, script_tag, &script_index);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
hb_ot_layout_script_find_language (hb_face, HB_OT_TAG_GSUB, script_index, lang_tag, &lang_index);
G_GNUC_END_IGNORE_DEPRECATIONS
if (hb_ot_layout_language_find_feature (hb_face, HB_OT_TAG_GSUB, script_index, lang_index, item->tag, &feature_index) &&
hb_ot_layout_feature_get_name_ids (hb_face, HB_OT_TAG_GSUB, feature_index, &id, NULL, NULL, NULL, NULL))
{
len = hb_ot_name_get_utf8 (hb_face, id, HB_LANGUAGE_INVALID, NULL, NULL);
len++;
label = g_new (char, len);
hb_ot_name_get_utf8 (hb_face, id, HB_LANGUAGE_INVALID, &len, label);
char *s = g_strdup_printf ("%s (%s)", label, item->name);
gtk_check_button_set_label (GTK_CHECK_BUTTON (item->feat), s);
g_free (s);
g_free (label);
}
else
{
label = get_feature_display_name (item->tag);
gtk_check_button_set_label (GTK_CHECK_BUTTON (item->feat), label);
g_free (label);
}
}
static void
update_feature_example (GtkFontChooserWidget *fontchooser,
FeatureItem *item,
@@ -2139,13 +2062,10 @@ add_check_group (GtkFontChooserWidget *fontchooser,
GtkGesture *gesture;
GtkWidget *box;
GtkWidget *example;
char *name;
tag = hb_tag_from_string (tags[i], -1);
name = get_feature_display_name (tag);
feat = gtk_check_button_new_with_label (name);
g_free (name);
feat = gtk_check_button_new_with_label (get_feature_display_name (tag));
set_inconsistent (GTK_CHECK_BUTTON (feat), TRUE);
g_signal_connect (feat, "toggled", G_CALLBACK (font_feature_toggled_cb), fontchooser);
g_signal_connect_swapped (feat, "notify::inconsistent", G_CALLBACK (update_font_features), fontchooser);
@@ -2207,14 +2127,14 @@ add_radio_group (GtkFontChooserWidget *fontchooser,
hb_tag_t tag;
GtkWidget *feat;
FeatureItem *item;
char *name;
const char *name;
GtkWidget *box;
GtkWidget *example;
tag = hb_tag_from_string (tags[i], -1);
name = get_feature_display_name (tag);
feat = gtk_check_button_new_with_label (name ? name : _("Default"));
g_free (name);
if (group_button == NULL)
group_button = feat;
else
@@ -2341,7 +2261,6 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
gtk_widget_show (item->top);
gtk_widget_show (gtk_widget_get_parent (item->top));
update_feature_label (fontchooser, item, hb_font, script_tag, lang_tag);
update_feature_example (fontchooser, item, hb_font, script_tag, lang_tag, fontchooser->font_desc);
if (GTK_IS_CHECK_BUTTON (item->feat))
@@ -2641,18 +2560,12 @@ gtk_font_chooser_widget_set_level (GtkFontChooserWidget *fontchooser,
gtk_widget_show (fontchooser->size_label);
gtk_widget_show (fontchooser->size_slider);
gtk_widget_show (fontchooser->size_spin);
gtk_widget_show (fontchooser->size_label2);
gtk_widget_show (fontchooser->size_slider2);
gtk_widget_show (fontchooser->size_spin2);
}
else
{
gtk_widget_hide (fontchooser->size_label);
gtk_widget_hide (fontchooser->size_slider);
gtk_widget_hide (fontchooser->size_spin);
gtk_widget_hide (fontchooser->size_label2);
gtk_widget_hide (fontchooser->size_slider2);
gtk_widget_hide (fontchooser->size_spin2);
}
update_fontlist (fontchooser);
+1 -4
View File
@@ -758,10 +758,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
/* step 0: exit early if list is empty */
if (gtk_list_item_manager_get_root (self->item_manager) == NULL)
{
gtk_list_base_update_adjustments (GTK_LIST_BASE (self), 0, 0, 0, 0, &x, &y);
return;
}
return;
/* step 1: determine width of the list */
gtk_grid_view_measure_column_size (self, &col_min, &col_nat);
+39 -37
View File
@@ -80,36 +80,31 @@ G_DEFINE_TYPE (GtkListItemFactory, gtk_list_item_factory, G_TYPE_OBJECT)
static void
gtk_list_item_factory_default_setup (GtkListItemFactory *self,
GObject *item,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
if (func)
func (item, data);
gtk_list_item_widget_default_setup (widget, list_item);
}
static void
gtk_list_item_factory_default_teardown (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
if (func)
func (item, data);
gtk_list_item_widget_default_teardown (widget, list_item);
gtk_list_item_set_child (list_item, NULL);
}
static void
gtk_list_item_factory_default_update (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected)
{
if (func)
func (item, data);
gtk_list_item_widget_default_update (widget, list_item, position, item, selected);
}
static void
@@ -127,38 +122,45 @@ gtk_list_item_factory_init (GtkListItemFactory *self)
void
gtk_list_item_factory_setup (GtkListItemFactory *self,
GObject *item,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget)
{
GtkListItem *list_item;
g_return_if_fail (GTK_IS_LIST_ITEM_FACTORY (self));
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->setup (self, item, bind, func, data);
list_item = gtk_list_item_new ();
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->setup (self, widget, list_item);
}
void
gtk_list_item_factory_teardown (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data)
GtkListItemWidget *widget)
{
GtkListItem *list_item;
g_return_if_fail (GTK_IS_LIST_ITEM_FACTORY (self));
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->teardown (self, item, unbind, func, data);
list_item = gtk_list_item_widget_get_list_item (widget);
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->teardown (self, widget, list_item);
g_object_unref (list_item);
}
void
gtk_list_item_factory_update (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
guint position,
gpointer item,
gboolean selected)
{
g_return_if_fail (GTK_IS_LIST_ITEM_FACTORY (self));
g_return_if_fail (G_IS_OBJECT (item));
GtkListItem *list_item;
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->update (self, item, unbind, bind, func, data);
g_return_if_fail (GTK_IS_LIST_ITEM_FACTORY (self));
g_return_if_fail (GTK_IS_LIST_ITEM_WIDGET (widget));
list_item = gtk_list_item_widget_get_list_item (widget);
GTK_LIST_ITEM_FACTORY_GET_CLASS (self)->update (self, widget, list_item, position, item, selected);
}
+15 -26
View File
@@ -37,44 +37,33 @@ struct _GtkListItemFactoryClass
/* setup @list_item so it can be bound */
void (* setup) (GtkListItemFactory *self,
GObject *item,
gboolean bind,
GFunc func,
gpointer data);
GtkListItemWidget *widget,
GtkListItem *list_item);
/* undo the effects of GtkListItemFactoryClass::setup() */
void (* teardown) (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data);
GtkListItemWidget *widget,
GtkListItem *list_item);
/* Update properties on @list_item to the given @item, which is in @position and @selected state.
* One or more of those properties might be unchanged. */
void (* update) (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data);
GtkListItemWidget *widget,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected);
};
void gtk_list_item_factory_setup (GtkListItemFactory *self,
GObject *item,
gboolean bind,
GFunc func,
gpointer data);
GtkListItemWidget *widget);
void gtk_list_item_factory_teardown (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data);
GtkListItemWidget *widget);
void gtk_list_item_factory_update (GtkListItemFactory *self,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data);
GtkListItemWidget *widget,
guint position,
gpointer item,
gboolean selected);
G_END_DECLS
+80 -134
View File
@@ -140,85 +140,6 @@ gtk_list_item_widget_grab_focus (GtkWidget *widget)
return GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->grab_focus (widget);
}
static void
gtk_list_item_widget_setup_func (gpointer object,
gpointer data)
{
GtkListItemWidget *self = data;
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GtkListItem *list_item = object;
priv->list_item = list_item;
list_item->owner = self;
if (list_item->child)
gtk_list_item_widget_add_child (self, list_item->child);
gtk_list_item_widget_set_activatable (self, list_item->activatable);
gtk_list_item_do_notify (list_item,
priv->item != NULL,
priv->position != GTK_INVALID_LIST_POSITION,
priv->selected);
}
static void
gtk_list_item_widget_setup_factory (GtkListItemWidget *self)
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GtkListItem *list_item;
list_item = gtk_list_item_new ();
gtk_list_item_factory_setup (priv->factory,
G_OBJECT (list_item),
priv->item != NULL,
gtk_list_item_widget_setup_func,
self);
g_assert (priv->list_item == list_item);
}
static void
gtk_list_item_widget_teardown_func (gpointer object,
gpointer data)
{
GtkListItemWidget *self = data;
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GtkListItem *list_item = object;
g_assert (priv->list_item == list_item);
priv->list_item = NULL;
list_item->owner = NULL;
if (list_item->child)
gtk_list_item_widget_remove_child (self, list_item->child);
gtk_list_item_widget_set_activatable (self, FALSE);
gtk_list_item_do_notify (list_item,
priv->item != NULL,
priv->position != GTK_INVALID_LIST_POSITION,
priv->selected);
gtk_list_item_set_child (list_item, NULL);
}
static void
gtk_list_item_widget_teardown_factory (GtkListItemWidget *self)
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
gtk_list_item_factory_teardown (priv->factory,
G_OBJECT (priv->list_item),
priv->item != NULL,
gtk_list_item_widget_teardown_func,
self);
g_assert (priv->list_item == NULL);
}
static void
gtk_list_item_widget_root (GtkWidget *widget)
{
@@ -228,7 +149,7 @@ gtk_list_item_widget_root (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->root (widget);
if (priv->factory)
gtk_list_item_widget_setup_factory (self);
gtk_list_item_factory_setup (priv->factory, self);
}
static void
@@ -240,7 +161,7 @@ gtk_list_item_widget_unroot (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_list_item_widget_parent_class)->unroot (widget);
if (priv->list_item)
gtk_list_item_widget_teardown_factory (self);
gtk_list_item_factory_teardown (priv->factory, self);
}
static void
@@ -553,45 +474,6 @@ gtk_list_item_widget_new (GtkListItemFactory *factory,
NULL);
}
typedef struct {
GtkListItemWidget *widget;
guint position;
gpointer item;
gboolean selected;
} GtkListItemWidgetUpdate;
static void
gtk_list_item_widget_update_func (gpointer object,
gpointer data)
{
GtkListItemWidgetUpdate *update = data;
GtkListItem *list_item = object;
/* Track notify manually instead of freeze/thaw_notify for performance reasons. */
gboolean notify_item = FALSE, notify_position = FALSE, notify_selected = FALSE;
GtkListItemWidget *self = update->widget;
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
/* FIXME: It's kinda evil to notify external objects from here... */
if (g_set_object (&priv->item, update->item))
notify_item = TRUE;
if (priv->position != update->position)
{
priv->position = update->position;
notify_position = TRUE;
}
if (priv->selected != update->selected)
{
priv->selected = update->selected;
notify_selected = TRUE;
}
if (list_item)
gtk_list_item_do_notify (list_item, notify_item, notify_position, notify_selected);
}
void
gtk_list_item_widget_update (GtkListItemWidget *self,
guint position,
@@ -599,24 +481,14 @@ gtk_list_item_widget_update (GtkListItemWidget *self,
gboolean selected)
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
GtkListItemWidgetUpdate update = { self, position, item, selected };
gboolean was_selected;
was_selected = priv->selected;
if (priv->list_item)
{
gtk_list_item_factory_update (priv->factory,
G_OBJECT (priv->list_item),
priv->item != NULL,
item != NULL,
gtk_list_item_widget_update_func,
&update);
}
gtk_list_item_factory_update (priv->factory, self, position, item, selected);
else
{
gtk_list_item_widget_update_func (NULL, &update);
}
gtk_list_item_widget_default_update (self, NULL, position, item, selected);
/* don't look at selected variable, it's not reentrancy safe */
if (was_selected != priv->selected)
@@ -632,6 +504,80 @@ gtk_list_item_widget_update (GtkListItemWidget *self,
}
}
void
gtk_list_item_widget_default_setup (GtkListItemWidget *self,
GtkListItem *list_item)
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
priv->list_item = list_item;
list_item->owner = self;
if (list_item->child)
gtk_list_item_widget_add_child (self, list_item->child);
gtk_list_item_widget_set_activatable (self, list_item->activatable);
gtk_list_item_do_notify (list_item,
priv->item != NULL,
priv->position != GTK_INVALID_LIST_POSITION,
priv->selected);
}
void
gtk_list_item_widget_default_teardown (GtkListItemWidget *self,
GtkListItem *list_item)
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
g_assert (priv->list_item == list_item);
priv->list_item = NULL;
list_item->owner = NULL;
if (list_item->child)
gtk_list_item_widget_remove_child (self, list_item->child);
gtk_list_item_widget_set_activatable (self, FALSE);
gtk_list_item_do_notify (list_item,
priv->item != NULL,
priv->position != GTK_INVALID_LIST_POSITION,
priv->selected);
}
void
gtk_list_item_widget_default_update (GtkListItemWidget *self,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected)
{
/* Track notify manually instead of freeze/thaw_notify for performance reasons. */
gboolean notify_item = FALSE, notify_position = FALSE, notify_selected = FALSE;
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
/* FIXME: It's kinda evil to notify external objects from here... */
if (g_set_object (&priv->item, item))
notify_item = TRUE;
if (priv->position != position)
{
priv->position = position;
notify_position = TRUE;
}
if (priv->selected != selected)
{
priv->selected = selected;
notify_selected = TRUE;
}
if (list_item)
gtk_list_item_do_notify (list_item, notify_item, notify_position, notify_selected);
}
void
gtk_list_item_widget_set_factory (GtkListItemWidget *self,
GtkListItemFactory *factory)
@@ -644,7 +590,7 @@ gtk_list_item_widget_set_factory (GtkListItemWidget *self,
if (priv->factory)
{
if (priv->list_item)
gtk_list_item_widget_teardown_factory (self);
gtk_list_item_factory_teardown (factory, self);
g_clear_object (&priv->factory);
}
@@ -653,7 +599,7 @@ gtk_list_item_widget_set_factory (GtkListItemWidget *self,
priv->factory = g_object_ref (factory);
if (gtk_widget_get_root (GTK_WIDGET (self)))
gtk_list_item_widget_setup_factory (self);
gtk_list_item_factory_setup (factory, self);
}
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FACTORY]);
+10
View File
@@ -59,6 +59,16 @@ void gtk_list_item_widget_update (GtkListItemWidg
gboolean selected);
GtkListItem * gtk_list_item_widget_get_list_item (GtkListItemWidget *self);
void gtk_list_item_widget_default_setup (GtkListItemWidget *self,
GtkListItem *list_item);
void gtk_list_item_widget_default_teardown (GtkListItemWidget *self,
GtkListItem *list_item);
void gtk_list_item_widget_default_update (GtkListItemWidget *self,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected);
void gtk_list_item_widget_set_factory (GtkListItemWidget *self,
GtkListItemFactory *factory);
void gtk_list_item_widget_set_single_click_activate
+1 -4
View File
@@ -596,10 +596,7 @@ gtk_list_view_size_allocate (GtkWidget *widget,
/* step 0: exit early if list is empty */
if (gtk_list_item_manager_get_root (self->item_manager) == NULL)
{
gtk_list_base_update_adjustments (GTK_LIST_BASE (self), 0, 0, 0, 0, &x, &y);
return;
}
return;
/* step 1: determine width of the list */
gtk_widget_measure (widget, opposite_orientation,
+8 -13
View File
@@ -220,7 +220,6 @@ gtk_map_list_model_items_changed_cb (GListModel *model,
{
MapNode *node;
guint start, end;
guint count;
if (self->items == NULL)
{
@@ -233,23 +232,22 @@ gtk_map_list_model_items_changed_cb (GListModel *model,
node = gtk_map_list_model_get_nth (self->items, position, &start);
g_assert (start <= position);
count = removed;
while (count > 0)
while (removed > 0)
{
end = start + node->n_items;
if (start == position && end <= position + count)
if (start == position && end <= position + removed)
{
MapNode *next = gtk_rb_tree_node_get_next (node);
count -= node->n_items;
removed -= node->n_items;
gtk_rb_tree_remove (self->items, node);
node = next;
}
else
{
if (end >= position + count)
if (end >= position + removed)
{
node->n_items -= count;
count = 0;
node->n_items -= removed;
removed = 0;
gtk_rb_tree_node_mark_dirty (node);
}
else if (start < position)
@@ -257,7 +255,7 @@ gtk_map_list_model_items_changed_cb (GListModel *model,
guint overlap = node->n_items - (position - start);
node->n_items -= overlap;
gtk_rb_tree_node_mark_dirty (node);
count -= overlap;
removed -= overlap;
start = position;
node = gtk_rb_tree_node_get_next (node);
}
@@ -484,10 +482,7 @@ gtk_map_list_model_clear_node (gpointer _node)
MapNode *node = _node;
if (node->item)
{
g_object_remove_weak_pointer (node->item, &node->item);
node->item = NULL;
}
g_object_remove_weak_pointer (node->item, &node->item);
}
static void
+2 -2
View File
@@ -138,7 +138,7 @@ time_adjustment_changed (GtkAdjustment *adjustment,
if (gtk_adjustment_get_value (adjustment) == (double) gtk_media_stream_get_timestamp (controls->stream) / G_USEC_PER_SEC)
return;
gtk_media_stream_seek (controls->stream,
gtk_media_stream_seek (controls->stream,
gtk_adjustment_get_value (adjustment) * G_USEC_PER_SEC + 0.5);
}
@@ -208,7 +208,7 @@ gtk_media_controls_dispose (GObject *object)
gtk_media_controls_set_media_stream (controls, NULL);
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_MEDIA_CONTROLS);
g_clear_pointer (&controls->box, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_media_controls_parent_class)->dispose (object);
}
+17 -24
View File
@@ -201,10 +201,13 @@ gtk_menu_tracker_item_finalize (GObject *object)
{
GtkMenuTrackerItem *self = GTK_MENU_TRACKER_ITEM (object);
g_clear_pointer (&self->action_namespace, g_free);
g_clear_pointer (&self->action_and_target, g_free);
g_clear_object (&self->observable);
g_clear_object (&self->item);
g_free (self->action_namespace);
g_free (self->action_and_target);
if (self->observable)
g_object_unref (self->observable);
g_object_unref (self->item);
G_OBJECT_CLASS (gtk_menu_tracker_item_parent_class)->finalize (object);
}
@@ -870,27 +873,18 @@ gtk_menu_tracker_opener_finalize (GObject *object)
{
GtkMenuTrackerOpener *opener = (GtkMenuTrackerOpener *)object;
if (opener->item != NULL)
{
GtkMenuTrackerItem *item = g_object_ref (opener->item);
gtk_action_observable_unregister_observer (opener->item->observable,
opener->submenu_action,
(GtkActionObserver *)opener);
g_clear_weak_pointer (&opener->item);
if (GTK_IS_ACTION_MUXER (opener->item->observable))
gtk_action_muxer_change_action_state (GTK_ACTION_MUXER (opener->item->observable),
opener->submenu_action,
g_variant_new_boolean (FALSE));
gtk_action_observable_unregister_observer (item->observable,
opener->submenu_action,
(GtkActionObserver *)opener);
gtk_menu_tracker_item_set_submenu_shown (opener->item, FALSE);
if (GTK_IS_ACTION_MUXER (item->observable))
gtk_action_muxer_change_action_state (GTK_ACTION_MUXER (item->observable),
opener->submenu_action,
g_variant_new_boolean (FALSE));
gtk_menu_tracker_item_set_submenu_shown (item, FALSE);
g_object_unref (item);
}
g_clear_pointer (&opener->submenu_action, g_free);
g_free (opener->submenu_action);
G_OBJECT_CLASS (gtk_menu_tracker_opener_parent_class)->finalize (object);
}
@@ -1001,8 +995,7 @@ gtk_menu_tracker_opener_new (GtkMenuTrackerItem *item,
opener = g_object_new (gtk_menu_tracker_opener_get_type (), NULL);
opener->first_time = TRUE;
g_set_weak_pointer (&opener->item, item);
opener->item = item;
if (item->action_namespace)
opener->submenu_action = g_strjoin (".", item->action_namespace, submenu_action, NULL);
-1
View File
@@ -207,7 +207,6 @@ gtk_password_entry_init (GtkPasswordEntry *entry)
entry->entry = gtk_text_new ();
gtk_text_set_buffer (GTK_TEXT (entry->entry), buffer);
gtk_text_set_visibility (GTK_TEXT (entry->entry), FALSE);
gtk_text_set_input_purpose (GTK_TEXT (entry->entry), GTK_INPUT_PURPOSE_PASSWORD);
gtk_widget_set_parent (entry->entry, GTK_WIDGET (entry));
gtk_editable_init_delegate (GTK_EDITABLE (entry));
g_signal_connect_swapped (entry->entry, "notify::has-focus", G_CALLBACK (focus_changed), entry);
+31 -39
View File
@@ -295,49 +295,12 @@ gtk_picture_get_property (GObject *object,
}
}
static void
gtk_picture_paintable_invalidate_contents (GdkPaintable *paintable,
GtkPicture *self)
{
gtk_widget_queue_draw (GTK_WIDGET (self));
}
static void
gtk_picture_paintable_invalidate_size (GdkPaintable *paintable,
GtkPicture *self)
{
gtk_widget_queue_resize (GTK_WIDGET (self));
}
static void
gtk_picture_clear_paintable (GtkPicture *self)
{
guint flags;
if (self->paintable == NULL)
return;
flags = gdk_paintable_get_flags (self->paintable);
if ((flags & GDK_PAINTABLE_STATIC_CONTENTS) == 0)
g_signal_handlers_disconnect_by_func (self->paintable,
gtk_picture_paintable_invalidate_contents,
self);
if ((flags & GDK_PAINTABLE_STATIC_SIZE) == 0)
g_signal_handlers_disconnect_by_func (self->paintable,
gtk_picture_paintable_invalidate_size,
self);
g_object_unref (self->paintable);
}
static void
gtk_picture_dispose (GObject *object)
{
GtkPicture *self = GTK_PICTURE (object);
gtk_picture_clear_paintable (self);
gtk_picture_set_paintable (self, NULL);
g_clear_object (&self->file);
g_clear_pointer (&self->alternative_text, g_free);
@@ -744,6 +707,20 @@ gtk_picture_set_pixbuf (GtkPicture *self,
g_object_unref (texture);
}
static void
gtk_picture_paintable_invalidate_contents (GdkPaintable *paintable,
GtkPicture *self)
{
gtk_widget_queue_draw (GTK_WIDGET (self));
}
static void
gtk_picture_paintable_invalidate_size (GdkPaintable *paintable,
GtkPicture *self)
{
gtk_widget_queue_resize (GTK_WIDGET (self));
}
/**
* gtk_picture_set_paintable: (attributes org.gtk.Method.set_property=paintable)
* @self: a `GtkPicture`
@@ -770,7 +747,22 @@ gtk_picture_set_paintable (GtkPicture *self,
if (paintable)
g_object_ref (paintable);
gtk_picture_clear_paintable (self);
if (self->paintable)
{
const guint flags = gdk_paintable_get_flags (self->paintable);
if ((flags & GDK_PAINTABLE_STATIC_CONTENTS) == 0)
g_signal_handlers_disconnect_by_func (self->paintable,
gtk_picture_paintable_invalidate_contents,
self);
if ((flags & GDK_PAINTABLE_STATIC_SIZE) == 0)
g_signal_handlers_disconnect_by_func (self->paintable,
gtk_picture_paintable_invalidate_size,
self);
g_object_unref (self->paintable);
}
self->paintable = paintable;
+3 -2
View File
@@ -34,6 +34,7 @@
#include "gtkliststore.h"
#include "gtkcheckbutton.h"
#include "gtkgrid.h"
#include "gtktogglebutton.h"
#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtkstringlist.h"
@@ -628,14 +629,14 @@ deconstruct_widgets (GtkPrinterOptionWidget *widget)
}
static void
check_toggled_cb (GtkCheckButton *check_button,
check_toggled_cb (GtkToggleButton *toggle_button,
GtkPrinterOptionWidget *widget)
{
GtkPrinterOptionWidgetPrivate *priv = widget->priv;
g_signal_handler_block (priv->source, priv->source_changed_handler);
gtk_printer_option_set_boolean (priv->source,
gtk_check_button_get_active (check_button));
gtk_toggle_button_get_active (toggle_button));
g_signal_handler_unblock (priv->source, priv->source_changed_handler);
emit_changed (widget);
}
+1 -4
View File
@@ -942,7 +942,6 @@ static void
gtk_print_unix_dialog_finalize (GObject *object)
{
GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (object);
GList *iter;
unschedule_idle_mark_conflicts (dialog);
disconnect_printer_details_request (dialog, FALSE);
@@ -968,9 +967,7 @@ gtk_print_unix_dialog_finalize (GObject *object)
g_clear_pointer (&dialog->waiting_for_printer, (GDestroyNotify)g_free);
g_clear_pointer (&dialog->format_for_printer, (GDestroyNotify)g_free);
for (iter = dialog->print_backends; iter != NULL; iter = iter->next)
gtk_print_backend_destroy (GTK_PRINT_BACKEND (iter->data));
g_list_free_full (dialog->print_backends, g_object_unref);
g_list_free (dialog->print_backends);
dialog->print_backends = NULL;
g_clear_object (&dialog->page_setup_list);
+2 -2
View File
@@ -794,7 +794,7 @@ gtk_search_entry_get_key_capture_widget (GtkSearchEntry *entry)
}
/**
* gtk_search_entry_set_search_delay: (attributes org.gtk.Property.set_property=search-delay)
* gtk_search_entry_set_search_delay:
* @entry: a `GtkSearchEntry`
* @delay: a delay in milliseconds
*
@@ -821,7 +821,7 @@ gtk_search_entry_set_search_delay (GtkSearchEntry *entry,
}
/**
* gtk_search_entry_get_search_delay: (attributes org.gtk.Property.get_property=search-delay)
* gtk_search_entry_get_search_delay
* @entry: a `GtkSearchEntry`
*
* Get the delay to be used between the last keypress and the
+1 -1
View File
@@ -585,7 +585,7 @@ gtk_shortcut_controller_class_init (GtkShortcutControllerClass *klass)
controller_class->unset_widget = gtk_shortcut_controller_unset_widget;
/**
* GtkShortcutController:item-type:
* GtkShortCutController:item-type:
*
* The type of items. See [method@Gio.ListModel.get_item_type].
*
+37 -43
View File
@@ -103,49 +103,45 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void
gtk_signal_list_item_factory_setup (GtkListItemFactory *factory,
GObject *item,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
g_signal_emit (factory, signals[SETUP], 0, item);
g_signal_emit (factory, signals[SETUP], 0, list_item);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->setup (factory, item, bind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->setup (factory, widget, list_item);
if (bind)
g_signal_emit (factory, signals[BIND], 0, item);
if (gtk_list_item_get_item (list_item))
g_signal_emit (factory, signals[BIND], 0, list_item);
}
static void
gtk_signal_list_item_factory_update (GtkListItemFactory *factory,
GObject *item,
gboolean unbind,
gboolean bind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item,
guint position,
gpointer item,
gboolean selected)
{
if (unbind)
g_signal_emit (factory, signals[UNBIND], 0, item);
if (gtk_list_item_get_item (list_item))
g_signal_emit (factory, signals[UNBIND], 0, list_item);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->update (factory, item, unbind, bind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->update (factory, widget, list_item, position, item, selected);
if (bind)
g_signal_emit (factory, signals[BIND], 0, item);
if (item)
g_signal_emit (factory, signals[BIND], 0, list_item);
}
static void
gtk_signal_list_item_factory_teardown (GtkListItemFactory *factory,
GObject *item,
gboolean unbind,
GFunc func,
gpointer data)
GtkListItemWidget *widget,
GtkListItem *list_item)
{
if (unbind)
g_signal_emit (factory, signals[UNBIND], 0, item);
if (gtk_list_item_get_item (list_item))
g_signal_emit (factory, signals[UNBIND], 0, list_item);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->teardown (factory, item, unbind, func, data);
GTK_LIST_ITEM_FACTORY_CLASS (gtk_signal_list_item_factory_parent_class)->teardown (factory, widget, list_item);
g_signal_emit (factory, signals[TEARDOWN], 0, item);
g_signal_emit (factory, signals[TEARDOWN], 0, list_item);
}
static void
@@ -160,7 +156,7 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
/**
* GtkSignalListItemFactory::setup:
* @self: The `GtkSignalListItemFactory`
* @object: The `GObject` to set up
* @listitem: The `GtkListItem` to set up
*
* Emitted when a new listitem has been created and needs to be setup for use.
*
@@ -177,7 +173,7 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GTK_TYPE_LIST_ITEM);
g_signal_set_va_marshaller (signals[SETUP],
G_TYPE_FROM_CLASS (klass),
g_cclosure_marshal_VOID__OBJECTv);
@@ -185,14 +181,13 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
/**
* GtkSignalListItemFactory::bind:
* @self: The `GtkSignalListItemFactory`
* @object: The `GObject` to bind
* @listitem: The `GtkListItem` to bind
*
* Emitted when an object has been bound, for example when a
* new [property@Gtk.ListItem:item] has been set on a
* `GtkListItem` and should be bound for use.
* Emitted when a new [property@Gtk.ListItem:item] has been set
* on the @listitem and should be bound for use.
*
* After this signal was emitted, the object might be shown in
* a [class@Gtk.ListView] or other widget.
* After this signal was emitted, the listitem might be shown in
* a [class@Gtk.ListView] or other list widget.
*
* The [signal@Gtk.SignalListItemFactory::unbind] signal is the
* opposite of this signal and can be used to undo everything done
@@ -206,7 +201,7 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GTK_TYPE_LIST_ITEM);
g_signal_set_va_marshaller (signals[BIND],
G_TYPE_FROM_CLASS (klass),
g_cclosure_marshal_VOID__OBJECTv);
@@ -214,10 +209,9 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
/**
* GtkSignalListItemFactory::unbind:
* @self: The `GtkSignalListItemFactory`
* @object: The `GObject` to unbind
* @listitem: The `GtkListItem` to unbind
*
* Emitted when a object has been unbound from its item, for example when
* a listitem was removed from use in a list widget
* Emitted when a listitem has been removed from use in a list widget
* and its new [property@Gtk.ListItem:item] is about to be unset.
*
* This signal is the opposite of the [signal@Gtk.SignalListItemFactory::bind]
@@ -231,7 +225,7 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GTK_TYPE_LIST_ITEM);
g_signal_set_va_marshaller (signals[UNBIND],
G_TYPE_FROM_CLASS (klass),
g_cclosure_marshal_VOID__OBJECTv);
@@ -239,11 +233,11 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
/**
* GtkSignalListItemFactory::teardown:
* @self: The `GtkSignalListItemFactory`
* @object: The `GObject` to tear down
* @listitem: The `GtkListItem` to teardown
*
* Emitted when an object is about to be destroyed.
* Emitted when a listitem is about to be destroyed.
*
* It is the last signal ever emitted for this @object.
* It is the last signal ever emitted for this @listitem.
*
* This signal is the opposite of the [signal@Gtk.SignalListItemFactory::setup]
* signal and should be used to undo everything done in that signal.
@@ -256,7 +250,7 @@ gtk_signal_list_item_factory_class_init (GtkSignalListItemFactoryClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GTK_TYPE_LIST_ITEM);
g_signal_set_va_marshaller (signals[TEARDOWN],
G_TYPE_FROM_CLASS (klass),
g_cclosure_marshal_VOID__OBJECTv);
+8 -21
View File
@@ -395,20 +395,6 @@ gtk_stack_page_set_property (GObject *object,
break;
}
}
static void
gtk_stack_page_constructed (GObject *gobject)
{
GtkStackPage *self = GTK_STACK_PAGE (gobject);
if (G_UNLIKELY (self->widget == NULL))
g_error ("GtkStackPage '%s' [%p] is missing a child widget",
self->name != NULL ? self->name : "<unnamed>",
self);
G_OBJECT_CLASS (gtk_stack_page_parent_class)->constructed (gobject);
}
static void
gtk_stack_page_class_init (GtkStackPageClass *class)
{
@@ -418,7 +404,6 @@ gtk_stack_page_class_init (GtkStackPageClass *class)
object_class->dispose = gtk_stack_page_dispose;
object_class->get_property = gtk_stack_page_get_property;
object_class->set_property = gtk_stack_page_set_property;
object_class->constructed = gtk_stack_page_constructed;
/**
* GtkStackPage:child: (attributes org.gtk.Property.get=gtk_stack_page_get_child)
@@ -1558,11 +1543,13 @@ gtk_stack_add_internal (GtkStack *stack,
g_return_val_if_fail (child != NULL, NULL);
child_info = g_object_new (GTK_TYPE_STACK_PAGE,
"child", child,
"name", name,
"title", title,
NULL);
child_info = g_object_new (GTK_TYPE_STACK_PAGE, NULL);
child_info->widget = g_object_ref (child);
child_info->name = g_strdup (name);
child_info->title = g_strdup (title);
child_info->icon_name = NULL;
child_info->needs_attention = FALSE;
child_info->last_focus = NULL;
gtk_stack_add_page (stack, child_info);
@@ -2640,7 +2627,7 @@ gtk_stack_measure (GtkWidget *widget,
int min_for_size;
gtk_widget_measure (child, OPPOSITE_ORIENTATION (orientation), -1, &min_for_size, NULL, NULL, NULL);
gtk_widget_measure (child, orientation, MAX (min_for_size, for_size), &child_min, &child_nat, NULL, NULL);
}
else
+6 -6
View File
@@ -143,7 +143,7 @@ gtk_statusbar_dispose (GObject *object)
g_slist_free_full (self->keys, g_free);
self->keys = NULL;
gtk_widget_dispose_template (GTK_WIDGET (self), GTK_TYPE_STATUSBAR);
g_clear_pointer (&self->message_area, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
}
@@ -225,7 +225,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
*
* Returns: the new `GtkStatusbar`
*/
GtkWidget*
GtkWidget*
gtk_statusbar_new (void)
{
return g_object_new (GTK_TYPE_STATUSBAR, NULL);
@@ -263,7 +263,7 @@ gtk_statusbar_get_context_id (GtkStatusbar *statusbar,
{
char *string;
guint id;
g_return_val_if_fail (GTK_IS_STATUSBAR (statusbar), 0);
g_return_val_if_fail (context_description != NULL, 0);
@@ -417,18 +417,18 @@ gtk_statusbar_remove (GtkStatusbar *statusbar,
gtk_statusbar_pop (statusbar, context_id);
return;
}
for (list = statusbar->messages; list; list = list->next)
{
msg = list->data;
if (msg->context_id == context_id &&
msg->message_id == message_id)
{
statusbar->messages = g_slist_remove_link (statusbar->messages, list);
gtk_statusbar_msg_free (msg);
g_slist_free_1 (list);
break;
}
}
+7 -57
View File
@@ -4291,9 +4291,7 @@ gtk_text_view_measure (GtkWidget *widget,
static void
gtk_text_view_compute_child_allocation (GtkTextView *text_view,
const AnchoredChild *vc,
GtkAllocation *allocation,
int gutter_width,
int gutter_height)
GtkAllocation *allocation)
{
int buffer_y;
GtkTextIter iter;
@@ -4308,8 +4306,8 @@ gtk_text_view_compute_child_allocation (GtkTextView *text_view,
buffer_y += vc->from_top_of_line;
allocation->x = vc->from_left_of_buffer - text_view->priv->xoffset + gutter_width;
allocation->y = buffer_y - text_view->priv->yoffset + gutter_height;
allocation->x = vc->from_left_of_buffer - text_view->priv->xoffset;
allocation->y = buffer_y - text_view->priv->yoffset;
gtk_widget_get_preferred_size (vc->widget, &req, NULL);
allocation->width = req.width;
@@ -4318,13 +4316,11 @@ gtk_text_view_compute_child_allocation (GtkTextView *text_view,
static void
gtk_text_view_update_child_allocation (GtkTextView *text_view,
const AnchoredChild *vc,
int gutter_width,
int gutter_height)
const AnchoredChild *vc)
{
GtkAllocation allocation;
gtk_text_view_compute_child_allocation (text_view, vc, &allocation, gutter_width, gutter_height);
gtk_text_view_compute_child_allocation (text_view, vc, &allocation);
gtk_widget_size_allocate (vc->widget, &allocation, -1);
@@ -4337,44 +4333,6 @@ gtk_text_view_update_child_allocation (GtkTextView *text_view,
#endif
}
static void
calculate_gutter_offsets (GtkTextView *text_view,
int *width,
int *height)
{
GtkWidget *x_gutter;
GtkWidget *y_gutter;
g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
g_return_if_fail (width != NULL && height != NULL);
x_gutter = gtk_text_view_get_gutter (text_view, GTK_TEXT_WINDOW_LEFT);
if (x_gutter != NULL)
{
GtkRequisition x_req = {0};
gtk_widget_get_preferred_size (x_gutter, &x_req, NULL);
*width = x_req.width;
}
else
{
*width = 0;
}
y_gutter = gtk_text_view_get_gutter (text_view, GTK_TEXT_WINDOW_TOP);
if (y_gutter != NULL)
{
GtkRequisition y_req = {0};
gtk_widget_get_preferred_size (y_gutter, &y_req, NULL);
*height = y_req.height;
}
else
{
*height = 0;
}
}
static void
gtk_anchored_child_allocated (GtkTextLayout *layout,
GtkWidget *child,
@@ -4384,10 +4342,6 @@ gtk_anchored_child_allocated (GtkTextLayout *layout,
{
AnchoredChild *vc = NULL;
GtkTextView *text_view = data;
int x_offset = 0;
int y_offset = 0;
calculate_gutter_offsets (text_view, &x_offset, &y_offset);
/* x,y is the position of the child from the top of the line, and
* from the left of the buffer. We have to translate that into text
@@ -4403,7 +4357,7 @@ gtk_anchored_child_allocated (GtkTextLayout *layout,
vc->from_left_of_buffer = x;
vc->from_top_of_line = y;
gtk_text_view_update_child_allocation (text_view, vc, x_offset, y_offset);
gtk_text_view_update_child_allocation (text_view, vc);
}
static void
@@ -4904,10 +4858,6 @@ changed_handler (GtkTextLayout *layout,
GtkTextIter first;
int new_first_para_top;
int old_first_para_top;
int x_offset = 0;
int y_offset = 0;
calculate_gutter_offsets (text_view, &x_offset, &y_offset);
/* If the bottom of the old area was above the top of the
* screen, we need to scroll to keep the current top of the
@@ -4937,7 +4887,7 @@ changed_handler (GtkTextLayout *layout,
for (iter = priv->anchored_children.head; iter; iter = iter->next)
{
const AnchoredChild *ac = iter->data;
gtk_text_view_update_child_allocation (text_view, ac, x_offset, y_offset);
gtk_text_view_update_child_allocation (text_view, ac);
}
gtk_widget_queue_resize (widget);
+12 -106
View File
@@ -386,29 +386,11 @@
* static void
* foo_widget_init (FooWidget *self)
* {
* // ...
* gtk_widget_init_template (GTK_WIDGET (self));
*
* // Initialize the rest of the widget...
* }
* ```
*
* as well as calling [method@Gtk.Widget.dispose_template] from the dispose
* function:
*
* ```c
* static void
* foo_widget_dispose (GObject *gobject)
* {
* FooWidget *self = FOO_WIDGET (gobject);
*
* // Dispose objects for which you have a reference...
*
* // Clear the template children for this widget type
* gtk_widget_dispose_template (GTK_WIDGET (self), FOO_TYPE_WIDGET);
*
* G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
* }
*
* You can access widgets defined in the template using the
* [id@gtk_widget_get_template_child] function, but you will typically declare
* a pointer in the instance private data structure of your type using the same
@@ -426,19 +408,9 @@
* G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)
*
* static void
* foo_widget_dispose (GObject *gobject)
* {
* gtk_widget_dispose_template (GTK_WIDGET (gobject), FOO_TYPE_WIDGET);
*
* G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject);
* }
*
* static void
* foo_widget_class_init (FooWidgetClass *klass)
* {
* // ...
* G_OBJECT_CLASS (klass)->dispose = foo_widget_dispose;
*
* gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
* "/com/example/ui/foowidget.ui");
* gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
@@ -450,7 +422,7 @@
* static void
* foo_widget_init (FooWidget *widget)
* {
* gtk_widget_init_template (GTK_WIDGET (widget));
*
* }
* ```
*
@@ -7465,7 +7437,16 @@ gtk_widget_real_destroy (GtkWidget *object)
GObject *child_object = gtk_widget_get_template_child (widget,
class_type,
child_class->name);
if (G_IS_OBJECT (child_object))
g_assert (child_object);
if (!G_IS_OBJECT (child_object))
{
g_critical ("Automated component '%s' of class '%s' seems to"
" have been prematurely finalized",
child_class->name, g_type_name (class_type));
}
else
{
FinalizeAssertion *assertion = g_slice_new0 (FinalizeAssertion);
assertion->child_class = child_class;
@@ -10997,81 +10978,6 @@ out:
g_object_unref (builder);
}
/**
* gtk_widget_dispose_template:
* @widget: the widget with a template
* @widget_type: the type of the widget to finalize the template for
*
* Clears the template children for the given widget.
*
* This function is the opposite of [method@Gtk.Widget.init_template], and
* it is used to clear all the template children from a widget instance.
* If you bound a template child to a field in the instance structure, or
* in the instance private data structure, the field will be set to `NULL`
* after this function returns.
*
* You should call this function inside the `GObjectClass.dispose()`
* implementation of any widget that called `gtk_widget_init_template()`.
* Typically, you will want to call this function last, right before
* chaining up to the parent type's dispose implementation, e.g.
*
* ```c
* static void
* some_widget_dispose (GObject *gobject)
* {
* SomeWidget *self = SOME_WIDGET (gobject);
*
* // Clear the template data for SomeWidget
* gtk_widget_dispose_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);
*
* G_OBJECT_CLASS (some_widget_parent_class)->dispose (gobject);
* }
* ```
*
* Since: 4.8
*/
void
gtk_widget_dispose_template (GtkWidget *widget,
GType widget_type)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (g_type_name (widget_type) != NULL);
GtkWidgetTemplate *template = GTK_WIDGET_GET_CLASS (widget)->priv->template;
g_return_if_fail (template != NULL);
/* Tear down the automatic child data */
GHashTable *auto_child_hash = get_auto_child_hash (widget, widget_type, FALSE);
for (GSList *l = template->children; l != NULL; l = l->next)
{
AutomaticChildClass *child_class = l->data;
/* This will drop the reference on the template children */
if (auto_child_hash != NULL)
{
gpointer child = g_hash_table_lookup (auto_child_hash, child_class->name);
g_assert (child != NULL);
/* We have to explicitly unparent direct children of this widget */
if (GTK_IS_WIDGET (child) && _gtk_widget_get_parent (child) == widget)
gtk_widget_unparent (child);
g_hash_table_remove (auto_child_hash, child_class->name);
}
/* Nullify the field last, to avoid re-entrancy issues */
if (child_class->offset != 0)
{
gpointer field_p;
field_p = G_STRUCT_MEMBER_P (widget, child_class->offset);
(* (gpointer *) field_p) = NULL;
}
}
}
/**
* gtk_widget_class_set_template:
* @widget_class: A `GtkWidgetClass`
-3
View File
@@ -833,9 +833,6 @@ GDK_AVAILABLE_IN_ALL
GObject *gtk_widget_get_template_child (GtkWidget *widget,
GType widget_type,
const char *name);
GDK_AVAILABLE_IN_4_8
void gtk_widget_dispose_template (GtkWidget *widget,
GType widget_type);
GDK_AVAILABLE_IN_ALL
void gtk_widget_class_set_template (GtkWidgetClass *widget_class,
GBytes *template_bytes);
+1 -1
View File
@@ -462,7 +462,7 @@ dispose (GObject *o)
g_clear_object (&sl->object);
gtk_widget_dispose_template (GTK_WIDGET (o), GTK_TYPE_INSPECTOR_A11Y);
g_clear_pointer (&sl->box, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_inspector_a11y_parent_class)->dispose (o);
}
+3 -1
View File
@@ -420,12 +420,14 @@ static void
dispose (GObject *object)
{
GtkInspectorActions *sl = GTK_INSPECTOR_ACTIONS (object);
GtkWidget *child;
g_clear_object (&sl->sorted);
g_clear_object (&sl->actions);
g_clear_object (&sl->object);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_ACTIONS);
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (gtk_inspector_actions_parent_class)->dispose (object);
}
+2 -2
View File
@@ -221,7 +221,7 @@ add_content_type_row (GtkInspectorClipboard *self,
{
GtkEventController *controller = gtk_drop_controller_motion_new ();
g_signal_connect (controller, "enter", G_CALLBACK (on_drop_row_enter), viewer);
gtk_widget_add_controller (vbox, controller);
gtk_widget_add_controller (vbox, controller);
gtk_widget_set_visible (viewer, FALSE);
@@ -355,7 +355,7 @@ gtk_inspector_clipboard_dispose (GObject *object)
gtk_inspector_clipboard_unset_display (self);
gtk_widget_dispose_template (GTK_WIDGET (self), GTK_TYPE_INSPECTOR_CLIPBOARD);
g_clear_pointer (&self->swin, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_inspector_clipboard_parent_class)->dispose (object);
}
+2 -2
View File
@@ -1087,6 +1087,8 @@ gtk_inspector_general_dispose (GObject *object)
GtkInspectorGeneral *gen = GTK_INSPECTOR_GENERAL (object);
GList *list, *l;
g_clear_pointer (&gen->swin, gtk_widget_unparent);
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_added), gen);
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_removed), gen);
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (populate_display_notify_cb), gen);
@@ -1097,8 +1099,6 @@ gtk_inspector_general_dispose (GObject *object)
disconnect_seat (gen, GDK_SEAT (l->data));
g_list_free (list);
gtk_widget_dispose_template (GTK_WIDGET (gen), GTK_TYPE_INSPECTOR_GENERAL);
G_OBJECT_CLASS (gtk_inspector_general_parent_class)->dispose (object);
}
+3 -1
View File
@@ -190,8 +190,10 @@ static void
dispose (GObject *object)
{
GtkInspectorListData *sl = GTK_INSPECTOR_LIST_DATA (object);
GtkWidget *child;
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_LIST_DATA);
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (gtk_inspector_list_data_parent_class)->dispose (object);
}
+4 -1
View File
@@ -99,7 +99,10 @@ gtk_inspector_logs_init (GtkInspectorLogs *logs)
static void
dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), GTK_TYPE_INSPECTOR_LOGS);
GtkWidget *child;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (object))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (gtk_inspector_logs_parent_class)->dispose (object);
}
+4 -12
View File
@@ -120,7 +120,7 @@ format_state_flags (GtkStateFlags state)
g_string_append (str, " | ");
g_string_append (str, fclass->values[i].value_nick);
}
}
}
g_type_class_unref (fclass);
}
else
@@ -165,15 +165,7 @@ update_allocation (GtkWidget *w,
gtk_label_set_label (GTK_LABEL (sl->request_mode), value->value_nick);
g_type_class_unref (class);
if (gtk_widget_get_visible (sl->measure_row))
gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), w);
}
static void
measure_graph_measure (GtkWidget *button,
GtkInspectorMiscInfo *sl)
{
gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), GTK_WIDGET (sl->object));
gtk_inspector_measure_graph_measure (GTK_INSPECTOR_MEASURE_GRAPH (sl->measure_graph), w);
}
static void
@@ -508,6 +500,7 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
gtk_widget_show (sl->state_row);
gtk_widget_show (sl->direction_row);
gtk_widget_show (sl->request_mode_row);
gtk_widget_show (sl->measure_row);
gtk_widget_show (sl->allocated_size_row);
gtk_widget_show (sl->baseline_row);
gtk_widget_show (sl->mnemonic_label_row);
@@ -603,7 +596,7 @@ dispose (GObject *o)
{
GtkInspectorMiscInfo *sl = GTK_INSPECTOR_MISC_INFO (o);
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_MISC_INFO);
g_clear_pointer (&sl->swin, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_inspector_misc_info_parent_class)->dispose (o);
}
@@ -669,7 +662,6 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
gtk_widget_class_bind_template_callback (widget_class, update_measure_picture);
gtk_widget_class_bind_template_callback (widget_class, measure_picture_drag_prepare);
gtk_widget_class_bind_template_callback (widget_class, measure_graph_measure);
gtk_widget_class_bind_template_callback (widget_class, show_surface);
gtk_widget_class_bind_template_callback (widget_class, show_renderer);
gtk_widget_class_bind_template_callback (widget_class, show_frame_clock);
-10
View File
@@ -273,15 +273,6 @@
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="measure_show">
<property name="label" translatable="yes">Show</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<signal name="clicked" handler="update_measure_picture" swapped="yes" after="1" object="measure_picture"/>
<signal name="clicked" handler="measure_graph_measure" after="1"/>
</object>
</child>
<child>
<object class="GtkToggleButton" id="measure_expand_toggle">
<property name="label" translatable="yes">Expand</property>
@@ -297,7 +288,6 @@
<child>
<object class="GtkListBoxRow" id="measure_row">
<property name="activatable">0</property>
<property name="visible" bind-source="measure_show" bind-property="active" bind-flags="sync-create"/>
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
+1 -2
View File
@@ -2039,12 +2039,11 @@ gtk_inspector_recorder_dispose (GObject *object)
{
GtkInspectorRecorder *recorder = GTK_INSPECTOR_RECORDER (object);
g_clear_pointer (&recorder->box, gtk_widget_unparent);
g_clear_object (&recorder->render_node_model);
g_clear_object (&recorder->render_node_root_model);
g_clear_object (&recorder->render_node_selection);
gtk_widget_dispose_template (GTK_WIDGET (recorder), GTK_TYPE_INSPECTOR_RECORDER);
G_OBJECT_CLASS (gtk_inspector_recorder_parent_class)->dispose (object);
}
+4 -5
View File
@@ -695,12 +695,12 @@ constructed (GObject *object)
GListModel *sort_model;
GtkSorter *column_sorter;
GtkSorter *sorter;
g_signal_connect (rl->open_details_button, "clicked",
G_CALLBACK (open_details), rl);
g_signal_connect (rl->close_details_button, "clicked",
G_CALLBACK (close_details), rl);
rl->tree_model = gtk_tree_list_model_new (load_resources (),
FALSE,
FALSE,
@@ -745,7 +745,7 @@ set_property (GObject *object,
GParamSpec *pspec)
{
GtkInspectorResourceList *rl = GTK_INSPECTOR_RESOURCE_LIST (object);
switch (param_id)
{
case PROP_BUTTONS:
@@ -765,11 +765,10 @@ dispose (GObject *object)
{
GtkInspectorResourceList *rl = GTK_INSPECTOR_RESOURCE_LIST (object);
g_clear_pointer (&rl->stack, gtk_widget_unparent);
g_clear_object (&rl->selection);
g_clear_object (&rl->tree_model);
gtk_widget_dispose_template (GTK_WIDGET (rl), GTK_TYPE_INSPECTOR_RESOURCE_LIST);
G_OBJECT_CLASS (gtk_inspector_resource_list_parent_class)->dispose (object);
}
+4 -2
View File
@@ -100,7 +100,7 @@ add_columns (GtkInspectorTreeData *sl)
gtk_tree_view_column_set_cell_data_func (col, cell, cell_data_func, sl, NULL);
gtk_tree_view_append_column (sl->view, col);
g_free (title);
}
}
}
static void
@@ -175,8 +175,10 @@ static void
dispose (GObject *object)
{
GtkInspectorTreeData *sl = GTK_INSPECTOR_TREE_DATA (object);
GtkWidget *child;
gtk_widget_dispose_template (GTK_WIDGET (sl), GTK_TYPE_INSPECTOR_TREE_DATA);
while ((child = gtk_widget_get_first_child (GTK_WIDGET (sl))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (gtk_inspector_tree_data_parent_class)->dispose (object);
}
+8 -8
View File
@@ -1077,7 +1077,7 @@ inspect_inspector (GtkButton *button,
inspector_window = gtk_inspector_window_get (gtk_widget_get_display (GTK_WIDGET (button)));
gtk_window_present (GTK_WINDOW (inspector_window));
}
static void
gtk_inspector_visual_init (GtkInspectorVisual *vis)
{
@@ -1091,12 +1091,12 @@ gtk_inspector_visual_constructed (GObject *object)
G_OBJECT_CLASS (gtk_inspector_visual_parent_class)->constructed (object);
g_signal_connect (vis->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->misc_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->visual_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->debug_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->misc_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->misc_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->visual_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->debug_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->misc_box, "row-activated", G_CALLBACK (row_activated), vis);
}
static void
@@ -1134,7 +1134,7 @@ gtk_inspector_visual_dispose (GObject *object)
{
GtkInspectorVisual *vis = GTK_INSPECTOR_VISUAL (object);
gtk_widget_dispose_template (GTK_WIDGET (vis), GTK_TYPE_INSPECTOR_VISUAL);
g_clear_pointer (&vis->swin, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_inspector_visual_parent_class)->dispose (object);
}
+1 -2
View File
@@ -311,11 +311,10 @@ gtk_inspector_window_dispose (GObject *object)
g_object_set_data (G_OBJECT (iw->inspected_display), "-gtk-inspector", NULL);
g_clear_pointer (&iw->top_stack, gtk_widget_unparent);
g_clear_object (&iw->flash_overlay);
g_clear_pointer (&iw->objects, g_array_unref);
gtk_widget_dispose_template (GTK_WIDGET (iw), GTK_TYPE_INSPECTOR_WINDOW);
G_OBJECT_CLASS (gtk_inspector_window_parent_class)->dispose (object);
}
+20 -1
View File
@@ -9,7 +9,6 @@ typedef struct {
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
/* These don't include ss01 - ss19 and cv01 - cv99 */
static NamedTag open_type_layout_features[] = {
{ MAKE_TAG('a','a','l','t'), NC_("OpenType layout", "Access All Alternates") },
{ MAKE_TAG('a','b','v','f'), NC_("OpenType layout", "Above-base Forms") },
@@ -108,6 +107,26 @@ static NamedTag open_type_layout_features[] = {
{ MAKE_TAG('s','i','z','e'), NC_("OpenType layout", "Optical size") },
{ MAKE_TAG('s','m','c','p'), NC_("OpenType layout", "Small Capitals") },
{ MAKE_TAG('s','m','p','l'), NC_("OpenType layout", "Simplified Forms") },
{ MAKE_TAG('s','s','0','1'), NC_("OpenType layout", "Stylistic Set 1") },
{ MAKE_TAG('s','s','0','2'), NC_("OpenType layout", "Stylistic Set 2") },
{ MAKE_TAG('s','s','0','3'), NC_("OpenType layout", "Stylistic Set 3") },
{ MAKE_TAG('s','s','0','4'), NC_("OpenType layout", "Stylistic Set 4") },
{ MAKE_TAG('s','s','0','5'), NC_("OpenType layout", "Stylistic Set 5") },
{ MAKE_TAG('s','s','0','6'), NC_("OpenType layout", "Stylistic Set 6") },
{ MAKE_TAG('s','s','0','7'), NC_("OpenType layout", "Stylistic Set 7") },
{ MAKE_TAG('s','s','0','8'), NC_("OpenType layout", "Stylistic Set 8") },
{ MAKE_TAG('s','s','0','9'), NC_("OpenType layout", "Stylistic Set 9") },
{ MAKE_TAG('s','s','1','0'), NC_("OpenType layout", "Stylistic Set 10") },
{ MAKE_TAG('s','s','1','1'), NC_("OpenType layout", "Stylistic Set 11") },
{ MAKE_TAG('s','s','1','2'), NC_("OpenType layout", "Stylistic Set 12") },
{ MAKE_TAG('s','s','1','3'), NC_("OpenType layout", "Stylistic Set 13") },
{ MAKE_TAG('s','s','1','4'), NC_("OpenType layout", "Stylistic Set 14") },
{ MAKE_TAG('s','s','1','5'), NC_("OpenType layout", "Stylistic Set 15") },
{ MAKE_TAG('s','s','1','6'), NC_("OpenType layout", "Stylistic Set 16") },
{ MAKE_TAG('s','s','1','7'), NC_("OpenType layout", "Stylistic Set 17") },
{ MAKE_TAG('s','s','1','8'), NC_("OpenType layout", "Stylistic Set 18") },
{ MAKE_TAG('s','s','1','9'), NC_("OpenType layout", "Stylistic Set 19") },
{ MAKE_TAG('s','s','2','0'), NC_("OpenType layout", "Stylistic Set 20") },
{ MAKE_TAG('s','s','t','y'), NC_("OpenType layout", "Math script style alternates") },
{ MAKE_TAG('s','t','c','h'), NC_("OpenType layout", "Stretching Glyph Decomposition") },
{ MAKE_TAG('s','u','b','s'), NC_("OpenType layout", "Subscript") },
+1 -1
View File
@@ -173,7 +173,7 @@ label {
> selection {
background-color: $backdrop_selected_bg_color;
color: transparent;
color: $selected_fg_color;
&:focus-within {
background-color: $selected_text_bg_color;
}
+1 -1
View File
@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.7.1',
version: '4.7.0',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
+1 -7
View File
@@ -292,15 +292,9 @@ gtk_ff_media_file_decode_frame (GtkFfMediaFile *video,
if (errnum >= 0)
{
errnum = avcodec_receive_frame (video->codec_ctx, frame);
if (errnum == AVERROR (EAGAIN))
{
// Just retry with the next packet
errnum = 0;
continue;
}
if (errnum < 0)
G_BREAKPOINT();
else
if (errnum >= 0)
{
av_packet_unref (&packet);
break;
+89 -113
View File
@@ -12,8 +12,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.6\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-06-25 00:19+0000\n"
"PO-Revision-Date: 2022-06-28 15:00+0430\n"
"POT-Creation-Date: 2022-06-10 06:06+0000\n"
"PO-Revision-Date: 2022-06-13 11:14+0430\n"
"Last-Translator: Danial Behzadi <dani.behzi@ubuntu.com>\n"
"Language-Team: Persian <>\n"
"Language: fa\n"
@@ -23,7 +23,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-Bookmarks: 133,-1,-1,-1,-1,-1,-1,-1,-1,-1\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 3.1\n"
"X-Generator: Poedit 3.0.1\n"
#: gdk/broadway/gdkbroadway-server.c:135
#, c-format
@@ -641,8 +641,8 @@ msgstr "نتوانست دادهٔ تخته‌گیره را تنظیم کند. م
#, c-format
msgid "Cannot get clipboard data. Clipboard data changed before we could get it."
msgstr ""
"نتوانست دادهٔ تخته‌گیره را بگیرد. داده‌ّای تخته‌گیره پیش از این که بتوانیم بگیریمشان "
"عوض شدند."
"نتوانست دادهٔ تخته‌گیره را بگیرد. داده‌ّای تخته‌گیره پیش از این که بتوانیم بگیریمشان عوض "
"شدند."
#: gdk/win32/gdkclipdrop-win32.c:969
#, c-format
@@ -710,8 +710,7 @@ msgstr "در حال نوشتن روی جریان بسته‌شده"
msgid "g_try_realloc () failed"
msgstr "g_try_realloc () شکست خورد"
#: gdk/win32/gdkhdataoutputstream-win32.c:93
#: gdk/win32/gdkhdataoutputstream-win32.c:231
#: gdk/win32/gdkhdataoutputstream-win32.c:93 gdk/win32/gdkhdataoutputstream-win32.c:231
msgid "GlobalReAlloc() failed: "
msgstr "GlobalReAlloc() شکست خورد: "
@@ -2083,8 +2082,8 @@ msgstr "یک پرونده با همان نام در حال حاضر وجود د
#: gtk/gtkmessagedialog.c:166 gtk/gtkmessagedialog.c:175 gtk/gtkmountoperation.c:604
#: gtk/gtkpagesetupunixdialog.c:283 gtk/gtkprintbackend.c:640
#: gtk/gtkprinteroptionwidget.c:722 gtk/gtkprintunixdialog.c:651
#: gtk/gtkprintunixdialog.c:807 gtk/gtkwindow.c:6110 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1723 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/gtkprintunixdialog.c:807 gtk/gtkwindow.c:6106 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1721 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:33
#: gtk/ui/gtkfontchooserdialog.ui:24
msgid "_Cancel"
@@ -2096,7 +2095,7 @@ msgid "_Open"
msgstr "_گشودن"
#: gtk/gtkfilechoosernative.c:574 gtk/inspector/css-editor.c:249
#: gtk/inspector/recorder.c:1724
#: gtk/inspector/recorder.c:1722
msgid "_Save"
msgstr "_ذخیره"
@@ -2172,8 +2171,8 @@ msgstr "آیا مطمئنید که می‌خواهید برای همیشه «%s
msgid "If you delete an item, it will be permanently lost."
msgstr "اگر موردی را پاک کنید، برای همیشه از دست خواهد رفت."
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827
#: gtk/gtklabel.c:5627 gtk/gtktext.c:6041 gtk/gtktextview.c:8914
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827 gtk/gtklabel.c:5627
#: gtk/gtktext.c:6041 gtk/gtktextview.c:8914
msgid "_Delete"
msgstr "_حذف"
@@ -2297,8 +2296,7 @@ msgstr "برنامه"
msgid "Audio"
msgstr "صدا"
#: gtk/gtkfilechooserwidget.c:4323 gtk/gtkfontbutton.c:596
#: gtk/inspector/visual.ui:170
#: gtk/gtkfilechooserwidget.c:4323 gtk/gtkfontbutton.c:596 gtk/inspector/visual.ui:170
msgid "Font"
msgstr "قلم"
@@ -2358,8 +2356,7 @@ msgstr "پرونده‌ای با نام «%s» از قبل وجود دارد.
#: gtk/gtkfilechooserwidget.c:5794 gtk/gtkprintunixdialog.c:646
#, c-format
msgid "The file already exists in “%s”. Replacing it will overwrite its contents."
msgstr ""
"پرونده از قبل در «%s» وجود دارد. با جایگزینی آن تمام محتوایش بازنویسی می‌شود."
msgstr "پرونده از قبل در «%s» وجود دارد. با جایگزینی آن تمام محتوایش بازنویسی می‌شود."
#: gtk/gtkfilechooserwidget.c:5799 gtk/gtkprintunixdialog.c:654
msgid "_Replace"
@@ -2570,7 +2567,7 @@ msgid "%d:%02d"
msgstr "%Id:%I02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176 gtk/gtkprintbackend.c:641
#: gtk/gtkwindow.c:6111
#: gtk/gtkwindow.c:6107
msgid "_OK"
msgstr "_تأیید"
@@ -2814,8 +2811,7 @@ msgstr "زباله‌دان"
msgid "Open the trash"
msgstr "گشودن زباله‌دان"
#: gtk/gtkplacessidebar.c:1183 gtk/gtkplacessidebar.c:1211
#: gtk/gtkplacessidebar.c:1411
#: gtk/gtkplacessidebar.c:1183 gtk/gtkplacessidebar.c:1211 gtk/gtkplacessidebar.c:1411
#, c-format
msgid "Mount and open “%s”"
msgstr "سوار و گشودن «%s»"
@@ -3071,8 +3067,7 @@ msgstr[0] "%s / %s در دسترس"
msgid "Disconnect"
msgstr "قطع ارتباط"
#: gtk/gtkplacesviewrow.c:471 gtk/ui/gtkplacesviewrow.ui:53
#: gtk/ui/gtksidebarrow.ui:50
#: gtk/gtkplacesviewrow.c:471 gtk/ui/gtkplacesviewrow.ui:53 gtk/ui/gtksidebarrow.ui:50
msgid "Unmount"
msgstr "پیاده کردن"
@@ -3195,8 +3190,7 @@ msgid "Out of paper"
msgstr "بدون کاغذ"
#. Translators: this is a printer status.
#: gtk/gtkprintoperation-win32.c:638
#: modules/printbackends/gtkprintbackendcups.c:2660
#: gtk/gtkprintoperation-win32.c:638 modules/printbackends/gtkprintbackendcups.c:2660
msgid "Paused"
msgstr "مکث شده"
@@ -3321,9 +3315,8 @@ msgctxt "progress bar label"
msgid "%.0f%%"
msgstr "%I.0f ٪"
#: gtk/gtkrecentmanager.c:1023 gtk/gtkrecentmanager.c:1036
#: gtk/gtkrecentmanager.c:1174 gtk/gtkrecentmanager.c:1184
#: gtk/gtkrecentmanager.c:1234 gtk/gtkrecentmanager.c:1243
#: gtk/gtkrecentmanager.c:1023 gtk/gtkrecentmanager.c:1036 gtk/gtkrecentmanager.c:1174
#: gtk/gtkrecentmanager.c:1184 gtk/gtkrecentmanager.c:1234 gtk/gtkrecentmanager.c:1243
#, c-format
msgid "Unable to find an item with URI “%s”"
msgstr "نمی‌توان موردی با نشانی «%s» یافت"
@@ -3462,22 +3455,22 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%Id ٪"
#: gtk/gtkwindow.c:6098
#: gtk/gtkwindow.c:6094
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "می‌خواهید از بازرس +GTK استفاده کنید؟"
#: gtk/gtkwindow.c:6100
#: gtk/gtkwindow.c:6096
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify the "
"internals of any GTK application. Using it may cause the application to break or "
"crash."
msgstr ""
"بازرس +GTK یک بازرس تعاملی است که به شما اجازه پیمایش و تغییر هسته برنامه‌های +GTK "
"را می‌دهد. استفاده از آن ممکن است باعث شود که برنامه‌ها قفل کنند یا از هم بپاشند."
"بازرس +GTK یک بازرس تعاملی است که به شما اجازه پیمایش و تغییر هسته برنامه‌های +GTK را "
"می‌دهد. استفاده از آن ممکن است باعث شود که برنامه‌ها قفل کنند یا از هم بپاشند."
#: gtk/gtkwindow.c:6105
#: gtk/gtkwindow.c:6101
msgid "Dont show this message again"
msgstr "این پیام را دوباره نشان نده"
@@ -3615,8 +3608,7 @@ msgstr "در این‌جا می‌توانید هر قاعدهٔ CSS قابل ش
#: gtk/inspector/css-editor.c:130
msgid ""
"You can temporarily disable this custom CSS by clicking on the “Pause” button "
"above."
"You can temporarily disable this custom CSS by clicking on the “Pause” button above."
msgstr ""
"می‌توانید با کلیک روی دکمهٔ «مکث» در بالا، این CSS سفارشی را موقّتاً از کار بیندازید."
@@ -3978,7 +3970,7 @@ msgstr "منبع:"
msgid "Defined At"
msgstr "تعریف شده در"
#: gtk/inspector/recorder.c:1694
#: gtk/inspector/recorder.c:1692
#, c-format
msgid "Saving RenderNode failed"
msgstr "ذخیرهٔ RenderNode شکست خورد"
@@ -4113,15 +4105,15 @@ msgstr "سلسله مراتب"
msgid "Implements"
msgstr "پیاده‌سازی‌ها"
#: gtk/inspector/visual.c:604 gtk/inspector/visual.c:623
#: gtk/inspector/visual.c:603 gtk/inspector/visual.c:622
msgid "Theme is hardcoded by GTK_THEME"
msgstr "تم با استفاده از GTK_THEME رونویسی شده است"
#: gtk/inspector/visual.c:854
#: gtk/inspector/visual.c:853
msgid "Backend does not support window scaling"
msgstr "پسانه از تغییر اندازه پنجره پشتیبانی نمی‌کند"
#: gtk/inspector/visual.c:1044
#: gtk/inspector/visual.c:1043
msgid "GL rendering is disabled"
msgstr "پرداخت GL از کار افتاده"
@@ -4221,13 +4213,9 @@ msgstr "شبیه‌سازی صفحهٔ لمسی"
msgid "Software GL"
msgstr "GL نرم‌افزاری"
#: gtk/inspector/visual.ui:714
msgid "Inspect Inspector"
msgstr "بازرسی بازرس"
#: gtk/inspector/window.ui:27
msgid "Select an Object"
msgstr "گزینش یک شی"
msgstr "یک شیء انتخاب کنید"
#: gtk/inspector/window.ui:42 gtk/inspector/window.ui:107
msgid "Show Details"
@@ -4235,7 +4223,7 @@ msgstr "نمایش جزییات"
#: gtk/inspector/window.ui:57
msgid "Show all Objects"
msgstr "نمایش تمام اشیا"
msgstr "نمایش تمام اشیاء"
#: gtk/inspector/window.ui:121
msgid "Show all Resources"
@@ -7333,8 +7321,8 @@ msgid ""
"If you really want to create an icon cache here, use --ignore-theme-index.\n"
msgstr ""
"پروندهٔ نمایهٔ زمینه در «%s» نیست.\n"
"اگر به‌راستی می‌خواهید این‌جا انبارهٔ نقشکی ایجاد کنید، از --ignore-theme-index "
"استفاده کنید.\n"
"اگر به‌راستی می‌خواهید این‌جا انبارهٔ نقشکی ایجاد کنید، از --ignore-theme-index استفاده "
"کنید.\n"
#~ msgid "The EGL implementation does not support any allowed APIs"
#~ msgstr "پشتیبانی EGL از هیچ API مجازی پیشتیبانی نمی‌کند"
@@ -8579,8 +8567,8 @@ msgstr ""
#~ "The folder could not be created, as a file with the same name already exists. "
#~ "Try using a different name for the folder, or rename the file first."
#~ msgstr ""
#~ "پوشه نمی‌تواند ایجاد شود، چون پرونده‌ای با همین نام از قبل وجود دارد. از نام‌ "
#~ "دیگری برای پوشه استفاده کنید، یا نام پرونده را تغییر دهید."
#~ "پوشه نمی‌تواند ایجاد شود، چون پرونده‌ای با همین نام از قبل وجود دارد. از نام‌ دیگری "
#~ "برای پوشه استفاده کنید، یا نام پرونده را تغییر دهید."
#~ msgid "Enter location"
#~ msgstr "وارد کردن مکان"
@@ -8634,18 +8622,18 @@ msgstr ""
#~ msgstr "در حال باز کردن %s"
#~ msgid ""
#~ "Select the color you want from the outer ring. Select the darkness or "
#~ "lightness of that color using the inner triangle."
#~ "Select the color you want from the outer ring. Select the darkness or lightness "
#~ "of that color using the inner triangle."
#~ msgstr ""
#~ "رنگی را که می‌خواهید از حلقه‌ی خارجی انتخاب کنید. تیرگی یا روشنی آن رنگ را با "
#~ "استفاده از مثلث داخلی انتخاب کنید."
#~ msgid ""
#~ "Click the eyedropper, then click a color anywhere on your screen to select "
#~ "that color."
#~ "Click the eyedropper, then click a color anywhere on your screen to select that "
#~ "color."
#~ msgstr ""
#~ "روی قطره‌چکان کلیک کنید، سپس روی رنگی در هر جای صفحه‌تان کلیک کنید تا آن رنگ "
#~ "انتخاب شود"
#~ "روی قطره‌چکان کلیک کنید، سپس روی رنگی در هر جای صفحه‌تان کلیک کنید تا آن رنگ انتخاب "
#~ "شود"
#~ msgid "_Hue:"
#~ msgstr "_پرده:"
@@ -8687,8 +8675,8 @@ msgstr ""
#~ msgstr "_نام رنگ:"
#~ msgid ""
#~ "You can enter an HTML-style hexadecimal color value, or simply a color name "
#~ "such as “orange” in this entry."
#~ "You can enter an HTML-style hexadecimal color value, or simply a color name such "
#~ "as “orange” in this entry."
#~ msgstr ""
#~ "می‌توانید یک مقدار رنگ شانزده‌شانزدهی به سبک HTML وارد کنید، یا به سادگی نام "
#~ "انگلیسی یک رنگ مثل «orange» را برای نارنجی را وارد کنید."
@@ -8700,13 +8688,13 @@ msgstr ""
#~ msgstr "چرخ رنگ"
#~ msgid ""
#~ "The previously-selected color, for comparison to the color youre selecting "
#~ "now. You can drag this color to a palette entry, or select this color as "
#~ "current by dragging it to the other color swatch alongside."
#~ "The previously-selected color, for comparison to the color youre selecting now. "
#~ "You can drag this color to a palette entry, or select this color as current by "
#~ "dragging it to the other color swatch alongside."
#~ msgstr ""
#~ "رنگی که پیش‌تر انتخاب شده بود، برای مقایسه با رنگی که حالا انتخاب کردید. "
#~ "می‌توانید این رنگ را تا یک مدخل تخته‌رنگ بکشید، یا با کشیدنش به نمونه‌ی دیگر در "
#~ "کنار آن، این رنگ را به عنوان رنگ فعلی انتخاب کنید."
#~ "رنگی که پیش‌تر انتخاب شده بود، برای مقایسه با رنگی که حالا انتخاب کردید. می‌توانید "
#~ "این رنگ را تا یک مدخل تخته‌رنگ بکشید، یا با کشیدنش به نمونه‌ی دیگر در کنار آن، این "
#~ "رنگ را به عنوان رنگ فعلی انتخاب کنید."
#~ msgid ""
#~ "The color youve chosen. You can drag this color to a palette entry to save it "
@@ -8716,8 +8704,7 @@ msgstr ""
#~ "استفاده در آینده ذخیره شود."
#~ msgid ""
#~ "The previously-selected color, for comparison to the color youre selecting "
#~ "now."
#~ "The previously-selected color, for comparison to the color youre selecting now."
#~ msgstr "رنگ انتخابی پیشین، برای مقایسه با رنگی که اکنون انتخاب می‌کنید."
#~ msgid "The color youve chosen."
@@ -8727,12 +8714,12 @@ msgstr ""
#~ msgstr "_ذخیره‌ی رنگ در اینجا"
#~ msgid ""
#~ "Click this palette entry to make it the current color. To change this entry, "
#~ "drag a color swatch here or right-click it and select “Save color here.”"
#~ "Click this palette entry to make it the current color. To change this entry, drag "
#~ "a color swatch here or right-click it and select “Save color here.”"
#~ msgstr ""
#~ "روی این مدخل تخته‌رنگ کلیک کنید تا رنگ فعلی شود. برای تغییر این مدخل، یک نمونه‌ی "
#~ "رنگ را به اینجا بکشید یا روی آن کلیک راست کنید و «ذخیره‌ی رنگ در اینجا» را "
#~ "انتخاب کنید."
#~ "رنگ را به اینجا بکشید یا روی آن کلیک راست کنید و «ذخیره‌ی رنگ در اینجا» را انتخاب "
#~ "کنید."
#~ msgid "_Help"
#~ msgstr "_راهنما"
@@ -9001,8 +8988,7 @@ msgstr ""
#~ msgid "\"%s\" is not a valid attribute name"
#~ msgstr "«%s» نام خصیصه‌ی معتبری نیست"
#~ msgid ""
#~ "\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
#~ msgid "\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
#~ msgstr "«%s» نمی‌تواند به یک مقدار معتبر از نوع «%s» برای خصیصه‌ی «%s» تبدیل شود"
#~ msgid "\"%s\" is not a valid value for attribute \"%s\""
@@ -9026,8 +9012,7 @@ msgstr ""
#~ msgid "Serialized data is malformed"
#~ msgstr "داده‌ی متوالی شده بد‌ریخت است"
#~ msgid ""
#~ "Serialized data is malformed. First section isn't GTKTEXTBUFFERCONTENTS-0001"
#~ msgid "Serialized data is malformed. First section isn't GTKTEXTBUFFERCONTENTS-0001"
#~ msgstr "داده‌ی متوالی شده بد‌ریخت است. اولین بخش GTKTEXTBUFFERCONTENTS-0001 نیست"
#~ msgid "LRE Left-to-right _embedding"
@@ -9224,8 +9209,8 @@ msgstr ""
#~ "The program was not able to create a connection to the indexer daemon. Please "
#~ "make sure it is running."
#~ msgstr ""
#~ "برنامه نتوانست اتصالی به شبح نمایه‌گذار برقرار کند. لطفا مطمئن شوید که در حال "
#~ "اجرا است."
#~ "برنامه نتوانست اتصالی به شبح نمایه‌گذار برقرار کند. لطفا مطمئن شوید که در حال اجرا "
#~ "است."
#~ msgid "smb://foo.example.com, ssh://192.168.0.1"
#~ msgstr "smb://foo.example.com, ssh://192.168.0.1"
@@ -9234,8 +9219,7 @@ msgstr ""
#~ "The GLX_ARB_create_context_profile extension needed to create core profiles is "
#~ "not available"
#~ msgstr ""
#~ "افزونه GLX_ARB_create_context_profile که برای ساخت نمایه هسته لازم است، موجود "
#~ "نیست"
#~ "افزونه GLX_ARB_create_context_profile که برای ساخت نمایه هسته لازم است، موجود نیست"
#~ msgid "Error launching preview"
#~ msgstr "خطا هنگام راه‌اندازی پیش‌نمایش"
@@ -9438,8 +9422,8 @@ msgstr ""
#~ msgid "No fonts matched your search. You can revise your search and try again."
#~ msgstr ""
#~ "هیچ قلمی با جستجو شما تطابق ندارد. می‌توانید در جستجو خود تجدید نظر کنید و "
#~ "مجددا تلاش کنید."
#~ "هیچ قلمی با جستجو شما تطابق ندارد. می‌توانید در جستجو خود تجدید نظر کنید و مجددا "
#~ "تلاش کنید."
#~ msgid "Failed to look for applications online"
#~ msgstr "جستجو برای برنامه بصورت برخط شکست خورد"
@@ -9632,11 +9616,9 @@ msgstr ""
#~ msgid "Failed to open file '%s': %s"
#~ msgstr "باز کردن پرونده‌ی «%s» شکست خورد: %s"
#~ msgid ""
#~ "Failed to load image '%s': reason not known, probably a corrupt image file"
#~ msgid "Failed to load image '%s': reason not known, probably a corrupt image file"
#~ msgstr ""
#~ "بار کردن تصویر «%s» شکست خورد: دلیل آن معلوم نیست، احتمالاً پرونده‌ی تصویری خراب "
#~ "است"
#~ "بار کردن تصویر «%s» شکست خورد: دلیل آن معلوم نیست، احتمالاً پرونده‌ی تصویری خراب است"
#~ msgid "_Browse for other folders"
#~ msgstr "_مرور برای سایر پوشه‌ها"
@@ -9698,21 +9680,20 @@ msgstr ""
#~ msgstr "پرونده‌ی تصویری «%s» هیچ داده‌ای ندارد"
#~ msgid ""
#~ "Failed to load animation '%s': reason not known, probably a corrupt animation "
#~ "file"
#~ "Failed to load animation '%s': reason not known, probably a corrupt animation file"
#~ msgstr ""
#~ "بار کردن پویانمایی «%s» شکست خورد: دلیل آن معلوم نیست، احتمالاً پرونده‌ی "
#~ "پویانمایی خراب است"
#~ "بار کردن پویانمایی «%s» شکست خورد: دلیل آن معلوم نیست، احتمالاً پرونده‌ی پویانمایی "
#~ "خراب است"
#~ msgid "Unable to load image-loading module: %s: %s"
#~ msgstr "نمی‌توان پیمانه‌ی تصویربارکن را بار کرد: %s: %s"
#~ msgid ""
#~ "Image-loading module %s does not export the proper interface; perhaps it's "
#~ "from a different GTK version?"
#~ "Image-loading module %s does not export the proper interface; perhaps it's from a "
#~ "different GTK version?"
#~ msgstr ""
#~ "پیمانه‌ی بار کردن پرونده %s رابط مناسب را صادر نمی‌کند؛ شاید از نسخه‌ی دیگری از "
#~ "GTK است؟"
#~ "پیمانه‌ی بار کردن پرونده %s رابط مناسب را صادر نمی‌کند؛ شاید از نسخه‌ی دیگری از GTK "
#~ "است؟"
#~ msgid "Couldn't recognize the image file format for file '%s'"
#~ msgstr "قالب پرونده‌ی تصویر برای پرونده‌ی «%s» تشخیص داده نشد"
@@ -9738,8 +9719,7 @@ msgstr ""
#~ msgid ""
#~ "Failed to close '%s' while writing image, all data may not have been saved: %s"
#~ msgstr ""
#~ "بستن «%s» هنگام نوشتن تصویر شکست خورد، ممکن است همه‌ی داده‌ها ذخیره نشده باشند: "
#~ "%s"
#~ "بستن «%s» هنگام نوشتن تصویر شکست خورد، ممکن است همه‌ی داده‌ها ذخیره نشده باشند: %s"
#~ msgid "Insufficient memory to save image into a buffer"
#~ msgstr "حافظه برای ذخیره کردن تصویر در میان‌گیر کافی نیست"
@@ -9753,8 +9733,8 @@ msgstr ""
#~ "Internal error: Image loader module '%s' failed to complete an operation, but "
#~ "didn't give a reason for the failure"
#~ msgstr ""
#~ "خطای داخلی: پیمانه‌ی بارکننده‌ی تصویر «%s» در بار کردن یک تصویر شکست خورد،ولی "
#~ "دلیلی برای این شکست اعلام نکرد"
#~ "خطای داخلی: پیمانه‌ی بارکننده‌ی تصویر «%s» در بار کردن یک تصویر شکست خورد،ولی دلیلی "
#~ "برای این شکست اعلام نکرد"
#~ msgid "Incremental loading of image type '%s' is not supported"
#~ msgstr "بار کردن افزایشی تصویر نوع «%s» پشتیبانی نمی‌شود"
@@ -9817,8 +9797,7 @@ msgstr ""
#~ msgstr "شکست در خواندن GIF: %s"
#~ msgid "GIF file was missing some data (perhaps it was truncated somehow?)"
#~ msgstr ""
#~ "بعضی از داده‌های پرونده‌ی GIF مفقود شده‌اند (شاید پرونده به شکلی قطع شده است؟)‏"
#~ msgstr "بعضی از داده‌های پرونده‌ی GIF مفقود شده‌اند (شاید پرونده به شکلی قطع شده است؟)‏"
#~ msgid "Internal error in the GIF loader (%s)"
#~ msgstr "خطای داخلی در بارگذار GIF (%s)"
@@ -9854,8 +9833,7 @@ msgstr ""
#~ msgid ""
#~ "GIF image has no global colormap, and a frame inside it has no local colormap."
#~ msgstr ""
#~ "تصویر GIF نقشه‌رنگ سراسری‌ای ندارد، و یکی از چارچوب‌های داخل آن نقشه‌رنگ محلی "
#~ "ندارد."
#~ "تصویر GIF نقشه‌رنگ سراسری‌ای ندارد، و یکی از چارچوب‌های داخل آن نقشه‌رنگ محلی ندارد."
#~ msgid "GIF image was truncated or incomplete."
#~ msgstr "تصویر GIF قطع شده یا ناقص است."
@@ -9933,8 +9911,8 @@ msgstr ""
#~ msgid ""
#~ "Insufficient memory to load image, try exiting some applications to free memory"
#~ msgstr ""
#~ "حافظه برای بار کردن تصویر کافی نیست، برای آزاد کردن حافظه خروج از بعضی "
#~ "برنامه‌ها را امتحان کنید"
#~ "حافظه برای بار کردن تصویر کافی نیست، برای آزاد کردن حافظه خروج از بعضی برنامه‌ها "
#~ "را امتحان کنید"
#~ msgid "Couldn't allocate memory for loading JPEG file"
#~ msgstr "نمی‌توان برای بار کردن پرونده‌ی JPEG حافظه تخصیص داد"
@@ -9947,8 +9925,7 @@ msgstr ""
#~ "JPEG quality must be a value between 0 and 100; value '%s' could not be parsed."
#~ msgstr "کیفیت JPEG باید مقداری بین ۰ و ۱۰۰ باشد؛ مقدار «%s» قابل درک نیست."
#~ msgid ""
#~ "JPEG quality must be a value between 0 and 100; value '%d' is not allowed."
#~ msgid "JPEG quality must be a value between 0 and 100; value '%d' is not allowed."
#~ msgstr "کیفیت JPEG باید مقداری بین ۰ و ۱۰۰ باشد؛ مقدار «%Id» مجاز نیست."
#~ msgid "The JPEG image format"
@@ -10009,11 +9986,11 @@ msgstr ""
#~ msgstr "حافظه برای بار کردن پرونده‌ی PNG کافی نیست"
#~ msgid ""
#~ "Insufficient memory to store a %ld by %ld image; try exiting some applications "
#~ "to reduce memory usage"
#~ "Insufficient memory to store a %ld by %ld image; try exiting some applications to "
#~ "reduce memory usage"
#~ msgstr ""
#~ "حافظه برای ذخیره‌ی یک تصویر %Ild در %Ild کافی نیست؛ برای کاهش مصرف حافظه خروج "
#~ "از بعضی برنامه‌ها را امتحان کنید"
#~ "حافظه برای ذخیره‌ی یک تصویر %Ild در %Ild کافی نیست؛ برای کاهش مصرف حافظه خروج از "
#~ "بعضی برنامه‌ها را امتحان کنید"
#~ msgid "Fatal error reading PNG image file"
#~ msgstr "خطای مهلک در خواندن پرونده‌ی تصویری PNG"
@@ -10035,8 +10012,7 @@ msgstr ""
#, fuzzy
#~ msgid ""
#~ "PNG compression level must be a value between 0 and 9; value '%d' is not "
#~ "allowed."
#~ "PNG compression level must be a value between 0 and 9; value '%d' is not allowed."
#~ msgstr "کیفیت JPEG باید مقداری بین ۰ و ۱۰۰ باشد؛ مقدار «%Id» مجاز نیست."
#~ msgid "Value for PNG text chunk %s cannot be converted to ISO-8859-1 encoding."
@@ -10305,8 +10281,8 @@ msgstr ""
#~ msgstr "پوشه قابل خواندن نیست: %s"
#~ msgid ""
#~ "The file \"%s\" resides on another machine (called %s) and may not be "
#~ "available to this program.\n"
#~ "The file \"%s\" resides on another machine (called %s) and may not be available "
#~ "to this program.\n"
#~ "Are you sure that you want to select it?"
#~ msgstr ""
#~ "پرونده‌ی «%s» روی دستگاه دیگری (به نام %s) است و ممکن است برای این برنامه قابل "
@@ -10363,8 +10339,8 @@ msgstr ""
#~ msgstr "تغییر نام پرونده‌ی «%s» به:"
#~ msgid ""
#~ "The filename \"%s\" couldn't be converted to UTF-8. (try setting the "
#~ "environment variable G_FILENAME_ENCODING): %s"
#~ "The filename \"%s\" couldn't be converted to UTF-8. (try setting the environment "
#~ "variable G_FILENAME_ENCODING): %s"
#~ msgstr ""
#~ "نام پرونده‌ی «%s» را نمی‌توان به UTF-8 تبدیل کرد. (تنظیم متغیر محیطی "
#~ "G_FILENAME_ENCODING را امتحان کنید): %s"
@@ -10493,8 +10469,8 @@ msgstr ""
#~ msgstr "این سیستم پرونده‌ها از سوار شدن پشتیبانی نمی‌کند"
#~ msgid ""
#~ "The name \"%s\" is not valid because it contains the character \"%s\". Please "
#~ "use a different name."
#~ "The name \"%s\" is not valid because it contains the character \"%s\". Please use "
#~ "a different name."
#~ msgstr ""
#~ "نام «%s» معتبر نیست چون شامل نویسه‌ی «%s» است. لطفاً از نام دیگری استفاده کنید."
+1010 -1164
View File
File diff suppressed because it is too large Load Diff
+1691 -1250
View File
File diff suppressed because it is too large Load Diff
+15 -18
View File
@@ -12,8 +12,8 @@ msgid ""
msgstr ""
"Project-Id-Version: 3.10\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-06-22 18:25+0000\n"
"PO-Revision-Date: 2022-06-23 22:40+0100\n"
"POT-Creation-Date: 2022-06-06 22:45+0000\n"
"PO-Revision-Date: 2022-06-07 14:53+0100\n"
"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
"Language-Team: Português <https://l10n.gnome.org/teams/pt/>\n"
"Language: pt\n"
@@ -21,7 +21,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.1\n"
"X-Generator: Poedit 3.0.1\n"
#: gdk/broadway/gdkbroadway-server.c:135
#, c-format
@@ -2133,8 +2133,8 @@ msgstr "Já existe um ficheiro com esse nome"
#: gtk/gtkmountoperation.c:604 gtk/gtkpagesetupunixdialog.c:283
#: gtk/gtkprintbackend.c:640 gtk/gtkprinteroptionwidget.c:722
#: gtk/gtkprintunixdialog.c:651 gtk/gtkprintunixdialog.c:807
#: gtk/gtkwindow.c:6110 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1723 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/gtkwindow.c:6106 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1721 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:33
#: gtk/ui/gtkfontchooserdialog.ui:24
msgid "_Cancel"
@@ -2147,7 +2147,7 @@ msgid "_Open"
msgstr "_Abrir"
#: gtk/gtkfilechoosernative.c:574 gtk/inspector/css-editor.c:249
#: gtk/inspector/recorder.c:1724
#: gtk/inspector/recorder.c:1722
msgid "_Save"
msgstr "_Gravar"
@@ -2622,7 +2622,7 @@ msgid "%d:%02d"
msgstr "%d:%02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
#: gtk/gtkprintbackend.c:641 gtk/gtkwindow.c:6111
#: gtk/gtkprintbackend.c:641 gtk/gtkwindow.c:6107
msgid "_OK"
msgstr "_Aceitar"
@@ -3531,12 +3531,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:6098
#: gtk/gtkwindow.c:6094
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Deseja usar o Inspetor GTK?"
#: gtk/gtkwindow.c:6100
#: gtk/gtkwindow.c:6096
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@@ -3547,7 +3547,7 @@ msgstr ""
"estado interno de qualquer aplicação GTK. Usá-lo pode fazer que a aplicação "
"se encerre ou falhe."
#: gtk/gtkwindow.c:6105
#: gtk/gtkwindow.c:6101
msgid "Dont show this message again"
msgstr "Não mostrar esta mensagem novamente"
@@ -4045,7 +4045,7 @@ msgstr "Origem:"
msgid "Defined At"
msgstr "Definido em"
#: gtk/inspector/recorder.c:1694
#: gtk/inspector/recorder.c:1692
#, c-format
msgid "Saving RenderNode failed"
msgstr "Falha ao gravar RenderNode"
@@ -4179,15 +4179,15 @@ msgstr "Hierarquia"
msgid "Implements"
msgstr "Implementa"
#: gtk/inspector/visual.c:604 gtk/inspector/visual.c:623
#: gtk/inspector/visual.c:603 gtk/inspector/visual.c:622
msgid "Theme is hardcoded by GTK_THEME"
msgstr "O tema está no código de GTK_THEME"
#: gtk/inspector/visual.c:854
#: gtk/inspector/visual.c:853
msgid "Backend does not support window scaling"
msgstr "O motor não suporta dimensionamento de janelas"
#: gtk/inspector/visual.c:1044
#: gtk/inspector/visual.c:1043
msgid "GL rendering is disabled"
msgstr "Desenho GL está desativado"
@@ -4287,10 +4287,6 @@ msgstr "Simular ecrã de toque"
msgid "Software GL"
msgstr "Programa GL"
#: gtk/inspector/visual.ui:714
msgid "Inspect Inspector"
msgstr "Inspetor de inspeção"
#: gtk/inspector/window.ui:27
msgid "Select an Object"
msgstr "Selecionar um objeto"
@@ -6226,6 +6222,7 @@ msgid "Language"
msgstr "Idioma"
#: gtk/ui/gtkfontchooserwidget.ui:188 gtk/ui/gtkfontchooserwidget.ui:324
#| msgid "Pre_view"
msgid "Preview text"
msgstr "Pré-visualizar texto"
+19 -23
View File
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-06-25 18:36+0000\n"
"PO-Revision-Date: 2022-06-30 11:34+0300\n"
"POT-Creation-Date: 2022-06-07 06:16+0000\n"
"PO-Revision-Date: 2022-06-07 14:48+0300\n"
"Last-Translator: Aleksandr Melman <Alexmelman88@gmail.com>\n"
"Language-Team: Русский <gnome-cyr@gnome.org>\n"
"Language: ru\n"
@@ -532,7 +532,7 @@ msgstr "Выход из спящего режима"
#: gdk/keyname-table.h:6916
msgctxt "keyboard label"
msgid "Suspend"
msgstr "Режим ожидания"
msgstr "Ждущий режим"
#: gdk/loaders/gdkjpeg.c:63
#, c-format
@@ -1393,7 +1393,7 @@ msgstr "индикатор выполнения"
#: gtk/gtkaccessible.c:603
msgctxt "accessibility"
msgid "radio"
msgstr "радио"
msgstr "кнопвыб"
#: gtk/gtkaccessible.c:604
msgctxt "accessibility"
@@ -2135,8 +2135,8 @@ msgstr "Файл с таким именем уже существует"
#: gtk/gtkmountoperation.c:604 gtk/gtkpagesetupunixdialog.c:283
#: gtk/gtkprintbackend.c:640 gtk/gtkprinteroptionwidget.c:722
#: gtk/gtkprintunixdialog.c:651 gtk/gtkprintunixdialog.c:807
#: gtk/gtkwindow.c:6110 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1723 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/gtkwindow.c:6106 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1721 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:33
#: gtk/ui/gtkfontchooserdialog.ui:24
msgid "_Cancel"
@@ -2149,7 +2149,7 @@ msgid "_Open"
msgstr "_Открыть"
#: gtk/gtkfilechoosernative.c:574 gtk/inspector/css-editor.c:249
#: gtk/inspector/recorder.c:1724
#: gtk/inspector/recorder.c:1722
msgid "_Save"
msgstr "_Сохранить"
@@ -2626,7 +2626,7 @@ msgid "%d:%02d"
msgstr "%d:%02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
#: gtk/gtkprintbackend.c:641 gtk/gtkwindow.c:6111
#: gtk/gtkprintbackend.c:641 gtk/gtkwindow.c:6107
msgid "_OK"
msgstr "_OK"
@@ -2688,7 +2688,7 @@ msgstr "_Забыть пароль немедленно"
#: gtk/gtkmountoperation.c:764
msgid "Remember password until you _logout"
msgstr "Запомнить пароль до _выхода из системы"
msgstr "Запомнить пароль _до выхода из сеанса"
#: gtk/gtkmountoperation.c:775
msgid "Remember _forever"
@@ -2802,7 +2802,7 @@ msgstr ""
#: gtk/gtkpagesetupunixdialog.c:784 gtk/ui/gtkpagesetupunixdialog.ui:5
#: gtk/ui/gtkprintunixdialog.ui:709
msgid "Page Setup"
msgstr "Настройка страницы"
msgstr "Параметры страницы"
#: gtk/gtkpasswordentry.c:173
msgid "Hide Text"
@@ -3536,12 +3536,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:6098
#: gtk/gtkwindow.c:6094
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Вы хотите использовать GTK Inspector?"
#: gtk/gtkwindow.c:6100
#: gtk/gtkwindow.c:6096
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@@ -3552,7 +3552,7 @@ msgstr ""
"изменять внутренние компоненты любого GTK-приложения. Его использование "
"может привести к поломке или аварийному завершению работы приложения."
#: gtk/gtkwindow.c:6105
#: gtk/gtkwindow.c:6101
msgid "Dont show this message again"
msgstr "Не показывать это сообщение снова"
@@ -3616,7 +3616,7 @@ msgstr "Включено"
#: gtk/inspector/actions.ui:41
msgid "Parameter Type"
msgstr "Тип параметра"
msgstr "Тип параметры"
#: gtk/inspector/actions.ui:52 gtk/inspector/css-node-tree.ui:74
#: gtk/inspector/misc-info.ui:121
@@ -4051,7 +4051,7 @@ msgstr "Источник:"
msgid "Defined At"
msgstr "Определён в"
#: gtk/inspector/recorder.c:1694
#: gtk/inspector/recorder.c:1692
#, c-format
msgid "Saving RenderNode failed"
msgstr "Сбой при сохранении RenderNode"
@@ -4185,15 +4185,15 @@ msgstr "Иерархия"
msgid "Implements"
msgstr "Реализует"
#: gtk/inspector/visual.c:604 gtk/inspector/visual.c:623
#: gtk/inspector/visual.c:603 gtk/inspector/visual.c:622
msgid "Theme is hardcoded by GTK_THEME"
msgstr "Тема жёстко задана с помощью GTK_THEME"
#: gtk/inspector/visual.c:854
#: gtk/inspector/visual.c:853
msgid "Backend does not support window scaling"
msgstr "Движок не поддерживает масштабирование окон"
#: gtk/inspector/visual.c:1044
#: gtk/inspector/visual.c:1043
msgid "GL rendering is disabled"
msgstr "Рендеринг GL выключен"
@@ -4293,10 +4293,6 @@ msgstr "Эмулировать сенсорный экран"
msgid "Software GL"
msgstr "Программный GL"
#: gtk/inspector/visual.ui:714
msgid "Inspect Inspector"
msgstr "Инспектор контроля"
#: gtk/inspector/window.ui:27
msgid "Select an Object"
msgstr "Выбрать объект"
@@ -4399,7 +4395,7 @@ msgstr "Информация"
#: gtk/inspector/window.ui:554
msgid "Settings"
msgstr "Настройки"
msgstr "Параметры"
#: gtk/inspector/window.ui:563
msgid "Resources"
+497 -603
View File
File diff suppressed because it is too large Load Diff
+391 -236
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -116,8 +116,7 @@ gtk_tests = [
['testtexture'],
['testwindowdrag'],
['testinhibitshortcuts'],
['testzoom'],
['testdatatable', ['frame-stats.c', 'variable.c']]
['testzoom']
]
if os_unix
-297
View File
@@ -1,297 +0,0 @@
/* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
#include <gtk/gtk.h>
#include "frame-stats.h"
/* This is our dummy item for the model. */
#define DATA_TABLE_TYPE_ITEM (data_table_item_get_type ())
G_DECLARE_FINAL_TYPE (DataTableItem, data_table_item, DATA_TABLE, ITEM, GObject)
struct _DataTableItem
{
GObject parent_instance;
int data;
};
struct _DataTableItemClass
{
GObjectClass parent_class;
};
G_DEFINE_TYPE (DataTableItem, data_table_item, G_TYPE_OBJECT)
static void data_table_item_init (DataTableItem *item) {}
static void data_table_item_class_init (DataTableItemClass *class) {}
static DataTableItem *
data_table_item_new (int data)
{
DataTableItem *item = g_object_new (DATA_TABLE_TYPE_ITEM, NULL);
item->data = data;
return item;
}
static void
set_adjustment_to_fraction (GtkAdjustment *adjustment,
double fraction)
{
double upper = gtk_adjustment_get_upper (adjustment);
double lower = gtk_adjustment_get_lower (adjustment);
double page_size = gtk_adjustment_get_page_size (adjustment);
gtk_adjustment_set_value (adjustment,
(1 - fraction) * lower +
fraction * (upper - page_size));
}
static gboolean
scroll_column_view (GtkWidget *column_view,
GdkFrameClock *frame_clock,
gpointer user_data)
{
GtkAdjustment *vadjustment;
vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (column_view));
set_adjustment_to_fraction (vadjustment, g_random_double ());
return TRUE;
}
enum WidgetType
{
WIDGET_TYPE_NONE,
WIDGET_TYPE_LABEL,
WIDGET_TYPE_TEXT,
WIDGET_TYPE_INSCRIPTION,
};
static enum WidgetType widget_type = WIDGET_TYPE_INSCRIPTION;
static void
setup (GtkSignalListItemFactory *factory,
GObject *listitem)
{
GtkWidget *widget;
switch (widget_type)
{
case WIDGET_TYPE_NONE:
/* It's actually a box, just to request size similar to labels. */
widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_size_request (widget, 50, 18);
break;
case WIDGET_TYPE_LABEL:
widget = gtk_label_new ("");
break;
case WIDGET_TYPE_TEXT:
widget = gtk_text_new ();
break;
case WIDGET_TYPE_INSCRIPTION:
widget = gtk_inscription_new ("");
gtk_inscription_set_min_chars (GTK_INSCRIPTION (widget), 6);
break;
default:
g_assert_not_reached ();
}
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), widget);
}
static void
bind (GtkSignalListItemFactory *factory,
GObject *listitem,
gpointer name)
{
GtkWidget *widget;
GObject *item;
widget = gtk_list_item_get_child (GTK_LIST_ITEM (listitem));
item = gtk_list_item_get_item (GTK_LIST_ITEM (listitem));
char buffer[16] = { 0, };
g_snprintf (buffer,
sizeof (buffer),
"%c%d",
GPOINTER_TO_INT (name),
DATA_TABLE_ITEM (item)->data);
switch (widget_type)
{
case WIDGET_TYPE_NONE:
break;
case WIDGET_TYPE_LABEL:
gtk_label_set_label (GTK_LABEL (widget), buffer);
break;
case WIDGET_TYPE_TEXT:
gtk_editable_set_text (GTK_EDITABLE (widget), buffer);
break;
case WIDGET_TYPE_INSCRIPTION:
gtk_inscription_set_text (GTK_INSCRIPTION (widget), buffer);
break;
default:
g_assert_not_reached ();
}
}
static gboolean
parse_widget_arg (const gchar* option_name,
const gchar* value,
gpointer data,
GError** error)
{
if (!g_strcmp0 (value, "none"))
{
widget_type = WIDGET_TYPE_NONE;
return TRUE;
}
else if (!g_strcmp0 (value, "label"))
{
widget_type = WIDGET_TYPE_LABEL;
return TRUE;
}
else if (!g_strcmp0 (value, "text"))
{
widget_type = WIDGET_TYPE_TEXT;
return TRUE;
}
else if (!g_strcmp0 (value, "inscription"))
{
widget_type = WIDGET_TYPE_INSCRIPTION;
return TRUE;
}
else
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
"Invalid option value");
return FALSE;
}
}
static gboolean no_auto_scroll = FALSE;
static gint n_columns = 20;
static GOptionEntry options[] = {
{
"widget",
'w',
G_OPTION_FLAG_NONE,
G_OPTION_ARG_CALLBACK,
parse_widget_arg,
"Cell item widget to use, can be one of: none, label, text, inscription",
"WIDGET"
},
{
"no-auto-scroll",
'n',
G_OPTION_FLAG_NONE,
G_OPTION_ARG_NONE,
&no_auto_scroll,
"Disable automatic scrolling",
NULL
},
{
"columns",
'c',
G_OPTION_FLAG_NONE,
G_OPTION_ARG_INT,
&n_columns,
"Column count",
"COUNT"
},
{ NULL }
};
static void
quit_cb (GtkWidget *widget,
gpointer data)
{
gboolean *done = data;
*done = TRUE;
g_main_context_wakeup (NULL);
}
int
main (int argc, char **argv)
{
GtkWidget *window;
GtkWidget *scrolled_window;
GListStore *store;
int i;
GtkMultiSelection *multi_selection;
GtkWidget *column_view;
GError *error = NULL;
gboolean done = FALSE;
GOptionContext *context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL);
frame_stats_add_options (g_option_context_get_main_group (context));
if (!g_option_context_parse (context, &argc, &argv, &error))
{
g_printerr ("Option parsing failed: %s\n", error->message);
return 1;
}
gtk_init ();
window = gtk_window_new ();
frame_stats_ensure (GTK_WINDOW (window));
gtk_window_set_default_size (GTK_WINDOW (window), 1700, 900);
scrolled_window = gtk_scrolled_window_new ();
gtk_window_set_child (GTK_WINDOW (window), scrolled_window);
store = g_list_store_new (DATA_TABLE_TYPE_ITEM);
for (i = 0; i < 10000; ++i)
{
DataTableItem *item = data_table_item_new (i);
g_list_store_append (store, item);
g_object_unref (item);
}
multi_selection = gtk_multi_selection_new (G_LIST_MODEL (store));
column_view = gtk_column_view_new (GTK_SELECTION_MODEL (multi_selection));
gtk_column_view_set_show_column_separators (GTK_COLUMN_VIEW (column_view), TRUE);
gtk_column_view_set_show_row_separators (GTK_COLUMN_VIEW (column_view), TRUE);
gtk_widget_add_css_class (column_view, "data-table");
for (i = 0; i < MIN (n_columns, 127 - 65); ++i)
{
const char name[] = { 'A' + i, '\0' };
GtkListItemFactory *factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind), GINT_TO_POINTER (name[0]));
gtk_column_view_append_column (GTK_COLUMN_VIEW (column_view),
gtk_column_view_column_new (name, factory));
}
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window),
column_view);
if (!no_auto_scroll)
{
gtk_widget_add_tick_callback (column_view,
scroll_column_view,
NULL,
NULL);
}
gtk_widget_show (window);
g_signal_connect (window, "destroy",
G_CALLBACK (quit_cb), &done);
while (!done)
g_main_context_iteration (NULL, TRUE);
return 0;
}
+1 -47
View File
@@ -80,33 +80,11 @@ quit_cb (GtkWidget *widget,
g_main_context_wakeup (NULL);
}
static void
level_changed (GtkCheckButton *button,
GParamSpec *pspec,
gpointer data)
{
GtkFontChooser *chooser = data;
GtkFontChooserLevel flags;
GtkFontChooserLevel flag;
flags = gtk_font_chooser_get_level (chooser);
flag = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (button), "flag"));
if (gtk_check_button_get_active (button))
flags |= flag;
else
flags &= ~flag;
gtk_font_chooser_set_level (chooser, flags);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *font_button;
GtkWidget *box;
GtkWidget *toggle;
gboolean done = FALSE;
gtk_init ();
@@ -136,31 +114,7 @@ main (int argc, char *argv[])
gtk_font_button_set_use_font (GTK_FONT_BUTTON (font_button), TRUE);
window = gtk_window_new ();
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_window_set_child (GTK_WINDOW (window), box);
gtk_box_append (GTK_BOX (box), font_button);
toggle = gtk_check_button_new_with_label ("Style");
gtk_check_button_set_active (GTK_CHECK_BUTTON (toggle), TRUE);
g_object_set_data (G_OBJECT (toggle), "flag", GUINT_TO_POINTER (GTK_FONT_CHOOSER_LEVEL_STYLE));
g_signal_connect (toggle, "notify::active", G_CALLBACK (level_changed), font_button);
gtk_box_append (GTK_BOX (box), toggle);
toggle = gtk_check_button_new_with_label ("Size");
gtk_check_button_set_active (GTK_CHECK_BUTTON (toggle), TRUE);
g_object_set_data (G_OBJECT (toggle), "flag", GUINT_TO_POINTER (GTK_FONT_CHOOSER_LEVEL_SIZE));
g_signal_connect (toggle, "notify::active", G_CALLBACK (level_changed), font_button);
gtk_box_append (GTK_BOX (box), toggle);
toggle = gtk_check_button_new_with_label ("Variations");
g_object_set_data (G_OBJECT (toggle), "flag", GUINT_TO_POINTER (GTK_FONT_CHOOSER_LEVEL_VARIATIONS));
g_signal_connect (toggle, "notify::active", G_CALLBACK (level_changed), font_button);
gtk_box_append (GTK_BOX (box), toggle);
toggle = gtk_check_button_new_with_label ("Features");
g_object_set_data (G_OBJECT (toggle), "flag", GUINT_TO_POINTER (GTK_FONT_CHOOSER_LEVEL_FEATURES));
g_signal_connect (toggle, "notify::active", G_CALLBACK (level_changed), font_button);
gtk_box_append (GTK_BOX (box), toggle);
gtk_window_set_child (GTK_WINDOW (window), font_button);
gtk_widget_show (window);
g_signal_connect (font_button, "notify::font",
-1
View File
@@ -78,7 +78,6 @@ test_type (gconstpointer data)
if (g_type_is_a (type, GTK_TYPE_APPLICATION) ||
g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) ||
g_type_is_a (type, GTK_TYPE_LAYOUT_CHILD) ||
g_type_is_a (type, GTK_TYPE_STACK_PAGE) ||
#ifdef G_OS_UNIX
g_type_is_a (type, GTK_TYPE_PRINT_JOB) ||
#endif
+3 -92
View File
@@ -57,6 +57,7 @@ new_store (guint start,
guint end,
guint step);
#if 0
static void
splice (GListStore *store,
guint pos,
@@ -64,11 +65,9 @@ splice (GListStore *store,
guint *numbers,
guint added)
{
GObject **objects;
GObject *objects[added];
guint i;
objects = g_newa (GObject*, added);
for (i = 0; i < added; i++)
{
/* 0 cannot be differentiated from NULL, so don't use it */
@@ -82,6 +81,7 @@ splice (GListStore *store,
for (i = 0; i < added; i++)
g_object_unref (objects[i]);
}
#endif
static void
add (GListStore *store,
@@ -223,11 +223,6 @@ test_create_empty (void)
map = new_model (NULL);
assert_model (map, "");
assert_changes (map, "");
g_assert_true (g_list_model_get_item_type (G_LIST_MODEL (map)) == G_TYPE_OBJECT);
g_assert_true (g_list_model_get_n_items (G_LIST_MODEL (map)) == 0);
g_assert_true (g_list_model_get_item (G_LIST_MODEL (map), 0) == NULL);
g_assert_true (gtk_map_list_model_get_model (map) == NULL);
g_assert_true (gtk_map_list_model_has_map (map));
g_object_unref (map);
}
@@ -285,17 +280,14 @@ test_set_map_func (void)
assert_changes (map, "");
gtk_map_list_model_set_map_func (map, map_multiply, GUINT_TO_POINTER (3), NULL);
g_assert_true (gtk_map_list_model_has_map (map));
assert_model (map, "3 6 9 12 15");
assert_changes (map, "0-5+5");
gtk_map_list_model_set_map_func (map, NULL, NULL, NULL);
g_assert_false (gtk_map_list_model_has_map (map));
assert_model (map, "1 2 3 4 5");
assert_changes (map, "0-5+5");
gtk_map_list_model_set_map_func (map, map_multiply, GUINT_TO_POINTER (2), NULL);
g_assert_true (gtk_map_list_model_has_map (map));
assert_model (map, "2 4 6 8 10");
assert_changes (map, "0-5+5");
@@ -303,84 +295,6 @@ test_set_map_func (void)
g_object_unref (map);
}
static void
test_add_items (void)
{
GtkMapListModel *map;
GListStore *store;
store = new_store (1, 5, 1);
map = new_model (store);
assert_model (map, "2 4 6 8 10");
assert_changes (map, "");
add (store, 6);
assert_model (map, "2 4 6 8 10 12");
assert_changes (map, "+5*");
g_object_unref (store);
g_object_unref (map);
}
static void
test_remove_items (void)
{
GtkMapListModel *map;
GListStore *store;
store = new_store (1, 5, 1);
map = new_model (store);
assert_model (map, "2 4 6 8 10");
assert_changes (map, "");
g_list_store_remove (store, 2);
assert_model (map, "2 4 8 10");
assert_changes (map, "-2*");
g_object_unref (store);
g_object_unref (map);
}
static void
test_splice (void)
{
GtkMapListModel *map;
GListStore *store;
GObject *items[5];
store = new_store (1, 5, 1);
map = new_model (store);
assert_model (map, "2 4 6 8 10");
assert_changes (map, "");
splice (store, 2, 2, (guint[]){ 4, 3 }, 2);
assert_model (map, "2 4 8 6 10");
assert_changes (map, "2-2+2");
for (int i = 0; i < 5; i++)
{
items[i] = g_list_model_get_item (G_LIST_MODEL (map), i);
g_assert_true (items[i] != NULL);
}
splice (store, 1, 1, (guint[]){ 1, 2, 5 }, 3);
assert_model (map, "2 2 4 10 8 6 10");
assert_changes (map, "1-1+3*");
for (int i = 0; i < 5; i++)
{
GObject *item = g_list_model_get_item (G_LIST_MODEL (map), i);
g_assert_true (item != NULL);
if (i == 0)
g_assert (item == items[0]);
g_object_unref (item);
g_object_unref (items[i]);
}
g_object_unref (store);
g_object_unref (map);
}
int
main (int argc, char *argv[])
{
@@ -394,9 +308,6 @@ main (int argc, char *argv[])
g_test_add_func ("/maplistmodel/create", test_create);
g_test_add_func ("/maplistmodel/set-model", test_set_model);
g_test_add_func ("/maplistmodel/set-map-func", test_set_map_func);
g_test_add_func ("/maplistmodel/add_items", test_add_items);
g_test_add_func ("/maplistmodel/remove_items", test_remove_items);
g_test_add_func ("/maplistmodel/splice", test_splice);
return g_test_run ();
}
-3
View File
@@ -409,9 +409,6 @@ test_type (gconstpointer data)
if (g_str_equal (g_type_name (type), "GtkPlacesSidebar"))
return;
if (g_type_is_a (type, GTK_TYPE_STACK_PAGE))
return;
/* These rely on a d-bus session bus */
if (g_type_is_a (type, GTK_TYPE_MOUNT_OPERATION))
return;
+1 -3
View File
@@ -178,9 +178,7 @@ main (int argc, char **argv)
all_types[i] != GDK_TYPE_PIXBUF_LOADER &&
all_types[i] != gdk_pixbuf_simple_anim_iter_get_type() &&
!g_type_is_a (all_types[i], GTK_TYPE_SHORTCUT_TRIGGER) &&
!g_type_is_a (all_types[i], GTK_TYPE_SHORTCUT_ACTION) &&
/* can't instantiate empty stack pages */
all_types[i] != GTK_TYPE_STACK_PAGE)
!g_type_is_a (all_types[i], GTK_TYPE_SHORTCUT_ACTION))
{
char *test_path = g_strdup_printf ("/FinalizeObject/%s", g_type_name (all_types[i]));