Compare commits

...

633 Commits

Author SHA1 Message Date
Matthias Clasen
842df3cdff testsuite: Add selection model tests 2019-02-07 22:26:03 -05:00
Benjamin Otte
dd7b9d931a gtk: Add GtkSingleSelection
GtkSingleSelection is a GtkSelectionModel that allows selecting a single
item.
2019-02-07 22:26:03 -05:00
Benjamin Otte
e41236bc1f gtk: Add GtkSelectionModel
The selection model is a list model interface that takes care of
selections and is to be used by the list model widgets to manage their
selections.
2019-02-07 22:26:03 -05:00
Jakub Steiner
a3e517aa9c Adwaita: menu border-radius fix from gtk3
- avoid painting over the rounded corners with background
2019-02-06 14:34:55 +01:00
Jakub Steiner
8d537379ed Adwaita: sync with stable styling
- fold over changes in teh stable brnch to get the same look

fixes issue #1656
2019-02-06 14:01:38 +01:00
Daniel Mustieles
7be59fa8e3 Updated Spanish translation 2019-02-06 12:11:09 +01:00
Daniel Mustieles
7a59fd7fdf Updated Spanish translation 2019-02-06 12:09:19 +01:00
Daniel Mustieles
a5e4a38b60 Updated Spanish translation 2019-02-06 11:42:45 +01:00
Emmanuele Bassi
b56c0fb596 Rename project files
Meson and DOAP are the last holdovers for the old "gtk+" name.
2019-02-06 10:42:50 +01:00
Emmanuele Bassi
5a0eea82ba docs: Fix project name for translators 2019-02-06 10:42:33 +01:00
Emmanuele Bassi
61fbd5b541 tests: Fix comment for accuracy
The command line for compiling testwindowsize has changed.
2019-02-06 10:41:49 +01:00
Emmanuele Bassi
22f073b57b docs: Fix references to pkg-config files
The pkg-config files for GDK were dropped in 4.0, and now the GTK
pkg-config files have been renamed.
2019-02-06 10:40:51 +01:00
Emmanuele Bassi
1668496359 docs: Fix GTK links and locations 2019-02-06 10:39:27 +01:00
Emmanuele Bassi
45361e19c3 Rename more GSources to use gtk 2019-02-06 10:37:24 +01:00
Rico Tzschichholz
d2d35e52c3 Adjust some more pkg-config references for gtk+ to gtk rename
See https://gitlab.gnome.org/GNOME/gtk/issues/1439
2019-02-06 09:56:08 +01:00
Matthias Clasen
dbc4298b0a Merge branch 'less-invisible' into 'master'
Less invisible

See merge request GNOME/gtk!562
2019-02-06 08:26:55 +00:00
Matthias Clasen
e91144f6c9 Make GtkInvisible private
We can't quite get rid of its use in the inspector,
but we can make it private.
2019-02-06 02:06:19 -05:00
Matthias Clasen
a75dcce707 Make the invisible invisible
The change to make widgets visible by default broke GtkInvisibles
special-cased state handling and that in turn caused picking in
the inspector to break with another recent change.

This change makes the inspector pick button work again.
2019-02-05 16:55:07 -05:00
Balázs Úr
28044aa2df Update Hungarian translation 2019-02-05 20:01:40 +00:00
Balázs Úr
4fbf10f71e Update Hungarian translation 2019-02-05 19:57:50 +00:00
Piotr Drąg
3260a60034 Update POTFILES.in and POTFILES.skip 2019-02-05 18:35:55 +01:00
Matthias Clasen
785373ce2a printoperation-win32: Stop using an invisible
We can just as well use a GtkWindow here. We just need
a handle. Untested.
2019-02-05 10:56:40 -05:00
Matthias Clasen
aad44999f3 filechoosernativeportal: Stop using an invisible
A label works just as well here, it turns out.
2019-02-05 10:46:48 -05:00
Matthias Clasen
721e598e99 Reduce includes of gtkinvisible.h
We want to get rid of GtkInvisible.
2019-02-05 10:46:33 -05:00
Timm Bäder
51268f53d8 docs: Remove reference to deleted file 2019-02-05 15:15:38 +01:00
Timm Bäder
9d950087ef inspector: Remove window icon
The property does not exist anymore and the window icon has never been
used on non-x11 backends.
2019-02-05 15:14:19 +01:00
Timm Bäder
1674b6e269 main: Prefer implicit grab widget to target widget for motion events
When an implcit grab is going on, we don't need to consider other
widgets for motion (etc.) events.
2019-02-05 15:13:01 +01:00
Timm Bäder
33ac41bc94 infobar: Remove an unused variable 2019-02-05 15:09:59 +01:00
Matthias Clasen
f60ca91d2b A few forgotten button box functions 2019-02-05 08:44:45 -05:00
Timm Bäder
057144cfdd window: Inline function into only caller 2019-02-05 08:11:43 -05:00
Timm Bäder
9b91041025 window: Remove remaining icon_list handling 2019-02-05 08:11:43 -05:00
Timm Bäder
b215384064 window: Remove default_icon_serial
Now unused.
2019-02-05 08:11:43 -05:00
Timm Bäder
e6c5b9348d window: Remove default icon list 2019-02-05 08:11:43 -05:00
Timm Bäder
55b99e9916 window: Remove icon list 2019-02-05 08:11:43 -05:00
Timm Bäder
131e8d8905 Remove some unnecessary gtkwindow.h includes 2019-02-05 08:11:43 -05:00
Timm Bäder
e82d97f069 window: Remove set_default_icon 2019-02-05 08:11:43 -05:00
Timm Bäder
490bb4c2ea window: Remove icon property 2019-02-05 08:11:43 -05:00
Timm Bäder
79664567c4 window: Remove _set_default_icon_from_file 2019-02-05 08:11:43 -05:00
Timm Bäder
7abcd5ba3b window: Remove set_icon_from_file
Not all backends support setting window icons from raw pixel data, so
remove the public API in GtkWindow for it.
2019-02-05 08:11:43 -05:00
Matthias Clasen
3489ed087d Merge branch 'kill-buttonbox' into 'master'
Drop GtkButtonBox

See merge request GNOME/gtk!554
2019-02-05 13:06:09 +00:00
Alexander Larsson
ca1ffa0c23 Merge branch 'master' into 'master'
Ensure focus on click ( Fix #1633 )

Closes #1633

See merge request GNOME/gtk!546
2019-02-05 13:05:34 +00:00
Matthias Clasen
32e61b955a Drop gtkboxprivate.h
Not needed anymore.
2019-02-05 07:54:35 -05:00
Matthias Clasen
de4703ebfa Drop buttonbox from tests 2019-02-05 07:40:43 -05:00
Matthias Clasen
a8e6cd3c47 Merge branch 'no-more-plus' into 'master'
Drop the "plus" from "GTK"

See merge request GNOME/gtk!558
2019-02-05 10:52:38 +00:00
Emmanuele Bassi
f6c07a0ddb glade: Drop the "plus"
From documentation and catalog description.
2019-02-05 11:26:54 +01:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Emmanuele Bassi
866d0c4fb9 themes: Drop the "plus"
Comments and documentation.
2019-02-05 11:25:41 +01:00
Emmanuele Bassi
4569bc6358 inspector: Drop the "plus"
From user-visible strings, mostly.
2019-02-05 11:25:15 +01:00
Emmanuele Bassi
1b6734346c modules: Drop the plus
Use 'GTK' consistently.
2019-02-05 10:30:33 +01:00
Emmanuele Bassi
803ae6a62f examples: Rename the pkg-config file for GTK 4
We dropped the '+' and the major.minor version from the pkg-config file
name.
2019-02-05 10:27:57 +01:00
Emmanuele Bassi
589cb19715 demos: Drop the '+' from GTK
The demos have user-visible text that should refer to "GTK", not "GTK+"
any more.
2019-02-05 10:19:57 +01:00
Emmanuele Bassi
0f24fddaf7 docs: Drop the '+' from GTK
We need to adapt to both the change in the name of the project, and to
the name change in the pkg-config file.
2019-02-05 10:14:31 +01:00
Matthias Clasen
179e85f803 about dialog: Stop setting secondary
We no longer use a button box, so this is not available.
2019-02-05 03:46:31 -05:00
Matthias Clasen
1aeeefdccb Merge branch 'drop-the-plus' into 'master'
Rename some references to GTK+

See merge request GNOME/gtk!553
2019-02-05 08:29:39 +00:00
Matthias Clasen
dcda16a26f Merge branch 'pango-deprecation' into 'master'
Pango deprecation

See merge request GNOME/gtk!555
2019-02-05 08:28:48 +00:00
Matthias Clasen
99c5a3d72c gtk: Stop using deprecated pango api 2019-02-04 18:28:31 -05:00
Matthias Clasen
101f1c7b42 gdk: Stop using deprecated pango api 2019-02-04 18:28:31 -05:00
Matthias Clasen
2350d0945a gdk: Add a copy of some deprecated pango api
We use pango_find_base_dir() in a few places, and
this api has been deprecated.
2019-02-04 18:28:31 -05:00
Matthias Clasen
dbd360262c Add an explicit fribidi dep
We will use fribidi api to determine text direction.
2019-02-04 18:28:31 -05:00
Matthias Clasen
5120748981 Drop GtkButtonBox
This widget does not seem worth keeping,
and we want to get rid of child properties.
2019-02-04 12:44:55 -05:00
Matthias Clasen
d080be3e50 Rename some references to GTK+
We are dropping the plus.
2019-02-04 11:58:09 -05:00
Mickael Istria
14010899b5 Issue #1633 - Ensure focus on click
This is necessary to give back focus to the Broadway elements when
content is embedded in an IFrame.

Signed-off-by: Mickael Istria <mistria@redhat.com>
2019-02-04 17:46:09 +01:00
Timm Bäder
25e199e7b7 testgtk: Fix image menu item child order
We want the image first, text second.
2019-02-04 17:05:30 +01:00
Timm Bäder
257df1d8b5 tooltip: Get the pointer position relative to the toplevel widget
Since we position the tooltip window relative to the toplevel widget and
not actually relative to the effective_toplevel, we shouldn't get the
pointer position relative to the effective_toplevel.

We previously used the pointer position (relative to the
effective_toplevel) and the anchor rect (relative to the toplevel
widget) together to calculate x_distance. This leads to wrong values in
cases where get_surface (new_tooltip_widget) != get_surface (toplevel)

Fixes #1427 in master
2019-02-04 17:05:30 +01:00
Timm Bäder
47ba423eca tooltip: Use gtk_widget_compute_bounds to get tootip widget anchor
Instead of using gtk_widget_get_allocated_width/height, which might
return the wrong box for the tooltip widget.
2019-02-04 17:05:30 +01:00
Timm Bäder
489e87baea main: Rename local variable
Make it a little clearer that this is the event widget and not just any
widget.
2019-02-04 17:05:30 +01:00
Timm Bäder
43234eec42 gtkmain: Rename event_widget to target_widget in do_event
The event_widget is the widget that the surface belongs to which got
this event. The target widget is the one that will receive the event.
The previous terminology was confusing.
2019-02-04 17:05:30 +01:00
Matthias Clasen
3d1fd5169c Merge branch 'popover-menu-position' into 'master'
Drop GtkPopoverMenu::position

See merge request GNOME/gtk!552
2019-02-04 15:57:44 +00:00
Matthias Clasen
268fcbb838 Drop GtkPopoverMenu::position
This is another unnecessary position child property.
2019-02-04 10:47:18 -05:00
Emmanuele Bassi
af63e894e6 Merge branch 'enum-template-basename' into 'master'
Use @basename@ in enumeration type templates

See merge request GNOME/gtk!550
2019-02-04 13:19:10 +00:00
Emmanuele Bassi
2514760a8b Merge branch 'testgtk-warning' into 'master'
tests: Remove spurious gtk_container_add()

See merge request GNOME/gtk!549
2019-02-04 13:06:43 +00:00
Emmanuele Bassi
4040f76529 Use @basename@ in enumeration type templates
The @filename@ directive will use the full path of the file being parsed
for enumeration types; we should use @basename@, instead, as it improves
the reproducibility of the build by using only the file name.
2019-02-04 14:02:45 +01:00
Emmanuele Bassi
3bb1423804 tests: Remove spurious gtk_container_add()
Commit bd71e744d2 removed
gtk_box_pack_end(), but it added a gtk_container_add() with an
uninitialised widget, and the compiler is very unhappy about it.
2019-02-04 10:03:33 +01:00
Emmanuele Bassi
35e973d698 docs: Remove <ulink> elements
We use Markdown for documentation, not Docbook.
2019-02-04 09:53:22 +01:00
Balázs Úr
8390883028 Update Hungarian translation 2019-02-03 17:28:26 +00:00
Balázs Úr
f84116b8ff Update Hungarian translation 2019-02-03 13:54:30 +00:00
Balázs Úr
27446b4b04 Update Hungarian translation 2019-02-02 14:52:38 +00:00
Timm Bäder
4dca2f9604 recorder: Don't try to print info about a NULL list model 2019-01-31 17:00:50 +01:00
Timm Bäder
5852a5ece8 switch: Notify :state by pspec 2019-01-30 17:46:08 +01:00
Emmanuele Bassi
a7fa1cf6f2 Merge branch '1480-critical-csd-close-button' into 'master'
gtkmain: Avoid critical messages on closing window

Closes #1480

See merge request GNOME/gtk!442
2019-01-30 11:53:12 +00:00
Timm Bäder
d9d4879623 Merge branch 'wip/carlosg/texthandles-position' into 'master'
gtkentry: Fix text handle coordinates calculation

See merge request GNOME/gtk!542
2019-01-29 13:36:43 +00:00
Carlos Garnacho
a15325ef44 gtkentry: Fix text handle coordinates calculation
The text allocation is already in widget-local coordinates, involving the
GtkAllocation here is not right.
2019-01-29 12:00:07 +01:00
Jakub Steiner
5765d47568 Merge branch 'expander-row-padding' into 'master'
adwaita: Fix the greediness of row:not(.expander)

See merge request GNOME/gtk!526
2019-01-29 09:46:34 +00:00
Jakub Steiner
7286ede490 Merge branch 'adwaita-osd-spinbutton-entry-fix-master' into 'master'
Horizontal OSD spinbutton entry fix

See merge request GNOME/gtk!332
2019-01-29 09:39:57 +00:00
Timm Bäder
4a333f826a Merge branch 'wip/matthiasc/event-signal' into 'master'
Remove vestigial ::event support

See merge request GNOME/gtk!538
2019-01-29 08:33:40 +00:00
Timm Bäder
8c4dc3de4d widget: Also propagate ACTIVE state when unsetting 2019-01-29 07:19:54 +01:00
Timm Bäder
0a5362a7d9 gtkmain: Remove comment mentioning GDK_PROPERTY_NOTIFY
... which doesn't exist anymore.
2019-01-29 07:19:54 +01:00
Timm Bäder
245cebec1d widget: Ignore events on unmapped widgets
There was a special case for GtkSearchBar, so remove that one.
2019-01-29 07:19:54 +01:00
Benjamin Otte
bde2332a1a main: Report correct target for button release events
Button release events should not go to the widget below the pointer, but
to the widget that received the original button press.

Fixes #24
2019-01-29 07:19:54 +01:00
Timm Bäder
20429f4764 Remove :active state handling on widgets 2019-01-29 07:19:54 +01:00
Timm Bäder
1b504a3303 Automatically set :active state on button press/release 2019-01-29 07:19:54 +01:00
Timm Bäder
61ec2ab5c9 widget: Propagate PRELIGHT state when unsetting it
Without this, disabling a widget that's being hovered and is a child
widget of the widget we're disabling (e.g. the GtkImage child of a
GtkButton) will retain its :hover state even though it should be
insensitive to any sort of input now.
2019-01-29 07:19:54 +01:00
Timm Bäder
611964d915 widget: Avoid some type checks when picking 2019-01-29 05:03:26 +01:00
Timm Bäder
16481734c1 csstransformvalue: Convert skew values to radians 2019-01-29 05:03:26 +01:00
Timm Bäder
d54cccfdd5 label: Use pango_layout_get_log_attrs_readonly
No need to memdup the log attrs in this case.
2019-01-29 05:03:26 +01:00
Timm Bäder
7f4b7c48e8 cssparser: Make _gtk_css_parser_try a macro
We almost always pass a constant string to it, so use a macro and try to
trick the compiler into evaluating the 2(!) strlen() calls at compile
time.
2019-01-29 05:03:26 +01:00
Timm Bäder
df1f036a95 cssanimatedstyle: Avoid some type checks and unnecessary work 2019-01-29 05:03:26 +01:00
Timm Bäder
f3c51cdf5f scrolledwindow: Don't NULL the indicator widget in unmap
We still have the widget, so just keep the pointer to it.
2019-01-29 05:03:26 +01:00
Fran Dieguez
95404c8a51 Update Galician translation 2019-01-28 21:55:11 +00:00
Fran Dieguez
b2f0c10ade Update Galician translation 2019-01-27 21:40:17 +00:00
Balázs Úr
847b3a9bae Update Hungarian translation 2019-01-27 20:14:31 +00:00
Fran Dieguez
7fcd183317 Update Galician translation 2019-01-27 00:09:39 +00:00
Fran Dieguez
9b06692442 Update Galician translation 2019-01-26 23:53:47 +00:00
Matthias Clasen
8a667a5f1d Remove vestigial ::event support
The signal is gone, no need to keep the vfunc around.
2019-01-26 15:36:55 -05:00
Matthias Clasen
a3801299f5 Merge branch 'tabular-menus' into 'master'
Drop tabular menus

See merge request GNOME/gtk!527
2019-01-25 17:32:41 +00:00
Matthias Clasen
714d04cb86 Merge branch 'switch-icons' into 'master'
Use switch icons

See merge request GNOME/gtk!529
2019-01-25 02:30:08 +00:00
Matthias Clasen
f03fe74369 Update css tests results
These now show images as children of the switch,
as expected.
2019-01-24 21:10:12 -05:00
Matthias Clasen
57542e0cf6 icon browser: Add on and off icons
These are going to be used internally.
2019-01-24 20:43:12 -05:00
Matthias Clasen
70db084d43 Fix gtk4-icon-browser
It was broken by a recent GtkDialog change that renamed
the internal vbox child to content_area.
2019-01-24 20:43:12 -05:00
Matthias Clasen
c5f90fc20d switch: Use icons
This works better than glyphs, avoiding the
uncertainties of font availability and fallback..
2019-01-24 20:43:12 -05:00
Matthias Clasen
1528e7eabf Add switch icons
These will be used in GtkSwitch in the future.
2019-01-24 20:43:12 -05:00
Matthias Clasen
9dee863217 menu: Drop the child properties
These were only there in support of tabular menus.
2019-01-23 23:36:04 -05:00
Matthias Clasen
e31a96123e Drop gtk_menu_attach
We no longer support tabular menus.
2019-01-23 23:30:18 -05:00
Matthias Clasen
a65f5c2e73 tree menu: Drop support for grids
This was only used in GtkComboBox, and it no longer
supports grids,
2019-01-23 23:20:22 -05:00
Matthias Clasen
a5ba0d46c2 combobox: Drop support for grids
This is pretty much unued, and we want to get rid of it.

This removes support for wrap-width, row-span-column
and column-span-column properties.
2019-01-23 22:52:36 -05:00
Matthias Clasen
b0e67f1eed testcombo fixup 2019-01-23 22:52:16 -05:00
Matthias Clasen
b3dbdcdf77 fixup notify tests 2019-01-23 22:51:48 -05:00
Matthias Clasen
f87e40bccd Drop a grid combo example 2019-01-23 22:45:55 -05:00
Matthias Clasen
19dbc831c5 Drop row/column-span-column from tests 2019-01-23 22:42:51 -05:00
Matthias Clasen
e2693ef44f testgtk: Drop tabular menu
Tabular menus are basically unused, and we want to drop this.
2019-01-23 22:40:53 -05:00
Matthias Clasen
2de7f760e5 gl texture: fix a typo 2019-01-23 22:33:44 -05:00
Matthias Clasen
d339a43634 header bar: Drop the position child property
There is no particular need to have this, and we want
to get rid of child properties.
2019-01-23 20:05:28 -05:00
Matthias Clasen
003eefe8bf action bar: Drop the position child property
There is no particular need to have this, and we want
to get rid of child properties.
2019-01-23 19:30:47 -05:00
Matthias Clasen
f3f5a896de box: Avoid position in the reorder api
Change the reorder api to insert after a sibling,
so that moving to first place becomes reorder (... NULL).

And add a insert_after api that can replace the common
container_add / reorder_after (... NULL) combination.

Update all callers.
2019-01-23 19:30:47 -05:00
Matthias Clasen
883d5d8584 box: Remove the position child property
The position child property is problematic, since it
requires us to emit notification for all children when
inserting a child early in the list of children.

Remove the property from all ui files.
2019-01-23 19:30:47 -05:00
Timm Bäder
c7b1df1ebd migration guide: Add a paragraph about GtkBox's pack-type 2019-01-23 19:30:46 -05:00
Timm Bäder
e9e40ddb42 box: Remove gtk_box_pack_start 2019-01-23 19:30:46 -05:00
Timm Bäder
a543ed84f6 box: Remove gtk_box_pack_end 2019-01-23 19:30:46 -05:00
Timm Bäder
3d34b91453 box: Simplify documentation
Remove all references to any sort of "packing".
2019-01-23 19:30:46 -05:00
Timm Bäder
1ccba26de9 box: Remove children list
GtkWidget saves a widget list for us, so we don't need to keep track of
them ourselves. This is okay now that we don't have a pack-type child
property anymore.
2019-01-23 19:30:46 -05:00
Timm Bäder
c47abb5f68 testsuite: Remove box packing css node tests
Testing the correct css order for mixed pack-start/pack-end cases
doesn't make sense if boxes don't have a notion of pack-type anymore.
2019-01-23 19:30:46 -05:00
Timm Bäder
28c51175d8 box: Remove pack-type child property 2019-01-23 19:30:46 -05:00
Timm Bäder
99738e7059 assistant: Fix button order in ui file 2019-01-23 19:30:46 -05:00
Timm Bäder
494e9d750a dialog: Expose the content area as a separate GtkBox child
This way, the "vbox" internal child does not contain anything by
default. It previously did contain "internal" widgetry like the action
area.
2019-01-23 19:30:46 -05:00
Timm Bäder
3a13515777 Stop using GtkBox's pack-type child prop in UI files 2019-01-23 19:30:46 -05:00
Timm Bäder
ab6a67dbeb combobox: Stop using GtkBox's pack-type property
Reorder the child widgets accordingly instead.
2019-01-23 19:30:46 -05:00
Timm Bäder
d7756dc62b scalebutton: Stop relying on GtkBox's pack-type child prop 2019-01-23 19:30:46 -05:00
Timm Bäder
bd71e744d2 Stop using gtk_box_pack_end
It might soon go away!
2019-01-23 19:30:46 -05:00
Timm Bäder
09361e7665 tests: Remove flicker test
gtk+ hasn't been flickering in ages so this test isn't very useful.
2019-01-23 19:30:46 -05:00
Timm Bäder
4349e33d4e shortcutssection: Use a center box as footer 2019-01-23 19:30:46 -05:00
Matthias Clasen
afaac98442 Update a11y tests
Working towards a passing testsuite.
2019-01-23 19:27:35 -05:00
Matthias Clasen
c1f79a935c switch: Avoid problems with glyph availability
If none of the glyphs we want are available, fall
back to using empty strings here, rather than causing
critical warnings.
2019-01-23 15:47:02 -05:00
Adrien Plazas
636a9a6ea7 adwaita: Fix the greediness of row:not(.expander)
This avoids list rows (e.g. the ones in a stack sidebar) to be
accidentally selected and see their padding messed up.
2019-01-23 21:41:58 +01:00
Jakub Steiner
6ebbd8d375 Merge branch 'expander-row-padding' into 'master'
adwaita: Fix the padding of row.expander

See merge request GNOME/gtk!521
2019-01-22 12:57:07 +00:00
Adrien Plazas
773efe41a9 adwaita: Fix the padding of row.expander
This will allow to implement the expanding rows pattern.
2019-01-22 12:44:33 +01:00
Benjamin Otte
359bc7695c build: Reintroduce warning flags from autotools
Some of the flags got lost in the meson transition or were demoted from
error flags to warning flags.
This commit reintroduces them.

It also includes fixes for the code that had warnings with those flags.
The big one being -Wshadow.
2019-01-22 04:33:12 +01:00
Benjamin Otte
7723749e00 meson.build: Order warning flags alphabetically
... and remove the duplicate we already had.
2019-01-22 04:33:11 +01:00
Benjamin Otte
c875465477 imcontextwayland: Get rid of global variable
Attach it to the GdkDisplay.
Also fixes -Wshadow complaining about "global" being shadowed.
2019-01-22 04:33:11 +01:00
Benjamin Otte
7978e04963 immodule: Clean up loading code
Remove the unneeded is_platform() check and just go by extension point
priority.

Also g_error() out if no im module exists, because "simple" is compiled
in and should always exist.
2019-01-22 04:33:11 +01:00
Benjamin Otte
bbd1532f84 imcontext: Fix priorities of modules
All built-in backend modules get a priority of 0 because they are the
default ones.
GtkIMContextSimple gets a priority of G_MININT because it's the fallback
one.

This mirrors the media modules code.
2019-01-22 04:33:11 +01:00
Timm Bäder
3d40f003b2 Merge branch 'no-more-bgo' into 'master'
docs: Point people at the right place for bugs

Closes #1559

See merge request GNOME/gtk!498
2019-01-21 07:05:26 +00:00
Chun-wei Fan
a0e8cd5bac testsuite/gtk/slicelistmodel.c: Avoid VLAs
Unfortunately VLA's are unlikely to be supported on any Visual Studio
versions, although it is C99, so replace it with g_newa() calls.
2019-01-21 13:49:20 +08:00
Pieter Schalk Schoeman
d86c99312c Update Afrikaans translation 2019-01-20 23:28:41 +00:00
Pieter Schalk Schoeman
f3fdb83160 Update Afrikaans translation 2019-01-20 23:26:52 +00:00
Matthias Clasen
9430b0b6ee testsuite: Add slice model tests
Do the same style of tests we do for all the
other list models. These tests found the issue
fixed in the previous commit.
2019-01-20 06:14:21 +01:00
Matthias Clasen
045b92abdd slice model: Don't report excessive changes
We were not skipping an unchanged initial segment
of the slice in some cases. Fix that.
2019-01-20 06:11:48 +01:00
Benjamin Otte
af56f06b7b rbtree: Fix a crash in insertion fixup
This got broken in commit a33ff4c6ab.

Testcase included.
2019-01-20 06:09:40 +01:00
Benjamin Otte
5e00cdbd74 rbtree: Add a trivial way to add rbtree tests to the testsuite.
The format of the printout will be suitable for addition as a new test to
  testsuite/gtk/rbtree-crash.c
by just grepping the printouts from the relevant rbtree.
2019-01-20 06:09:40 +01:00
Matthias Clasen
9baef5e101 Merge branch 'reference-include' into 'master'
Specify the C include for Unix printing API

See merge request GNOME/gtk!516
2019-01-19 01:13:42 +00:00
Michael Catanzaro
c7af14dea8 filechoosernativeportal: stuff the current filter into options
We need to tell the portal what filter is supposed to be selected by
default, or it will just pick the first one, which could be wrong and
annoying.

This will require updated xdg-desktop-portal and xdg-desktop-portal-gtk
to work properly.

Fixes #1492
2019-01-18 20:02:11 -05:00
Michael Catanzaro
f3f22b76dc filechoosernativeportal: remove redundant casts
We are casting from GtkFileChooserNative to... GtkFileChooserNative.
Boo.
2019-01-18 20:01:52 -05:00
Michael Catanzaro
a0f750f7c9 filechoosernative: forward current_filter to delegate dialog
gtk_file_chooser_set_filter() doesn't work for GtkFileChooserNative. The
code forwards added and removed filters to the delegate dialog, but
doesn't do anything to set the selected one, so the wrong one gets
chosen. So fix that.

This only fixes the fallback dialog. The portal will be fixed in a
subsequent commit.

Partial fix for #1492
2019-01-18 20:01:37 -05:00
Emmanuele Bassi
3543a54545 Specify the C include for Unix printing API
Instead of using the INCLUDE directive inside the sections file, we can
specify the default C include in the gtkdoc-mkdb arguments, and override
it inside the C sources that need it.
2019-01-19 00:00:34 +00:00
Emmanuele Bassi
95c0f07295 Merge branch 'master' into 'master'
A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells

See merge request GNOME/gtk!505
2019-01-18 23:13:31 +00:00
Matthias Clasen
8f697d6715 Merge branch 'switch-fallback' into 'master'
Add fallback glyphs for GtkSwitch states

See merge request GNOME/gtk!509
2019-01-18 22:43:54 +00:00
Matthias Clasen
28241cecff about dialog: Use ::activate-link for license
This should behave the same as all the other links
in this dialog.

Closes: #1561
2019-01-18 17:31:56 -05:00
Timm Bäder
8e0cbc1c3d gl renderer: Support (not) resetting the opacity for offscreen nodes
We usually want to do that, but it's wrong for e.g. crossfade nodes.
2019-01-18 19:43:54 +01:00
Timm Bäder
7843da1f2b entry: Use pango_layout_get_log_attrs_readonly
Since we're not modifying anything...
2019-01-18 19:43:53 +01:00
Timm Bäder
7aad0896a7 entry: Use a label as placeholder
This gives us a better way of choosing the color of the placeholder text
(and enabled general css styling on it of course).

Closes #378 (If you want to keep the placeholder on focused and empty
entries, just don't set the placeholder opacity to 0 in
entry:focus>placeholder. This is the default behavior but this commit
includes a rule in Adwaita to hide it.
2019-01-18 19:43:53 +01:00
Timm Bäder
7c72712b0f entry: Trivial indentation fix 2019-01-18 19:43:52 +01:00
Timm Bäder
a25d6b1dc7 tooltip: Use gdk_rectangle_contains_point 2019-01-18 19:43:52 +01:00
Timm Bäder
c8ec0f42a0 tooltip: Move tooltips enabled checks into tooltips_enabled 2019-01-18 19:43:51 +01:00
Timm Bäder
2353e0e03f tooltip: Look at the event's target widget
Since we now have a widget whenever we query tooltips, we can as well
get the events target_widget if we have an event (which is what we do
when coming from gtkmain.c). This keeps us from searching the entire
widget hierarchy for the target event even though we've already done
that for pointing events in gtkmain.c

This reduced the work done in gtk_tooltip_handle_event in normal motion
events to basically nothing since we already did all the heavy lifting
when handling the pointing event in gtkmain.c
2019-01-18 19:43:51 +01:00
Timm Bäder
11f9ae8202 tooltip: Remove gtk_tooltip_trigger_tooltip_query
As stated by the documentation, this should be called when a widget gets
updated, but in that case, one can equally use
gtk_widget_trigger_tooltip_query.
2019-01-18 19:43:51 +01:00
Timm Bäder
0e07912231 tooltips: Remove keyboard mode tooltips
Keyboard mode was only used in gtk_widget_real_show_help before, but now
that's gone and so is any usage of keyboard mode tooltips.
2019-01-18 19:43:50 +01:00
Timm Bäder
c49cc977fa gizmo: return void from snapshot func
This boolean return was from the old gadget code and we weren't using it
in the new gizmo code.
2019-01-18 19:43:50 +01:00
Timm Bäder
3ca688a6dd scrolledwindow: Reset indicators in unmap()
This is unrelated to any windowing resources these days, so no need for
an unrealize handler.
2019-01-18 19:43:49 +01:00
Timm Bäder
fae6113ce3 filechooserwidget: Show spinner when searching
This was lost it seems
2019-01-18 19:43:49 +01:00
Timm Bäder
5c81cc2f36 GdkEvent: Make gdk_event_set_user_data private 2019-01-18 19:43:48 +01:00
Timm Bäder
01e985a830 GdkEvent: Remove unused struct 2019-01-18 19:43:48 +01:00
Timm Bäder
b2eff300b1 GdkEvent: Add a proper user_data member to GdkEventAny
Setting it as qdata on the object doesn't save any memory since we use
the user_data as the event target, which every event has set these days.
This way is also faster since just reffing the object doesn't do any
locking.
2019-01-18 19:43:48 +01:00
Timm Bäder
dbc8d253c3 scrolledwindow: Fix a event widget/event target mixup 2019-01-18 19:43:47 +01:00
Timm Bäder
0f6e15cfa2 scrolledwindow: remove unused struct 2019-01-18 19:43:46 +01:00
Timm Bäder
ea2f66226a iconview: Fix scrolled drawing
We were only drawing the scrolled away first few items
2019-01-18 19:41:19 +01:00
Timm Bäder
e14fe222e8 gl renderer: Don't add clip ops if the clip didn't change 2019-01-18 19:40:49 +01:00
Emmanuele Bassi
58d9c3d5bd switch: Update state labels when needed
If the text style changes, or the display settings do, we need to update
the state labels to ensure that the glyphs are available in the font
we're using.
2019-01-18 14:43:42 +00:00
Emmanuele Bassi
a5fcdca935 docs: Point people at the right place for bugs
We don't use Bugzilla for GTK any more, so our documentation should
reflect that change.

Closes #1559
2019-01-18 14:34:10 +00:00
Emmanuele Bassi
215903c4f1 Merge branch 'get-timings-transfer' into 'master'
g-i: Add transfer none annotations for frame clock timings getters

See merge request GNOME/gtk!511
2019-01-16 23:43:14 +00:00
Tomasz Miąsko
16867d8abf g-i: Add transfer none annotations for frame clock timings getters 2019-01-17 00:01:38 +01:00
Timm Bäder
9b15c6900a colorscale: Redraw correct widget after setting rgba
The entire color scale hack is still done in GtkRange, which draws the
color scale in the range gizmo. So, to correctly redraw the color scale
when setting a new color, we need to redraw the proper widget and that's
the trough widget.

Fixes #1453
2019-01-16 19:20:53 +01:00
Timm Bäder
135cf16969 entry: Remove _gtk_entry_grab_focus
We have API for both the select and !select behavior these days, so use
that one.

Fixes #1457
2019-01-16 19:18:13 +01:00
Timm Bäder
374e93ef96 window: Directly find the cursor in the widget hierarchy
Instead of recording the way up from the target widget to the grab
widget (or toplevel) and then walking that path upwards, just walk the
parent chain and look at the cursor.
2019-01-16 19:01:40 +01:00
Timm Bäder
83f8056992 scrolledwindow: Remove unused drag_device member 2019-01-16 19:01:40 +01:00
Timm Bäder
cf1526cca6 snapshot: Add gtk_snapshot_from_parent
Most of the time, the GtkSnapshot objects we create while snapshotting
widgets don't end up containing all that many nodes or states in their
respective node or state stack. This undermines the amortized allocation
behavior of the G(Ptr)Array we use for the stacks. So instead, use the
(until now unused) parent_snapshot GtkSnapshot* passed to
gtk_widget_create_render_node and reuse its node and state stack.

We do not avoid allocating a new GtkSnapshot object, but we do avoid
allocating a ton of G(Ptr)Array objects and we also avoid realloc'ing
their storage.
2019-01-16 19:01:40 +01:00
Timm Bäder
c1c764255f window: Don't manually queue a draw on the new focus widget
This is either unneeded and OK to remove, or it is needed and there's a
bug somewhere else.
2019-01-16 19:01:38 +01:00
Timm Bäder
7dd54b5789 treeview: Don't get separator_height more than once
Closes !209
2019-01-16 18:58:15 +01:00
Timm Bäder
697aa95c7e treeview: cache expander size
We need to know it all the time and since we get it from CSS, doing that
is fairly expensive.
2019-01-16 18:58:15 +01:00
Daniel Mustieles
a93f984b16 Updated Spanish translation 2019-01-16 09:54:54 +01:00
Emmanuele Bassi
5c50e48156 Add fallback glyphs for GtkSwitch states
Even though the IEC power glyphs are part of Unicode 9.0 (released in
2016) not all fonts have them.

To avoid showing the hexbox of doom when the system font does not have
the glyphs we'd like to use, add a fallback pair, using the old glyphs
we suggested when the labels were translatable.
2019-01-15 22:16:05 +00:00
Carmen Bianca BAKKER
c7af3e61e2 Update Esperanto translation 2019-01-14 21:16:22 +00:00
Benjamin Otte
e104337704 rbtree: Fix removing last element
The refactoring of automatically updating tree->root when setting a
node's parent works very well - unless all nodes get removed and no
node's parent got updated.
2019-01-14 18:42:18 +01:00
Benjamin Otte
8a7706f2b5 rbtree: Make node getters not require tree argument
The tree is not needed to walk around the nodes.

It is however still needed for anything that requires modifying the
tree.

There is no immediate benefit in changing this API, but there might be
situations in the future where we can avoid looking up the tree when we
just want to check some details about the node.
2019-01-14 02:14:11 +01:00
Benjamin Otte
6a3c2a230a rbtree: Add gtk_rb_tree_node_get_tree()
Store a link to the tree in the root node. This allows looking up the
tree in O(log N) from the node without any extra memory usage.

This is useful because code can just store a pointer to the node and
doesn't need to keep the tree pointer around. And that can (for large
trees) save quite a bit of memory.
2019-01-14 02:14:11 +01:00
Benjamin Otte
a33ff4c6ab rbtree: Access node->parent only via accessors
This also adds a set_parent() function that automatically takes care of
updating tree->root for root nodes.
2019-01-14 02:14:11 +01:00
Benjamin Otte
7ff949ea30 rbtree: Remove gtk_rb_tree_find()
Searching through the tree is too specific to use a general function.
All the existing code just copies and slightly adapts the same 20 lines
instead, so there's no reason to keep the complicated API.
2019-01-14 02:14:11 +01:00
Matthias Clasen
25bca27bfe Rename GtkCssRBTree to GtkRBTree
This is a generally usable red-black tree api,
and it is not used in css at all.
2019-01-14 02:14:11 +01:00
Matthias Clasen
e269f43afc Rename GtkRBTree to GtkTreeRBTree
This frees up the generic name for a more
generic rbtree implementation.
2019-01-14 02:14:11 +01:00
Timm Bäder
59bf76dce1 gl renderer: Force blur shadow node children offscreen
This broke the overlay blur demoe when resizing the window to a size
that would completely move the image below a button, causing the
GtkSnapshot code to remove the clip node below the blur node.
2019-01-13 08:41:37 +01:00
Timm Bäder
44a2a49f31 overlay: Directly create cairo_region
Instead of doing a cairo_region_create + union, just pass the rect
directly to cairo_region_create_rectangle
2019-01-13 08:41:37 +01:00
Timm Bäder
69bc42f444 rendernodepaintable: Don't try to snapshot 0×0 nodes
Considering the operations that some of the rendernode constructors
do, nodes with width or height 0 (or both of course) are very well
possible. This would break in the rendernodepaintable when adding a
transform, which divides by width/height of the rendernode.
2019-01-13 08:39:05 +01:00
Timm Bäder
269535c844 overlay: Blur the clipped node, not clip the blurred node
Blurring is a lot more expensive than clipping, so try to blur less by
clipping first.
2019-01-13 08:23:25 +01:00
Timm Bäder
c7f773f3e3 overlay: Trivial indentation fix 2019-01-13 08:23:25 +01:00
Timm Bäder
c6da0c9a7a demo: Fix tranparency overlay demo
We'd like the rose picture to be bigger than 16×16. Also remove the
scrolledwindow since the GtkPicture now automatically scales down the
rose image. This also fixes the picture always being allocated at y=0.
2019-01-13 08:23:25 +01:00
Timm Bäder
d098cd5865 overlay: Don't offset the main window snapshot
We need the node without an offset applied.

Fixes the rose picture being offset in tests/testoverlay
2019-01-13 08:23:25 +01:00
Timm Bäder
4dc8ab58a3 testoverlay: Re-enable blurring
Accidentally disabled in 8b14c8d0a8
2019-01-13 08:23:25 +01:00
Timm Bäder
5680393f9d label: Add missing nullable annotation 2019-01-13 08:23:25 +01:00
Piotr Drąg
aadcec3d1e Update Polish translation 2019-01-12 13:19:35 +01:00
Mike Gorse
a52431d2b4 A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells
These functions were missing GDK_AVAILABLE_IN macros, so they were
listed in the gir but not exported.
2019-01-11 16:53:39 -06:00
Timm Bäder
5fd936beef spinbutton: Use increment/decrement icon names
And add list-{remove,add}-symbolic as fallback.

Fixes #1569
2019-01-11 18:29:20 +01:00
Timm Bäder
563b80d434 label: Skip updating link state if we have no layout
This can happen whenever the ::activate-link handler sets different
markup on the label, causing all links to be recreated. In this case,
the GtkLabelLink* passed to emit_activate_link is garbage after the
g_signal_emit call and we shouldn't try to do anything with it.

Fixes #1498
2019-01-11 17:46:12 +01:00
Timm Bäder
f4f0f0e6a0 snapshot: Get new GArray item directly
Instead of building it up ourselves, then coping it into the GArray and
then getting the last element of that array.
2019-01-11 17:02:23 +01:00
Emmanuele Bassi
ba9b0c6f7d Use the IEC power symbols for GtkSwitch labels
Unicode 9.0 introduced glyps for the "on" and "off" power states, in the
form of:

 - U+23FD POWER ON SYMBOL, or ⏽
 - U+2B58 HEAVY CIRCLE, or ⭘

With `HEAVY CIRCLE` as "power off symbol" selected to avoid adding yet
another circle to the standard.

Since we moved GtkSwitch to always show glyphs instead of (translatable)
strings, asking the localisation teams to either come up with a suitable
short string to replace the English "ON" and "OFF", or to fall back to
Unicode glyphs, we should ensure we're using the appropriate symbols to
begin with.

See also: gtk!503 for the corresponding gtk-3-24 change.
2019-01-11 15:25:30 +00:00
Timm Bäder
3ce3de98da Merge branch 'wip/muktupavels/listbox-master' into 'master'
listbox: set selected_row before emitting signal

See merge request GNOME/gtk!502
2019-01-11 11:38:27 +00:00
Alberts Muktupāvels
1cd934e105 listbox: set selected_row before emitting signal
Signal emittion was added in 6f857f87dc commit and it seems that
this is only place where selected_row is set after emitting signal.

Because of this gtk_list_box_get_selected_row currently returns NULL
as selected row if selection mode is set to GTK_SELECTION_BROWSE.
2019-01-11 13:19:28 +02:00
Timm Bäder
dc1d3824a2 Merge branch 'wip/dboles/EventControllerKey-docs-4' into 'master'
EventControllerKey: Add missing documentation bits

See merge request GNOME/gtk!454
2019-01-11 09:39:25 +00:00
Matthias Clasen
927e49ed86 switch: Always use I/O
This allows for smaller switches, and goes better with
modern themes that have round switches.
2019-01-10 17:21:48 -05:00
Timm Bäder
d55fc8b7b1 gl renderer: Dont't try to draw glyphs at scale 0
Fixes #1475
2019-01-10 17:14:48 +01:00
Timm Bäder
e72d0a9118 gl glyphcache: Only support one dirty glyph per atlas 2019-01-10 16:49:19 +01:00
Timm Bäder
8b14c8d0a8 testoverlay: Fix fancy effect 2019-01-10 16:49:19 +01:00
Timm Bäder
913b4fcc49 iconcache: Remove unused defines 2019-01-10 16:49:19 +01:00
Timm Bäder
fb7d033953 gl renderer: Remove debug code 2019-01-10 16:49:19 +01:00
Timm Bäder
cfa440bbae gl renderer: Fix hidpi transform nodes 2019-01-10 16:49:19 +01:00
Timm Bäder
7ac9fe3b60 shadowvalue: Remove unused API 2019-01-10 16:49:19 +01:00
Timm Bäder
b0a8b7da63 gl renderer: Only compile the vertex shader once
All our programs use the same vertex shader, so don't compile it over
and over again. This improves startup times by at least 0.001%, I swear.
2019-01-10 16:49:19 +01:00
Timm Bäder
b2ff6e91cd gl renderer: Don't forget the offset when rendering blur nodes 2019-01-10 16:49:19 +01:00
Daniel Mustieles
b4d906c464 Update Spanish translation 2019-01-10 08:50:55 +00:00
Timm Bäder
ae03caacc4 Merge branch 'patch-1' into 'master'
Fix a typo in “popup-context-menu” documentation.

See merge request GNOME/gtk!500
2019-01-10 06:23:09 +00:00
bodqhrohro
ec22646210 Fix a typo in “popup-context-menu” documentation. 2019-01-09 14:24:29 +00:00
Timm Bäder
ba1644cba1 Merge branch 'wip/sadiq/750-gtk4' into 'master'
gtkpopover: Fix popover when parent widget is partially visible

Closes #750

See merge request GNOME/gtk!496
2019-01-09 11:53:45 +00:00
Mohammed Sadiq
d11bc68b27 gtkpopover: Fix popover when parent widget is partially visible
fixes https://gitlab.gnome.org/GNOME/gtk/issues/750
2019-01-09 17:12:23 +05:30
Daniel Mustieles
5720e406b9 Updated Spanish translation 2019-01-09 09:52:53 +01:00
Emmanuele Bassi
b3f8f358b5 Merge branch 'meson-warning' into 'master'
build: Avoid a Meson deprecation warning

See merge request GNOME/gtk!493
2019-01-08 14:59:21 +00:00
Emmanuele Bassi
e458ea2f3d build: Avoid a Meson deprecation warning
Using an empty `configuration_data` object to copy a configuration file
is deprecated since Meson 0.47 (released July 2018); the equivalent
behaviour is available by using `copy: true`.
2019-01-08 14:46:46 +00:00
Benjamin Otte
b6d8d3975e revealer: Handle child-visible properly
The target position is irrelevant for determining if the child should be
visible. When the current position is 0, it needs to be hidden, period.

Fixes #1355
2019-01-08 01:29:41 +01:00
Benjamin Otte
5e96129be1 settings: Don't special case IM modules
The previous fixes made it unnecessary to hardcode IM modules for
different display types. The code now automatically skips system IM
modules for other displays.
2019-01-08 00:41:12 +01:00
Benjamin Otte
0ef7d07880 immodule: Check if module matches display
When loading IM modules from environment variables or GtkSettings, we
would accept "xim" on Wayland. That is a bad idea.
2019-01-08 00:41:12 +01:00
Benjamin Otte
545e95bb5c immodule: Don't load unsupported IM module
The code would technically allow loading the xim module when X11 support
was not compiled in.

This is probably an artificial concern, because it's pretty hard to
compile XIM support without X11 support, but it makes the code clearer,
so there we go.
2019-01-08 00:41:12 +01:00
Benjamin Otte
ca76675a69 immodule: Pass a GdkDisplay for default context ID
After all, the context depends on the display - we want to use the
wayland context for Wayland,  xim for X11 and so on.
2019-01-08 00:41:12 +01:00
Benjamin Otte
16d4ce4d03 immulticontext: Don't have a global_context_id
Context IDs are dependant on the display - both because displays can use
different backends, but also because changing the GtkSetting is a
per-display operation.

So just remove the cache.
If it turns out we need a per-display cache, we can add one to
GtkSettings.
2019-01-08 00:41:12 +01:00
Olivier Fourdan
58e273d056 a11y: Check display in *grab_cell_focus()
Calling the accessibility function `grab_focus()` on a `GtkCell` under
Wayland will cause the client to crash.

This is another case of `gdk_x11_get_server_time()` being called
regardless of the actual windowing backend used.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1507
2019-01-07 21:06:57 +00:00
Carlos Garnacho
1c14285dee flowbox: Accept multipress gesture late
So it's able to operate properly with the DnD gesture set by
gtk_drag_source_set(). We usually just react on button release,
that's the right time to claim the gesture.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1557
2019-01-07 21:01:59 +00:00
Daniel Boles
cd69570e78 searchenginequartz: Fix naming of Beagle @ comment
As funny as that is, it's not very instructive. :P

https://gitlab.gnome.org/GNOME/gtk/merge_requests/490#note_400993
2019-01-07 20:46:08 +00:00
John Ralls
52b9e4703b [GtkSearchEngineQuartz] Limit the returned hits.
When the result set is larger than the limit.
2019-01-07 20:46:08 +00:00
Daniel Boles
d7193eaf8b [GtkSearchEngineQuartz] Resolve the path to a GtkFile* for the hit list.
Instead of a char* path, which the search_hit parser doesn't expect,
causing a crash.

Closes: $https://gitlab.gnome.org/GNOME/gtk/issues/815
2019-01-07 20:46:08 +00:00
Carlos Garnacho
b52dea7a10 Merge branch 'fix-corner-resize' into 'master'
Fix resize corners

See merge request GNOME/gtk!481
2019-01-07 18:14:33 +00:00
Matthias Clasen
7bb5888272 Merge branch 'commit-docs' into 'master'
docs: Move commit style docs to the contribution guide

See merge request GNOME/gtk!358
2019-01-07 16:44:41 +00:00
Ryuta Fujii
4404afc9f3 Update Japanese translation 2019-01-05 01:16:56 +00:00
Ryuta Fujii
dadac6a9e1 Update Japanese translation
(cherry picked from commit 69ddfcf1ed)
2019-01-04 22:21:43 +00:00
Aurimas Černius
210a06174d Updated Lithuanian translation 2019-01-04 23:23:00 +02:00
Timm Bäder
f9a5a474f0 imcontextwayland: (Hopefully) fix if expression 2019-01-04 05:55:26 +01:00
Piotr Drąg
c51f1fda28 Update POTFILES.in 2019-01-03 19:21:09 +01:00
Timm Bäder
ea3d0c0f01 buttonbox: Remove redundant if statement
This used to do something in the past.
2019-01-03 08:57:16 +01:00
Timm Bäder
2c1198f6c2 colorchooser: Remove extra custom color 2019-01-03 08:56:46 +01:00
Timm Bäder
9d3120cc1e popover demo: Fix size-allocate callback signature 2019-01-03 08:56:40 +01:00
Timm Bäder
66d3aa8101 window: Fix state_flags_changed impl name
This is unrelated to GdkSurface and was changed by accident.
2019-01-03 08:56:34 +01:00
Timm Bäder
0530637fef stack: Don't queue an unnecessary redraw
Both queue_allocate and queue_resize already queue a draw.
2019-01-03 08:52:35 +01:00
Timm Bäder
3d6bdb9af3 entry: Remove unused struct 2019-01-03 08:52:08 +01:00
Matthias Clasen
7e7c90961c Check for the session bus before using it
Patch by Chris Allen, #475
2019-01-02 20:35:19 -05:00
Matthias Clasen
3da9280a8a Merge branch 'wip/nbenitezl/move-bookmark-placeholder-index-4' into 'master'
gtkplacessidebar.c: move bookmark at the placeholder index

See merge request GNOME/gtk!459
2019-01-03 01:27:49 +00:00
Matthias Clasen
ed17a8ddd7 Merge branch 'patch-1' into 'master'
Zero-fill new GtkTextIter

See merge request GNOME/gtk!455
2019-01-03 01:02:07 +00:00
Matthias Clasen
cd7e70680c Merge branch 'wip/carlosg/imwayland-for-master' into 'master'
Use zwp_text_input_v3 on gtk4

Closes #1317 and #1525

See merge request GNOME/gtk!462
2019-01-03 00:36:35 +00:00
Matthias Clasen
a80007ac12 Fix XChangeProperty calls
They must be long...

Closes: #1556
2019-01-02 19:26:56 -05:00
Matthias Clasen
dc68d04c32 Fix resize corners
I was stuck in an X session and noticed that my resize corners
all got east or north cursors. It turns out that gnome-shell
does not properly advertise support for edge constraints under X11,
and the absence of that makes the code for determining the edge
under the cursor misbehave.

This change should fix that.
2019-01-02 19:08:02 -05:00
Timm Bäder
bd95e16372 Merge branch 'wip/carlosg/revealer-fix-interrupted-animations-master' into 'master'
revealer: Fully set the target state if unmapped during animation

See merge request GNOME/gtk!466
2019-01-02 08:50:25 +00:00
Timm Bäder
c1e1e2da80 image: Avoid some unnecessary signal connections
Equivalent if fd9879e5ff but for GtkImage.
2018-12-31 12:44:02 +01:00
Timm Bäder
ea8f1469c1 image: Indentation fix 2018-12-31 12:44:02 +01:00
Timm Bäder
1d3aa9207c gl renderer: Add a clip stack
So we can check that the currently set clip is the first one and now
intersect with it. This first clip is always the entire viewport or the
entire render_area and we don't want to end up drawing things to a
texture because of it.
2018-12-31 12:44:02 +01:00
Timm Bäder
b4f2a3416e picture: Avoid some unnecessary signal connections
We don't need to ever invalidate the picture size if the paintable tells
us its size is static. Same for the contents.
2018-12-31 12:44:02 +01:00
Timm Bäder
3b46e2a558 image: Remove private struct from public header 2018-12-31 12:44:02 +01:00
Daniel Boles
480a04131c CellAccessible: Fix return type of row|column_span
See:
 * c876c74eb7
 * 63e0eb5de5
2018-12-30 18:15:11 +00:00
Jordi Mas
171a710a23 Update Catalan translation 2018-12-29 09:31:36 +01:00
Emmanuele Bassi
4f532a414c docs: Clarify the section on dependencies 2018-12-28 18:44:36 +00:00
Emmanuele Bassi
3f567781dd docs: Clarify the section on commit access
The section is about rules for direct commit access to the upstream
repository, so let's be more clear about it.
2018-12-28 18:44:36 +00:00
Emmanuele Bassi
0397c8b628 docs: Clarify autoclosing issues syntax
Link to the GitLab documentation, and clarify that if no single commit
in a merge requests closes an issue, you should add a reference to the
issue in the commit message anyway.
2018-12-28 18:44:36 +00:00
Emmanuele Bassi
3939824d11 docs: Make the contribution guide slightly more friendly
This is an important document for newcomers, so we should err on the
side of being more detailed on what kind of contributions we expect,
and how we expect them.

The text is heavily modelled on the contributing-template by Nadia
Eghbal available here:

  https://github.com/nayafia/contributing-template
2018-12-28 18:44:36 +00:00
Emmanuele Bassi
d7cafca118 docs: Move commit style docs to the contribution guide
There's no point in having a separate file detailing how commits ought
to work, considering we already have a contribution guide.
2018-12-28 18:28:52 +00:00
Jordi Mas
d10709c917 Update Catalan translation 2018-12-28 09:55:51 +01:00
Jordi Mas
e9d4823c57 Update Catalan translation 2018-12-25 09:57:57 +01:00
Jordi Mas
06d764d046 Update Catalan translation 2018-12-24 17:38:01 +01:00
Christoph Reiter
325badc3eb Merge branch 'fix-typo-win32-compilation-speedup-macro-gtk4' into 'master'
Win32: Fix typo on compilation speedup macro define [Gtk4]

See merge request GNOME/gtk!473
2018-12-22 17:54:08 +00:00
Tomasz Miąsko
c665a1d5a5 Annotate values of PRIORITY constants
g-ir-scanner incorrectly evaluates macro definition that include
references to other macro definitions. Provide a correct value as an
annotation.

Differences in generated gir files:

```diff
@@ -19017 +19017 @@
-    <constant name="PRIORITY_REDRAW" value="20" c:type="GDK_PRIORITY_REDRAW">
+    <constant name="PRIORITY_REDRAW" value="120" c:type="GDK_PRIORITY_REDRAW">
@@ -74229,3 +74229,3 @@
     </constant>
-    <constant name="PRIORITY_RESIZE" value="10" c:type="GTK_PRIORITY_RESIZE">
+    <constant name="PRIORITY_RESIZE" value="110" c:type="GTK_PRIORITY_RESIZE">
       <doc xml:space="preserve">Use this priority for functionality related to size allocation.
@@ -106786,3 +106786,3 @@
     <constant name="TEXT_VIEW_PRIORITY_VALIDATE"
-              value="5"
+              value="125"
               c:type="GTK_TEXT_VIEW_PRIORITY_VALIDATE">
```

See !472
2018-12-22 18:52:20 +01:00
Jordi Mas
c7f1a275ac Update Catalan translation 2018-12-22 10:33:41 +01:00
Luca Bacci
a52989842e Win32: Fix typo on compilation speedup macro define
There is a typo, the correct macro to define is WIN32_LEAN_AND_MEAN.
After this change <shellapi.h> must be included in order to use
ExtractIconExW().
2018-12-22 01:18:17 +01:00
Mohammed Sadiq
1df276f263 mediastream: Fix possible memory leak
@error is (transfer full).  So the error passed should be freed if not used
2018-12-20 10:26:56 +05:30
Carlos Garnacho
615f10f7c8 revealer: Fully set the target state if unmapped during animation
If the revealer is told do animate and then unrealize itself, we do
(correctly) stop the animation, but used to do a shortcut where we
just set the target state as current.

Other things are dependent on the animation properly finishing though,
like the contained widget child visibility. This may lead to inconsistent
state where gtk_revealer_get_child_revealed() returns TRUE but the child
widget is unmapped, or vice-versa.

Fully finish the animation here, so the child state is coherent the next
time the revealer is mapped. We can also skip notifying on the property
since it will be handled by gtk_revealer_set_position().
2018-12-19 20:53:40 +01:00
Peter Hutterer
38cba6895a x11: make the tool lookup dependent on the hw id as well
Tools on the same physical item have the same serial number, so the eraser
and the pen part of a single pen share that serial number. With the current
lookup code, we'll always return whichever tool comes first into proximity.

Change the code to use the hw id in addition to the serial number, this way we
can differ between two tools.
2018-12-18 21:41:49 +01:00
Peter Hutterer
e95e045898 x11: don't add unknown tools to our list
Generic tools (Bamboo, built-in tablets) always have the same serial number
assigned by the wacom driver. This includes the touch tool when the wacom
driver handles the touch evdev node (common where users require the wacom
gestures to work).

When the first device is the touch device, a tool is created with that serial.
All future tools now return the touch tool on lookup since they all share the
same serial number. Worse, this happens *across* devices, so the pen
event node gets assigned the touch tool because they all have the same serial.

Since we don't actually care about the touch as a tool, let's skip any unknown
tool. This captures pads as well.
2018-12-18 21:41:09 +01:00
Peter Hutterer
1b730dcf31 x11: get the tool type from the wacom driver properties
Any wacom device currently sets the tool type to UNKNOWN. The wacom driver has
a property that exports the tool type as one of stylus, eraser, cursor, pad or
touch. Only three of those are useful here but that's better than having all
of them as unknown.
2018-12-18 21:41:08 +01:00
Carlos Garnacho
beb9ee6d4a build: wrap IM protocol building under have_wayland altogether
We poke variables that might not be defined if the wayland backend
is disabled.
2018-12-18 20:51:53 +01:00
Carlos Garnacho
8ce6d03c7b imwayland: Respect maximum length of 4000 Bytes on strings being sent.
Hitting the limit will raise protocol errors.
2018-12-18 20:38:44 +01:00
Carlos Garnacho
904202a636 imwayland: Plug leaks
The various strings (pending/current preedit, surrounding, and commit
buffer) are being leaked in the case of GtkIMContext destruction.
2018-12-18 20:38:44 +01:00
Dorota Czaplejewicz
7a0b6a3639 imwayland.c: fix formatting 2018-12-18 20:38:44 +01:00
Dorota Czaplejewicz
b465e04ae2 imwayland: rearrange functions to remove prototypes 2018-12-18 20:38:41 +01:00
Dorota Czaplejewicz
f67627875f imwayland: Handle enter and leave events
Before this patch, imwayland would assume that text-input enter and leave events follow the general (wl_keyboard) focus, and was unable to handle the situation where they would not be provided at the same time.
2018-12-18 20:27:12 +01:00
Carlos Garnacho
8912dc226c imwayland: Collect return value from ::delete-surrounding signal
There's not much we can do about the signal not being handled, but
we should fetch the return value anyway.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
12ac9f351e imwayland: Don't reset serial while text-input is alive
The serial number is a persistent property of the text-input object.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
c4b4e90f98 imwayland: Fix clearing of preedit text in webkitgtk
Fixes webkitgtk misbehaviour as outlined in https://gitlab.gnome.org/GNOME/gtk/issues/1316#note_312942 , which was introduced in 49b17e6c.
The preedit will be cleared on exit only if it is already present.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
fcf28ded42 imwayland: Fix clearing of preedit text
Fixes terminal emulator misbehaviour as outlined in https://gitlab.gnome.org/GNOME/gtk/issues/1316, which was introduced in 49b17e6c. The original commit cleared preedit text by setting it to an empty string, which still counted as existing preedit. The fix sets preedit string to null, which is correctly understood as not present.
2018-12-18 20:27:12 +01:00
Carlos Garnacho
1e69d248cb modules: Check current context before retrieving surrounding
There may be situations where this might get called while the
currently focused context just went away (eg. after setting the
text widget unsensitive).

Closes: #1317
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
c49b29fa53 imwayland: clear preedit on focus out 2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
024220aee8 imwayland: Add text-input-unstable-v3 support
The wayland input module now represents text-input-unstable-v3 support, while the old module supporting gtk-text-input was renamed to gtkwayland.
2018-12-18 20:27:12 +01:00
Benjamin Otte
1423265610 gstmedia: Implement error handling.
I wonder who forgot that.
Whoops.
2018-12-18 02:04:54 +01:00
Benjamin Otte
89c48a08a0 mediastream: Allow multiple calls to gtk_media_stream_error()
Just ignore all further ones.
2018-12-18 02:04:16 +01:00
Benjamin Otte
c30968861f a11y: Fix function return type
Typo right there.
2018-12-18 01:20:36 +01:00
Daniel Boles
a8ac6f833c RGBA: tiny grammar improvements in to_string doc 2018-12-17 20:49:34 +00:00
Daniel Boles
271acaff53 RGBA: Consistently use “” around inline arg names
instead of being inconsistent and not using them later, which leaves a
bunch of single letters floating among real words, not the prettiest.
2018-12-17 20:49:34 +00:00
Daniel Boles
c35e0cba39 RGBA: Fix example to_string output for reality/CSS
* We don't output spaces anywhere in the code, unlike the doc suggested.
* CSS explicitly forbids whitespace between function names and lparens:
  https://stackoverflow.com/questions/13877198
2018-12-17 20:49:34 +00:00
Nelson Benítez León
65240967e4 gtkplacessidebar.c: move bookmark at the placeholder index
As that index is set in drag_motion_callback() and visually shown
on the widget as a drop target hint.

https://bugzilla.gnome.org/show_bug.cgi?id=787356
https://gitlab.gnome.org/GNOME/gtk/issues/904
2018-12-17 19:19:20 +00:00
Peter Bloomfield
8a27302d56 gtkmain: Terminate two loops early
In propagate_event_{down,up}(), set handled_event to TRUE if a widget is
unrealized, so as to terminate the corresponding loop early.

See https://gitlab.gnome.org/GNOME/gtk/merge_requests/442
2018-12-17 12:04:10 -05:00
Peter Bloomfield
8ce01084af gtkmain: Avoid critical messages on closing window
Do not call _gtk_widget_captured_event(), in propagate_event_down(), or
gtk_widget_event(), in propagate_event_up(), when the widget has been
unrealized.
2018-12-17 11:41:17 -05:00
Christoph Reiter
a99bd2a422 ci: Update Docker image to Fedora 29 and meson to 0.49.0 2018-12-16 21:33:22 +01:00
Orivej Desh
3ec2d5fa38 Zero-fill new GtkTextIter
iter_init_common() is used on uninitialized GtkTextIter, and since neither it
nor its callers initiliaze its padding fields, they contain garbage.

This is a problem for Go - which checks that structs passed to C functions do
not contain pointers to Go-allocated memory - when the garbage happens to be
such a pointer.  Although Go zero-fills all GtkTextIter that it allocates, this
does not help when GTK functions such as insert_pixbuf_or_widget_segment called
for gtk_text_buffer_create_child_anchor copy garbage from their stack-allocated
GtkTextIter into a clean iter.  To work around this a GtkTextIter has to be
discraded after use in text buffer anchor inserting functions:
https://github.com/gotk3/gotk3/pull/307
2018-12-16 17:03:47 +00:00
Andre Klapper
a0b5b39bbd Replace git.gnome.org by Gitlab URL in <GitRepository> in DOAP file 2018-12-16 00:45:41 +01:00
Andre Klapper
ab52862a5d Replace Bugzilla by Gitlab URL in DOAP file 2018-12-15 23:32:24 +01:00
Daniel Boles
a350192ea2 EventControllerKey: Add missing documentation bits 2018-12-14 23:28:54 +00:00
Emmanuele Bassi
cb0d8d6d90 Remove gtk_widget_show_all() call
Extraneous chunk from 7601bca758.

Cherry picked from gtk-3-24, which has a gtk_widget_show_all() function.
2018-12-14 20:38:03 +00:00
Matthias Clasen
86ad3e8f2a Merge branch 'master' into 'master'
A11y: Add support for AtkTableCell

See merge request GNOME/gtk!411
2018-12-14 19:25:27 +00:00
Mike Gorse
8f29a0633b A11y: Add support for AtkTableCell 2018-12-14 19:25:27 +00:00
António Fernandes
7601bca758 placesview: List only available protocols as available
We display a list of supported protocols in the server_addresses_popover.

However, this curated list contains protocols which may or may not be
available, depending on the respective gvfs backend being installed.

So, populate the list only with protocols which are available.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:30:52 -05:00
António Fernandes
3bbfff9280 placesview: Set .error style if unsupported protocol
When the user types an address with a schema that is not supported,
the Connect button doesn't become sensitive, but there is no visible
feedback at all.

This feels unresponsive and leaves the user clueless.

While it doesn't help explain why the address doesn't work, this will
provide a hint that the input was acknowledged but doesn't work.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:28:47 -05:00
Matthias Clasen
5b049364dc Merge branch 'fix-polygon-svg-recolor' into 'master'
icontheme: Recolor <polygon> elements in SVGs too

See merge request GNOME/gtk!443
2018-12-14 17:02:30 +00:00
Timm Bäder
7997bdc5d7 Merge branch 'demo-combobox-typo-gtk4' into 'master'
demos/gtk-demo/combobox: fix typo

See merge request GNOME/gtk!444
2018-12-13 12:05:14 +00:00
LRN
04aebda1e9 Merge branch 'win32-honest-clipboard-gtk4' into 'master'
GDK W32: Be honest about supported clipboard formats (GTK4)

See merge request GNOME/gtk!399
2018-12-11 13:47:57 +00:00
Jakub Steiner
77792b6475 Revert "Adwaita: GNOME 3.32"
This reverts all GNOME 3.32 styling from master
2018-12-10 21:22:56 +01:00
Christoph Reiter
5612e84551 GDK W32: Always set gtk-font-name to the active UI font. Fixes #1484
This makes apps use "Segoe UI 9" by default instead of whatever matches "Sans 10".
It also cleans up the code and uses some new pango API while at it.

This was previously disabled in 9e686d1fb5 because it led to a poor glyph coverage
on certain versions of Windows which don't default to "Segoe UI 9" (Chinese, Korean, ..)
because the font fallback list was missing in pango.

This is about to get fixed in https://gitlab.gnome.org/GNOME/pango/merge_requests/34
so enable it again when we detect a new enough pango version.

(See !436 for the original MR)
2018-12-10 09:00:50 +01:00
Jeremy Bicha
462193ae26 demos/gtk-demo/combobox: fix typo
Fix typo that prevented the P-S submenu from displaying correctly
2018-12-09 23:30:38 -05:00
Matej Urbančič
80a90a084e Updated Slovenian translation 2018-12-09 21:26:33 +01:00
Christoph Reiter
2f29cb9e6f win32: Don't multiply the scroll event deltas by the Windows scroll lines setting. See #1408
GTK widgets expect the scroll deltas to be 1 or -1 and calculate a scroll value from that.
Multiplying the delta by the Windows scroll line setting (which defaults to 3) results
in a much larger delta and vastly different behaviour for running a GTK app on Windows
vs on Linux. For example text view and tree view scroll by 9 lines per scroll wheel tick
per default this way while on Linux it is around 3.

Remove the multiplication for now.

See !426 for the gtk3 MR
2018-12-08 15:28:37 +01:00
Christoph Reiter
67fdfca3ba GDK W32: set default settings for fontconfig.
Enables hinting, antialiasing and set the subpixel orientation according to the
active clear type setting. This ensures that font rendering with the fontconfig backend
looks similar to the win32 backend, at least with the default system font.

See !437
2018-12-08 14:54:15 +01:00
Philip Chimento
284d909347 icontheme: Recolor <polygon> elements in SVGs too
Otherwise, it's possible to have a symbolic icon where some of the
shapes keep the #bebebe chroma key color.
2018-12-08 01:40:32 +00:00
Timm Bäder
43ef4d7b53 menushell: Listen to non-primary button clicks
Menus should also be deactivated on right-button clicks.
2018-12-07 17:03:45 +01:00
Timm Bäder
3ce45508e1 gl renderer: Track border width state separately 2018-12-07 16:36:10 +01:00
Timm Bäder
57efdcfbbe gl renderer: Ignore subsequent render target ops 2018-12-07 16:36:10 +01:00
Timm Bäder
df817bd118 gl renderer: Ignore viewport ops to the same viewport 2018-12-07 16:36:10 +01:00
Timm Bäder
82a1d4f280 gesturestylus: Use proper syntax when refering to signals 2018-12-07 16:36:10 +01:00
Jakub Steiner
80f2660838 Adwaita: regenerate CSS
- for the previous patch
2018-12-07 12:00:21 +01:00
Jakub Steiner
edd4d2918a Merge branch 'context_menus' into 'master'
Adwaita GTK Theme: Add bigger shadow and border-radius to menus

See merge request GNOME/gtk!432
2018-12-07 09:58:56 +00:00
Jakub Steiner
320d272ec8 Adwaita: buttons & headerbar tweaks
- tone down the button z-depth
- flatter headerbars
2018-12-05 16:21:45 +01:00
Daniel Boles
72d09d22e9 Box, Grid: Improve various bits of documentation
Issue #1495 showed that the docs of GtkGrid retain outdated implications
that (as was once, but is no longer, the case) it is intended to replace
GtkBox, by discussing HfW and widget properties in a way that suggests
GtkBox can't handle them. But of course it does, and it's preferable for
simple single-row/column cases. Worse, we said GtkGrid “provides exactly
the same functionality” for the latter case, but the original point of
that Issues was that it doesn’t, at least for CSS positional selectors!

Box:
• Use an actually meaningful @Short_description.
• Remove unhelpful @See_also references to unrelated containers.
• Remove references to “rectangular area”: it might be another shape
  via CSS, or “rectangular” might falsely imply 2 dimensions of children.
• Mention Orientable:orientation.
• Emphasise usefulness of :[hv]align for allocating in the other axis.
• Don’t say that Grid “provides exactly the same functionality” for a
  single row or column, since (A) it is overkill for that case and (B)
  said Issue proved that it *doesn’t* for CSS child order, for example.

Grid:
• Don’t dwell on widget properties and height-for-width in a way that
  wrongly implies that Box can’t handle those (or Grid can better). In
  fact, just get rid of that bit altogether: Box handles them fine, and
  such wording was only needed years ago for migration from GTK+ 2 to 3.
• Point to GtkBox as being preferred for the simple row/column use case.
2018-12-04 20:43:19 +00:00
Timm Bäder
a2a4603329 Merge branch 'bye-app-menu-gtk4' into 'master'
widget-factory: move app menu contents to primary menu (gtk4)

Closes #916

See merge request GNOME/gtk!365
2018-12-04 14:32:22 +00:00
Timm Bäder
8de1ba2cc4 application: Remove dead assignment 2018-12-04 06:30:47 +01:00
Timm Bäder
2644da106b button: Remove some dead code 2018-12-04 06:30:47 +01:00
Timm Bäder
4860410c4a button: Remove some unnecessary includes 2018-12-04 06:30:47 +01:00
Timm Bäder
4b3a94f382 gl renderer: Fix remaining TODO about offset nodes
All of the nodes should now support offsets.
2018-12-04 06:30:47 +01:00
Timm Bäder
d67dacedba gl renderer: transform nodes: offset 2018-12-04 06:30:47 +01:00
Timm Bäder
e1feb1b712 gl renderer: Clip nodes: offset 2018-12-04 06:30:47 +01:00
Timm Bäder
e8670c89ae gl renderer: Linear gradients: offset 2018-12-04 06:30:47 +01:00
Timm Bäder
b4f918904c gl renderer: Outset shadow nodes: offset 2018-12-04 06:30:47 +01:00
Timm Bäder
aead150ce2 gl renderer: Care about offset when rendering border nodes 2018-12-04 06:30:47 +01:00
Timm Bäder
fd47e57e4b gl renderer: care about offset when rendering shadow nodes 2018-12-04 06:30:47 +01:00
Matthias Clasen
1e129c1dd2 emoji chooser: Actually force Emoji presentation
The previous commit was using the text presentation selector
instead of the Emoji one. Oops.
2018-12-03 21:47:53 -05:00
Timm Bäder
e0a7d28339 testuite Add translucent offscreen rendering test case 2018-12-02 16:15:17 +01:00
Timm Bäder
ad93806005 showrendernode: Fix GtkImage size
Make sure we show the paintable unscaled.
2018-12-02 16:14:31 +01:00
Timm Bäder
2b95a5daee gl renderer: Remove blend shader
It's unused.
2018-12-02 16:04:40 +01:00
Timm Bäder
0681c5d5bc gl renderer: Reset opacity when rendering to a texture
The opacity will already be applied when rendering the final texture.
2018-12-02 16:03:08 +01:00
Timm Bäder
b19926c079 gl renderer: Add function to draw debug rectangle 2018-12-02 14:31:57 +01:00
Timm Bäder
692ed4f994 gl renderer: Refactor render op builder 2018-12-02 14:17:18 +01:00
Timm Bäder
ad759307f8 gl renderer: Add more node types to print_render_node_tree
debugging ++
2018-12-02 13:39:55 +01:00
Timm Bäder
fb6adaaa62 window: Don't try to size-allocate unmapped popovers
The gtk_widget_size_allocate call won't do anything anyway.
2018-12-02 13:25:43 +01:00
Timm Bäder
58a4ae94e9 gl renderer: Use ops_transform_bounds_modelview in more places 2018-12-02 13:25:43 +01:00
Timm Bäder
9df9087a13 gl renderer: Add NodeSample
As a quick way of checking what a particular sample of nodes (e.g. all
offset node children) are made up of.
2018-12-02 13:25:43 +01:00
Timm Bäder
f8df527c68 sizerequest: Directly query new request_mode
We are already inside the function that populates the size request
cache, so do it here instead of implicitly in get_request_mode.
2018-12-02 13:25:43 +01:00
Timm Bäder
71512cf9ad gl renderer: Move geometry calculation further down
We don't need it above, so move it to where it belongs.
2018-12-02 13:25:43 +01:00
Timm Bäder
79cc8fb261 gl renderer: Apply offset with scale 2018-12-02 13:25:43 +01:00
Timm Bäder
2831dbb110 gl renderer: Refactor add_offscreen_ops
Use a graphene_rect_t for the node bounds instead of 4 floats.
This makes it simpler to pass the size in without the offset applied.
2018-12-02 13:25:43 +01:00
Timm Bäder
933acb3682 gl renderer: Add offscreen ops without offset applied
When doing color matrix nodes. This fixes color matrix node with scale =
2.
2018-12-02 13:25:43 +01:00
Timm Bäder
574ebafa46 gl renderer: Reset offset when rendering offscreen
We want to apply the offset to the rendered texture, not to the
offscreen-rendered content.
2018-12-02 13:25:43 +01:00
Timm Bäder
74dd05b45e gl renderer: add render ops for dumping the framebuffer
So offscreen rendering can be properly debugged.
2018-12-02 13:25:43 +01:00
Timm Bäder
3eb2cef421 gl renderer: Set the render region as initial clip
So we avoid creating render ops for things outside of it.
2018-12-02 13:25:43 +01:00
Timm Bäder
94745241c2 GdkGLContext: Fix damage computation with buffer_age
As per the spec:

> The back buffer can
> either be reported as invalid (has an age of 0) or it may be
> reported to contain the contents from n frames prior to the
> current frame.

So a  buffer age of 1 means that the buffer was used in the last frame.
We were handling buffer_age==1 the same as buffer_age==0, i.e. we
returned the full damage for the surface.

[1] https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_buffer_age.txt
2018-12-02 13:25:43 +01:00
Timm Bäder
538491efa1 gl renderer: Fix only_translation check 2018-12-02 13:25:43 +01:00
Matthias Clasen
6f8c4f873d Merge branch 'force-emoji' into 'master'
Force emoji presentation

See merge request GNOME/gtk!431
2018-11-30 21:38:02 +00:00
Matthias Clasen
7a4e9fa4d3 Force emoji presentation
Append a variation selector to the Emoji sequences,
to force Emoji presentation. Without this, some
Emoji come out with text presentation by default.

Closes: Pango #334
2018-11-30 16:20:44 -05:00
Jakub Steiner
f3c704b82e Adwaita: updated switch control
- might be nasty to hide labels with CSS. We can fix properly later.
- the blue border seesm aliased when :checked
2018-11-30 20:55:00 +01:00
frederik.feichtmeier
a6a69dd567 Adapt border-radius and box-shadow of menus to popovers 2018-11-30 11:54:22 +01:00
Jakub Steiner
8921c868a5 Adwaita: shade buttons
- it was a bit too flat
2018-11-29 21:56:45 +01:00
Jakub Steiner
3f8598baa4 Adwaita: button tweaks
- step back on toning down the borders. Flatness !> legibility.
- darker active state for light
- draw gradinets from bottom up, to keep px sized shading regardless
  of button size.
2018-11-29 20:19:41 +01:00
Jakub Steiner
b5fd7b3211 Adwaita: headerbar backdrop state 2018-11-29 14:34:53 +01:00
Jakub Steiner
e9fe9410e0 Adwaita: sync headerbar styling for devel mode 2018-11-29 13:12:44 +01:00
Timm Bäder
904fd5f1fc Remove gtk_widget_intersect
It's been broken for quite a while now and doesn't make sense anymore
these days.
2018-11-29 11:14:26 +01:00
Timm Bäder
f598836d6c popover: Don't recalculate position if unmapped 2018-11-29 08:50:18 +01:00
Timm Bäder
5907ff694f gl renderer: Render non-trivial transforms to a texture
This way we can e.g. render rotated clips, borders, etc.
2018-11-29 08:50:18 +01:00
Timm Bäder
7c020bfaaa inspect-button: Remove custom pick() implementation
This was added to work around the fact that pick() does not look at
insensitive widgets at all, but the replacement didn't properly work
either.
2018-11-29 08:50:18 +01:00
Timm Bäder
2bd02d9185 popover: Get rid of a gtk_widget_get_allocation call
Use _compute_bounds instead.
2018-11-29 08:50:18 +01:00
Timm Bäder
c0cf592336 gl renderer: Cache offscreen textures per node, not size 2018-11-29 08:50:16 +01:00
Timm Bäder
12378f0afa gl renderer: Expand matrix metadata extraction
Instead of getting the translation x/y everytime we use the modelview,
get it once, when extracting the metadata. Do the same with the scale.
And save if the matrix is "simple" at all, i.e. if it only consists of a
translation and/or scale. This will be helpful later when we start
drawing transformed nodes on textures.
2018-11-29 08:23:42 +01:00
Timm Bäder
5ea211bbb1 Revert "gldriver: Don't create surfaces to upload textures"
This reverts commit 6466e53bfc.

This breaks GtkGLArea.
2018-11-29 07:39:11 +01:00
Timm Bäder
c17c18f1ae widget: Remove one translate_coordinates copy
Just use the double version in the integer version.
2018-11-29 07:39:11 +01:00
Jakub Steiner
dbde7b68c0 Adwaita: flatten the headerbar again 2018-11-28 20:28:56 +01:00
frederik.feichtmeier
95f06f6e75 Add bigger shadow and border-radius to menus
Increase the visibility of the box-shadow for menus
Introduce a border-radius variable for menus
Use this variable for all corners of menus except top for the top menus
2018-11-28 17:43:55 +01:00
Jakub Steiner
a26edd59d1 Adwaita: tune button & hederbar colors 2018-11-28 14:22:21 +01:00
Mohammed Sadiq
dcd21e12cd texttag: Replace gtk3-demo reference with gtk4-demo 2018-11-28 16:51:45 +05:30
Jakub Steiner
e5efc84eda Adwaita: buttons & headerbars
- tone down the bottom border contrast (increase bottom lightness,
  decrease overall lightness)
- darken headerbars slightly (might require darkening wm colors when
  dust settles)
2018-11-28 00:16:20 +01:00
Matthias Clasen
8035969860 Merge branch 'master-escape-included-svg' into 'master'
(#1471): base64-encode included SVGs to avoid mis-escaped characters

Closes #1471

See merge request GNOME/gtk!430
2018-11-27 20:25:28 +00:00
Federico Mena Quintero
e5f9bf2e9b (#1471): base64-encode included SVGs to avoid mis-escaped characters
We wrap SVG data from icons within another SVG with extra styling
information.  The wrapped SVG may contain characters that cannot be
part of a data: URL (https://fetch.spec.whatwg.org/#data-urls).

Librsvg 2.45 got more strict in its parsing of data: URLs; whereas
previously it ignored '#' characters in them, now it considers them to
be the start of a fragment identifier, which is not allowed in data:
URLs anyway.

To avoid unallowed characters, we now create a data: URL with a
base-64 encoded SVG.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1471
2018-11-27 13:57:21 -06:00
Timm Bäder
0be4d31217 headerbar: Remove superfluous parentheses 2018-11-27 06:06:28 +01:00
Timm Bäder
eebb849760 widget: Query CSS values later in size_allocate
Move it below the "this widget only changed its position" check.
2018-11-27 06:00:30 +01:00
Timm Bäder
f92745aacf widget: Save baseline without CSS values applied
Similar to what we do with width/height.
2018-11-27 05:59:47 +01:00
Timm Bäder
7aee30bfc2 adwaita: icon-shadow -> -gtk-icon-shadow 2018-11-27 05:41:53 +01:00
Timm Bäder
ef751bc809 gl renderer: Use stack to keep track of modelview matrix
So we can avoid calculating metadata for matrices all the time.
2018-11-27 05:39:27 +01:00
Timm Bäder
fe49f83982 colorplane: Convert crosshair rendering to snapshot
This is slightly different than the cairo version since the
half-transparent lines now overlap but nobody can see that anyway.
2018-11-27 05:37:38 +01:00
Timm Bäder
059d9376da colorscale: Cache hue texture
Otherwise we regenerate a new one on every snapshot() call.
2018-11-27 05:37:38 +01:00
Timm Bäder
6466e53bfc gldriver: Don't create surfaces to upload textures 2018-11-27 05:37:38 +01:00
Timm Bäder
b7963a06ab widget: Parent widgets may also consume motions
This is important when the target widget of an event is not the one that
would otherwise receive the gesture. For example, the GtkSwitch
implementation currently attaches a pan gesture to the switch itself,
but the target widget below the pointer might be the switch slider or
label.

See #1465
2018-11-27 05:37:38 +01:00
Timm Bäder
eeeefb40c7 switch: Shorten size_allocate impl a bit 2018-11-27 05:37:38 +01:00
Jakub Steiner
97d8676b40 Adwaita: help fullcolor app icons
- draw a large dropshadow for aboutboxes
- draw an outline for low res

See issues #1434 and #1445.
2018-11-26 17:33:28 +01:00
Jakub Steiner
6e28d004ae Adwaita: tone down broders, buttons
- very contrasty lines feel dated in today's flat world
- tone down the contrast a little
2018-11-23 17:32:46 +01:00
Jakub Steiner
8d7bf3ad0c Adwaita: list buttons
- tone down buttons when inside lists

Fixes issue #1473
2018-11-22 13:24:49 +01:00
Timm Bäder
d76a0feef6 widget: gdk_display_get_monitor can return NULL
Fixes #1466
2018-11-20 12:45:18 +01:00
Timm Bäder
08a07d4ae5 entry: Shorten finalize implementation
By using g_clear_pointer and g_clear_object where appropriate.
2018-11-20 12:45:18 +01:00
Timm Bäder
b42d99b37e Merge branch 'zbrown/emit-transient-for' into 'master'
window: Actually emit notify::transient-for

See merge request GNOME/gtk!424
2018-11-20 11:29:18 +00:00
Zander Brown
ea487b2233 window: Actually emit notify::transient-for
Because it seems we weren't doing that
2018-11-19 21:17:01 +00:00
Timm Bäder
40ae5c1319 Merge branch 'benzea/foreach-documentation' into 'master'
container: Document that removal from foreach is permissible

Closes #1461

See merge request GNOME/gtk!423
2018-11-19 13:38:34 +00:00
Benjamin Berg
8c9c3e4426 container: Document that removal from foreach is permissible
It is permissable to remove a widget using gtk_container_remove from the
gtk_container_foreach callback handler. Document this fact to make it
more discoverable.

Fixes #1461
2018-11-19 13:58:34 +01:00
Timm Bäder
d0f4fcb6fd Merge branch 'akitouni/gdkvulkan-doc-typo' into 'master'
vulkancontext: fix typos in documentation

See merge request GNOME/gtk!417
2018-11-19 07:41:36 +00:00
Timm Bäder
4142d0a69a Merge branch 'more-nullable' into 'master'
g-i: Add some nullable annotations

See merge request GNOME/gtk!419
2018-11-19 07:40:39 +00:00
Christoph Reiter
b061821f24 g-i: Add some nullable annotations
Based on grepping arg docs for NULL.
See https://gitlab.gnome.org/GNOME/pygobject/issues/261
2018-11-18 13:36:50 +01:00
Abderrahim Kitouni
e0833e492c vulkancontext: fix typos in documentation 2018-11-17 19:35:47 +01:00
Timm Bäder
55faaf1aa1 Merge branch 'jjardon/no_G_TYPE_INSTANCE_GET_PRIVATE' into 'master'
Stop using G_TYPE_INSTANCE_GET_PRIVATE completely

See merge request GNOME/gtk!402
2018-11-15 09:59:01 +00:00
Timm Bäder
7aa02b9e95 Merge branch 'include-ft2build.h' into 'master'
font chooser: Properly include freetype headers

Closes #1432

See merge request GNOME/gtk!413
2018-11-14 13:30:28 +00:00
Timm Bäder
c65c6ba11f widget: Fix size-allocate signal docs 2018-11-13 20:54:18 +01:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
1f1306a53b docs: Add GtkEventControllerLegacy 2018-11-13 15:40:42 +01:00
Timm Bäder
ce3d5fcb0a vulkancontext: Add missing error switch 2018-11-13 15:28:46 +01:00
Timm Bäder
28bd56454d appchooserbutton: Remove priv pointer 2018-11-13 15:19:07 +01:00
Timm Bäder
75deff035b testappchooserbutton: Fix for class hierarchy change 2018-11-13 15:19:07 +01:00
Timm Bäder
87ee7e31a4 appchooserbutton: Inherit from GtkWidget 2018-11-13 15:19:05 +01:00
Timm Bäder
5a3ecb9703 render: Fix a position/size mixup
Fixes the foreigndrawing demo.
2018-11-13 14:10:17 +01:00
Timm Bäder
e656f66720 toolbar: Remove dead code
The size definitely changes, otherwise ->size_allocate does not get
called.
2018-11-13 14:10:17 +01:00
Timm Bäder
0d47a6c970 toolbar: Remove some unused defines 2018-11-13 14:10:16 +01:00
Matthias Clasen
39f8e1e137 wayland: Adapt to settings portal api change
ReadAll now accepts an array of patterns.
2018-11-12 13:51:56 -05:00
Carlos Garnacho
d7c2e5844b Merge branch 'scroll-event-propagation' into 'master'
eventcontrollerscroll: Conditionally propagate ::scroll

Closes #45

See merge request GNOME/gtk!250
2018-11-12 10:05:46 +00:00
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Leonardo Taccari
b3ba2961d2 font chooser: Properly include freetype headers
freetype headers should be included via <ft2build.h> and then
indirectly via FT_*_H macros.

Fixes issue #1432.
2018-11-09 22:13:30 +01:00
Timm Bäder
c2c1acc73e calendar: Remove unused struct member 2018-11-09 20:18:13 +01:00
Timm Bäder
c44728282c scrolledwindow: Remove some useless code
This is all being done already be the add_class/remove_class calls
before.
2018-11-09 19:37:55 +01:00
Timm Bäder
85a002bf9f scale: Don't set label css name to "label"
That's already the css name of all labels.
2018-11-09 18:59:30 +01:00
Timm Bäder
6eba544ad4 colorscale: Remove x/y arguments from snapshot_scale
We only pass 0 anyway.
2018-11-09 18:01:58 +01:00
Jakub Steiner
f610fbfc0e Adwaita: use HIG grey for bg_color
- refresh with a light bg color, use the new color palette
2018-11-09 15:37:08 +01:00
Jakub Steiner
1e2d11cc62 Adwaita: fix osd bg color
- don't try deriving from bg_color, osd should be consistent
  for light & dark.

FIxes issue #1449
2018-11-09 11:19:41 +01:00
Adrien Plazas
f1e24ca30a Adwaita: Propagate bg color to titlebar separator descendants
Gives the same background color to all separators descending from a
title bar than to its direct childrens.

This prevents separators which are in a titlebar but not direct children
from the widget with the titlebar style class from being almost
transparent and hence it prevent them from revealing the clear color of
the window's titlebar (black).

https://gitlab.gnome.org/GNOME/gtk/issues/1231
2018-11-09 08:49:38 +01:00
Jakub Steiner
1787f04097 Merge branch 'wip/jimmac/insensitive-progress' into 'master'
Adwaita: draw insensitive progressbars

See merge request GNOME/gtk!360
2018-11-09 07:27:49 +00:00
Jakub Steiner
671f69c6ca Merge branch 'wip/jimmac/hig-colors-gtk4' into 'master'
Adwaita: use new HIG colors

See merge request GNOME/gtk!407
2018-11-09 07:25:05 +00:00
Jakub Steiner
7b51de6bbd Adwaita: use new HIG colors
- blue selection color, success & destructive colors updates
- blueish tint for dark

Addresses issue #1443
2018-11-08 16:58:13 +01:00
Timm Bäder
45b909f2c5 testpopup: Fix GtkEventControllerMotion::motion callback signature 2018-11-08 05:48:14 +01:00
Timm Bäder
0b4ee06f8e eventcontrollerlegact: Fix ::event docs
As discussed in !388.
2018-11-08 05:48:14 +01:00
Timm Bäder
797739198f icontheme: Stop exporting gtk_icon_info_new_for_file 2018-11-08 05:48:14 +01:00
Timm Bäder
0c017ff109 icontheme: Stop exporting gtk_icon_theme_color_symbolic_pixbuf 2018-11-08 05:48:14 +01:00
Timm Bäder
aad3686726 icontheme: Drop remaining emblem code 2018-11-08 05:48:14 +01:00
Timm Bäder
fe7a2635d0 icontheme: Don't reference nonexistent parameter in docs 2018-11-08 05:48:14 +01:00
Timm Bäder
2834b38d2c icontheme: Use a bit field in AsyncSymbolicData
176 -> 144 bytes
2018-11-08 05:48:14 +01:00
Timm Bäder
29563a33ba icontheme: Stop strdup'ing css colors when loading
... symbolic icons.
2018-11-08 05:48:10 +01:00
Timm Bäder
5936d7f8f2 gl renderer: Properly retrieve matrix scale
So rotating offscreen nodes works.
2018-11-08 05:13:50 +01:00
Timm Bäder
481a78eee7 widget: Avoid some more ->priv accesses 2018-11-08 05:13:50 +01:00
Timm Bäder
ac4134c298 range: Remove multipress_gesture member
We don't need it in the instance struct since we only set it up and then
access it in its signal callbacks.
2018-11-08 05:13:50 +01:00
Timm Bäder
145659af93 widget: Some whitespace fixes 2018-11-08 05:13:50 +01:00
Daniel Boles
31b8e0f109 Popover: Minimally document the ::closed signal
This is better than nothing at all. The wording is taken from Carlos's
commit message when he added this shortly before 3.12 (but skip Since).
Skip the bit from his commit message explaining what this replaced; we
don't need to say all the less good things our convenience API replaces.
2018-11-07 20:33:15 +00:00
Daniel Boles
18199a3cef testtreelistmodel: Don't use non-standard function
as per efd3758f6a strcasecmp() is not a C
standard thing (not that we bothered including any header for it anyway)
and so this test failed to build on Windows with Microsoft Visual C.
2018-11-07 20:32:55 +00:00
Daniel Boles
3194c39471 TreeMenu: Don't manually reinvent g_list_index()
g_list_index() "Gets the position of the element containing the given
data (starting from 0)." That is exactly what we were manually doing.
2018-11-07 20:32:55 +00:00
Javier Jardón
9d51a8f53a gtk/gtktoolbutton.c: Document why we need to still use G_TYPE_INSTANCE_GET_PRIVATE
This is the excellent explanation from Emmanuele at
https://gitlab.gnome.org/GNOME/gtk/merge_requests/402#note_361210:
"
Every time you instantiate a type, the instance_init() function is called for each
parent type T_p of your type T; to preserve invariants, the class pointer inside
the instance data is set to the parent type before each invocation, until you hit
your type T. This means that calling GET_CLASS() inside an instance_init() function
will give you a pointer to the class vtable for the parent type T_p while you're
iterating over parent types. What if you want to access the actual class vtable of
the type T, though? Well, you can because the actual signature of instance_init() is:

  void (* GInstanceInitFunc) (GTypeInstance *instance, gpointer g_class);

i.e. all instance_init() functions get passed the instance they are initialising
and the class vtable of the real type you're instantiating.

This is how GtkToolButton works: it "peeks ahead" at instance initialisation time,
to use the button_type class field of the actual type you're instantiating,
and calls g_object_new() with it to store the resulting object in its own private
data structure.

This whole contrived mechanism is needed to allow out-of-tree tool buttons to just
set the button type on their class init, and have their parent class create the
button they want, instead of asking all tool buttons to do this themselves and have
a virtual function called get_button() for GtkToolButton to call whenever it needs
to operate on the button instance.

Now we're coming to a close: we cannot use the G_DEFINE_TYPE macro because the
instance_init() function it creates internally will not pass the class pointer
to your custom instance_init(). Since we cannot use G_DEFINE_TYPE, we also cannot use
G_ADD_PRIVATE either.

This is the reason why, when I ported GTK 3 to the new private instance data structure
macros, I left GtkToolButton alone. I should have left a comment there, because @matthiasc
tried doing that as well, and then had to revert it in commit 1c4a7bd5. So: my bad,
sorry about that.

If we want to drop the G_TYPE_INSTANCE_GET_PRIVATE and the g_type_class_add_private() calls,
we cannot use G_DEFINE_TYPE, but what we can do is unrolling what the macros do themselves:

- add a global GtkToolButton_private_offset variable
- add a static inline gtk_tool_button_get_instance_private() that does return
(G_STRUCT_MEMBER_P (self, GtkToolButton_private_offset));
- call g_type_add_instance_private (g_define_type_id, sizeof (GtkToolButtonPrivate)) inside
gtk_tool_button_get_type() and store the result in GtkToolButton_private_offset
- replace g_type_class_add_private() inside gtk_tool_button_class_init() with
g_type_class_adjust_private_offset (klass, &GtkToolButton_private_offset)
"
2018-11-07 17:50:04 +00:00
Javier Jardón
c37c86a9bf gtk/gtktextview.c: Remove unused GTK_TEXT_VIEW_GET_PRIVATE() macro 2018-11-06 13:45:58 +00:00
Timm Bäder
b4b30b4951 Merge branch 'wip/3v1n0/recent-info-cleanup' into 'master'
gtk-autocleanups: add cleanup function for GtkRecentInfo

See merge request GNOME/gtk!409
2018-11-06 09:52:11 +00:00
Matthias Clasen
54830a2af3 wayland: Fix a thinko in settings portal support
When we decide to fall back because the settings portal
is not present, adhere to that decision elsewhere. And
treat the fontconfig-timestamp like the other special-cased
settings, with G_TYPE_NONE.
2018-11-05 18:34:13 -05:00
Marco Trevisan
9946dd2ab7 gtk-autocleanups: add cleanup function for GtkRecentInfo 2018-11-05 21:37:42 +00:00
Matthias Clasen
5028cb35bc Merge branch 'wip/settings-portal' into 'master'
settings portal

See merge request GNOME/gtk!403
2018-11-04 20:57:26 +00:00
Matthias Clasen
48b569eae0 wayland: Support the settings portal
Under Wayland, we are currently directly using GSettings
for desktop settings. But in a sandbox, we may not have
access to dconf, so this may fail. Use the new settings
portal instead.
2018-11-04 15:44:50 -05:00
Matthias Clasen
8099669466 Move the should_use_portal helper to gdk
We want to use it there too, in the future.
Update all callers.
2018-11-04 08:17:32 -05:00
Matthias Clasen
1c465604d5 Use a simpler sandbox check
No need to use the runtime dir and allocate a string.
We can just check in /.
2018-11-04 08:17:32 -05:00
Matthias Clasen
833442e1e2 Merge branch 'wip/fmuellner/deco-setting' into 'master'
wayland: Remove GNOME Classic-specific workaround

See merge request GNOME/gtk!400
2018-11-02 16:18:25 +00:00
Florian Müllner
1e39f999e3 wayland: Remove GNOME Classic-specific workaround
As GSettings now supports session-specific defaults, GNOME Classic
no longer uses a separate schema and the decoration layout is always
determined by the regular schema.

This essentially reverts commit add67b516c (although the code was
moved since then).

https://gitlab.gnome.org/GNOME/gtk/merge_requests/400
2018-11-02 16:44:33 +01:00
John Ralls
e31187e1cf GdkQuartz: Handle NULL from [NSGraphicsContext currentContext].
By returning a default surface. The situation where there's no
currentContext arises when GtkCSS is trying to determine the
layout sizes so no actual display is necessary.

Closes: #1411
2018-11-01 15:39:27 -07:00
John Ralls
e457a7823c Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite. 2018-11-01 15:38:43 -07:00
John Ralls
88c77eb7be Update GDK_OSX versions to current MacOS release. 2018-11-01 15:38:29 -07:00
Piotr Drąg
f57d337fac Update POTFILES.in 2018-10-31 18:46:48 +01:00
Timm Bäder
60b0f48fbc Merge branch 'wip/carlosg/public-legacy-controller' into 'master'
Make legacy controller public

See merge request GNOME/gtk!388
2018-10-31 13:39:08 +00:00
Руслан Ижбулатов
4c6d60ce2b GDK W32: Be honest about supported clipboard formats
Do not lie to W32 about the formats that we provide or accept.

Originally the logic behind such lies was that GdkPixbuf allows us to
convert any supported image to BMP or PNG, and therefore we should
announce that we always provide/accept BMP and PNG along with other
formats.

But that's not how it works. GDK has built-in serializers and
deserializers for all pixbuf formats (where it just invokes GdkPixbuf
API) and will use them automatically to read or write GdkTexture
objects (internally wrapping GdkPixbuf objects where necessary). The
encoding and decoding of images is handled
by GdkContent(De)Serializers, backend has nothing to do with it.

Therefore W32 GDK backend should only offer formats that it can
actually do conversion for by itself (such as image/bmp <-> CF_DIB,
or text/uri-list <-> CFSTR_SHELLIDLIST).
2018-10-31 08:40:50 +00:00
Timm Bäder
b4acf81609 Merge branch '1422-gtkentry-s-minimum-width-is-hardcoded-to-150px-GTK4' into 'master'
gtkentry: set minimum-width to 0 instead of 150

Closes #1422 and evince#1002

See merge request GNOME/gtk!393
2018-10-26 09:25:36 +00:00
Matej Urbančič
62871400b1 Updated Slovenian translation 2018-10-25 22:06:19 +02:00
Matej Urbančič
c4b3337569 Added Slovenian translation 2018-10-25 22:03:51 +02:00
Nelson Benítez León
45e6e0cd04 gtkentry: set minimum-width to 0 instead of 150
and use 150 as natural-width.

Currently there's no way for a GtkEntry to be less
than 150px wide (apart from using "width-chars" property),
this is too much for a default minimum-width, an app
developer may need to have a shorter GtkEntry, for example
when the UI it's been shrunk by the user (see [1]) or when
you want to match the size of another widget (which is less
than 150px) see [2] for Evince bug on using
gtk_combo_box_new_with_model_and_entry() for PDF forms where
GtkEntry of ComboBox is too wide and doesn't match the combo
list width.

Using "width-chars" property may be a workaround to obtain
a short minimum-width for the entry, but is not a proper
solution for the mentioned cases as you may not know how
short your GtkEntry will be, or the fact that using "chars"
as a width unit is not pixel accurate.

Curious note: the commit that introduced the GtkEntry
minimum-width to be 150px is from 20 years ago, see
https://bit.ly/2ySEfK4

[1] This change was already suggested by Benjamin Otte
in a blog comment https://bit.ly/2J96wRo

[2] Fixes issue evince#1002
2018-10-24 23:02:31 +05:00
Timm Bäder
98dd53c2c3 Merge branch 'nirbheek/meson-fallback-dep-fixes' into 'master'
Misc meson fixes for using subproject dependencies

See merge request GNOME/gtk!232
2018-10-24 09:42:12 +00:00
Kristjan SCHMIDT
ad7eaf2bb8 Update Esperanto translation 2018-10-24 08:14:41 +00:00
Jakub Steiner
ef82f1799f Adwaita: prevent devel styling break selection mode
- Selection mode does not get the special devel styling.

- removed teh last-child() selector for it doesn't work anymore.
  Better style all section of the headerbar than none. Proper fix pending.

https://source.puri.sm/Librem5/libhandy/issues/57
2018-10-22 10:31:20 +02:00
Ignacio Casal Quinteiro
1729da8a3e quartz: do not cache the screen in the gdkmonitor
Instead we just cache the monitor number and get
out of it the nsscreen when it is needed. This is
a requirement since it nsscreen it is not supposed
to be cached.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312
2018-10-17 10:10:44 +02:00
Matthias Clasen
a3ac3b61ef Merge branch '1397-gtknotebook-built-in-popup-menu-listing-tabs-doesn-t-use-tab-label-text-for-the-last-tab-4' into 'master'
Notebook: Ensure menu label updates with tab_label

Closes #1397

See merge request GNOME/gtk!386
2018-10-16 20:49:42 +00:00
LRN
532a48aa92 Merge branch 'lrn/zorder-gtk4' into 'master'
Don't let the OS maintain relative Z-order for windows (GTK4)

See merge request GNOME/gtk!197
2018-10-15 22:48:14 +00:00
Carlos Garnacho
f3674688bf tests: Drop "saved positions" test in testgtk
This test solely relies on configure events, which aren't supported anymore.
2018-10-15 20:05:54 +02:00
Carlos Garnacho
dd6aa7b870 tests: Drop ::event handler in testgtk
We can use ::size-allocate for it, as window positions in root coordinates
are neither supported nor crucial here.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
21d0e30903 testsuite: Fix gestures tests for the legacy controller
Let it create one with the right propagation phase, so the event propagation
chain stays the same.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
3c73f70dae tests: Use GtkEventControllerMotion in testpopup
Track motion through it, instead of a GtkWidget::event handler.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
65fbd0af4e tests: Remove ::event handler in testwindowsize
We just want widget size here, not windowing configuration events.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
55b32c8a8f gtkwidget: Drop obsolete code
This path is not being hit anymore, gtkmain.c does handle those events
itself.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
bb0e964f56 testsuite: Fix gestures test
Was broken by the removal of the default GtkEventControllerLegacy.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
0f4a6bfbf8 gtkeventcontrollerlegacy: Make public
And move ::event into it, dropping the GtkWidget::event signal.
2018-10-15 17:39:04 +02:00
Daniel Boles
4e884b6056 Notebook: Ensure menu_label updates with tab_label
This was noticed in Firefox and demonstrated using a GtkBuilder ui file.
buildable_add_child() calls set_tab_label(), but the latter did nothing
to update the menu_label corresponding to that tab with the new text.
Using Builder to populate the tab child, only tabs other than last got
the right non-default labels, and even that was mostly coincidental, as
adding the main child called update_labels() via real_insert_page(), so
it took effect when the 2nd last main child is added, updating the rest
but leaving the last with the default label, not that given in Builder.

Fix by factoring out the code from child_reordered() to a new helper
menu_item_recreate() and calling that in set_tab_label(), so that
whenever the tab_label is updated, so is its corresponding menu_label.

This fixes the reported case and presumably others that we could write.

fixes https://gitlab.gnome.org/GNOME/gtk/issues/1397
2018-10-12 23:50:12 +01:00
Daniel Boles
f252bbc02c Notebook: Don't notify 2x from set_tab_label_text
It calls set_tab_label(), which already does that.
2018-10-12 23:40:16 +01:00
Daniel Boles
9cbd3ac017 gtk-demo/main: Suppress implicit fallthru warning
Comments matched to reassure the compiler that fallthrough is
intentional are supposed to precede the case or default keywords, at
least in GCC, so the one here did not suppress the warning with GCC. We
can just the if condition and put the comment at the end to solve that.

https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
2018-10-12 22:19:25 +01:00
Nirbheek Chauhan
4bae7fb0fd .gitignore: Ignore all subdirs in the subprojects dir 2018-10-12 14:23:53 +05:30
Nirbheek Chauhan
b98f5a0823 meson: Always fetch pangoft2_dep from the pango subproject
This ensures that we will use pangoft2 if it is available, and not if
it is not available.

See: https://gitlab.gnome.org/GNOME/pango/merge_requests/6
2018-10-12 13:08:48 +05:30
Nirbheek Chauhan
00c29e1fbe meson: Use proxy-libintl subproject when needed and available
Such as on Windows with MSVC.
2018-10-12 13:08:48 +05:30
Nirbheek Chauhan
de3e5be235 meson: Add a fallback for the harfbuzz dependency
This meson port is not upstream yet, so a wrap file is not included.
Upstream has expressed interest but the port hasn't been tested on all
platforms yet. Will be added when it gets upstreamed.

Link to WIP port: https://github.com/centricular/harfbuzz
2018-10-12 13:08:48 +05:30
Timm Bäder
ae3e6d1949 emojichooser: Pass chooser to add_emoji 2018-10-11 12:27:56 +02:00
Timm Bäder
114efa83c6 widget: Stop adding a legacy event controller
The only event signal left is ::event and everything needing that
connects to it directly.
2018-10-11 12:27:56 +02:00
Timm Bäder
d15df65a9d gl renderer: Save some matrix multiplications
We do this for every single node, which is a little costly, especially
since the common case for the modelview matrix these days is a simple
translation. So, check whether the new modelview matrix is only a
translation matrix and if so, don't do a full matrix multiplication per
node.
2018-10-11 12:27:56 +02:00
Timm Bäder
e0a1311e5b spinbutton: Don't use gfloat in a code sample 2018-10-11 12:27:56 +02:00
Timm Bäder
48e88c6ea4 Merge branch 'file-sealing' into 'master'
gdk: seal in-memory files when possible

See merge request GNOME/gtk!353
2018-10-10 11:12:03 +00:00
Timm Bäder
50c63fc39a Merge branch 'gtkbuilder-tag-end-wrong-type' into 'master'
GtkBuildable: Fix the type of the user_data in GtkBuildable.custom_tag_end

See merge request GNOME/gtk!378
2018-10-10 11:09:25 +00:00
Chun-wei Fan
1ca5b41571 gtkimcontextime.c: Fix Korean input
Commit 64a489ad inadvertently introduced a regression that broke Korean
text input because the changes there resulted that only the last input
string that we have from ImmGetCompositionStringW() for each time the
commit signal is emitted is kept, and also as a result the final Korean
character that is input by hitting space is also lost as a result, as we
didn't check for whether we are done with preediting.

Fix these issues by doing the following when we receive the
WM_IME_COMPOSITION message with GCS_RESULTSTR from Windows:
-Do not emit the commit signal during WM_IME_ENDCOMPOSITION, and...
-Emit the commit signal anyways, as we did before c255ba68, however...
-We still save up the string to commit, because we need to re-compute
 the cursor position when we do ->get_preedit_string(), which needs to
 take the GCS_RESULTSTR string we get from WM_IME_COMPOSITION into
 account as well, so that we avoid getting the Pango criticals that
 occur during Chinese (and most likely Japanese) input as the cursor
 position is out-of-range.

Fixes issue #1350.
2018-10-09 17:10:23 +08:00
Chun-wei Fan
cebf5ed46c testsuite/gtk/filterlistmodel.c: Avoid GCCism
Pointer arithmetic on gpointers (void *) is a GCCism, so avoid that by
being more explicit with things.
2018-10-09 16:26:36 +08:00
Chun-wei Fan
1ca906008e testsuite/gtk/[flatten|sort]listmodel.c: Avoid VLA usage
Visual Studio is unlikely to support VLAs at any point, so avoid using
them and use g_newa() instead.
2018-10-09 16:26:21 +08:00
Robert Ancell
dd69c4e0f2 GtkBuildable: Fix the type of the user_data in GtkBuildable.custom_tag_end
The previous type was a pointer to a pointer, which seems to be a copy-paste
error from GtkBuildable.custom_tag_start which is an out parameter. It was
always cast in use so this is an API break, but not an ABI one.
2018-10-08 11:38:20 +13:00
Daniel Boles
cbb0d7ba69 Merge branch 'master' into 'master'
gtkstack: fix null pointer dereference

See merge request GNOME/gtk!361
2018-10-07 17:28:31 +00:00
Aurimas Černius
cbdb744c40 Updated Lithuanian translation 2018-10-07 16:57:01 +03:00
LRN
10fef2fbb4 Merge branch 'win32-runtime-immodule-swap-gtk4' into 'master'
GDK W32: Support switching IM contexts at runtime (GTK4)

See merge request GNOME/gtk!372
2018-10-07 09:05:16 +00:00
Benjamin Otte
8e2fb9c2be docs: Update GtkSliceListModel 2018-10-07 02:23:40 +00:00
Mohammed Sadiq
f48ed12e78 slicelistmodel: Fix typos in docs 2018-10-07 07:46:58 +05:30
Руслан Ижбулатов
66c0336ead GDK W32: Support switching IM contexts at runtime
This leverages the normal input context switching mechanism in GTK
by making it think that the gtk-im-module setting changed.
The backend returns gtk-im-module value as "ime" if W32
IME API says that an IME is in use. Otherwise it returns
and empty string - this still triggers an input context
switching code, which, not being able to create the desired context
(which is and empty string), falls back to looking at current
keyboard layout (currently that code is still a FIXME).

Paired with the code that signals gtk-im-module change on keyboard layout
switches, this is sufficient to make GTK capable of switching to
the appropriate IM context at runtime. At least, the kinds of context
that specify languages for which they are used automatically by default
(once locale matching is implemented), and the IME context.

Loading other kinds of IM context might still work via specifying
the gtk-im-module setting in gtk ini file, but doing so will likely
make GTK incapable of using the IME context that is used
for Korean, Chinese and Japanese (and some other languages).

Until someone figures out a way to actually change gtk-im-module
setting on Windows at runtime with meaningful values, the behaviour
introduced by this commit seems like a sufficient workaround.
2018-10-06 17:45:30 +00:00
Benjamin Otte
0657a53940 inspector: Highlight CSS node on selection
Fixes #1383
2018-10-06 00:29:31 +02:00
Benjamin Otte
eecd5823d0 docs: Put subsection into right section
The widget observer APIs belong into the widget docs, not the window
docs. Oops.
2018-10-06 00:29:31 +02:00
Benjamin Otte
99b769706c video: Add header include guard 2018-10-06 00:29:31 +02:00
Jakub Steiner
39843ebb3f Adwaita: fix devel styling for sidebar apps
- don't put the gradient/cogged wheel on apps that have a split headerbar
  due to having a sidebar
2018-10-04 20:36:44 +02:00
Jeremy Bicha
52bcf7fd46 widget-factory: Add Keyboard Shortcuts menu item
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/916
2018-09-30 20:43:53 -04:00
Jeremy Bicha
43997fb550 widget-factory: Rename About menu item to About Widget Factory
This follows the recommendation in
https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement
2018-09-30 20:43:51 -04:00
Jeremy Bicha
c59669d376 widget-factory: Move app menu contents to primary menu
GNOME Shell 3.32 will remove support for the app menu
so we need to move its contents to the primary (hamburger)
menu.

widget-factory already had a primary menu.

The only item in the app menu was About.

https://gitlab.gnome.org/GNOME/Initiatives/issues/4
2018-09-30 20:43:41 -04:00
Alex Monday
aa14b187e0 Adwaita: Horizontal OSD spinbutton entry fix
Add placeholder to hande horizontal spinbutton entries,
add instructions for horizontal OSD spinbutton entry to use this
placeholder.
2018-09-30 23:54:14 +05:00
Kristjan SCHMIDT
ac97d2be0c Update Esperanto translation 2018-09-30 10:24:25 +00:00
emersion
e9a67cc6d0 gdk: seal in-memory files when possible
This can be used by compositors to mmap memory without having to
handle SIGBUS.
2018-09-27 23:35:18 +02:00
Hugo Lefeuvre
44655932c4 gtkstack: fix null pointer dereference
The gtk_stack_snapshot_slide() function dereferences the
last_visible_child pointer without proper != NULL ckeck. This might
result in NULL pointer dereference and crash if last_visible_child is
invalid.

Add a != NULL check before dereferencing the pointer.
2018-09-27 09:53:22 -04:00
Jakub Steiner
278f9a9eda Adwaita: draw insensitive progressbars
- keep inheriting stuff from scales, but
  do draw highlights

Addresses issue #1191
2018-09-26 22:43:31 +02:00
Matthias Clasen
a28c7e8839 Merge branch 'wip/sadiq/fixes' into 'master'
docs: Fix inclusion of source files in tutorial

See merge request GNOME/gtk!341
2018-09-26 18:28:23 +00:00
Matthias Clasen
77c8d2df00 Merge branch 'wip/jimmac/nightly-headerbar' into 'master'
Adwaita: tone down the 'devel' styling

See merge request GNOME/gtk!357
2018-09-26 16:11:43 +00:00
Jakub Steiner
aeca5858d8 Adwaita: tone down the 'devel' styling
The selected bg was too prominent and intefered with button styling.
2018-09-26 15:50:58 +02:00
Timm Bäder
89b96a864e Merge branch 'wip/arnaudb/fix-dashed-border-4' into 'master'
Make dashed border-style work correctly

See merge request GNOME/gtk!355
2018-09-25 07:12:58 +00:00
Timm Bäder
26302cada5 Update expected node files
We don't technically hide the arrow nodes anymore.
2018-09-24 21:05:07 +02:00
Arnaud B
42d064c62f Make dashed border-style work correctly
There’s a short-path done for focus rectangles, but it can be taken in other conditions, and then fail occasionally to render a dashed line if the border-width is too big.
2018-09-24 09:39:55 +02:00
Piotr Drąg
273189fc1a Update Polish translation 2018-09-23 18:27:30 +02:00
Timm Bäder
d51abaea2e scalebutton: Remove unused define 2018-09-23 18:01:59 +02:00
Timm Bäder
248708c282 button: Remove key_controller member
Unneeded now.
2018-09-23 17:59:37 +02:00
Timm Bäder
0e2748006a assistant: Remove some unused defines 2018-09-23 17:34:03 +02:00
Timm Bäder
e89bd7dfa2 menu: Remove useless if statement 2018-09-23 17:34:03 +02:00
Timm Bäder
2f6e998a27 menu: Show scroll arrows if necessary 2018-09-23 17:34:03 +02:00
Timm Bäder
7b7296410e menu: Remove arrow visibility flags 2018-09-23 17:34:03 +02:00
Jan Alexander Steffens (heftig)
d90e2733ea GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE
Close https://gitlab.gnome.org/GNOME/gtk/issues/1323#note_327705
2018-09-22 17:56:38 +01:00
Daniel Boles
19bf502fde Merge branch 'master' into 'master'
flattenlistmodel: Fix uninitialized variable warning

See merge request GNOME/gtk!347
2018-09-22 16:52:49 +00:00
Piotr Drąg
2b8e30a8ed Use Unicode apostrophes in new strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2018-09-20 19:01:14 +02:00
Yi-Soo An
4ad8dcebd8 flattenlistmodel: Fix uninitialized variable warning
Variable, added, would be a garbage value if model is NULL and
the following code, if condition, use the uninitialized variable.
A side effect could be occurred by that.

To avoid, the variable is initialized to zero.
2018-09-20 12:45:33 +09:00
Matthias Clasen
a966b90e51 Merge branch 'master' into 'master'
Remove some duplication in testfilechooserbutton

See merge request GNOME/gtk!342
2018-09-19 13:46:50 +00:00
Matthias Clasen
5b2a451e75 Merge branch 'installed-tests' into 'master'
Get GTK+ 4 installed-tests closer to working

See merge request GNOME/gtk!348
2018-09-19 11:59:16 +00:00
Emin Tufan Çetin
8105bde835 Update Turkish translation 2018-09-19 11:13:18 +00:00
Emin Tufan Çetin
2329b62c14 Update Turkish translation 2018-09-19 11:05:05 +00:00
Emin Tufan Çetin
1e1bed056f Update Turkish translation 2018-09-19 10:56:13 +00:00
Simon McVittie
a0d83bdfa7 testsuite: Install accessibility-dump executable alongside tests
The installed-tests want to run this.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-09-19 09:41:49 +01:00
Simon McVittie
fa8190328d testsuite: Fix installed-test metadata for autotestkeywords
The executable is called autotestkeywords, so we shouldn't try to run
an executable named keywords. Also rename the metadata file to match.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-09-19 09:40:37 +01:00
Simon McVittie
d19cba429d reftests: Fix path to installed-tests in .test metadata
The installed-tests are now namespaced as gtk-4.0 to avoid colliding
with GTK+ 3, but these files weren't updated.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-09-19 09:37:06 +01:00
Benjamin Otte
be2609a271 inspector: Handle case where there's no default application 2018-09-19 04:31:29 +02:00
Benjamin Otte
5bf009a203 cssrbtree: Fix a crasher
After removing elements, there were a few cases where the tree wasn't
properly balanced which could further down violate assumptions about the
layout.

Attached is the original testcase that triggered it. I didn't bother
simplifying it.
2018-09-19 04:31:29 +02:00
LRN
93a89a371e Merge branch 'win32-scroll-both-gtk4' into 'master'
GDK W32: send both smooth and discrete scrolling events (GTK4)

See merge request GNOME/gtk!337
2018-09-18 16:43:37 +00:00
Benjamin Otte
60cb315be6 Merge branch 'revealer-support-min-size-master' into 'master'
gtkrevealer: support minimum size of child

Closes #635

See merge request GNOME/gtk!317
2018-09-18 15:19:12 +00:00
Eduard Braun
73728814b0 GDK W32: fix direction of horizontal smooth scrolling events
Commit 359df028be changed the
code to send GDK_SCROLL_SMOOTH with deltas instead of
GDK_SCROLL_(UP|DOWN|LEFT|RIGHT).

Windows defines deltas inversed for vertical direction
(positive values mean the wheel was turned forward)
but not for horizontal direction
(positive values mean the wheel was turned towards the right).

This commit fixes behavior as both axes were inverted previously.
2018-09-18 13:52:36 +00:00
Руслан Ижбулатов
d4098099dd GDK W32: send both smooth and discrete scrolling events
Commit d64467b334 changed the
code to send GDK_SCROLL_SMOOTH with deltas instead of
GDK_SCROLL_(UP|DOWN|LEFT|RIGHT). Change it again, to send
both the GDK_SCROLL_SMOOTH and the GDK_SCROLL_(UP|DOWN|LEFT|RIGHT)
event separately (with the discrete event marked as emulated),
as this is what other backends (such as wayland) do.
2018-09-18 13:52:35 +00:00
Carlos Soriano
57ef793e6d revealer: Support minimum size of child
Up until now when allocating the child it only used the natural size
while the measuring also used the minimum size, resulting in a clipped
child when animating if the child had different minimum size and
natural size. This was an obvious case when using labels that had
ellipsization.

This commit gives full allocation to the child by inverting the size
the revealer reduces from its animation progress.

Code done by Benjamin Otte.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/635
2018-09-18 11:36:29 +02:00
Christoph Reiter
58cdd5139e ci/docker: add lcov so we can create coverage reports
This was requested on IRC; the docker image in the registry is updated already.
2018-09-18 09:55:50 +02:00
Benjamin Otte
2c84049769 treelistmodel: Improve naming a bit
The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...
2018-09-18 08:03:03 +02:00
Benjamin Otte
29c700d1c7 listmodels: Clarify documentation for function prototypes
Fixes #1341
2018-09-18 08:02:21 +02:00
Mohammed Sadiq
0d7c987b1a Revert "listlistmodel: Fix documentation comment"
This reverts commit 03679d4342.

listlistmodel is private
2018-09-18 10:01:12 +05:30
Mohammed Sadiq
03679d4342 listlistmodel: Fix documentation comment 2018-09-18 09:56:19 +05:30
Georges Basile Stavracas Neto
1a4b60fb36 tree-list-model: Return the correct item type
When passthrough is enabled, it should return the GType
of the child GListModels; when disabled, it should be
GTK_TYPE_TREE_LIST_ROW.

The conditions are inverted however, causing a few
warnings to trigger.

Fix that by returning the correct GType.
2018-09-18 00:51:57 -03:00
Mohammed Sadiq
05b2ae0f31 Merge branch 'wip/sadiq/model-fixes' into 'master'
treelistmodel: Fix memory leak

See merge request GNOME/gtk!344
2018-09-18 02:54:30 +00:00
Mohammed Sadiq
f211d71f74 treelistmodel: Fix memory leak
gtk_tree_list_model_init_node() increases the reference count
of the model passed. Let's not do that, and let it take the
model passed.
2018-09-18 07:50:44 +05:30
Mohammed Sadiq
691ab421fb Merge branch 'wip/sadiq/model-fixes' into 'master'
treelistmodel: Fix signal emission on row destroy

See merge request GNOME/gtk!343
2018-09-18 02:03:58 +00:00
Mohammed Sadiq
9e3e9e83ef treelistmodel: Fix signal emission on row destroy 2018-09-18 07:11:27 +05:30
Manu Cornet
a0056d5ca8 Remove some duplication in testfilechooserbutton
Most of the code creating the two types of dialogs (open file,
choose folder) is the same. This refactors the common code into a
helper method. This also makes it easier to add other chooser types
for this test (e.g. save file).
2018-09-17 12:27:46 +00:00
Rico Tzschichholz
f3e6d00db1 gtk: Fix some g-i annotations warnings 2018-09-17 13:00:36 +02:00
Robert Ancell
e55df03fe2 Merge branch 'toolbar-expand' into 'master'
toolbar: Use hexpand/vexpand Gtk+ properties

See merge request GNOME/gtk!334
2018-09-17 08:59:19 +00:00
Robert Ancell
c8a13a2d8a toolbar: Use hexpand/vexpand Gtk+ properties 2018-09-17 10:25:59 +02:00
Mohammed Sadiq
6971e2923d docs: Fix inclusion of source files in tutorial 2018-09-17 13:39:22 +05:30
Matthias Clasen
231b76bdd1 tree list model: Add docs 2018-09-16 23:07:00 -04:00
Matthias Clasen
57ba4048de Minor doc fix
Clarify some wording.
2018-09-16 23:07:00 -04:00
Benjamin Otte
545c5f18b2 testsuite: Disable some tests for older glib 2018-09-17 04:30:28 +02:00
Benjamin Otte
5571217218 testsuite: Add tests for GtkSortListModel 2018-09-17 03:57:37 +02:00
Benjamin Otte
b92c328425 sortlistmodel: Actually insert unsorted items at the wrong place
We were adding items in reverse order, oops.
2018-09-17 03:57:37 +02:00
Piotr Drąg
8bdcff3320 Update POTFILES.in 2018-09-16 21:02:31 +02:00
Benjamin Otte
9ffd88012d docs: Add missing TreeListModel docs 2018-09-16 19:39:39 +02:00
Matthias Clasen
563fb97f90 Merge branch 'wip/sadiq/fixes' into 'master'
gdkselectioninputstream-x11: Fix memory leak

See merge request GNOME/gtk!340
2018-09-16 17:06:29 +00:00
Benjamin Otte
ee5708f543 testtreelistmodel: Display the file icon, because why not 2018-09-16 18:50:17 +02:00
Benjamin Otte
b7bf04fabd inspector: Update the controllers list to show parent controllers
Now we show all the controllers that are relevant when widget gets sent
events.
2018-09-16 18:50:17 +02:00
Benjamin Otte
b94b8ac38d testtreelistmodel: Make the statusbar display more info
Now display how many items were filtered (if any) and how many
directories remain to be sanned (if any).
2018-09-16 18:50:17 +02:00
Benjamin Otte
afd69db678 testtreelistmodel: Sort files by name 2018-09-16 18:50:17 +02:00
Benjamin Otte
f3834138f7 GtkSortListModel: Add 2018-09-16 18:50:17 +02:00
Benjamin Otte
64b7c123cc testtreelistmodel: Add search
Add a simple search that does a case insensitive substring search of the
file paths.
2018-09-16 18:50:17 +02:00
Benjamin Otte
fcb780ee13 testtreelistmodel: Make the directory loading async
This is way more complicated than it should be, because it requires
manually limiting the number of open file enumerators.

On the other hand, it exhaustively tests the items-changed emission of
all involved listmodels because those signals come in pretty much
randomly.

It's also 50% slower than the sync version, with the caeat that the sync
version only shows the UI after it's done loading, while this version
shows it right away.
2018-09-16 18:50:17 +02:00
Benjamin Otte
65b795b861 testtreelistmodel: Add a hack to handle LONG lists
... and make the lists long by autoexpanding the tree.
2018-09-16 18:50:17 +02:00
Benjamin Otte
64d97b233b GtkSliceListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
db8474e5b1 inspector: Make controllers page use gtk_list_box_bind_model() 2018-09-16 18:50:17 +02:00
Benjamin Otte
5e8983883e inspector: Rename "Gestures" page to "Controllers"
And rename GtkInspectorGestures => GtkInspectorControllers, too.
2018-09-16 18:50:17 +02:00
Benjamin Otte
59006e2e03 inspector: Make gestures page handle all controllers
This requires removing support for gesture groups.
2018-09-16 18:50:17 +02:00
Benjamin Otte
b6acc31d44 GtkMapListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
6d0fe46cba propertylookuplistmodel: Add
This model just takes an object and a property name and recursively
looks it up. In particular, I want it for:

widget, widget.parent, widget.parent.parent, ...
2018-09-16 18:50:17 +02:00
Benjamin Otte
05e752e096 inspector: Turn object tree into a GtkListBox
The code gets rid of the GtkTreeView and replaces it with a GtkListBox.

Most of the logic is now done via GListModel subclasses.

A big change is that this new list is now tracking updates itself and
doesn't need to be manually updated. All code that used to cause rescans
or add forgotten objects to the tree has been removed.

If objects are missing from the object tree, the logic for tracking them
needs to be added.
2018-09-16 18:50:17 +02:00
Benjamin Otte
2237009983 testsuite: Disable some tests with older glib
Fixes CI.
2018-09-16 18:50:17 +02:00
Benjamin Otte
417ac4ab43 inspector: Use a GtkPicture to display render nodes
Instead of the outdated render node view, use modern GTK APIs.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4495eaae84 inspector: Add an icon to the render node list 2018-09-16 18:50:17 +02:00
Benjamin Otte
aba76fe8e9 inspector: Make the render node tree use a ListBox
It used to be a treeview.
2018-09-16 18:50:17 +02:00
Benjamin Otte
867042f88f widget: Add gtk_widget_observe_controllers()
This mirrors gtk_widget_observe_children() - just that it observes the
controllers, not the children.
2018-09-16 18:50:17 +02:00
Benjamin Otte
32ec7dec61 gtk: Add GtkFlattenListModel
We can flatten lists of lists into lists now!
2018-09-16 18:50:17 +02:00
Benjamin Otte
d6161e09cd treelistmodel: Add more API to navigate the tree
This adds functionality from GtkTreeIter into GtkTreeListRow that allows
finding items in the model and getting their position for use in
GtkListBox.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4b5fb5ec79 treelistmodel: Refactor to add GtkTreeListRow
This patch does multiple things:

1. Add a custom persistent per-row object.
2. Move all per-row API to that object. This means notifications are now
   possible.
3. Add a "passthrough" construct-only property to the TreeListModel that
   influences if the model returns these new object or passes through
   the ones from the model.

This greatly simplifies the code needed to be written for widgetry,
because one can just connect the per-row object to the expanders that
expand and collapse rows.

As an added power feature, these objects can also be passed through
further models (like filter models).

It also adds kind of a hack to Adwaita to make the test look neat.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4f70f72349 gtk: Add GtkFilterListModel
This is a GListModel implementation that filters the given source model.
2018-09-16 18:50:17 +02:00
Benjamin Otte
dd94129e27 widget: Add gtk_widget_observe_children()
This creates a listmodel that tracks a widget's children. Doing so turns
adding/removing children from O(1) to O(N) though, so use with caution.
2018-09-16 18:50:17 +02:00
Benjamin Otte
63e5b827ed window: Add gtk_window_get_toplevels()
This one returns a list of all toplevel windows.
2018-09-16 18:50:17 +02:00
Benjamin Otte
573c63973a gtk: Add GtkTreeListModel
This is a GListModel implementation with a neat API that can be used to
implement trees inside GtkListBox.
2018-09-16 18:50:17 +02:00
Mohammed Sadiq
1ce960c85b gdkselectioninputstream-x11: Fix memory leak 2018-09-16 20:08:25 +05:30
Matthias Clasen
d7a5dcba0b gtk_application_inihit: allow no reason
We document this argument as nullable, so treat it as such.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1327
2018-09-13 23:31:48 -04:00
Emin Tufan Çetin
a4b1c6b384 Update Turkish translation 2018-09-11 20:17:29 +00:00
Jakub Steiner
0edec9bcae Merge branch 'adwaita-fixes' into 'master'
Adwaita fixes

See merge request GNOME/gtk!333
2018-09-10 14:29:54 +00:00
Adrien Plazas
7d12a843f2 Adwaita: Set selection mode to headerbars if it's on ancestors
This allows to set the container of the headerbars in selection mode
rather than having to set the mode to each element of the title bar.
2018-09-10 15:51:12 +02:00
Adrien Plazas
867efe2e33 Adwaita: Style separator.sidebar
Let separators be declared as sidebars to have the same style as those
drawn by GtkStackSidebar. This also let them handle the selection-mode
class, whether they are assigned it or they descend from something in
selection mode.

Also drop setting the selection mode color for non-sidebar separators.

This is convenient when building a custom sidebar using a GtkSeparator
and to extend a sidebar to the title bar.
2018-09-10 15:50:43 +02:00
Adrien Plazas
a121bfa7ec Adwaita: Drop the background of nested headerbars
This is needed to work around headerbar sliding animation issues without
refactoring Adwaita's support of titlebars and headerbars as it may
break applications.

https://gitlab.gnome.org/GNOME/gtk/issues/1264
2018-09-10 15:49:37 +02:00
Jakub Steiner
02758cd48d Merge branch 'wip/adwaita/linked-entry-error-state-fix-master' into 'master'
Adwaita: Fix linked elements in error state

See merge request GNOME/gtk!315
2018-09-10 10:47:05 +00:00
Alex Monday
3e5746356e themes: Fix linked elements in error state
Add instructions for color of linked elements border which ajoints
entry, when parent linked entry is in error state.
2018-09-02 14:48:53 +05:00
Руслан Ижбулатов
b7f9a5419f GDK W32: Use SWP_NOOWNERZORDER everywhere it can be applied
There is no reason why we shouldn't pass this flag every time
Z-order changes. We have separate routines that are used to
maintain relative Z-order, so it should be completely OK to
pass SWP_NOOWNERZORDER to let the OS know that it shouldn't try
to maintain relative Z-order of the windows when raising them.
2018-06-17 10:59:49 +00:00
Руслан Ижбулатов
6cfa799ca1 GDK W32: Don't let TEMP surfaces cause zorder side-effects
Pass SWP_NOOWNERZORDER when rising TEMP surfaces to the top. This ensures that
they don't drag anything else to the top with them. The use-case for this is
a tooltip appearing for a non-foreground surface, causing said surface to rise
above other surfaces, some of which maybe foreground at the moment.

https://bugzilla.gnome.org/show_bug.cgi?id=784766
2018-06-17 10:59:47 +00:00
728 changed files with 72203 additions and 53993 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/subprojects/*/

View File

@@ -13,7 +13,7 @@ stages:
- subprojects/pango/
fedora-x86_64:
image: registry.gitlab.gnome.org/gnome/gtk/master:v1
image: registry.gitlab.gnome.org/gnome/gtk/master:v2
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh
@@ -64,7 +64,7 @@ flatpak:widget-factory:
<<: *flatpak-defaults
pages:
image: registry.gitlab.gnome.org/gnome/gtk/master:v1
image: registry.gitlab.gnome.org/gnome/gtk/master:v2
stage: deploy
script:
- meson -Ddocumentation=true _build .

View File

@@ -1,4 +1,4 @@
FROM fedora:28
FROM fedora:29
RUN dnf -y install \
hicolor-icon-theme \
@@ -33,6 +33,7 @@ RUN dnf -y install \
iso-codes \
itstool \
json-glib-devel \
lcov \
libattr-devel \
libepoxy-devel \
libffi-devel \
@@ -69,7 +70,7 @@ RUN dnf -y install \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson
RUN pip3 install meson==0.49.0
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}

View File

@@ -2,7 +2,7 @@
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v1"
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v2"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .

View File

@@ -1,31 +1,144 @@
If you want to hack on the GTK+ project, you'll need to have the development
tools appropriate for your operating system, including:
# Contribution guidelines
Thank you for considering contributing to the GTK project!
These guidelines are meant for new contributors, regardless of their level
of proficiency; following them allows the maintainers of the GTK project to
more effectively evaluate your contribution, and provide prompt feedback to
you. Additionally, by following these guidelines you clearly communicate
that you respect the time and effort that the people developing GTK put into
managing the project.
GTK is a complex free software GUI toolkit, and it would not exist without
contributions from the free and open source software community. There are
many things that we value:
- bug reporting and fixing
- documentation and examples
- tests
- new features
Please, do not use the issue tracker for support questions. If you have
questions on how to use GTK effectively, you can use:
- the `#gtk` IRC channel on irc.gnome.org
- the [gtk](https://mail.gnome.org/mailman/listinfo/gtk-list) mailing list,
for general questions on GTK
- the [gtk-app-devel](https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list)
mailing list, for questions on application development with GTK
- the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list, for questions on developing GTK itself
You can also look at the GTK tag on [Stack
Overflow](https://stackoverflow.com/questions/tagged/gtk).
The issue tracker is meant to be used for actionable issues only.
## How to report bugs
### Security issues
You should not open a new issue for security related questions.
When in doubt, send an email to the [security](mailto:security@gnome.org)
mailing list.
### Bug reports
If you're reporting a bug make sure to list:
0. which version of GTK are you using?
0. which operating system are you using?
0. the necessary steps to reproduce the issue
0. the expected outcome
0. a description of the behavior; screenshots are also welcome
0. a small, self-contained example exhibiting the behavior; if this
is not available, try reproducing the issue using the GTK examples
or interactive tests
If the issue includes a crash, you should also include:
0. the eventual warnings printed on the terminal
0. a backtrace, obtained with tools such as GDB or LLDB
For small issues, such as:
- spelling/grammar fixes in the documentation
- typo correction
- comment clean ups
- changes to metadata files (CI, `.gitignore`)
- build system changes
- source tree clean ups and reorganizations
You should directly open a merge request instead of filing a new issue.
### Features and enhancements
Feature discussion can be open ended and require high bandwidth channels; if
you are proposing a new feature on the issue tracker, make sure to make
an actionable proposal, and list:
0. what you're trying to achieve
0. prior art, in other toolkits or applications
0. design and theming changes
If you're proposing the integration of new features it helps to have
multiple applications using shared or similar code, especially if they have
iterated over it various times.
Each feature should also come fully documented, and with tests.
## Your first contribution
### Prerequisites
If you want to contribute to the GTK project, you will need to have the
development tools appropriate for your operating system, including:
- Python 3.x
- Meson
- Ninja
- Gettext (19.7 or newer)
- a C99 compatible compiler
- a [C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
Up-to-date instructions about developing GNOME applications and libraries
can be found here:
can be found on [the GNOME Developer Center](https://developer.gnome.org).
* https://developer.gnome.org
The GTK project uses GitLab for code hosting and for tracking issues. More
information about using GitLab can be found [on the GNOME
wiki](https://wiki.gnome.org/GitLab).
Information about using GitLab with GNOME can be found here:
### Dependencies
* https://wiki.gnome.org/GitLab
In order to get GTK from Git installed on your system, you need to have the
required versions of all the software dependencies required by GTK; typically,
this means a recent version of GLib, Cairo, Pango, and ATK, as well as the
platform-specific dependencies for the windowing system you are using (Wayland,
X11, Windows, or macOS).
In order to get Git GTK+ installed on your system, you need to have the
required versions of all the GTK+ dependencies; typically, this means a
recent version of GLib, Cairo, Pango, and ATK, as well as the platform
specific dependencies for the windowing system you are using (Wayland, X11,
Windows, or macOS).
The core dependencies for GTK are:
- [GLib, GObject, and GIO](https://gitlab.gnome.org/GNOME/glib)
- [Cairo](http://cairographics.org)
- [Pango](https://gitlab.gnome.org/GNOME/pango)
- [GdkPixbuf](https://gitlab.gnome.org/GNOME/gdk-pixbuf)
- [Epoxy](https://github.com/anholt/libepoxy)
- [ATK](https://gitlab.gnome.org/GNOME/atk)
- [Graphene](https://github.com/ebassi/graphene)
GTK will attempt to download and build some of these dependencies if it
cannot find them on your system.
Additionally, you may want to look at projects that create a development
environment for you, like [jhbuild](https://wiki.gnome.org/HowDoI/Jhbuild)
and [gvsbuild](https://github.com/wingtk/gvsbuild).
### Getting started
You should start by forking the GTK repository from the GitLab web UI, and
cloning from your fork:
```ssh
```sh
$ git clone https://gitlab.gnome.org/yourusername/gtk.git
$ cd gtk
```
@@ -38,7 +151,7 @@ $ git clone git@gitlab.gnome.org:GNOME/gtk.git
$ cd gtk
```
To compile the Git version of GTK+ on your system, you will need to
To compile the Git version of GTK on your system, you will need to
configure your build using Meson:
```sh
@@ -47,11 +160,6 @@ $ cd _builddir
$ ninja
```
**Note**: For information about submitting patches and pushing changes
to Git, see the [README.md](./README.md) and [README.commits.md](./README.commits.md) files. In particular,
don't, under any circumstances, push anything to Git before reading and
understanding [README.commits.md](./README.commits.md).
Typically, you should work on your own branch:
```sh
@@ -60,6 +168,99 @@ $ git checkout -b your-branch
Once you've finished working on the bug fix or feature, push the branch
to the Git repository and open a new merge request, to let the GTK
maintainers review your contribution. The [CODE-OWNERS](./docs/CODE-OWNERS)
document contains the list of core contributors to GTK and the areas for
which they are responsible.
maintainers review your contribution.
### Code reviews
Each contribution is reviewed by the core developers of the GTK project.
The [CODE-OWNERS](./docs/CODE-OWNERS) document contains the list of core
contributors to GTK and the areas for which they are responsible; you
should ensure to receive their review and signoff on your changes.
### Commit messages
The expected format for git commit messages is as follows:
```plain
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too
brief.
Closes #1234
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Consider the commit
message as an email sent to the developers (or yourself, six months
down the line) detailing **why** you changed something. There's no need
to specify the **how**: the changes can be inlined.
- When committing code on behalf of others use the `--author` option, e.g.
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
- If your commit is addressing an issue, use the
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
to automatically close the issue when merging the commit with the upstream
repository:
```plain
Closes #1234
Fixes #1234
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1234
```
- If you have a merge request with multiple commits and none of them
completely fixes an issue, you should add a reference to the issue in
the commit message, e.g. `Bug: #1234`, and use the automatic issue
closing syntax in the description of the merge request.
### Commit access to the GTK repository
GTK is part of the GNOME infrastructure. At the current time, any
person with write access to the GNOME repository can merge changes to
GTK. This is a good thing, in that it encourages many people to work
on GTK, and progress can be made quickly. However, GTK is a fairly
large and complicated project on which many other things depend, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK that has been built up over the years, we'd like to ask
people committing to GTK to follow a few rules:
0. Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've been
working on GTK for a while it probably isn't necessary to ask. But when
in doubt, ask. Even if your change is correct, somebody may know a
better way to do things. If you are making changes to GTK, you should
be subscribed to the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list; this is a good place to ask about intended changes.
The `#gtk` IRC channel on irc.gnome.org is also a good place to find GTK
developers to discuss changes, but if you live outside of the EU/US time
zones, an email to the gtk-devel mailing list is the most certain and
preferred method.
0. Ask _first_.
0. Always write a meaningful commit message. Changes without a sufficient
commit message will be reverted.
0. Never push to the `master` branch, or any stable branches, directly; you
should always go through a merge request, to ensure that the code is
tested on the CI infrastructure at the very least. A merge request is
also the proper place to get a comprehensive code review from the core
developers of GTK.
If you have been contributing to GTK for a while and you don't have commit
access to the repository, you may ask to obtain it following the [GNOME account
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).

View File

@@ -1,71 +0,0 @@
GTK+ is part of the GNOME git repository. At the current time, any
person with write access to the GNOME repository, can make changes to
GTK+. This is a good thing, in that it encourages many people to work
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
large and complicated package that many other things depend on, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK+ that has been built up over the years, we'd like to ask
people committing to GTK+ to follow a few rules:
0. Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've
been working on GTK+ for a while it probably isn't necessary
to ask. But when in doubt, ask. Even if your change is correct,
somebody may know a better way to do things.
If you are making changes to GTK+, you should be subscribed
to gtk-devel-list@gnome.org. (Subscription address:
gtk-devel-list-request@gnome.org.) This is a good place to ask
about intended changes.
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
is also a good place to find GTK+ developers to discuss changes with,
however, email to gtk-devel-list is the most certain and preferred
method.
0. Ask _first_.
0. With git, we no longer maintain a ChangeLog file, but you are expected
to produce a meaningful commit message. Changes without a sufficient
commit message will be reverted. See below for the expected format
of commit messages.
Notes:
* When developing larger features or complicated bug fixes, it is
advisable to work in a branch in your own cloned GTK+ repository.
You may even consider making your repository publically available
so that others can easily test and review your changes.
* The expected format for git commit messages is as follows:
```
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Normally, for patches
sent to a mailing list it's copied from there.
- When committing code on behalf of others use the `--author` option, e.g.
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
Owen Taylor
13 Aug 1998
17 Apr 2001
Matthias Clasen
31 Mar 2009

View File

@@ -1,17 +1,17 @@
GTK+ — The GTK toolkit
======================
GTK — The GTK toolkit
=====================
[![Build Status](https://gitlab.gnome.org/GNOME/gtk/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gtk/pipelines)
General information
-------------------
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects ranging
GTK is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK is suitable for projects ranging
from small one-off projects to complete application suites.
GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
GTK is free software and part of the GNU Project. However, the
licensing terms for GTK, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
@@ -39,7 +39,7 @@ Nightly documentation can be found at
Building and installing
-----------------------
In order to build GTK+ you will need:
In order to build GTK you will need:
- [a C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
- [Python 3](https://www.python.org/)
@@ -79,7 +79,7 @@ If you are building the Wayland backend, you will also need:
- Wayland-cursor
- Wayland-EGL
Once you have all the necessary dependencies, you can build GTK+ by using
Once you have all the necessary dependencies, you can build GTK by using
Meson:
```sh
@@ -94,7 +94,7 @@ You can run the test suite using:
$ meson test
```
And, finally, you can install GTK+ using:
And, finally, you can install GTK using:
```
$ sudo ninja install
@@ -118,10 +118,10 @@ In the bug report please include:
* Information about your system. For instance:
- which version of GTK+ you are using
- which version of GTK you are using
- what operating system and version
- for Linux, which distribution
- if you built GTK+, the list of options used to configure the build
- if you built GTK, the list of options used to configure the build
And anything else you think is relevant.
@@ -143,7 +143,7 @@ In the bug report please include:
Release notes
-------------
The release notes for GTK+ are part of the migration guide in the API
The release notes for GTK are part of the migration guide in the API
reference. See:
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
@@ -152,7 +152,7 @@ reference. See:
Licensing terms
---------------
GTK+ is released under the terms of the GNU Lesser General Public License,
GTK is released under the terms of the GNU Lesser General Public License,
version 2.1 or, at your option, any later version, as published by the Free
Software Foundation.

View File

@@ -200,20 +200,20 @@ activate_about (GSimpleAction *action,
};
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK+ Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
"program-name", "GTK Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2013 The GTK+ Team",
"copyright", "(C) 1997-2013 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ functions.",
"comments", "Program to demonstrate GTK functions.",
"authors", authors,
"documenters", documentors,
"logo-icon-name", "gtk4-demo",
"title", "About GTK+ Code Demos",
"title", "About GTK Code Demos",
NULL);
}
@@ -455,13 +455,16 @@ demo_application_window_constructed (GObject *object)
}
static void
demo_application_window_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
demo_application_window_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget, allocation,
GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget,
width,
height,
baseline);
if (!window->maximized && !window->fullscreen)

View File

@@ -96,12 +96,12 @@ create_page1 (GtkWidget *assistant)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), entry);
gtk_container_add (GTK_CONTAINER (box), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
@@ -119,7 +119,7 @@ create_page2 (GtkWidget *assistant)
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
gtk_box_pack_start (GTK_BOX (box), checkbutton);
gtk_container_add (GTK_CONTAINER (box), checkbutton);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE);

View File

@@ -1,127 +0,0 @@
/* Button Boxes
*
* The Button Box widgets are used to arrange buttons with padding.
*/
#include <glib/gi18n.h>
#include <gtk/gtk.h>
static GtkWidget *
create_bbox (gint horizontal,
char *title,
gint spacing,
gint layout)
{
GtkWidget *frame;
GtkWidget *bbox;
GtkWidget *button;
frame = gtk_frame_new (title);
if (horizontal)
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
else
bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
g_object_set (bbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (frame), bbox);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
gtk_box_set_spacing (GTK_BOX (bbox), spacing);
button = gtk_button_new_with_label (_("OK"));
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label (_("Cancel"));
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label (_("Help"));
gtk_container_add (GTK_CONTAINER (bbox), button);
return frame;
}
GtkWidget *
do_button_box (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *frame_horz;
GtkWidget *frame_vert;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (main_vbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_widget_set_margin_top (frame_horz, 10);
gtk_widget_set_margin_bottom (frame_horz, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
g_object_set (vbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
g_object_set (hbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@@ -7,7 +7,7 @@
* computers, as long as there is a network connection to the
* computer where the application is running.
*
* Only some of the windowing systems where GTK+ runs have the
* Only some of the windowing systems where GTK runs have the
* concept of multiple displays. (The X Window System is the
* main example.) Other windowing systems can only handle one
* keyboard and mouse, and combine all monitors into
@@ -315,7 +315,7 @@ create_frame (ChangeDisplayInfo *info,
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin);
gtk_container_add (GTK_CONTAINER (hbox), scrollwin);
*tree_view = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE);
@@ -325,7 +325,7 @@ create_frame (ChangeDisplayInfo *info,
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
*button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox);
gtk_container_add (GTK_CONTAINER (hbox), *button_vbox);
if (!info->size_group)
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -365,11 +365,11 @@ create_display_frame (ChangeDisplayInfo *info)
button = left_align_button_new ("_Open...");
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
button = left_align_button_new ("_Close");
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
G_TYPE_STRING,
@@ -542,10 +542,10 @@ do_changedisplay (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
frame = create_display_frame (info);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
initialize_displays (info);

View File

@@ -259,45 +259,45 @@ do_clipboard (GtkWidget *do_widget)
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Copy"));
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (copy_button_clicked), entry);
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the second entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Paste"));
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (paste_button_clicked), entry);
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first image */
image = gtk_image_new_from_icon_name ("dialog-warning");

View File

@@ -1,7 +1,7 @@
/* Color Chooser
*
* A GtkColorChooser lets the user choose a color. There are several
* implementations of the GtkColorChooser interface in GTK+. The
* implementations of the GtkColorChooser interface in GTK. The
* GtkColorChooserDialog is a prebuilt dialog containing a
* GtkColorChooserWidget.
*/
@@ -88,7 +88,7 @@ do_colorsel (GtkWidget *do_widget)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 200);
@@ -101,7 +101,7 @@ do_colorsel (GtkWidget *do_widget)
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (change_color_callback), NULL);

View File

@@ -144,7 +144,7 @@ create_capital_store (void)
{ NULL, "Jackson" },
{ NULL, "Jefferson City" },
{ NULL, "Juneau" },
{ "K - O" },
{ "K - O", NULL },
{ NULL, "Lansing" },
{ NULL, "Lincoln" },
{ NULL, "Little Rock" },
@@ -154,7 +154,7 @@ create_capital_store (void)
{ NULL, "Nashville" },
{ NULL, "Oklahoma City" },
{ NULL, "Olympia" },
{ NULL, "P - S" },
{ "P - S", NULL },
{ NULL, "Phoenix" },
{ NULL, "Pierre" },
{ NULL, "Providence" },
@@ -326,7 +326,7 @@ do_combobox (GtkWidget *do_widget)
* insensitive rows
*/
frame = gtk_frame_new ("Items with icons");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -367,7 +367,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox demonstrating trees.
*/
frame = gtk_frame_new ("Where are we ?");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -395,7 +395,7 @@ do_combobox (GtkWidget *do_widget)
/* A GtkComboBoxEntry with validation */
frame = gtk_frame_new ("Editable");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -413,7 +413,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox with string IDs */
frame = gtk_frame_new ("String IDs");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);

View File

@@ -143,7 +143,6 @@
<file>application_demo.c</file>
<file>assistant.c</file>
<file>builder.c</file>
<file>button_box.c</file>
<file>changedisplay.c</file>
<file>clipboard.c</file>
<file>colorsel.c</file>

View File

@@ -199,9 +199,6 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
@@ -255,16 +252,10 @@
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar1">
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>

View File

@@ -56,16 +56,16 @@ interactive_dialog_clicked (GtkButton *button,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
image = gtk_image_new_from_icon_name ("dialog-question");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (hbox), image);
gtk_container_add (GTK_CONTAINER (hbox), image);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table);
gtk_container_add (GTK_CONTAINER (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
@@ -123,29 +123,29 @@ do_dialog (GtkWidget *do_widget)
/* Standard message dialog */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_mnemonic ("_Message Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (message_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
/* Interactive dialog*/
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
button = gtk_button_new_with_mnemonic ("_Interactive Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (interactive_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), vbox2);
gtk_box_pack_start (GTK_BOX (vbox2), button);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
gtk_container_add (GTK_CONTAINER (vbox2), button);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table);
gtk_container_add (GTK_CONTAINER (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);

View File

@@ -352,7 +352,7 @@ do_dnd (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
fixed = gtk_fixed_new ();
gtk_box_pack_start (GTK_BOX (vbox), fixed);
gtk_container_add (GTK_CONTAINER (vbox), fixed);
gtk_widget_set_hexpand (fixed, TRUE);
gtk_widget_set_vexpand (fixed, TRUE);

View File

@@ -208,12 +208,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Checkerboard pattern</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_vexpand (frame, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
@@ -228,12 +228,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Scribble area</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_widget_set_vexpand (frame, TRUE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);

View File

@@ -356,7 +356,7 @@ do_editable_cells (GtkWidget *do_widget)
g_object_set (vbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Shopping list (you can edit the cells!)"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -365,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create models */
items_model = create_items_model ();
@@ -387,17 +387,17 @@ do_editable_cells (GtkWidget *do_widget)
/* some buttons */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_label ("Add item");
g_signal_connect (button, "clicked",
G_CALLBACK (add_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
button = gtk_button_new_with_label ("Remove item");
g_signal_connect (button, "clicked",
G_CALLBACK (remove_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
}

View File

@@ -34,19 +34,19 @@ do_entry_buffer (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"Entries share a buffer. Typing in one is reflected in the other.");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Create a buffer */
buffer = gtk_entry_buffer_new (NULL, 0);
/* Create our first entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create the second entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
g_object_unref (buffer);
}

View File

@@ -60,11 +60,11 @@ do_entry_completion (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Create our entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create the completion object */
completion = gtk_entry_completion_new ();

View File

@@ -73,7 +73,7 @@ do_expander (GtkWidget *do_widget)
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_box_pack_end (GTK_BOX (area), expander);
gtk_container_add (GTK_CONTAINER (area), expander);
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_cb), window);

View File

@@ -1,8 +1,8 @@
/* Foreign drawing
*
* Many applications can't use GTK+ widgets, for a variety of reasons,
* Many applications can't use GTK widgets, for a variety of reasons,
* but still want their user interface to appear integrated with the
* rest of the desktop, and follow GTK+ themes. This demo shows how to
* rest of the desktop, and follow GTK themes. This demo shows how to
* use GtkStyleContext and the gtk_render_ APIs to achieve this.
*
* Note that this is a very simple, non-interactive example.

View File

@@ -128,9 +128,10 @@ gtk_fishbowl_measure (GtkWidget *widget,
}
static void
gtk_fishbowl_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
gtk_fishbowl_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
GtkFishbowl *fishbowl = GTK_FISHBOWL (widget);
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
@@ -147,8 +148,8 @@ gtk_fishbowl_size_allocate (GtkWidget *widget,
continue;
gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
child_allocation.x = allocation->x + round (child->x * (allocation->width - child_requisition.width));
child_allocation.y = allocation->y + round (child->y * (allocation->height - child_requisition.height));
child_allocation.x = round (child->x * (width - child_requisition.width));
child_allocation.y = round (child->y * (height - child_requisition.height));
child_allocation.width = child_requisition.width;
child_allocation.height = child_requisition.height;

View File

@@ -266,7 +266,7 @@ do_iconview (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
tool_bar = gtk_toolbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), tool_bar);
gtk_container_add (GTK_CONTAINER (vbox), tool_bar);
up_button = gtk_tool_button_new (NULL, NULL);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
@@ -292,7 +292,7 @@ do_iconview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (sw, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* Create the store and fill it with the contents of '/' */
parent = g_strdup ("/");

View File

@@ -262,7 +262,7 @@ start_progressive_loading (GtkWidget *picture)
* pauses in the reading process.
*/
load_timeout = g_timeout_add (150, progressive_timeout, picture);
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout");
}
static void
@@ -354,13 +354,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Image loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
image = gtk_image_new_from_icon_name ("gtk3-demo");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
@@ -373,13 +373,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Animation loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
picture = gtk_picture_new_for_resource ("/images/floppybuddy.gif");
@@ -390,13 +390,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Symbolic themed icon</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
image = gtk_image_new_from_gicon (gicon);
@@ -412,13 +412,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Progressive image loading</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
/* Create an empty image for now; the progressive loader
* will create the pixbuf and fill it in.
@@ -435,13 +435,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Displaying video</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
video = gtk_video_new_for_resource ("/images/gtk-logo.webm");
gtk_media_stream_set_loop (gtk_video_get_media_stream (GTK_VIDEO (video)), TRUE);
@@ -454,7 +454,7 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>GtkWidgetPaintable</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
paintable = gtk_widget_paintable_new (do_widget);
picture = gtk_picture_new_for_paintable (paintable);
@@ -464,7 +464,7 @@ do_images (GtkWidget *do_widget)
/* Sensitivity control */
button = gtk_toggle_button_new_with_mnemonic ("_Insensitive");
gtk_box_pack_start (GTK_BOX (base_vbox), button);
gtk_container_add (GTK_CONTAINER (base_vbox), button);
g_signal_connect (button, "toggled",
G_CALLBACK (toggle_sensitivity_callback),

View File

@@ -65,24 +65,24 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Message");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Warning");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -91,24 +91,24 @@ do_infobar (GtkWidget *do_widget)
bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL);
gtk_info_bar_set_show_close_button (GTK_INFO_BAR (bar), TRUE);
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Error");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -116,12 +116,12 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Other");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -130,7 +130,7 @@ do_infobar (GtkWidget *do_widget)
frame = gtk_frame_new ("Info bars");
gtk_widget_set_margin_top (frame, 8);
gtk_widget_set_margin_bottom (frame, 8);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
g_object_set (vbox2, "margin", 8, NULL);
@@ -138,9 +138,9 @@ do_infobar (GtkWidget *do_widget)
/* Standard message dialog */
label = gtk_label_new ("An example of different info bars");
gtk_box_pack_start (GTK_BOX (vbox2), label);
gtk_container_add (GTK_CONTAINER (vbox2), label);
gtk_box_pack_start (GTK_BOX (vbox2), actions);
gtk_container_add (GTK_CONTAINER (vbox2), actions);
}
if (!gtk_widget_get_visible (window))

View File

@@ -268,7 +268,7 @@ do_list_store (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -276,7 +276,7 @@ do_list_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create tree model */
model = create_model ();

View File

@@ -361,12 +361,12 @@ do_listbox (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("Messages from Gtk+ and friends");
gtk_box_pack_start (GTK_BOX (vbox), label);
label = gtk_label_new ("Messages from GTK and friends");
gtk_container_add (GTK_CONTAINER (vbox), label);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled);
gtk_container_add (GTK_CONTAINER (vbox), scrolled);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listbox);

View File

@@ -67,9 +67,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="short_time_label">
@@ -79,10 +76,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -118,9 +111,6 @@
<object class="GtkLabel" id="label4">
<property name="label" translatable="yes">Resent by</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="resent_by_button">
@@ -130,9 +120,6 @@
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -172,9 +159,6 @@
<property name="relief">none</property>
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="favorite-buttton">
@@ -184,9 +168,6 @@
<property name="relief">none</property>
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="more-button">
@@ -200,14 +181,8 @@
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -250,14 +225,8 @@ FAVORITES</property>
</child>
<child type="label_item"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
@@ -279,14 +248,8 @@ FAVORITES</property>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>

View File

@@ -42,24 +42,24 @@ activate_about (GSimpleAction *action,
{
GtkApplication *app = user_data;
const gchar *authors[] = {
"The GTK+ Team",
"The GTK Team",
NULL
};
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK+ Demo",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
"program-name", "GTK Demo",
"version", g_strdup_printf ("%s,\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2013 The GTK+ Team",
"copyright", "(C) 1997-2013 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ widgets",
"comments", "Program to demonstrate GTK widgets",
"authors", authors,
"logo-icon-name", "gtk3-demo",
"title", "About GTK+ Demo",
"logo-icon-name", "gtk4-demo",
"title", "About GTK Demo",
NULL);
}
@@ -831,15 +831,14 @@ load_file (const gchar *demoname,
/* Skipping blank lines */
while (g_ascii_isspace (*p))
p++;
if (*p)
{
p = lines[i];
state++;
/* Fall through */
}
else
if (!*p)
break;
p = lines[i];
state++;
/* Fall through */
case 3:
/* Reading program body */
gtk_text_buffer_insert (source_buffer, &start, p, -1);

View File

@@ -19,7 +19,7 @@
<style><class name="devel"/></style>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="title">GTK+ Demo</property>
<property name="title">GTK Demo</property>
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
@@ -152,9 +152,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>

View File

@@ -115,7 +115,7 @@ do_menus (GtkWidget *do_widget)
menubar = gtk_menu_bar_new ();
gtk_widget_set_hexpand (menubar, TRUE);
gtk_box_pack_start (GTK_BOX (box1), menubar);
gtk_container_add (GTK_CONTAINER (box1), menubar);
gtk_widget_show (menubar);
menu = create_menu (2);
@@ -136,19 +136,19 @@ do_menus (GtkWidget *do_widget)
gtk_widget_show (menuitem);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_box_pack_start (GTK_BOX (box1), box2);
gtk_container_add (GTK_CONTAINER (box1), box2);
gtk_widget_show (box2);
button = gtk_button_new_with_label ("Flip");
g_signal_connect (button, "clicked",
G_CALLBACK (change_orientation), menubar);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@@ -4,7 +4,6 @@ demos = files([
'application_demo.c',
'assistant.c',
'builder.c',
'button_box.c',
'changedisplay.c',
'clipboard.c',
'colorsel.c',

View File

@@ -3,12 +3,12 @@
<id>org.gtk.Demo.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<name>GTK+ Demo</name>
<summary>Program to demonstrate GTK+ functions</summary>
<name>GTK Demo</name>
<summary>Program to demonstrate GTK functions</summary>
<description>
<p>
GTK+ Demo is a collection of examples that demonstrate the major
features of the GTK+ toolkit.
GTK Demo is a collection of examples that demonstrate the major
features of the GTK toolkit.
</p>
</description>
<screenshots>
@@ -30,4 +30,4 @@
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
</component>
</component>

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Name=GTK+ Demo
Comment=GTK+ code examples and demonstrations
Name=GTK Demo
Comment=GTK code examples and demonstrations
Exec=gtk4-demo
Icon=gtk4-demo
Terminal=false

View File

@@ -65,7 +65,7 @@ do_overlay (GtkWidget *do_widget)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_set_margin_top (label, 8);
gtk_widget_set_margin_bottom (label, 50);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
@@ -74,7 +74,7 @@ do_overlay (GtkWidget *do_widget)
gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number");
gtk_widget_set_margin_top (entry, 50);
gtk_widget_set_margin_bottom (entry, 8);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_container_add (GTK_CONTAINER (window), overlay);

View File

@@ -84,15 +84,16 @@ drawing_area_ensure_surface (DrawingArea *area,
}
static void
drawing_area_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
drawing_area_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
DrawingArea *area = (DrawingArea *) widget;
drawing_area_ensure_surface (area, allocation->width, allocation->height);
drawing_area_ensure_surface (area, width, height);
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, allocation, baseline);
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, width, height, baseline);
}
static void

View File

@@ -148,7 +148,7 @@ do_panes (GtkWidget *do_widget)
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
g_object_set (vpaned, "margin", 5, NULL);
gtk_box_pack_start (GTK_BOX (vbox), vpaned);
gtk_container_add (GTK_CONTAINER (vbox), vpaned);
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
@@ -173,13 +173,13 @@ do_panes (GtkWidget *do_widget)
/* Now create toggle buttons to control sizing */
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_pane_options (GTK_PANED (hpaned),
"Horizontal",
"Left",
"Right"));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_pane_options (GTK_PANED (vpaned),
"Vertical",
"Top",

View File

@@ -55,10 +55,11 @@ create_complex_popover (GtkWidget *parent,
}
static void
entry_size_allocate_cb (GtkEntry *entry,
const GtkAllocation *allocation,
int baseline,
gpointer user_data)
entry_size_allocate_cb (GtkEntry *entry,
int width,
int height,
int baseline,
gpointer user_data)
{
GtkEntryIconPosition popover_pos;
GtkPopover *popover = user_data;

View File

@@ -81,9 +81,6 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>

View File

@@ -12,7 +12,7 @@
#include <string.h>
#define HEART "♥"
const char text[] = "I ♥ GTK+";
const char text[] = "I ♥ GTK";
static void
fancy_shape_renderer (cairo_t *cr,

View File

@@ -240,20 +240,20 @@ do_search_entry (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Search entry demo");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create our entry */
entry = gtk_search_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the find and cancel buttons */
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), notebook);
gtk_container_add (GTK_CONTAINER (hbox), notebook);
find_button = gtk_button_new_with_label ("Find");
g_signal_connect (find_button, "clicked",

View File

@@ -83,38 +83,38 @@ do_search_entry2 (GtkWidget *do_widget)
entry = gtk_search_entry_new ();
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (container), entry);
gtk_container_add (GTK_CONTAINER (container), entry);
searchbar = gtk_search_bar_new ();
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_ENTRY (entry));
gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
gtk_container_add (GTK_CONTAINER (searchbar), container);
gtk_box_pack_start (GTK_BOX (vbox), searchbar);
gtk_container_add (GTK_CONTAINER (vbox), searchbar);
/* Hook the search bar to key presses */
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (searchbar), window);
/* Help */
label = gtk_label_new ("Start Typing to search");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Toggle button */
button = gtk_toggle_button_new_with_label ("Search");
g_object_bind_property (button, "active",
searchbar, "search-mode-enabled",
G_BINDING_BIDIRECTIONAL);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
/* Result */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Result:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed_cb), label);
@@ -122,15 +122,15 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (changed_cb), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Signal:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed), label);

View File

@@ -19,7 +19,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *widget;
GtkWidget *header;
const gchar* pages[] = {
"Welcome to GTK+",
"Welcome to GTK",
"GtkStackSidebar Widget",
"Automatic navigation",
"Consistent appearance",
@@ -49,7 +49,7 @@ do_sidebar (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar);
gtk_container_add (GTK_CONTAINER (box), sidebar);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
@@ -57,9 +57,9 @@ do_sidebar (GtkWidget *do_widget)
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX(box), widget);
gtk_container_add (GTK_CONTAINER(box), widget);
gtk_box_pack_start (GTK_BOX (box), stack);
gtk_container_add (GTK_CONTAINER (box), stack);
for (i=0; (c = *(pages+i)) != NULL; i++ )
{

View File

@@ -116,7 +116,7 @@ do_sizegroup (GtkWidget *do_widget)
/* Create one frame holding color options */
frame = gtk_frame_new ("Color Options");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -129,7 +129,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And another frame holding line style options */
frame = gtk_frame_new ("Line Options");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -142,7 +142,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And a check button to turn grouping on and off */
check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping");
gtk_box_pack_start (GTK_BOX (vbox), check_button);
gtk_container_add (GTK_CONTAINER (vbox), check_button);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
g_signal_connect (check_button, "toggled",

View File

@@ -53,7 +53,7 @@ do_spinner (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 5, NULL);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
/* Sensitive */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);

View File

@@ -157,7 +157,7 @@ create_text_view (GtkWidget *hbox,
guint timeout;
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);

View File

@@ -280,7 +280,7 @@ insert_text (GtkTextBuffer *buffer)
gtk_text_buffer_insert (buffer, &iter,
"This line (and most of the others in this buffer) is word-wrapped, "
"using the proper Unicode algorithm. Word wrap should work in all "
"scripts and languages that GTK+ supports. Let's make this a long "
"scripts and languages that GTK supports. Let's make this a long "
"paragraph to demonstrate: blah blah blah blah blah blah blah blah "
"blah blah blah blah blah blah blah blah blah blah blah\n\n", -1);

View File

@@ -131,9 +131,6 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
@@ -141,9 +138,6 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>

View File

@@ -1,10 +1,10 @@
/* Theming/Style Classes
*
* GTK+ uses CSS for theming. Style classes can be associated
* GTK uses CSS for theming. Style classes can be associated
* with widgets to inform the theme about intended rendering.
*
* This demo shows some common examples where theming features
* of GTK+ are used for certain effects: primary toolbars,
* of GTK are used for certain effects: primary toolbars,
* inline toolbars and linked buttons.
*/

View File

@@ -12,12 +12,10 @@ do_transparent (GtkWidget *do_widget)
if (!window)
{
GtkWidget *sw;
GtkWidget *overlay;
GtkWidget *button;
GtkWidget *label;
GtkWidget *box;
GtkWidget *image;
GtkWidget *picture;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
@@ -54,17 +52,8 @@ do_transparent (GtkWidget *do_widget)
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), button);
gtk_container_child_set (GTK_CONTAINER (overlay), button, "blur", 5.0, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (overlay), sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (sw), box);
image = gtk_image_new_from_resource ("/transparent/portland-rose.jpg");
gtk_container_add (GTK_CONTAINER (box), image);
picture = gtk_picture_new_for_resource ("/transparent/portland-rose.jpg");
gtk_container_add (GTK_CONTAINER (overlay), picture);
}
if (!gtk_widget_get_visible (window))

View File

@@ -401,7 +401,7 @@ do_tree_store (GtkWidget *do_widget)
g_object_set (vbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -410,7 +410,7 @@ do_tree_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create model */
model = create_model ();

View File

@@ -513,3 +513,5 @@ trophy-gold=
night-light=
daytime-sunrise=
daytime-sunset=
on=
off=

View File

@@ -121,7 +121,7 @@
<property name="use-header-bar">1</property>
<property name="resizable">0</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkGrid">

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<menu id="app-menu">
<section>
<item>
<attribute name="label" translatable="yes">About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>

View File

@@ -3,11 +3,11 @@
<id>org.gtk.WidgetFactory.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<name>GTK+ Widget Factory</name>
<summary>Program to demonstrate GTK+ functions</summary>
<name>GTK Widget Factory</name>
<summary>Program to demonstrate GTK functions</summary>
<description>
<p>
GTK+ Widget Factory is a showcase of GTK+ widgets. It was
GTK Widget Factory is a showcase of GTK widgets. It was
originally created to help theme authors test their creations
for completeness.
</p>

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Widget Factory
Comment=A showcase for GTK+ widgets, designed for testing themes.
Comment=A showcase for GTK widgets, designed for testing themes.
Exec=gtk4-widget-factory
Icon=gtk4-widget-factory
Terminal=false

View File

@@ -212,28 +212,28 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
g_string_append_printf (s, "\tGTK+\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can apppear here: <http://www.gtk.org>");
version = g_strdup_printf ("%s\nRunning against GTK+ %d.%d.%d",
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK+ Widget Factory",
"program-name", "GTK Widget Factory",
"version", version,
"copyright", "(C) 1997-2013 The GTK+ Team",
"copyright", "(C) 1997-2013 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ themes and widgets",
"comments", "Program to demonstrate GTK themes and widgets",
"authors", authors,
"logo-icon-name", "gtk4-widget-factory",
"title", "About GTK+ Widget Factory",
"title", "About GTK Widget Factory",
"system-information", s->str,
NULL);
@@ -803,7 +803,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
"margin", 6,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label);
gtk_container_add (GTK_CONTAINER (row), label);
gdk_rgba_parse (&rgba, color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -815,7 +815,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
@@ -914,7 +914,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
"hexpand", TRUE,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label);
gtk_container_add (GTK_CONTAINER (row), label);
gdk_rgba_parse (&rgba, colors[i].color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -926,7 +926,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);

View File

@@ -6,9 +6,6 @@
<gresource prefix="/org/gtk/WidgetFactory">
<file>widget-factory.css</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">help-overlay.ui</file>
</gresource>

View File

@@ -16,6 +16,16 @@
<attribute name="action">win.transition</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Widget Factory</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
<menu id="dinner_menu">
<section>
@@ -397,7 +407,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
<object class="GtkApplicationWindow" id="window">
<style><class name="devel"/></style>
<property name="title">GTK+ Widget Factory</property>
<property name="title">GTK Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
@@ -462,9 +472,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry1">
@@ -476,9 +483,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="secondary-icon-tooltip-text">Change mode</property>
<signal name="icon-release" handler="on_entry_icon_release" swapped="no"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
@@ -487,9 +491,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="invisible-char">•</property>
<property name="text" translatable="yes">entry</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box223">
@@ -509,14 +510,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="icon-name">window-close-symbolic</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
@@ -578,9 +573,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="sensitive">0</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton1">
@@ -589,9 +581,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="max-width-chars">2</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton2">
@@ -600,9 +589,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="width-chars">2</property>
<property name="max-width-chars">2</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
@@ -796,9 +782,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkSeparator" id="separator1">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box19">
@@ -818,9 +801,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton3">
@@ -829,9 +809,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton4">
@@ -841,9 +818,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox1">
@@ -856,9 +830,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox2">
@@ -872,9 +843,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkFontButton" id="fontbutton1">
@@ -882,9 +850,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="level">family|style|size|features|variations</property>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="colorbutton1">
@@ -893,16 +858,10 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="rgba">#31316867a09f</property>
<property name="use-alpha">1</property>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="filechooserbutton1">
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="linkbutton1">
@@ -913,39 +872,24 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch1">
<property name="halign">center</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch2">
<property name="sensitive">0</property>
<property name="halign">center</property>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator2">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box20">
@@ -966,26 +910,17 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fraction">0.5</property>
<property name="inverted">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="progressbar3">
<property name="fraction">0.5</property>
<property name="show-text">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar1">
<property name="value">0.6</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar2">
@@ -998,9 +933,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<offset name="full" value="5"/>
</offsets>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
</child>
@@ -1029,16 +961,10 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fill-level">75</property>
<property name="draw-value">0</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="scale5">
@@ -1056,9 +982,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<mark value="4" position="bottom"></mark>
</marks>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box25">
@@ -1082,9 +1005,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="inverted">1</property>
<property name="halign">start</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -1119,32 +1039,17 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="halign">start</property>
<signal name="format-value" handler="scale_format_value_blank"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator3">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box26">
@@ -1177,9 +1082,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
@@ -1193,9 +1095,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame4">
@@ -1209,22 +1108,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator4">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
@@ -1325,25 +1215,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator5"/>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box5">
@@ -1369,9 +1247,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkBox" id="box7">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label6">
@@ -1453,9 +1328,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook3">
@@ -1509,9 +1381,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook4">
@@ -1565,14 +1434,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
@@ -3047,9 +2910,6 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -3080,9 +2940,6 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -3141,9 +2998,6 @@ microphone-sensitivity-medium-symbolic</property>
<property name="show-emoji-icon">1</property>
<property name="placeholder-text" translatable="yes">Age…</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="linked"/>
@@ -3279,7 +3133,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Zelda</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkLabel">
@@ -3318,7 +3172,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Settings</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkGrid">
@@ -3439,7 +3293,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Choose one</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkFlowBox" id="selection_flowbox">

View File

@@ -1,8 +1,8 @@
GTK+ Coding Style
GTK Coding Style
-------------------------------------------------------------------------------
This document is intended to be a short description of the preferred
coding style to be used for the GTK+ source code. It was strongly
coding style to be used for the GTK source code. It was strongly
inspired by Clutter's CODING_STYLE.
Coding style is a matter of consistency, readability and maintainance;
@@ -12,7 +12,7 @@ and consistent answers to common questions regarding the coding style,
and will also try to identify the allowed exceptions.
The examples will show the preferred coding style; the negative examples
will be clearly identified. Please, don't submit code to GTK+ that
will be clearly identified. Please, don't submit code to GTK that
looks like any of these.
Part of the rationales for these coding style rules are available either
@@ -38,10 +38,10 @@ using tab characters alone, or using a combination of spaces and tabs.
Do not change the editor's configuration to change the meaning of a
tab character (see below); code using tabs to indent will not be accepted
into GTK+.
into GTK.
Even if two spaces for each indentation level allows deeper nesting than
8 spaces, GTK+ favours self-documenting function names that can take
8 spaces, GTK favours self-documenting function names that can take
quite some space. For this reason you should avoid deeply nested code.
+ Tab characters
@@ -399,7 +399,7 @@ patch or commit. Never use empty lines at the beginning or at the end of
a file.
Do enable the default git pre-commit hook that detect trailing
whitespace for you and help you to avoid corrupting GTK+'s tree with
whitespace for you and help you to avoid corrupting GTK's tree with
it. Do that as follows:
chmod a+x .git/hooks/pre-commit
@@ -410,7 +410,7 @@ duplicate blank lines.
+ Headers
Headers are special, for GTK+, in that they don't have to obey the
Headers are special, for GTK, in that they don't have to obey the
80 characters limit. The only major rule for headers is that the function
definitions should be vertically aligned in three columns:
@@ -479,7 +479,7 @@ Additionally, public headers should use C++ guards around their declarations:
+ Includes
GTK+ source files must never include the global gtk.h header; instead, it
GTK source files must never include the global gtk.h header; instead, it
should include the individual headers that are needed.
Every source file must include config.h first, followed by the header matching
@@ -658,7 +658,7 @@ after the license header:
* @Short_Description: Height-for-width geometry management
* @Title: GtkSizeRequest
*
* The GtkSizeRequest interface is GTK+'s height-for-width (and
* The GtkSizeRequest interface is GTK's height-for-width (and
* width-for-height) geometry management system.
* ...
*/
@@ -672,8 +672,8 @@ get_type function needs to listed in gtk3.types.
+ Old code
New code that is being added to GTK+ should adhere to the style
explained above. Existing GTK+ code does largely follow these
New code that is being added to GTK should adhere to the style
explained above. Existing GTK code does largely follow these
conventions, but there are some differences, e.g. occurrences
of tabs, etc.

View File

@@ -1,5 +1,5 @@
How to do a GTK+ release?
=========================
How to do a GTK release?
========================
## Before we begin
@@ -91,7 +91,7 @@ $ ninja -C _build gtk40-properties-pot
12. Tag the release. The git command for doing that looks like:
```sh
$ git tag -m "GTK+ 4.2.0" 4.2.0
$ git tag -m "GTK 4.2.0" 4.2.0
```
13. Bump the version number in `meson.build` and commit the change.
@@ -110,8 +110,8 @@ $ git push origin 4.2.0
this looks like:
```sh
$ scp gtk+-4.2.0.tar.xz matthiasc@master.gnome.org:
$ ssh matthiasc@master.gnome.org ftpadmin install gtk+-4.2.0.tar.xz
$ scp gtk-4.2.0.tar.xz matthiasc@master.gnome.org:
$ ssh matthiasc@master.gnome.org ftpadmin install gtk-4.2.0.tar.xz
```
16. Go to the gnome-announce list archives, find the last announce message,

View File

@@ -1,5 +1,5 @@
Things to care about when using/programing for GTK+
===================================================
Things to care about when using/programing for GTK
==================================================
This file is meant to collect some frequently triggered failures when
programming for/with Gtk, having the spirit of a developers FAQ.

View File

@@ -57,7 +57,7 @@ The GDK API
===========
It is expect that the GDK DND API will never be
used by anything other than the DND code in GTK+.
used by anything other than the DND code in GTK.
/* Drag and Drop */
@@ -159,7 +159,7 @@ the taskbar.
Internally, when the outer drag enters a proxy dest site, a
new source drag is created, with SourceInfo and
GdkDragContext. From the GDK side, it looks much like a
normal source drag; on the GTK+ side, most of the code is
normal source drag; on the GTK side, most of the code is
disjoint. The need to pass in a specific target window
is the reason why the GDK DND API splits
gdk_drag_find_window() and gdk_drag_motion().

View File

@@ -1,4 +1,4 @@
Information about the icon theme cache format used by GTK+
Information about the icon theme cache format used by GTK
for more information, see the mailing list threads at
http://mail.gnome.org/archives/gtk-devel-list/2004-April/msg00065.html
@@ -30,7 +30,7 @@ We would like to propose the cache file format as an appendix to the
icon theme specification. One thing which still needs to be investigated
is caching of the actual image data; the file format is has an
IMAGE_DATA_OFFSET member to allow adding that compatibly. An
implementation of the caching scheme for GTK+ can be found at [2]. The
implementation of the caching scheme for GTK can be found at [2]. The
cache generator which is included in the patch depends only on glib, and
it may be a good idea to move it to freedesktop.org as well.

View File

@@ -4,23 +4,23 @@
]>
<refentry id="gtk-broadway">
<refmeta>
<refentrytitle>Using GTK+ with Broadway</refentrytitle>
<refentrytitle>Using GTK with Broadway</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ with Broadway</refname>
<refname>Using GTK with Broadway</refname>
<refpurpose>
HTML-specific aspects of using GTK+
HTML-specific aspects of using GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ with Broadway</title>
<title>Using GTK with Broadway</title>
<para>
The GDK Broadway backend provides support for displaying GTK+
The GDK Broadway backend provides support for displaying GTK
applications in a web browser, using HTML5 and web sockets. To run
your application in this way, select the Broadway backend by setting
<literal>GDK_BACKEND=broadway</literal>. Then you can make
@@ -36,9 +36,9 @@ port that you want to use.
</para>
<para>
It is also possible to use multiple GTK+ applications in the same
It is also possible to use multiple GTK applications in the same
web browser window, by using the Broadway server,
<command>broadwayd</command>, that ships with GTK+.
<command>broadwayd</command>, that ships with GTK.
To use broadwayd, start it like this:
<programlisting>
broadwayd :5

View File

@@ -4,31 +4,31 @@
]>
<refentry id="gtk-building">
<refmeta>
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
<refentrytitle>Compiling the GTK libraries</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Compiling the GTK+ Libraries</refname>
<refname>Compiling the GTK Libraries</refname>
<refpurpose>
How to compile GTK+ itself
How to compile GTK itself
</refpurpose>
</refnamediv>
<refsect1 id="overview">
<title>Building GTK+</title>
<title>Building GTK</title>
<para>
Before we get into the details of how to compile GTK+, we should
mention that in many cases, binary packages of GTK+ prebuilt for
Before we get into the details of how to compile GTK, we should
mention that in many cases, binary packages of GTK prebuilt for
your operating system will be available, either from your
operating system vendor or from independent sources. If such a
set of packages is available, installing it will get you
programming with GTK+ much faster than building it yourself. In
fact, you may well already have GTK+ installed on your system
programming with GTK much faster than building it yourself. In
fact, you may well already have GTK installed on your system
already.
</para>
<para>
In order to build GTK+, you will need <application>meson</application>
In order to build GTK, you will need <application>meson</application>
installed on your system. On Linux, and other UNIX-like operating
systems, you will also need <application>ninja</application>. This
guide does not cover how to install these two requirements, but you
@@ -38,11 +38,11 @@ How to compile GTK+ itself
refer to it in the examples.
</para>
<para>
If you are building GTK+ from a source distribution or from a Git
If you are building GTK from a source distribution or from a Git
clone, you will need to use <application>meson</application> to
configure the project. The most commonly useful argument is the
<systemitem>--prefix</systemitem> one, which determines where the
files will go once installed. To install GTK+ under a prefix
files will go once installed. To install GTK under a prefix
like <filename>/opt/gtk</filename> you would run Meson as:
</para>
<informalexample>
@@ -83,7 +83,7 @@ How to compile GTK+ itself
<envar>PKG_CONFIG_PATH</envar> environment variable contains
a search path that <command>pkg-config</command> (see below)
uses when looking for files describing how to compile
programs using different libraries. If you were installing GTK+
programs using different libraries. If you were installing GTK
and it's dependencies into <filename>/opt/gtk</filename>, you
might want to set these variables as:
</para>
@@ -109,26 +109,26 @@ How to compile GTK+ itself
<refsect1 id="dependencies">
<title>Dependencies</title>
<para>
Before you can compile the GTK+ widget toolkit, you need to have
Before you can compile the GTK widget toolkit, you need to have
various other tools and libraries installed on your
system. Dependencies of GTK+ have their own build systems, so
system. Dependencies of GTK have their own build systems, so
you will need to refer to their own installation instructions.
</para>
<para>
A particular important tool used by GTK+ to find its dependencies
A particular important tool used by GTK to find its dependencies
is <application>pkg-config</application>.
</para>
<para>
<ulink url="https://www.freedesktop.org/wiki/Software/pkg-config/">pkg-config</ulink>
is a tool for tracking the compilation flags needed for
libraries that are used by the GTK+ libraries. (For each
libraries that are used by the GTK libraries. (For each
library, a small <literal>.pc</literal> text file is installed
in a standard location that contains the compilation flags
needed for that library along with version number information.)
</para>
<para>
Some of the libraries that GTK+ depends on are maintained by
by the GTK+ team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
Some of the libraries that GTK depends on are maintained by
by the GTK team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
Other libraries are maintained separately.
</para>
<itemizedlist>
@@ -196,7 +196,7 @@ How to compile GTK+ itself
<listitem>
<para>
The libraries from the X window system are needed to build
Pango and GTK+. You should already have these installed on
Pango and GTK. You should already have these installed on
your system, but it's possible that you'll need to install
the development environment for these libraries that your
operating system vendor provides.
@@ -213,14 +213,14 @@ How to compile GTK+ itself
<para>
<ulink url="https://www.cairographics.org">Cairo</ulink>
is a graphics library that supports vector graphics and image
compositing. Both Pango and GTK+ use Cairo for drawing.
compositing. Both Pango and GTK use Cairo for drawing.
</para>
</listitem>
<listitem>
<para>
<ulink url="https://github.com/anholt/libepoxy">libepoxy</ulink>
is a library that abstracts the differences between different
OpenGL libraries. GTK+ uses it for cross-platform GL support
OpenGL libraries. GTK uses it for cross-platform GL support
and for its own drawing.
</para>
</listitem>
@@ -228,20 +228,20 @@ How to compile GTK+ itself
<para>
<ulink url="https://github.com/anholt/libepoxy">Graphene</ulink>
is a library that provides vector and matrix types for 2D and
3D transformations. GTK+ uses it internally for drawing.
3D transformations. GTK uses it internally for drawing.
</para>
</listitem>
<listitem>
<para>
The <ulink url="https://wayland.freedesktop.org">Wayland</ulink> libraries
are needed to build GTK+ with the Wayland backend.
are needed to build GTK with the Wayland backend.
</para>
</listitem>
<listitem>
<para>
The <ulink url="https://www.freedesktop.org/wiki/Software/shared-mime-info">shared-mime-info</ulink>
package is not a hard dependency of GTK+, but it contains definitions
for mime types that are used by GIO and, indirectly, by GTK+.
package is not a hard dependency of GTK, but it contains definitions
for mime types that are used by GIO and, indirectly, by GTK.
gdk-pixbuf will use GIO for mime type detection if possible. For this
to work, shared-mime-info needs to be installed and
<envar>XDG_DATA_DIRS</envar> set accordingly at configure time.
@@ -251,7 +251,7 @@ How to compile GTK+ itself
</itemizedlist>
</refsect1>
<refsect1 id="building">
<title>Building and testing GTK+</title>
<title>Building and testing GTK</title>
<para>
First make sure that you have the necessary external
dependencies installed: <command>pkg-config</command>, Meson, Ninja,
@@ -263,16 +263,16 @@ How to compile GTK+ itself
accessible through your operating system package repositories.
</para>
<para>
Then build and install the GTK+ libraries in the order:
GLib, Cairo, Pango, ATK, then GTK+. For each library, follow the
Then build and install the GTK libraries in the order:
GLib, Cairo, Pango, ATK, then GTK. For each library, follow the
instructions they provide, and make sure to share common settings
between them and the GTK+ build; if you are using a separate prefix
for GTK+, for instance, you will need to use the same prefix for all
between them and the GTK build; if you are using a separate prefix
for GTK, for instance, you will need to use the same prefix for all
its dependencies you build. If you're lucky, this will all go smoothly,
and you'll be ready to <link linkend="gtk-compiling">start compiling
your own GTK+ applications</link>. You can test your GTK+ installation
your own GTK applications</link>. You can test your GTK installation
by running the <command>gtk4-demo</command> program that
GTK+ installs.
GTK installs.
</para>
<para>
If one of the projects you're configuring or building fails, look
@@ -287,7 +287,7 @@ How to compile GTK+ itself
<title>Extra Configuration Options</title>
<para>
In addition to the normal options provided by Meson, GTK+ defines
In addition to the normal options provided by Meson, GTK defines
various arguments that modify what should be built.
<cmdsynopsis>
@@ -375,7 +375,7 @@ How to compile GTK+ itself
<title><systemitem>xinerama</systemitem></title>
<para>
By default GTK+ will try to link against the Xinerama libraries
By default GTK will try to link against the Xinerama libraries
if they are found. This options can be used to explicitly control
whether Xinerama should be used.
</para>
@@ -388,16 +388,16 @@ How to compile GTK+ itself
<para>
The <application>gtk-doc</application> package is
used to generate the reference documentation included
with GTK+. By default support for <application>gtk-doc</application>
with GTK. By default support for <application>gtk-doc</application>
is disabled because it requires various extra dependencies
to be installed. If you have
<application>gtk-doc</application> installed and
are modifying GTK+, you may want to enable
are modifying GTK, you may want to enable
<application>gtk-doc</application> support by passing
in <systemitem>documentation</systemitem>.
</para>
<para>
Additionally, some tools provided by GTK+ have their own
Additionally, some tools provided by GTK have their own
manual pages generated using a similar set of dependencies;
if you have <application>xsltproc</application> then you
can generate manual pages by passing <systemitem>man-pages</systemitem>
@@ -409,7 +409,7 @@ How to compile GTK+ itself
<title><systemitem>print-backends</systemitem></title>
<para>
By default, GTK+ will try to build various print backends if
By default, GTK will try to build various print backends if
their dependencies are found. This option can be used to
explicitly control which print backends should be built.
</para>
@@ -439,7 +439,7 @@ How to compile GTK+ itself
<para>
Allows to disable building introspection support. This is option
is mainly useful for shortening turnaround times on developer
systems. Installed builds of GTK+ should always have introspection
systems. Installed builds of GTK should always have introspection
support.
</para>
</formalpara>
@@ -450,9 +450,9 @@ How to compile GTK+ itself
<systemitem>demos</systemitem></title>
<para>
By default, GTK+ will build quite a few tests and demos.
By default, GTK will build quite a few tests and demos.
While these are useful on a developer system, they are not
needed when GTK+ is built e.g. for a flatpak runtime. These
needed when GTK is built e.g. for a flatpak runtime. These
options allow to disable building tests and demos.
</para>
</formalpara>

View File

@@ -4,24 +4,24 @@
]>
<refentry id="gtk-compiling">
<refmeta>
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
<refentrytitle>Compiling GTK Applications</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Compiling GTK+ Applications</refname>
<refname>Compiling GTK Applications</refname>
<refpurpose>
How to compile your GTK+ application
How to compile your GTK application
</refpurpose>
</refnamediv>
<refsect1>
<title>Compiling GTK+ Applications on UNIX</title>
<title>Compiling GTK Applications on UNIX</title>
<para>
To compile a GTK+ application, you need to tell the compiler where to
find the GTK+ header files and libraries. This is done with the
To compile a GTK application, you need to tell the compiler where to
find the GTK header files and libraries. This is done with the
<literal>pkg-config</literal> utility.
</para>
<para>
@@ -29,9 +29,9 @@ The following interactive shell session demonstrates how
<literal>pkg-config</literal> is used (the actual output on
your system may be different):
<programlisting>
$ pkg-config --cflags gtk+-4.0
$ pkg-config --cflags gtk4
-pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
$ pkg-config --libs gtk+-4.0
$ pkg-config --libs gtk4
-pthread -lgtk-4 -lgdk-4 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
</programlisting>
</para>
@@ -40,14 +40,14 @@ The simplest way to compile a program is to use the "backticks"
feature of the shell. If you enclose a command in backticks
(<emphasis>not single quotes</emphasis>), then its output will be
substituted into the command line before execution. So to compile
a GTK+ Hello, World, you would type the following:
a GTK Hello, World, you would type the following:
<programlisting>
$ cc `pkg-config --cflags gtk+-4.0` hello.c -o hello `pkg-config --libs gtk+-4.0`
$ cc `pkg-config --cflags gtk4` hello.c -o hello `pkg-config --libs gtk4`
</programlisting>
</para>
<para>
Deprecated GTK+ functions are annotated to make the compiler
Deprecated GTK functions are annotated to make the compiler
emit warnings when they are used (e.g. with gcc, you need to use
the -Wdeprecated-declarations option). If these warnings are
problematic, they can be turned off by defining the preprocessor
@@ -56,26 +56,26 @@ option <literal>-DGDK_DISABLE_DEPRECATION_WARNINGS</literal>
</para>
<para>
GTK+ deprecation annotations are versioned; by defining the
GTK deprecation annotations are versioned; by defining the
macros %GDK_VERSION_MIN_REQUIRED and %GDK_VERSION_MAX_ALLOWED,
you can specify the range of GTK+ versions whose API you want
you can specify the range of GTK versions whose API you want
to use. APIs that were deprecated before or introduced after
this range will trigger compiler warnings.
</para>
<para>
Here is how you would compile hello.c if you want to allow it
to use symbols that were not deprecated in 3.2:
to use symbols that were not deprecated in 4.2:
<programlisting>
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-4.0`
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
</programlisting>
</para>
<para>
And here is how you would compile hello.c if you don't want
it to use any symbols that were introduced after 3.4:
it to use any symbols that were introduced after 4.2:
<programlisting>
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-4.0`
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
</programlisting>
</para>

View File

@@ -4,15 +4,15 @@
]>
<refentry id="chap-css-overview">
<refmeta>
<refentrytitle>GTK+ CSS Overview</refentrytitle>
<refentrytitle>GTK CSS Overview</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GTK+ CSS Overview</refname>
<refname>GTK CSS Overview</refname>
<refpurpose>
Overview of CSS in GTK+
Overview of CSS in GTK
</refpurpose>
</refnamediv>
@@ -31,10 +31,10 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
-->
<refsect1 id="css-overview">
<title>Overview of CSS in GTK+</title>
<title>Overview of CSS in GTK</title>
<para>
This chapter describes in detail how GTK+ uses CSS for styling
This chapter describes in detail how GTK uses CSS for styling
and layout.
</para>
@@ -61,7 +61,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
<title>CSS nodes</title>
<para>
GTK+ applies the style information found in style sheets by matching
GTK applies the style information found in style sheets by matching
the selectors against a tree of nodes. Each node in the tree has a
name, a state and possibly style classes. The children of each node
are linearly ordered.
@@ -99,7 +99,7 @@ scale[.fine-tune]
<title>Style sheets</title>
<para>
The basic structure of the style sheets understood by GTK+ is
The basic structure of the style sheets understood by GTK is
a series of statements, which are either rule sets or “@-rules”,
separated by whitespace.
</para>
@@ -128,7 +128,7 @@ button, entry {
<title>Importing style sheets</title>
<para>
GTK+ supports the CSS @import rule, in order to load another
GTK supports the CSS @import rule, in order to load another
style sheet in addition to the currently parsed one.
</para>
@@ -339,8 +339,8 @@ checkbutton:indeterminate {
</para>
<para>
The full syntax for selectors understood by GTK+ can be found in the
table below. The main difference to CSS is that GTK+ does not currently
The full syntax for selectors understood by GTK can be found in the
table below. The main difference to CSS is that GTK does not currently
support attribute selectors.
</para>
@@ -373,7 +373,7 @@ checkbutton:indeterminate {
<entry><phrase role="nowrap">E#id</phrase></entry>
<entry>any E node with the given ID</entry>
<entry><ulink url="https://www.w3.org/TR/css3-selectors/#id-selectors">CSS</ulink></entry>
<entry>GTK+ uses the widget name as ID</entry>
<entry>GTK uses the widget name as ID</entry>
</row>
<row>
<entry><phrase role="nowrap">E:nth-child(〈nth-child〉)</phrase></entry>
@@ -543,7 +543,7 @@ checkbutton:indeterminate {
</example>
<para>
GTK+ adds several additional ways to specify colors.
GTK adds several additional ways to specify colors.
</para>
<literallayout><code>〈gtk color〉 = 〈symbolic color〉 | 〈color expression〉 | 〈win32 color〉</code>
@@ -576,7 +576,7 @@ checkbutton:indeterminate {
</example>
<para>
GTK+ also supports color expressions, which allow colors to be transformed
GTK also supports color expressions, which allow colors to be transformed
to new ones and can be nested, providing a rich language to define colors.
Color expressions resemble functions, taking 1 or more colors and in some
cases a number as arguments.
@@ -595,7 +595,7 @@ checkbutton:indeterminate {
</literallayout>
<para>
On Windows, GTK+ allows to refer to system colors, as follows:
On Windows, GTK allows to refer to system colors, as follows:
</para>
<literallayout><code>〈win32 color〉 = -gtk-win32-color( 〈name〉, 〈integer〉 )</code>
@@ -632,7 +632,7 @@ checkbutton:indeterminate {
<para>
The simplest way to specify an image in CSS is to load an image
file from a URL. CSS does not specify anything about supported file
formats; within GTK+, you can expect at least PNG, JPEG and SVG to
formats; within GTK, you can expect at least PNG, JPEG and SVG to
work. The full list of supported image formats is determined by the
available gdk-pixbuf image loaders and may vary between systems.
</para>
@@ -734,14 +734,14 @@ label {
</para>
<para>
GTK+ extends the CSS syntax for images and also uses it for specifying icons.
GTK extends the CSS syntax for images and also uses it for specifying icons.
</para>
<literallayout><code>〈gtk image〉 = 〈themed icon〉 | 〈scaled image〉 | 〈recolored image〉 | 〈win32 theme part〉</code>
</literallayout>
<para>
GTK+ has extensive support for loading icons from icon themes. It is
GTK has extensive support for loading icons from icon themes. It is
accessible from CSS with the -gtk-icontheme syntax.
</para>
@@ -770,7 +770,7 @@ arrow.fancy {
</example>
<para>
GTK+ supports scaled rendering on hi-resolution displays. This works
GTK supports scaled rendering on hi-resolution displays. This works
best if images can specify normal and hi-resolution variants. From
CSS, this can be done with the -gtk-scaled syntax.
</para>
@@ -816,7 +816,7 @@ arrow {
]]></programlisting>
</example>
<para>
On Windows, GTK+ allows to refer to system theme parts as images, as follows:
On Windows, GTK allows to refer to system theme parts as images, as follows:
</para>
<literallayout><code>〈win32 theme part〉 = -gtk-win32-theme-part( 〈name〉, 〈integer〉 〈integer〉</code>
@@ -830,7 +830,7 @@ arrow {
<para>
CSS defines a mechanism by which changes in CSS property values can
be made to take effect gradually, instead of all at once. GTK+ supports
be made to take effect gradually, instead of all at once. GTK supports
these transitions as well.
</para>
@@ -911,7 +911,7 @@ spinner {
<para>
In order to extend key bindings affecting different widgets,
GTK+ supports the @binding-set rule to parse a set of bind/unbind
GTK supports the @binding-set rule to parse a set of bind/unbind
directives. Note that in order to take effect, the binding sets
defined in this way must be associated with rule sets by setting
the -gtk-key-bindings property.

View File

@@ -4,15 +4,15 @@
]>
<refentry id="chap-css-properties">
<refmeta>
<refentrytitle>GTK+ CSS Properties</refentrytitle>
<refentrytitle>GTK CSS Properties</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GTK+ CSS Properties</refname>
<refname>GTK CSS Properties</refname>
<refpurpose>
CSS Properties in GTK+
CSS Properties in GTK
</refpurpose>
</refnamediv>
@@ -34,9 +34,9 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
<title>Supported CSS Properties</title>
<para>
GTK+ supports CSS properties and shorthands as far as they can be applied
GTK supports CSS properties and shorthands as far as they can be applied
in the context of widgets, and adds its own properties only when needed.
All GTK+-specific properties have a -gtk prefix.
All GTK-specific properties have a -gtk prefix.
</para>
<para>
@@ -66,7 +66,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
</para>
<para>
Whereever a number is allowed, GTK+ also accepts a Windows-specific
Whereever a number is allowed, GTK also accepts a Windows-specific
theme size:
</para>
@@ -1159,7 +1159,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
</table>
<para>
GTK+ uses the CSS outline properties to render the 'focus rectangle'.
GTK uses the CSS outline properties to render the 'focus rectangle'.
</para>
<table pgwide="1">

View File

@@ -4,15 +4,15 @@
]>
<refentry id="chap-drawing-model">
<refmeta>
<refentrytitle>The GTK+ Drawing Model</refentrytitle>
<refentrytitle>The GTK Drawing Model</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>The GTK+ Drawing Model</refname>
<refname>The GTK Drawing Model</refname>
<refpurpose>
The GTK+ drawing model in detail
The GTK drawing model in detail
</refpurpose>
</refnamediv>
@@ -21,12 +21,12 @@
<title>Overview of the drawing model</title>
<para>
This chapter describes the GTK+ drawing model in detail. If you
are interested in the procedure which GTK+ follows to draw its
This chapter describes the GTK drawing model in detail. If you
are interested in the procedure which GTK follows to draw its
widgets and windows, you should read this chapter; this will be
useful to know if you decide to implement your own widgets. This
chapter will also clarify the reasons behind the ways certain
things are done in GTK+; for example, why you cannot change the
things are done in GTK; for example, why you cannot change the
background color of all widgets with the same method.
</para>
@@ -52,7 +52,7 @@
clipping", instead of "toplevel application windows". Most
windowing systems support nested windows, where the contents of
child windows get clipped by the boundaries of their parents.
Although GTK+ and GDK in particular may run on a windowing
Although GTK and GDK in particular may run on a windowing
system with no such notion of nested windows, GDK presents the
illusion of being under such a system. A toplevel window may
contain many subwindows and sub-subwindows, for example, one for
@@ -63,16 +63,16 @@
</para>
<para>
In practice, most windows in modern GTK+ application are client-side
In practice, most windows in modern GTK application are client-side
constructs. Only few windows (in particular toplevel windows) are
<emphasis>native</emphasis>, which means that they represent a
window from the underlying windowing system on which GTK+ is running.
window from the underlying windowing system on which GTK is running.
For example, on X11 it corresponds to a <type>Window</type>; on Win32,
it corresponds to a <type>HANDLE</type>.
</para>
<para>
Generally, the drawing cycle begins when GTK+ receives an
Generally, the drawing cycle begins when GTK receives an
exposure event from the underlying windowing system: if the
user drags a window over another one, the windowing system will
tell the underlying window that it needs to repaint itself. The
@@ -80,7 +80,7 @@
that it needs to update its display. For example, when the user
types a character in a <link
linkend="GtkEntry"><classname>GtkEntry</classname></link>
widget, the entry asks GTK+ to queue a redraw operation for
widget, the entry asks GTK to queue a redraw operation for
itself.
</para>
@@ -95,7 +95,7 @@
</para>
<para>
The following sections describe how GTK+ decides which widgets
The following sections describe how GTK decides which widgets
need to be repainted in response to such events, and how widgets
work internally in terms of the resources they use from the
windowing system.
@@ -106,10 +106,10 @@
<title>The frame clock</title>
<para>
All GTK+ applications are mainloop-driven, which means that most
All GTK applications are mainloop-driven, which means that most
of the time the app is idle inside a loop that just waits for
something to happen and then calls out to the right place when
it does. On top of this GTK+ has a frame clock that gives a
it does. On top of this GTK has a frame clock that gives a
“pulse” to the application. This clock beats at a steady rate,
which is tied to the framerate of the output (this is synced to
the monitor via the window manager/compositor). The clock has
@@ -215,7 +215,7 @@
<para>
Most widgets, including those that create their own GdkSurfaces have
a transparent background, so they draw on top of whatever widgets
are below them. This was not the case in GTK+ 2 where the theme set
are below them. This was not the case in GTK 2 where the theme set
the background of most widgets to the default background color. (In
fact, transparent GdkSurfaces used to be impossible.)
</para>
@@ -233,7 +233,7 @@
<title>Scrolling</title>
<para>
Traditionally, GTK+ has used self-copy operations to implement
Traditionally, GTK has used self-copy operations to implement
scrolling with native windows. With transparent backgrounds, this
no longer works. Instead, we just mark the entire affected area for
repainting when these operations are used. This allows (partially)
@@ -253,7 +253,7 @@
<literal>draw</literal> handler were sent directly to the
windowing system, flicker could result. This is because areas may get
redrawn repeatedly: the background, then decorative frames, then text
labels, etc. To avoid flicker, GTK+ employs a <firstterm>double
labels, etc. To avoid flicker, GTK employs a <firstterm>double
buffering</firstterm> system at the GDK level. Widgets normally don't
know that they are drawing to an off-screen buffer; they just issue their
normal drawing commands, and the buffer gets sent to the windowing system
@@ -284,7 +284,7 @@
</para>
<para>
To make this easier, GTK+ normally calls
To make this easier, GTK normally calls
<function>gdk_surface_begin_paint_region()</function>
before emitting the #GtkWidget::draw signal, and
then it calls <function>gdk_surface_end_paint()</function>

View File

@@ -3,11 +3,11 @@
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
<title>Getting Started with GTK+</title>
<title>Getting Started with GTK</title>
<para>GTK+ is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
<para>GTK is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
widget toolkit</ulink>. Each user interface created by
GTK+ consists of widgets. This is implemented in C using
GTK consists of widgets. This is implemented in C using
<link linkend="gobject">GObject</link>, an object-oriented framework for C.
Widgets are organized in a hierachy. The window widget is the main container.
The user interface is then built by adding buttons, drop-down menus, input
@@ -17,14 +17,14 @@
assembling the interface manually. You can also use a visual user interface
editor, like <ulink url="https://glade.gnome.org/">Glade</ulink>.</para>
<para>GTK+ is event-driven. The toolkit listens for events such as
<para>GTK is event-driven. The toolkit listens for events such as
a click on a button, and passes the event to your application.</para>
<para>This chapter contains some tutorial information to get you
started with GTK+ programming. It assumes that you have GTK+, its
started with GTK programming. It assumes that you have GTK, its
dependencies and a C compiler installed and ready to use. If you
need to build GTK+ itself first, refer to the
<link linkend="gtk-compiling">Compiling the GTK+ libraries</link>
need to build GTK itself first, refer to the
<link linkend="gtk-compiling">Compiling the GTK libraries</link>
section in this reference.</para>
<section>
@@ -44,30 +44,30 @@
<informalexample>
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-0 example-0.c `pkg-config --libs gtk+-4.0`</literal>
<literal>gcc `pkg-config --cflags gtk4` -o example-0 example-0.c `pkg-config --libs gtk4`</literal>
</literallayout>
</para>
<note><para>For more information on how to compile a GTK+ application, please
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
<note><para>For more information on how to compile a GTK application, please
refer to the <link linkend="gtk-compiling">Compiling GTK Applications</link>
section in this reference.</para></note>
<para>All GTK+ applications will, of course, include
<para>All GTK applications will, of course, include
<filename>gtk/gtk.h</filename>, which declares functions, types and
macros required by GTK+ applications.</para>
macros required by GTK applications.</para>
<warning><para>Even if GTK+ installs multiple header files, only the
<warning><para>Even if GTK installs multiple header files, only the
top-level <filename>gtk/gtk.h</filename> header can be directly included
by third party code. The compiler will abort with an error if any other
header is directly included.</para></warning>
<para>In a GTK+ application, the purpose of the main() function is to
<para>In a GTK application, the purpose of the main() function is to
create a #GtkApplication object and run it. In this example a
#GtkApplication pointer named <varname>app</varname> is called and then
initialized using gtk_application_new().</para>
@@ -89,8 +89,8 @@
when your application is launched with
g_application_run() on the line below.
The gtk_application_run() also takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments
counter and string array; this allows GTK to parse specific command line
arguments that control the behavior of GTK itself. The parsed arguments
will be removed from the array, leaving the unrecognized ones for your
application to parse.
</para>
@@ -128,16 +128,16 @@
#GtkApplication object is freed from memory with g_object_unref().
Finally the status integer is returned and the GTK application exits.</para>
<para>While the program is running, GTK+ is receiving
<para>While the program is running, GTK is receiving
<firstterm>events</firstterm>. These are typically input events caused by
the user interacting with your program, but also things like messages from
the window manager or other applications. GTK+ processes these and as a
the window manager or other applications. GTK processes these and as a
result, <firstterm>signals</firstterm> may be emitted on your widgets.
Connecting handlers for these signals is how you normally make your
program do something in response to user input.</para>
<para>The following example is slightly more complex, and tries to
showcase some of the capabilities of GTK+.</para>
showcase some of the capabilities of GTK.</para>
<para>In the long tradition of programming languages and libraries,
it is called <emphasis>Hello, World</emphasis>.</para>
@@ -151,16 +151,16 @@
</informalfigure>
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<title>Hello World in GTK</title>
<para>Create a new file with the following content named example-1.c.</para>
<programlisting><xi:include href="../../../../examples/hello-world.c" parse="text">
<programlisting><xi:include href="@SRC_DIR@/examples/hello-world.c" parse="text">
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-1 example-1.c `pkg-config --libs gtk+-4.0`</literal>
<literal>gcc `pkg-config --cflags gtk4` -o example-1 example-1.c `pkg-config --libs gtk4`</literal>
</literallayout>
</para>
</section>
@@ -169,8 +169,8 @@
button to our window, with the label "Hello World". Two new GtkWidget pointers
are declared to accomplish this, <varname>button</varname> and
<varname>button_box</varname>. The button_box variable is created to store a
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
#GtkBox which is GTK's way of controlling the size and layout of buttons.
The #GtkBox is created and assigned to gtk_box_new() which takes a
#GtkOrientation enum as parameter. The buttons which this box will contain can
either be stored horizontally or vertically but this does not matter in this
particular case as we are dealing with only one button. After initializing
@@ -215,7 +215,7 @@
it becomes important to control how each widget is positioned and sized.
This is where packing comes in.</para>
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
<para>GTK comes with a large variety of <firstterm>layout containers</firstterm>
whose purpose it is to control the layout of the child widgets that are
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
@@ -233,12 +233,12 @@
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<para>Create a new file with the following content named example-2.c.</para>
<programlisting><xi:include href="../../../../examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-2 example-2.c `pkg-config --libs gtk+-4.0`</literal>
<literal>gcc `pkg-config --cflags gtk4` -o example-2 example-2.c `pkg-config --libs gtk4`</literal>
</literallayout>
</para>
</section>
@@ -250,21 +250,21 @@
or hundreds of widgets, doing all the setup work in C code is
cumbersome, and making changes becomes next to impossible.</para>
<para>Thankfully, GTK+ supports the separation of user interface
<para>Thankfully, GTK supports the separation of user interface
layout from your business logic, by using UI descriptions in an
XML format that can be parsed by the #GtkBuilder class.</para>
<example>
<title>Packing buttons with GtkBuilder</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="../../../../examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<para>Create a new file with the following content named builder.ui.</para>
<programlisting><xi:include href="../../../../examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-3 example-3.c `pkg-config --libs gtk+-4.0`</literal>
<literal>gcc `pkg-config --cflags gtk4` -o example-3 example-3.c `pkg-config --libs gtk4`</literal>
</literallayout>
</para>
@@ -324,7 +324,7 @@
</variablelist>
</para>
<para>GTK+ includes application support that is built on top of
<para>GTK includes application support that is built on top of
#GApplication. In this tutorial we'll build a simple application by
starting from scratch, adding more and more pieces over time. Along
the way, we'll learn about #GtkApplication, templates, resources,
@@ -332,8 +332,8 @@
#GtkListBox, and more.</para>
<para>The full, buildable sources for these examples can be found
in the examples/ directory of the GTK+ source distribution, or
<ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/examples">online</ulink> in the GTK+ git repository.
in the examples/ directory of the GTK source distribution, or
<ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/examples">online</ulink> in the GTK git repository.
You can build each example separately by using make with the <filename>Makefile.example</filename>
file. For more information, see the <filename>README</filename> included in the
examples directory.</para>
@@ -346,7 +346,7 @@
of our application class.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>All the application logic is in the application class, which
@@ -364,16 +364,16 @@
GIO <ulink url="https://developer.gnome.org/gio/2.36/GApplication.html#GApplication.description">documentation</ulink>.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Another important class that is part of the application support
in GTK+ is #GtkApplicationWindow. It is typically subclassed as well.
in GTK is #GtkApplicationWindow. It is typically subclassed as well.
Our subclass does not do anything yet, so we will just get an empty
window.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>As part of the initial setup of our application, we also
@@ -388,7 +388,7 @@
</informalfigure>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/org.gtk.exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/org.gtk.exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
@@ -420,7 +420,7 @@
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make use of this file in our application, we revisit
@@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>This file has to be converted into a C source file that will be
@@ -599,7 +599,7 @@ example_app_window_open (ExampleAppWindow *win,
in a ui file, and add it as a resource to our binary.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To associate the app menu with the application, we have to call
@@ -698,7 +698,7 @@ example_app_class_init (ExampleAppClass *class)
GSettings requires a schema that describes our settings:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Before we can make use of this schema in our application,
@@ -747,13 +747,13 @@ example_app_window_init (ExampleAppWindow *win)
<para>Lets start with the template.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Next comes the dialog subclass.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Now we revisit the <literal>preferences_activated(<!-- -->)</literal> function in our
@@ -797,7 +797,7 @@ preferences_activated (GSimpleAction *action,
<title>Adding a search bar</title>
<para>We continue to flesh out the functionality of our application.
For now, we add search. GTK+ supports this with #GtkSearchEntry and
For now, we add search. GTK supports this with #GtkSearchEntry and
#GtkSearchBar. The search bar is a widget that can slide in from the
top to present a search entry.</para>
@@ -805,7 +805,7 @@ preferences_activated (GSimpleAction *action,
to slide out the search bar below the header bar.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Implementing the search needs quite a few code changes that
@@ -882,7 +882,7 @@ example_app_window_init (ExampleAppWindow *win)
which demonstrates #GtkMenuButton, #GtkRevealer and #GtkListBox.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>The code to populate the sidebar with buttons for the words
@@ -893,7 +893,7 @@ example_app_window_init (ExampleAppWindow *win)
ui file.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To connect the menuitem to the show-words setting, we use
@@ -952,7 +952,7 @@ example_app_window_init (ExampleAppWindow *win)
triggers the show-lines action:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make this menu item do something, we create a property
@@ -1007,12 +1007,12 @@ example_app_window_init (ExampleAppWindow *win)
<para>Our application already uses a GtkHeaderBar, but so far it
still gets a 'normal' window titlebar on top of that. This is a
bit redundant, and we will now tell GTK+ to use the header bar
bit redundant, and we will now tell GTK to use the header bar
as replacement for the titlebar. To do so, we move it around to
be a direct child of the window, and set its type to be titlebar.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>A small extra bonus of using a header bar is that we get
@@ -1048,7 +1048,7 @@ example_app_window_init (ExampleAppWindow *win)
e.g. when another window is moved and uncovers part of the widget, or
when the window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
gtk_widget_queue_draw() or its variants. GTK takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.</para>
@@ -1068,12 +1068,12 @@ example_app_window_init (ExampleAppWindow *win)
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-4.c.</para>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@SRC_DIR@/examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-4 example-4.c `pkg-config --libs gtk+-4.0`</literal>
<literal>gcc `pkg-config --cflags gtk4` -o example-4 example-4.c `pkg-config --libs gtk4`</literal>
</literallayout>
</para>
</section>

View File

@@ -51,11 +51,11 @@
<glossterm>column</glossterm>
<glossdef>
<para>
GTK+ contains several widgets which display data in columns,
GTK contains several widgets which display data in columns,
e.g. the #GtkTreeView.
These <glossterm linkend="view-column">view columns</glossterm> in
the tree view are represented by #GtkTreeViewColumn
objects inside GTK+. They should not be confused with
objects inside GTK. They should not be confused with
<glossterm linkend="model-column">model columns</glossterm> which
are used to organize the data in tree models.
</para>
@@ -114,7 +114,7 @@
<glossterm>event</glossterm>
<glossdef>
<para>
Events are the way in which GDK informs GTK+ about external events
Events are the way in which GDK informs GTK about external events
like pointer motion, button clicks, key presses, etc.
</para>
</glossdef>
@@ -177,7 +177,7 @@
<para>
These widgets follow the well-known model-view pattern, which separates
the data (the model) to be displayed from the component which does the
actual visualization (the view). Examples of this pattern in GTK+ are
actual visualization (the view). Examples of this pattern in GTK are
the #GtkTreeView/#GtkTreeModel and #GtkTextView/#GtkTextBuffer
</para>
<para>
@@ -281,7 +281,7 @@
<glossterm>style</glossterm>
<glossdef>
<para>
A style encapsulates what GTK+ needs to know in order to draw
A style encapsulates what GTK needs to know in order to draw
a widget. Styles can be modified with
<link linkend="gtk3-Resource-Files">resource files</link>.
</para>
@@ -294,7 +294,7 @@
<para>
A <glossterm linkend="widget">widget</glossterm> that does not
require a <glossterm linkend="parent">parent</glossterm> container.
The only toplevel widgets in GTK+ are #GtkWindow and widgets derived from it.
The only toplevel widgets in GTK are #GtkWindow and widgets derived from it.
</para>
<glossseealso>
<glossterm linkend="container">container</glossterm>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-broadwayd</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
@@ -40,7 +40,7 @@
<refsect1><title>Description</title>
<para>
<command>gtk4-broadwayd</command> is a display server for the Broadway
GDK backend. It allows multiple GTK+ applications to display their
GDK backend. It allows multiple GTK applications to display their
windows in the same web browser, by connecting to gtk4-broadwayd.
</para>
<para>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-builder-tool</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-demo-application</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-demo</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
@@ -24,7 +24,7 @@
<refnamediv>
<refname>gtk4-demo</refname>
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
<refpurpose>Demonstrate GTK widgets</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -40,7 +40,7 @@
<refsect1><title>Description</title>
<para>
<command>gtk4-demo</command> is a collection of examples.
Its purpose is to demonstrate many GTK+ widgets in a form
Its purpose is to demonstrate many GTK widgets in a form
that is useful to application developers.
</para>
<para>

View File

@@ -8,18 +8,18 @@
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GTK+ 4 Reference Manual</title>
<title>GTK 4 Reference Manual</title>
<releaseinfo>
This document is for the GTK+ 4 library, version &version;.
This document is for the GTK 4 library, version &version;.
The latest versions can be found online at
<ulink role="online-location" url="https://developer.gnome.org/gtk4/">https://developer.gnome.org/gtk4/</ulink>.
If you are looking for the older GTK+ 3 series of libraries,
If you are looking for the older GTK 3 series of libraries,
see <ulink role="online-location" url="https://developer.gnome.org/gtk3/">https://developer.gnome.org/gtk3/</ulink>.
</releaseinfo>
</bookinfo>
<part id="gtk">
<title>GTK+ Overview</title>
<title>GTK Overview</title>
<xi:include href="overview.xml"/>
<xi:include href="xml/getting_started.xml"/>
<xi:include href="resources.sgml" />
@@ -29,7 +29,7 @@
</part>
<part id="gtkobjects">
<title>GTK+ Widgets and Objects</title>
<title>GTK Widgets and Objects</title>
<chapter>
<title>Object Hierarchy</title>
@@ -41,6 +41,16 @@
<xi:include href="visual_index.xml" />
</chapter>
<chapter id="Lists">
<title>GListModel support</title>
<xi:include href="xml/gtkfilterlistmodel.xml" />
<xi:include href="xml/gtkflattenlistmodel.xml" />
<xi:include href="xml/gtkmaplistmodel.xml" />
<xi:include href="xml/gtkslicelistmodel.xml" />
<xi:include href="xml/gtksortlistmodel.xml" />
<xi:include href="xml/gtktreelistmodel.xml" />
</chapter>
<chapter id="Application">
<title>Application support</title>
<xi:include href="xml/gtkapplication.xml" />
@@ -61,7 +71,6 @@
<xi:include href="xml/gtkmessagedialog.xml" />
<xi:include href="xml/gtkaboutdialog.xml" />
<xi:include href="xml/gtkassistant.xml" />
<xi:include href="xml/gtkinvisible.xml" />
<xi:include href="xml/gtkwindowgroup.xml" />
</chapter>
@@ -79,7 +88,6 @@
<xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
<xi:include href="xml/gtkbbox.xml" />
<xi:include href="xml/gtkpaned.xml" />
<xi:include href="xml/gtklayout.xml" />
<xi:include href="xml/gtknotebook.xml" />
@@ -301,6 +309,7 @@
<title>Gestures and event handling</title>
<xi:include href="xml/gtkeventcontroller.xml" />
<xi:include href="xml/gtkeventcontrollerkey.xml" />
<xi:include href="xml/gtkeventcontrollerlegacy.xml" />
<xi:include href="xml/gtkeventcontrollerscroll.xml" />
<xi:include href="xml/gtkeventcontrollermotion.xml" />
<xi:include href="xml/gtkgesture.xml" />
@@ -319,7 +328,7 @@
</part>
<part id="gtkbase">
<title>GTK+ Core Reference</title>
<title>GTK Core Reference</title>
<xi:include href="xml/gtkmain.xml" />
<xi:include href="xml/gtkfeatures.xml" />
<xi:include href="xml/gtkaccelgroup.xml" />
@@ -334,7 +343,7 @@
</part>
<part id="theming">
<title>Theming in GTK+</title>
<title>Theming in GTK</title>
<xi:include href="css-overview.xml" />
<xi:include href="css-properties.xml" />
<xi:include href="xml/gtkstylecontext.xml" />
@@ -345,15 +354,15 @@
</part>
<part id="migrating">
<title>Migrating from Previous Versions of GTK+</title>
<title>Migrating from Previous Versions of GTK</title>
<partintro>
<para>
This part describes what you need to change in programs use
older versions of GTK+ so that they can use the new features.
older versions of GTK so that they can use the new features.
It also mentions how to convert applications using widgets
found in the libgnomeui library to use their counterparts
in GTK+.
in GTK.
</para>
</partintro>
@@ -362,7 +371,7 @@
</part>
<part>
<title>GTK+ Tools</title>
<title>GTK Tools</title>
<xi:include href="gtk4-demo.xml" />
<xi:include href="gtk4-demo-application.xml" />
<xi:include href="gtk4-widget-factory.xml" />
@@ -376,7 +385,7 @@
</part>
<part id="platform-support">
<title>GTK+ Platform Support</title>
<title>GTK Platform Support</title>
<xi:include href="building.sgml" />
<xi:include href="xml/compiling.sgml" />
<xi:include href="running.sgml" />

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-encode-symbolic-svg</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
@@ -39,7 +39,7 @@
<refsect1><title>Description</title>
<para>
<command>gtk4-encode-symbolic-svg</command> converts symbolic svg icons into
specially prepared png files. GTK+ can load and recolor these pngs, just like
specially prepared png files. GTK can load and recolor these pngs, just like
original svgs, but loading them is much faster.
</para>
<para>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-icon-browser</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-launch</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-query-settings</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -1,6 +1,3 @@
<INCLUDE>gtk/gtk.h</INCLUDE>
<SECTION>
<FILE>gtkaboutdialog</FILE>
<TITLE>GtkAboutDialog</TITLE>
@@ -273,31 +270,6 @@ GtkAspectFramePrivate
gtk_aspect_frame_get_type
</SECTION>
<SECTION>
<FILE>gtkbbox</FILE>
<TITLE>GtkButtonBox</TITLE>
GtkButtonBox
GtkButtonBoxClass
gtk_button_box_new
gtk_button_box_get_layout
gtk_button_box_get_child_secondary
gtk_button_box_get_child_non_homogeneous
GtkButtonBoxStyle
gtk_button_box_set_layout
gtk_button_box_set_child_secondary
gtk_button_box_set_child_non_homogeneous
<SUBSECTION Standard>
GTK_BUTTON_BOX
GTK_IS_BUTTON_BOX
GTK_TYPE_BUTTON_BOX
GTK_BUTTON_BOX_CLASS
GTK_IS_BUTTON_BOX_CLASS
GTK_BUTTON_BOX_GET_CLASS
<SUBSECTION Private>
GtkButtonBoxPrivate
gtk_button_box_get_type
</SECTION>
<SECTION>
<FILE>gtkbin</FILE>
<TITLE>GtkBin</TITLE>
@@ -322,17 +294,14 @@ gtk_bin_get_type
GtkBox
GtkBoxClass
gtk_box_new
gtk_box_pack_start
gtk_box_pack_end
gtk_box_get_homogeneous
gtk_box_set_homogeneous
gtk_box_get_spacing
gtk_box_set_spacing
gtk_box_reorder_child
gtk_box_query_child_packing
gtk_box_set_child_packing
gtk_box_get_baseline_position
gtk_box_set_baseline_position
gtk_box_insert_child_after
gtk_box_reorder_child_after
<SUBSECTION Standard>
GTK_BOX
GTK_IS_BOX
@@ -442,6 +411,30 @@ gtk_list_box_get_type
gtk_list_box_row_get_type
</SECTION>
<SECTION>
<FILE>gtkselectionmodel</FILE>
<TITLE>GtkSelectionModel</TITLE>
GtkSelectionModel
gtk_selection_model_is_selected
gtk_selection_model_select_item
gtk_selection_model_unselect_item
gtk_selection_model_select_range
gtk_selection_model_unselect_range
gtk_selection_model_select_all
gtk_selection_model_unselect_all
<SUBSECTION>
gtk_selection_model_selection_changed
<SUBSECTION Standard>
GTK_SELECTION_MODEL
GTK_SELECTION_MODEL_CLASS
GTK_SELECTION_MODEL_GET_CLASS
GTK_IS_SELECTION_MODEL
GTK_IS_SELECTION_MODEL_CLASS
GTK_TYPE_SELECTION_MODEL
<SUBSECTION Private>
gtk_selection_model_get_type
</SECTION>
<SECTION>
<FILE>gtkbuildable</FILE>
GtkBuildable
@@ -1239,6 +1232,26 @@ GTK_TYPE_FILE_FILTER
gtk_file_filter_get_type
</SECTION>
<SECTION>
<FILE>gtkfilterlistmodel</FILE>
<TITLE>GtkFilterListModel</TITLE>
GtkFilterListModel
gtk_filter_list_model_new
gtk_filter_list_model_get_model
gtk_filter_list_model_set_filter_func
gtk_filter_list_model_has_filter
gtk_filter_list_model_refilter
<SUBSECTION Standard>
GTK_FILTER_LIST_MODEL
GTK_IS_FILTER_LIST_MODEL
GTK_TYPE_FILTER_LIST_MODEL
GTK_FILTER_LIST_MODEL_CLASS
GTK_IS_FILTER_LIST_MODEL_CLASS
GTK_FILTER_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_filter_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkfixed</FILE>
<TITLE>GtkFixed</TITLE>
@@ -1259,6 +1272,24 @@ GtkFixedChild
gtk_fixed_get_type
</SECTION>
<SECTION>
<FILE>gtkflattenlistmodel</FILE>
<TITLE>GtkFlattenListModel</TITLE>
GtkFlattenListModel
gtk_flatten_list_model_new
gtk_flatten_list_model_set_model
gtk_flatten_list_model_get_model
<SUBSECTION Standard>
GTK_FLATTEN_LIST_MODEL
GTK_IS_FLATTEN_LIST_MODEL
GTK_TYPE_FLATTEN_LIST_MODEL
GTK_FLATTEN_LIST_MODEL_CLASS
GTK_IS_FLATTEN_LIST_MODEL_CLASS
GTK_FLATTEN_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_flatten_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkfontbutton</FILE>
<TITLE>GtkFontButton</TITLE>
@@ -1579,23 +1610,6 @@ gtk_im_multicontext_get_type
GtkIMMulticontextPrivate
</SECTION>
<SECTION>
<FILE>gtkinvisible</FILE>
<TITLE>GtkInvisible</TITLE>
GtkInvisible
gtk_invisible_new
<SUBSECTION Standard>
GTK_INVISIBLE
GTK_IS_INVISIBLE
GTK_TYPE_INVISIBLE
GTK_INVISIBLE_CLASS
GTK_IS_INVISIBLE_CLASS
GTK_INVISIBLE_GET_CLASS
<SUBSECTION Private>
gtk_invisible_get_type
GtkInvisiblePrivate
</SECTION>
<SECTION>
<FILE>gtklabel</FILE>
<TITLE>GtkLabel</TITLE>
@@ -1706,6 +1720,27 @@ GtkLinkButtonPrivate
gtk_link_button_get_type
</SECTION>
<SECTION>
<FILE>gtkmaplistmodel</FILE>
<TITLE>GtkMapListModel</TITLE>
GtkMapListModel
GtkMapListModelMapFunc
gtk_map_list_model_new
gtk_map_list_model_set_map_func
gtk_map_list_model_set_model
gtk_map_list_model_get_model
gtk_map_list_model_has_map
<SUBSECTION Standard>
GTK_MAP_LIST_MODEL
GTK_IS_MAP_LIST_MODEL
GTK_TYPE_MAP_LIST_MODEL
GTK_MAP_LIST_MODEL_CLASS
GTK_IS_MAP_LIST_MODEL_CLASS
GTK_MAP_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_map_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkmenu</FILE>
<TITLE>GtkMenu</TITLE>
@@ -2534,6 +2569,51 @@ GtkSizeGroupPrivate
gtk_size_group_get_type
</SECTION>
<SECTION>
<FILE>gtkslicelistmodel</FILE>
<TITLE>GtkSliceListModel</TITLE>
GtkSliceListModel
gtk_slice_list_model_new
gtk_slice_list_model_new_for_type
gtk_slice_list_model_set_model
gtk_slice_list_model_get_model
gtk_slice_list_model_set_offset
gtk_slice_list_model_get_offset
gtk_slice_list_model_set_size
gtk_slice_list_model_get_size
<SUBSECTION Standard>
GTK_SLICE_LIST_MODEL
GTK_IS_SLICE_LIST_MODEL
GTK_TYPE_SLICE_LIST_MODEL
GTK_SLICE_LIST_MODEL_CLASS
GTK_IS_SLICE_LIST_MODEL_CLASS
GTK_SLICE_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_slice_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtksortlistmodel</FILE>
<TITLE>GtkSortListModel</TITLE>
GtkSortListModel
gtk_sort_list_model_new
gtk_sort_list_model_new_for_type
gtk_sort_list_model_set_sort_func
gtk_sort_list_model_has_sort
gtk_sort_list_model_set_model
gtk_sort_list_model_get_model
gtk_sort_list_model_resort
<SUBSECTION Standard>
GTK_SORT_LIST_MODEL
GTK_IS_SORT_LIST_MODEL
GTK_TYPE_SORT_LIST_MODEL
GTK_SORT_LIST_MODEL_CLASS
GTK_IS_SORT_LIST_MODEL_CLASS
GTK_SORT_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_sort_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkspinbutton</FILE>
<TITLE>GtkSpinButton</TITLE>
@@ -3258,7 +3338,6 @@ gtk_tooltip_set_icon
gtk_tooltip_set_icon_from_icon_name
gtk_tooltip_set_icon_from_gicon
gtk_tooltip_set_custom
gtk_tooltip_trigger_tooltip_query
gtk_tooltip_set_tip_area
<SUBSECTION Standard>
GTK_TYPE_TOOLTIP
@@ -3268,6 +3347,49 @@ GTK_TOOLTIP
gtk_tooltip_get_type
</SECTION>
<SECTION>
<FILE>gtktreelistmodel</FILE>
<TITLE>GtkTreeListModel</TITLE>
GtkTreeListModel
GtkTreeListRow
GtkTreeListModelCreateModelFunc
gtk_tree_list_model_new
gtk_tree_list_model_get_model
gtk_tree_list_model_get_passthrough
gtk_tree_list_model_set_autoexpand
gtk_tree_list_model_get_autoexpand
gtk_tree_list_model_get_child_row
gtk_tree_list_model_get_row
<SUBSECTION>
gtk_tree_list_row_get_item
gtk_tree_list_row_set_expanded
gtk_tree_list_row_get_expanded
gtk_tree_list_row_is_expandable
gtk_tree_list_row_get_position
gtk_tree_list_row_get_depth
gtk_tree_list_row_get_children
gtk_tree_list_row_get_parent
gtk_tree_list_row_get_child_row
<SUBSECTION Standard>
GTK_TREE_LIST_MODEL
GTK_IS_TREE_LIST_MODEL
GTK_TYPE_TREE_LIST_MODEL
GTK_TREE_LIST_MODEL_CLASS
GTK_IS_TREE_LIST_MODEL_CLASS
GTK_TREE_LIST_MODEL_GET_CLASS
GTK_TREE_LIST_ROW
GTK_IS_TREE_LIST_ROW
GTK_TYPE_TREE_LIST_ROW
GTK_TREE_LIST_ROW_CLASS
GTK_IS_TREE_LIST_ROW_CLASS
GTK_TREE_LIST_ROW_GET_CLASS
<SUBSECTION Private>
gtk_tree_list_model_get_type
gtk_tree_list_row_get_type
</SECTION>
<SECTION>
<FILE>gtktreemodel</FILE>
<TITLE>GtkTreeModel</TITLE>
@@ -4274,7 +4396,6 @@ gtk_widget_list_accel_closures
gtk_widget_can_activate_accel
gtk_widget_event
gtk_widget_activate
gtk_widget_intersect
gtk_widget_is_focus
gtk_widget_grab_focus
gtk_widget_grab_default
@@ -4457,6 +4578,10 @@ gtk_widget_class_bind_template_callback
gtk_widget_class_bind_template_callback_full
gtk_widget_class_set_connect_func
<SUBSECTION>
gtk_widget_observe_children
gtk_widget_observe_controllers
<SUBSECTION Standard>
GTK_WIDGET
GTK_IS_WIDGET
@@ -4500,6 +4625,7 @@ gtk_window_set_destroy_with_parent
gtk_window_set_display
gtk_window_is_active
gtk_window_is_maximized
gtk_window_get_toplevels
gtk_window_list_toplevels
gtk_window_add_mnemonic
gtk_window_remove_mnemonic
@@ -5225,7 +5351,6 @@ GtkPrintOperationPrivate
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintunixdialog</FILE>
<TITLE>GtkPrintUnixDialog</TITLE>
GtkPrintUnixDialog
@@ -5573,7 +5698,6 @@ gtk_print_context_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintjob</FILE>
<TITLE>GtkPrintJob</TITLE>
GtkPrintJob
@@ -5625,7 +5749,6 @@ gtk_print_job_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkpagesetupunixdialog</FILE>
<TITLE>GtkPageSetupUnixDialog</TITLE>
GtkPageSetupUnixDialog
@@ -6453,6 +6576,24 @@ GTK_GESTURE_SINGLE_GET_CLASS
gtk_gesture_single_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerlegacy</FILE>
<TITLE>GtkEventControllerlegacy</TITLE>
GtkEventControllerlegacy
gtk_event_controller_legacy_new
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER_LEGACY
GTK_EVENT_CONTROLLER_LEGACY
GTK_EVENT_CONTROLLER_LEGACY_CLASS
GTK_IS_EVENT_CONTROLLER_LEGACY
GTK_IS_EVENT_CONTROLLER_LEGACY_CLASS
GTK_EVENT_CONTROLLER_LEGACY_GET_CLASS
<SUBSECTION Private>
gtk_event_controller_legacy_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerscroll</FILE>
<TITLE>GtkEventControllerScroll</TITLE>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-update-icon-cache</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
@@ -56,7 +56,7 @@
the icons in the directory tree below the given directory.
</para>
<para>
GTK+ can use the cache files created by <command>gtk4-update-icon-cache</command>
GTK can use the cache files created by <command>gtk4-update-icon-cache</command>
to avoid a lot of system call and disk seek overhead when the application
starts. Since the format of the cache files allows them to be mmaped
shared between multiple applications, the overall memory consumption is

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-widget-factory</title>
<productname>GTK+</productname>
<productname>GTK</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
@@ -24,7 +24,7 @@
<refnamediv>
<refname>gtk4-widget-factory</refname>
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
<refpurpose>Demonstrate GTK widgets</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -37,8 +37,8 @@
<refsect1><title>Description</title>
<para>
<command>gtk4-widget-factory</command> is a collection of examples.
Its purpose is to demonstrate many GTK+ widgets in a form
that is useful to GTK+ theme developers.
Its purpose is to demonstrate many GTK widgets in a form
that is useful to GTK theme developers.
</para>
<para>
The application shows widgets in different, typical combinations

View File

@@ -18,7 +18,6 @@ gtk_bin_get_type
gtk_box_get_type
gtk_builder_get_type
gtk_buildable_get_type
gtk_button_box_get_type
gtk_button_get_type
gtk_calendar_get_type
gtk_cell_area_get_type
@@ -54,6 +53,7 @@ gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_controller_get_type
gtk_event_controller_key_get_type
gtk_event_controller_legacy_get_type
gtk_event_controller_motion_get_type
gtk_event_controller_scroll_get_type
gtk_expander_get_type
@@ -90,7 +90,6 @@ gtk_im_context_get_type
gtk_im_context_simple_get_type
gtk_im_multicontext_get_type
gtk_info_bar_get_type
gtk_invisible_get_type
gtk_label_get_type
gtk_layout_get_type
gtk_link_button_get_type

View File

@@ -1,5 +1,5 @@
This directory contains a collection of images of various widgets.
They are created via the shooter command in gtk+/docs/tools/, and are
They are created via the shooter command in gtk/docs/tools/, and are
updated semi-regularly. The images are used in both the headers of
individual widgets as well as the visual index of widgets.

View File

@@ -4,26 +4,26 @@
]>
<refentry id="chap-input-handling">
<refmeta>
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
<refentrytitle>The GTK Input and Event Handling Model</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>The GTK+ Input and Event Handling Model</refname>
<refname>The GTK Input and Event Handling Model</refname>
<refpurpose>
GTK+ input and event handling in detail
GTK input and event handling in detail
</refpurpose>
</refnamediv>
<refsect1 id="input-overview">
<title>Overview of GTK+ input and event handling</title>
<title>Overview of GTK input and event handling</title>
<para>
This chapter describes in detail how GTK+ handles input. If you are interested
This chapter describes in detail how GTK handles input. If you are interested
in what happens to translate a key press or mouse motion of the users into a
change of a GTK+ widget, you should read this chapter. This knowledge will also
change of a GTK widget, you should read this chapter. This knowledge will also
be useful if you decide to implement your own widgets.
</para>
@@ -33,13 +33,13 @@
<!-- input devices: master/slave, keyboard/pointer/touch -->
<para>
The most basic input devices that every computer user has interacted with are
keyboards and mice; beyond these, GTK+ supports touchpads, touchscreens and
more exotic input devices such as graphics tablets. Inside GTK+, every such
keyboards and mice; beyond these, GTK supports touchpads, touchscreens and
more exotic input devices such as graphics tablets. Inside GTK, every such
input device is represented by a #GdkDevice object.
</para>
<para>
To simplify dealing with the variability between these input devices, GTK+
To simplify dealing with the variability between these input devices, GTK
has a concept of master and slave devices. The concrete physical devices that
have many different characteristics (mice may have 2 or 3 or 8 buttons,
keyboards have different layouts and may or may not have a separate number
@@ -48,14 +48,14 @@
pointer/keyboard pairs - you can think of such a pair as a 'seat'.
</para>
<para>
GTK+ widgets generally deal with the master devices, and thus can be used
GTK widgets generally deal with the master devices, and thus can be used
with any pointing device or keyboard.
</para>
<!-- input events: button, touch, key, motion, etc -->
<para>
When a user interacts with an input device (e.g. moves a mouse or presses
a key on the keyboard), GTK+ receives events from the windowing system.
a key on the keyboard), GTK receives events from the windowing system.
These are typically directed at a specific window - for pointer events,
the window under the pointer (grabs complicate this), for keyboard events,
the window with the keyboard focus.
@@ -81,7 +81,7 @@
</simplelist>
</para>
<para>
When GTK+ is initialized, it sets up an event handler function with
When GTK is initialized, it sets up an event handler function with
gdk_event_handler_set(), which receives all of these input events
(as well as others, for instance window management related events).
</para>
@@ -152,7 +152,7 @@
<para>
Next, the #GtkWidget::event signal is emitted.
Handling these signals was the primary way to handle input in GTK+ widgets
Handling these signals was the primary way to handle input in GTK widgets
before gestures were introduced. The signal is emitted from
the target widget up to the top-level, as part of the “bubble” phase.
</para>
@@ -193,7 +193,7 @@
by granting a “pointer emulating” hint to one of the currently interacting touch
sequences, which will be reported on every #GdkEventTouch event from that sequence. By
default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
event mask and didn't override #GtkWidget::touch-event, GTK will transform these
“pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
sequences could still trigger gestures or just get filtered out, regardless of the widget

View File

@@ -11,7 +11,6 @@ private_headers = [
'gtkapplicationprivate.h',
'gtkbindingsprivate.h',
'gtkbitmaskprivate.h',
'gtkboxprivate.h',
'gtkbuilderprivate.h',
'gtkbuttonprivate.h',
'gtkcellareaboxcontextprivate.h',
@@ -340,7 +339,6 @@ content_files = [
'css-overview.xml',
'css-properties.xml',
'drawing-model.xml',
'getting_started.xml',
'glossary.xml',
'gtk4-broadwayd.xml',
'gtk4-builder-tool.xml',
@@ -372,7 +370,6 @@ content_files = [
expand_content_files = [
'compiling.sgml',
'drawing-model.xml',
'getting_started.xml',
'glossary.xml',
'input-handling.xml',
'migrating-2to4.xml',
@@ -383,6 +380,7 @@ expand_content_files = [
]
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf)
types_conf = configuration_data()
if os_win32
@@ -413,6 +411,9 @@ gnome.gtkdoc('gtk4',
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--default-includes=gtk/gtk.h',
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),

View File

@@ -4,11 +4,11 @@
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<chapter id="gtk-migrating-2-to-4">
<title>Migrating from GTK+ 2.x to GTK+ 4</title>
<title>Migrating from GTK 2.x to GTK 4</title>
<para>
If your application is still using GTK+ 2, you should first convert it to
GTK+ 3, by following the <ulink url="https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html">migration guide</ulink> in the GTK+ 3
If your application is still using GTK 2, you should first convert it to
GTK 3, by following the <ulink url="https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html">migration guide</ulink> in the GTK 3
documentation, and then follow <xref linkend="gtk-migrating-3-to-4"/>.
</para>

View File

@@ -4,26 +4,26 @@
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<chapter id="gtk-migrating-3-to-4">
<title>Migrating from GTK+ 3.x to GTK+ 4</title>
<title>Migrating from GTK 3.x to GTK 4</title>
<para>
GTK+ 4 is a major new version of GTK+ that breaks both API and ABI
compared to GTK+ 3.x. Thankfully, most of the changes are not hard
GTK 4 is a major new version of GTK that breaks both API and ABI
compared to GTK 3.x. Thankfully, most of the changes are not hard
to adapt to and there are a number of steps that you can take to
prepare your GTK+ 3.x application for the switch to GTK+ 4. After
prepare your GTK 3.x application for the switch to GTK 4. After
that, there's a small number of adjustments that you may have to do
when you actually switch your application to build against GTK+ 4.
when you actually switch your application to build against GTK 4.
</para>
<section>
<title>Preparation in GTK+ 3.x</title>
<title>Preparation in GTK 3.x</title>
<para>
The steps outlined in the following sections assume that your
application is working with GTK+ 3.24, which is the final stable
release of GTK+ 3.x. It includes all the necessary APIs and tools
to help you port your application to GTK+ 4. If you are still using
an older version of GTK+ 3.x, you should first get your application
application is working with GTK 3.24, which is the final stable
release of GTK 3.x. It includes all the necessary APIs and tools
to help you port your application to GTK 4. If you are still using
an older version of GTK 3.x, you should first get your application
to build and work with the latest minor release in the 3.24 series.
</para>
@@ -33,7 +33,7 @@
Over the years, a number of functions, and in some cases, entire
widgets have been deprecated. These deprecations are clearly spelled
out in the API reference, with hints about the recommended replacements.
The API reference for GTK+ 3 also includes an
The API reference for GTK 3 also includes an
<ulink url="https://developer.gnome.org/gtk3/3.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
</para>
<para>
@@ -70,7 +70,7 @@
<section>
<title>Do not use widget style properties</title>
<para>
Style properties do not exist in GTK+ 4. You should stop using them in
Style properties do not exist in GTK 4. You should stop using them in
your custom CSS and in your code.
</para>
</section>
@@ -78,18 +78,18 @@
<section>
<title>Review your window creation flags</title>
<para>
GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use
GTK 4 removes the GDK_WA_CURSOR flag. Instead, just use
gdk_window_set_cursor() to set a cursor on the window after
creating it.
</para>
<para>
GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses
GTK 4 also removes the GDK_WA_VISUAL flag, and always uses
an RGBA visual for windows. To prepare your code for this,
use gdk_window_set_visual (gdk_screen_get_rgba_visual ()) after
creating your window.
</para>
<para>
GTK+ 4 also removes the GDK_WA_WMCLASS flag. If you need this
GTK 4 also removes the GDK_WA_WMCLASS flag. If you need this
X11-specific functionality, use XSetClassHint() directly.
</para>
</section>
@@ -97,12 +97,12 @@
<section>
<title>Stop using non-RGBA visuals</title>
<para>
GTK+ 4 always uses RGBA visuals for its windows; you should make
GTK 4 always uses RGBA visuals for its windows; you should make
sure that your code works with that.
</para>
<para>
At the same time, you should stop using GdkVisual APIs, this object
not longer exist in GTK+ 4. Most of its APIs are deprecated already
not longer exist in GTK 4. Most of its APIs are deprecated already
and not useful when dealing with RGBA visuals.
</para>
</section>
@@ -110,7 +110,7 @@
<section>
<title>Stop using GtkBox:padding, GtkBox:fill and GtkBox:expand</title>
<para>
GTK+4 removes these #GtkBox child properties, so you should not use them.
GTK4 removes these #GtkBox child properties, so you should not use them.
You can replace GtkBox:padding using the #GtkWidget:margin properties
on your #GtkBox child widgets.
</para>
@@ -152,7 +152,7 @@
<section>
<title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface()</title>
<para>
These functions are not supported in GTK+ 4. Instead, either use backend-specific
These functions are not supported in GTK 4. Instead, either use backend-specific
APIs, or render your widgets using gtk_widget_render().
</para>
</section>
@@ -162,7 +162,7 @@
<para>
The functions and properties related to automatically add a GtkImage
to a GtkButton, and using a GtkSetting to control its visibility, are
not supported in GTK+ 4. Instead, you can just pack a GtkImage inside
not supported in GTK 4. Instead, you can just pack a GtkImage inside
a GtkButton, and control its visibility like you would for any other
widget. If you only want to add a named icon to a GtkButton, you can
use gtk_button_set_icon_name().
@@ -172,24 +172,35 @@
<section>
<title>Stop using GtkWidget event signals</title>
<para>
Event controllers and #GtkGestures replace event signals in GTK+ 4. They
have been backported to GTK+ 3.x so you can prepare for this change.
Event controllers and #GtkGestures replace event signals in GTK 4. They
have been backported to GTK 3.x so you can prepare for this change.
</para>
</section>
<section>
<title>Set a proper app_id</title>
<para>
In GTK+4 we want the application's #GApplication
In GTK4 we want the application's #GApplication
'application-id' (and therefore the D-Bus name), the desktop
file basename and Wayland's xdg-shell app_id to match. In
order to achieve this with GTK+3 call g_set_prgname() with the same
order to achieve this with GTK3 call g_set_prgname() with the same
application id you passed to #GtkApplication. Rename your
desktop files to match the application id if needed.
</para>
<para>
The call to g_set_prgname() can be removed once you fully migrated
to GTK+4.
to GTK4.
</para>
</section>
<section>
<title>Stop using GtkBox's pack-type child property</title>
<para>
In order to improve performance and simplify the widget, GtkBox lost its
'pack-type' child property. In GTK4, every GtkBox instance has a simple
list of child widgets that it allocates from start to end.
The old behavior of pack-type=END can be emulated by simply making the
box child in the center hexpand and right-align the ones at the end.
</para>
</section>
@@ -201,15 +212,15 @@
<para>
This section outlines porting tasks that you need to tackle when
you get to the point that you actually build your application against
GTK+ 4. Making it possible to prepare for these in GTK+ 3 would
GTK 4. Making it possible to prepare for these in GTK 3 would
have been either impossible or impractical.
</para>
<section>
<title>Stop using GdkScreen</title>
<para>
The GdkScreen object has been removed in GTK+ 4. Most of its APIs already
had replacements in GTK+ 3 and were deprecated, a few remaining replacements
The GdkScreen object has been removed in GTK 4. Most of its APIs already
had replacements in GTK 3 and were deprecated, a few remaining replacements
have been added to GdkDisplay.
</para>
</section>
@@ -227,7 +238,7 @@
<section>
<title>Stop using GdkVisual</title>
<para>
This object is not useful with current GTK+ drawing APIs and has been removed
This object is not useful with current GTK drawing APIs and has been removed
without replacement.
</para>
</section>
@@ -235,8 +246,8 @@
<section>
<title>Stop using GdkDeviceManager</title>
<para>
The GdkDeviceManager object has been removed in GTK+ 4. Most of its APIs already
had replacements in GTK+ 3 and were deprecated in favor of GdkSeat.
The GdkDeviceManager object has been removed in GTK 4. Most of its APIs already
had replacements in GTK 3 and were deprecated in favor of GdkSeat.
</para>
</section>
@@ -264,9 +275,9 @@
<section>
<title>Stop accessing GdkEvent fields</title>
<para>
Direct access to GdkEvent structs is no longer possible in GTK+ 4. Some
frequently-used fields already had accessors in GTK+ 3, and the remaining
fields have gained accessors in GTK+ 4.
Direct access to GdkEvent structs is no longer possible in GTK 4. Some
frequently-used fields already had accessors in GTK 3, and the remaining
fields have gained accessors in GTK 4.
</para>
</section>
@@ -317,7 +328,7 @@
<section>
<title>Adapt to GtkCssProvider API changes</title>
<para>
In GTK+ 4, the various #GtkCssProvider load functions have lost
In GTK 4, the various #GtkCssProvider load functions have lost
their #GError argument. If you want to handle CSS loading errors,
use the #GtkCssProvider::parsing-error signal instead.
</para>
@@ -326,7 +337,7 @@
<section>
<title>Stop using GtkContainer::border-width</title>
<para>
GTK+ 4 has removed the #GtkContainer::border-width property.
GTK 4 has removed the #GtkContainer::border-width property.
Use other means to influence the spacing of your containers,
such as the CSS margin and padding properties on child widgets.
</para>
@@ -335,9 +346,9 @@
<section>
<title>Adapt to GtkWidget's size request changes</title>
<para>
GTK+ 3 used five different virtual functions in GtkWidget to
GTK 3 used five different virtual functions in GtkWidget to
implement size requisition, namely the gtk_widget_get_preferred_width()
family of functions. To simplify widget implementations, GTK+4 uses
family of functions. To simplify widget implementations, GTK4 uses
only one virtual function, GtkWidgetClass::measure() that widgets
have to implement.
</para>
@@ -355,7 +366,7 @@
<section>
<title>Switch to GtkWidget's children APIs</title>
<para>
Instead of the GtkContainer subclass, in GTK+ 4, any widget can
Instead of the GtkContainer subclass, in GTK 4, any widget can
have children, and there is new API to navigate the widget tree:
gtk_widget_get_first_child(), gtk_widget_get_last_child(),
gtk_widget_get_next_sibling(), gtk_widget_get_prev_sibling().
@@ -367,7 +378,7 @@
<section>
<title>Don't use -gtk-gradient in your CSS</title>
<para>
GTK+ now supports standard CSS syntax for both linear and radial
GTK now supports standard CSS syntax for both linear and radial
gradients, just use those.
</para>
</section>
@@ -375,7 +386,7 @@
<section>
<title>Don't use -gtk-icon-effect in your CSS</title>
<para>
GTK+ now supports a more versatile -gtk-icon-filter instead. Replace
GTK now supports a more versatile -gtk-icon-filter instead. Replace
-gtk-icon-effect: dim; with -gtk-icon-filter: opacity(0.5); and
-gtk-icon-effect: hilight; with -gtk-icon-filter: brightness(1.2);.
</para>
@@ -392,8 +403,8 @@
<section>
<title>Adapt to drawing model changes</title>
<para>
This area has seen the most radical changes in the transition from GTK+ 3
to GTK+ 4. Widgets no longer use a draw() function to render their contents
This area has seen the most radical changes in the transition from GTK 3
to GTK 4. Widgets no longer use a draw() function to render their contents
to a cairo surface. Instead, they have a snapshot() function that creates
one or more GskRenderNodes to represent their content. Third-party widgets
that use a draw() function or a #GtkWidget::draw signal handler for custom
@@ -423,7 +434,7 @@
<section>
<title>Widgets are now visible by default</title>
<para>
The default value of #GtkWidget::visible in GTK+ 4 is %TRUE, so you no
The default value of #GtkWidget::visible in GTK 4 is %TRUE, so you no
longer need to explicitly show all your widgets. On the flip side, you
need to hide widgets that are not meant to be visible from the start.
</para>
@@ -434,7 +445,7 @@
</para>
<para>
The function gtk_widget_show_all(), the #GtkWidget::no-show-all property
and its getter and setter have been removed in GTK+ 4, so you should stop using them.
and its getter and setter have been removed in GTK 4, so you should stop using them.
</para>
</section>
@@ -476,8 +487,8 @@
<section>
<title>GtkWidget event signals are removed</title>
<para>
Event controllers and #GtkGestures have already been introduced in GTK+ 3 to handle
input for many cases. In GTK+ 4, the traditional widget signals for handling input,
Event controllers and #GtkGestures have already been introduced in GTK 3 to handle
input for many cases. In GTK 4, the traditional widget signals for handling input,
such as #GtkWidget::motion-event or #GtkWidget::event have been removed.
</para>
</section>
@@ -533,7 +544,7 @@
<section>
<title>Adapt to icon size API changes</title>
<para>
Instead of the existing extensible set of symbolic icon sizes, GTK+ now only
Instead of the existing extensible set of symbolic icon sizes, GTK now only
supports normal and large icons with the #GtkIconSize enumeration. The actual sizes
can be defined by themes via the CSS property -gtk-icon-size.
</para>

View File

@@ -4,34 +4,34 @@
]>
<refentry id="gtk-osx">
<refmeta>
<refentrytitle>Using GTK+ on Mac OS X</refentrytitle>
<refentrytitle>Using GTK on Apple macOS</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ on Mac OS X</refname>
<refname>Using GTK on Apple macOS</refname>
<refpurpose>
OS X-specific aspects of using GTK+
MacOS-specific aspects of using GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ on Mac OS X</title>
<title>Using GTK on Apple macOS</title>
<para>
The Mac OS X port of GTK+ is an implementation of GDK (and therefore GTK+)
on top of the Quarz API.
The Apple macOS port of GTK is an implementation of GDK (and therefore GTK)
on top of the Quartz API.
</para>
<para>
Currently, the Mac OS X port does not use any additional commandline options
Currently, the macOS port does not use any additional commandline options
or environment variables.
</para>
<para>
For up-to-date information about the current status of this port, see the
<ulink url="https://wiki.gnome.org/Projects/GTK+/OSX">project page</ulink>.
<ulink url="https://wiki.gnome.org/Projects/GTK/OSX">project page</ulink>.
</para>
</refsect1>

View File

@@ -4,15 +4,15 @@
]>
<refentry id="gtk-other-software">
<refmeta>
<refentrytitle>Mixing GTK+ with other software</refentrytitle>
<refentrytitle>Mixing GTK with other software</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Mixing GTK+ with other software</refmiscinfo>
<refmiscinfo>Mixing GTK with other software</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Mixing GTK+ with other software</refname>
<refname>Mixing GTK with other software</refname>
<refpurpose>
How to combine GTK+ with other code and event loops
How to combine GTK with other code and event loops
</refpurpose>
</refnamediv>
@@ -20,9 +20,9 @@ How to combine GTK+ with other code and event loops
<title>Overview</title>
<para>
Often people want to use GTK+ in combination with another library or existing
body of code that is not GTK+-aware. The general problem people encounter
is that the control flow of the other code does not return to GTK+, so
Often people want to use GTK in combination with another library or existing
body of code that is not GTK-aware. The general problem people encounter
is that the control flow of the other code does not return to GTK, so
widgets do not repaint, mouse and keyboard events are ignored, and so forth.
</para>
@@ -35,10 +35,10 @@ targetting, and your own familiarity with each approach.
</refsect1>
<refsect1>
<title>Periodically yield to GTK+ main loop</title>
<title>Periodically yield to GTK main loop</title>
<para>
This is the simplest method, but requires you to modify the non-GTK+ code.
This is the simplest method, but requires you to modify the non-GTK code.
Say you have a function that does some kind of lengthy task:
<informalexample>
<programlisting>
@@ -99,7 +99,7 @@ lengthy task.
</refsect1>
<refsect1>
<title>Run the other code as a slave of the GTK+ main loop</title>
<title>Run the other code as a slave of the GTK main loop</title>
<para>
As a slightly cleaner solution, you can ask the main loop to run a small part of your
@@ -190,7 +190,7 @@ your needs.
</refsect1>
<refsect1>
<title>Integrate the GTK+ main loop with another main loop</title>
<title>Integrate the GTK main loop with another main loop</title>
<para>
</para>

View File

@@ -4,17 +4,17 @@
]>
<partintro>
<para>
GTK+ is a library for creating graphical user interfaces. It
GTK is a library for creating graphical user interfaces. It
works on many UNIX-like platforms, Windows, and OS X.
GTK+ is released under the GNU Library General Public License
GTK is released under the GNU Library General Public License
(GNU LGPL), which allows for flexible licensing of client
applications. GTK+ has a C-based object-oriented architecture that
applications. GTK has a C-based object-oriented architecture that
allows for maximum flexibility. Bindings for many other languages have
been written, including C++, Objective-C, Guile/Scheme, Perl, Python,
TOM, Ada95, Free Pascal, and Eiffel.
</para>
<para>
GTK+ depends on the following libraries:
GTK depends on the following libraries:
<variablelist>
<varlistentry>
@@ -64,7 +64,7 @@ other widgets that display text.
ATK is the Accessibility Toolkit. It provides a set of generic
interfaces allowing accessibility technologies to interact with a
graphical user interface. For example, a screen reader uses ATK to
discover the text in an interface and read it to blind users. GTK+
discover the text in an interface and read it to blind users. GTK
widgets have built-in support for accessibility using the ATK
framework.
</para></listitem>
@@ -82,16 +82,16 @@ Use a GdkPixbuf in combination with GtkImage to display images.
<varlistentry>
<term>GDK</term>
<listitem><para>
GDK is the abstraction layer that allows GTK+ to support multiple
GDK is the abstraction layer that allows GTK to support multiple
windowing systems. GDK provides window system facilities on X11, Windows,
and OS X.
</para></listitem>
</varlistentry>
<varlistentry>
<term>GTK+</term>
<term>GTK</term>
<listitem><para>
The GTK+ library itself contains <firstterm>widgets</firstterm>,
The GTK library itself contains <firstterm>widgets</firstterm>,
that is, GUI components such as GtkButton or GtkTextView.
</para></listitem>
</varlistentry>

View File

@@ -12,7 +12,7 @@
<refnamediv>
<refname>Common Questions</refname>
<refpurpose>
Find answers to common questions in the GTK+ manual
Find answers to common questions in the GTK manual
</refpurpose>
</refnamediv>
@@ -31,13 +31,13 @@ the question you have, this list is a good place to start.
<qandaentry>
<question><para>
How do I get started with GTK+?
How do I get started with GTK?
</para></question>
<answer><para>
The GTK+ <ulink url="https://www.gtk.org">website</ulink> offers some
The GTK <ulink url="https://www.gtk.org">website</ulink> offers some
<ulink url="https://www.gtk.org/documentation.php">tutorials</ulink> and other
documentation (most of it about GTK+ 2.x, but mostly still applicable).
documentation (most of it about GTK 2.x, but mostly still applicable).
More documentation ranging from whitepapers to online books can be found at
the <ulink url="https://developer.gnome.org">GNOME developer's site</ulink>.
After studying these materials you should be well prepared to come back to
@@ -47,7 +47,7 @@ this reference manual for details.
<qandaentry>
<question><para>
Where can I get help with GTK+, submit a bug report, or make a feature
Where can I get help with GTK, submit a bug report, or make a feature
request?
</para></question>
@@ -63,7 +63,7 @@ See the <link linkend="gtk-resources">documentation on this topic</link>.
<qandaentry>
<question><para>How do I port from one GTK+
<question><para>How do I port from one GTK
version to another?</para></question>
<answer>
@@ -77,8 +77,8 @@ specific widgets and functions.
<para>
If you have a question not covered in the manual, feel free to
ask on the mailing lists and please <ulink
url="https://bugzilla.gnome.org">file a bug report</ulink> against the
documentation.
url="https://gitlab.gnome.org/GNOME/gtk/issues/new">file a bug report</ulink>
against the documentation.
</para>
</answer>
@@ -88,7 +88,7 @@ documentation.
<qandaentry>
<question><para>
How does memory management work in GTK+? Should I free data returned
How does memory management work in GTK? Should I free data returned
from functions?
</para></question>
@@ -105,8 +105,8 @@ state (explained in its documentation).
For strings returned from functions, they will be declared "const"
if they should not be freed. Non-const strings should be
freed with g_free(). Arrays follow the same rule. If you find an
undocumented exception to the rules, please report a bug to <ulink
url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
undocumented exception to the rules, please
<ulink url="https://gitlab.gnome.org/GNOME/gtk/issues/new">file a bug report</ulink>.
</para>
</answer>
@@ -135,7 +135,7 @@ reference counting, not floating reference counting.
<para>
To get this, you must acquire a reference to the widget and drop the
floating reference (<quote>ref and sink</quote> in GTK+ parlance) after
floating reference (<quote>ref and sink</quote> in GTK parlance) after
creating it:
<informalexample><programlisting>
foo = gtk_foo_new (<!-- -->);
@@ -158,7 +158,7 @@ to get rid of the widget.
<qandaentry>
<question><para>
How do I use GTK+ with threads?
How do I use GTK with threads?
</para></question>
<answer>
@@ -175,7 +175,7 @@ documentation for portable threading primitives.
<qandaentry>
<question><para>
How do I internationalize a GTK+ program?
How do I internationalize a GTK program?
</para></question>
<answer>
@@ -257,13 +257,13 @@ the following convenience:
<qandaentry>
<question>
<para>
How do I use non-ASCII characters in GTK+ programs ?
How do I use non-ASCII characters in GTK programs ?
</para>
</question>
<answer>
<para>
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
GTK uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
one to six bytes and has a number of nice properties which make it a good
choice for working with Unicode text in C programs:
@@ -288,7 +288,7 @@ encodings, see g_locale_to_utf8() and g_convert().
</para>
<para>
Text coming from external sources (e.g. files or user input), has to be
converted to UTF-8 before being handed over to GTK+. The following example
converted to UTF-8 before being handed over to GTK. The following example
writes the content of a IS0-8859-1 encoded text file to
<literal>stdout</literal>:
<informalexample><programlisting>
@@ -368,24 +368,24 @@ returned in UTF-8 encoding.
<qandaentry>
<question><para>
How do I use GTK+ with C++?
How do I use GTK with C++?
</para></question>
<answer>
<para>
There are two ways to approach this. The GTK+ header files use the subset
of C that's also valid C++, so you can simply use the normal GTK+ API
There are two ways to approach this. The GTK header files use the subset
of C that's also valid C++, so you can simply use the normal GTK API
in a C++ program. Alternatively, you can use a "C++ binding"
such as <ulink url="https://www.gtkmm.org/">gtkmm</ulink>
which provides a native C++ API.
</para>
<para>
When using GTK+ directly, keep in mind that only functions can be
When using GTK directly, keep in mind that only functions can be
connected to signals, not methods. So you will need to use global
functions or "static" class functions for signal connections.
</para>
<para>
Another common issue when using GTK+ directly is that
Another common issue when using GTK directly is that
C++ will not implicitly convert an integer to an enumeration.
This comes up when using bitfields; in C you can write the following
code:
@@ -410,7 +410,7 @@ There are very few functions that require this cast, however.
<qandaentry>
<question><para>
How do I use GTK+ with other non-C languages?
How do I use GTK with other non-C languages?
</para></question>
<answer>
@@ -620,7 +620,7 @@ single-line text entry, see #GtkEntry.
<answer>
<para>
#GtkImage can display images in just about any format GTK+ understands.
#GtkImage can display images in just about any format GTK understands.
You can also use #GtkDrawingArea if you need to do something more complex,
such as draw text or graphics over the top of the image.
</para>
@@ -635,7 +635,7 @@ would use a combo box?
<answer>
<para>
With GTK+, a #GtkComboBox is the recommended widget to use for this use case.
With GTK, a #GtkComboBox is the recommended widget to use for this use case.
This widget looks like either a combo box or the current option menu, depending
on the current theme. If you need an editable text entry, use the
#GtkComboBox:has-entry property.
@@ -707,7 +707,7 @@ How do I disable/ghost/desensitize a widget?
</para></question>
<answer><para>
In GTK+ a disabled widget is termed "insensitive."
In GTK a disabled widget is termed "insensitive."
See gtk_widget_set_sensitive().
</para></answer>
</qandaentry>
@@ -931,11 +931,11 @@ See gtk_tree_view_set_expander_column() and gtk_tree_view_column_set_visible().
</qandadiv>
<qandadiv><title>Using cairo with GTK+</title>
<qandadiv><title>Using cairo with GTK</title>
<qandaentry>
<question><para>
How do I use cairo to draw in GTK+ applications ?
How do I use cairo to draw in GTK applications ?
</para></question>
<answer><para>
@@ -943,7 +943,7 @@ The #GtkWidget::draw signal gets a ready-to-use cairo context
as parameter that you should use.
</para>
<para>
All drawing in GTK+ is normally done in a draw handler, and GTK+
All drawing in GTK is normally done in a draw handler, and GTK
creates a temporary pixmap for double-buffering the drawing.
It is possible to turn off double-buffering, with
gtk_widget_set_double_buffered(), but this is not ideal,
@@ -961,7 +961,7 @@ Glitz or GL backend of cairo ?
<answer><para>
No. The GDK X11 backend uses the cairo X backend (and the other
GDK backends use their respective native cairo backends). The
GTK+ developers believe that the best way to improving the GDK
GTK developers believe that the best way to improving the GDK
drawing performance is to optimize the cairo X backend and the
relevant code paths in the X server that is uses (mostly the
Render extension).

View File

@@ -12,20 +12,19 @@
<refnamediv>
<refname>Mailing lists and bug reports</refname>
<refpurpose>
Getting help with GTK+
Getting help with GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>Filing a bug report or feature request</title>
<title>Opening a bug or feature request</title>
<para>
If you encounter a bug, misfeature, or missing feature in GTK+, please
file a bug report on
<ulink url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
We'd also appreciate reports of incomplete or misleading information in
the GTK+ documentation; file those against the "docs" component of the "gtk+"
product in Bugzilla.
If you encounter a bug, misfeature, or missing feature in GTK, please
file a bug report on our
<ulink url="https://gitlab.gnome.org/GNOME/gtk/issues/new">GitLab project</ulink>.
You should also file issues if the documentation is out of date with the
existing API, or unclear.
</para>
<para>
@@ -37,29 +36,34 @@ discussed, we'll add a note to that effect in the report.
<para>
The bug tracker should definitely be used for feature requests, it's
not only for bugs. We track all GTK+ development in Bugzilla, so it's
the way to be sure the GTK+ developers won't forget about an issue.
not only for bugs. We track all GTK development in GitLab, to ensure
that nothing gets lost.
</para>
</refsect1>
<refsect1>
<title>Submitting Patches</title>
<title>Working on GTK</title>
<para>
If you develop a bugfix or enhancement for GTK+, please file that in
Bugzilla as well. Bugzilla allows you to attach files; please attach a
patch generated by the <command>diff</command> utility, using the
<option>-u</option> option to make the patch more readable. All patches
must be offered under the terms of the GNU LGPL license, so be sure you
are authorized to give us the patch under those terms.
If you develop a bugfix or enhancement for GTK, please open a merge
request in GitLab as well. You should not attach patches to an issue,
or describe the fix as a comment. Merge requests allow us to build
GTK with your code applied, and run the test suite, on multiple platforms
and architectures, and verify that nothing breaks. They also allow us to
do proper code reviews, so we can iterate over the changes.
</para>
<para>
If you want to discuss your patch before or after developing it, mail
<ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink>.
But be sure to file the Bugzilla report as well; if the patch is only on the
list and not in Bugzilla, it's likely to slip through the cracks.
You should follow the <ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/CONTRIBUTING.md">contribution guide</ulink>
for GTK, available on GitLab.
</para>
<para>
If you want to discuss your approach before or after working on it,
send and email to <ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink>.
You should not send a patch to the mailing list, as it will inevitably
get lost, or forgotten. Always open a merge request.
</para>
</refsect1>
@@ -68,8 +72,8 @@ list and not in Bugzilla, it's likely to slip through the cracks.
<title>Mailing lists</title>
<para>
There are several mailing lists dedicated to GTK+ and related
libraries. Discussion of GLib, Pango, and ATK in addition to GTK+
There are several mailing lists dedicated to GTK and related
libraries. Discussion of GLib, Pango, and ATK in addition to GTK
proper is welcome on these lists. You can subscribe or view the
archives of these lists on
<ulink url="https://mail.gnome.org">http://mail.gnome.org</ulink>.
@@ -84,28 +88,28 @@ some days to happen.
<varlistentry>
<term><ulink url="mailto:gtk-list@gnome.org">gtk-list@gnome.org</ulink></term>
<listitem><para>
gtk-list covers general GTK+ topics; questions about using GTK+ in programs,
GTK+ from a user standpoint, announcements of GTK+-related projects
such as themes or GTK+ modules would all be on-topic. The bulk of the
traffic consists of GTK+ programming questions.
gtk-list covers general GTK topics; questions about using GTK in programs,
GTK from a user standpoint, announcements of GTK-related projects
such as themes or GTK modules would all be on-topic. The bulk of the
traffic consists of GTK programming questions.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-app-devel-list@gnome.org">gtk-app-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-app-devel-list covers writing applications in GTK+. It's narrower
gtk-app-devel-list covers writing applications in GTK. It's narrower
in scope than gtk-list, but the two lists overlap quite a
bit. gtk-app-devel-list is a good place to ask questions about GTK+
bit. gtk-app-devel-list is a good place to ask questions about GTK
programming. </para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-devel-list is for discussion of work on GTK+ itself, it is
gtk-devel-list is for discussion of work on GTK itself, it is
<emphasis>not</emphasis> for
asking questions about how to use GTK+ in applications. gtk-devel-list
asking questions about how to use GTK in applications. gtk-devel-list
is appropriate for discussion of patches, bugs, proposed features,
and so on.
</para></listitem>
@@ -114,7 +118,7 @@ and so on.
<varlistentry>
<term><ulink url="mailto:gtk-i18n-list@gnome.org">gtk-i18n-list@gnome.org</ulink></term>
<listitem><para>
gtk-i18n-list is for discussion of internationalization in GTK+;
gtk-i18n-list is for discussion of internationalization in GTK;
Pango is the main focus of the list. Questions about the details of
using Pango, and discussion of proposed Pango patches or features, are
all on topic.
@@ -125,7 +129,7 @@ all on topic.
<term><ulink url="mailto:gtk-doc-list@gnome.org">gtk-doc-list@gnome.org</ulink></term>
<listitem><para>
gtk-doc-list is for discussion of the <application>gtk-doc</application>
documentation system (used to document GTK+), and for work on the GTK+
documentation system (used to document GTK), and for work on the GTK
documentation.
</para></listitem>
</varlistentry>

View File

@@ -4,26 +4,26 @@
]>
<refentry id="gtk-running">
<refmeta>
<refentrytitle>Running GTK+ Applications</refentrytitle>
<refentrytitle>Running GTK Applications</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Running GTK+ Applications</refname>
<refname>Running GTK Applications</refname>
<refpurpose>
How to run and debug your GTK+ application
How to run and debug your GTK application
</refpurpose>
</refnamediv>
<refsect1>
<title>Running and debugging GTK+ Applications</title>
<title>Running and debugging GTK Applications</title>
<refsect2>
<title>Environment variables</title>
<para>
GTK+ inspects a number of environment variables in addition to standard
GTK inspects a number of environment variables in addition to standard
variables like <envar>LANG</envar>, <envar>PATH</envar>, <envar>HOME</envar>
or <envar>DISPLAY</envar>; mostly to determine paths to look for certain
files. The <link linkend="x11-envar">X11</link>,
@@ -36,8 +36,8 @@ additional environment variables.
<title><envar>GTK_DEBUG</envar></title>
<para>
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
this variable can be set to a list of debug options, which cause GTK+
Unless GTK has been configured with <option>--enable-debug=no</option>,
this variable can be set to a list of debug options, which cause GTK
to print out different types of debugging information.
<variablelist>
<varlistentry>
@@ -126,45 +126,45 @@ additional environment variables.
<title><envar>GTK_PATH</envar></title>
<para>
Specifies a list of directories to search when GTK+ is looking for
Specifies a list of directories to search when GTK is looking for
dynamically loaded objects such as input method
modules and print backends. If the path to
the dynamically loaded object is given as an absolute path name,
then GTK+ loads it directly.
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
then GTK loads it directly.
Otherwise, GTK goes in turn through the directories in <envar>GTK_PATH</envar>,
followed by the directory <filename>.gtk-4.0</filename> in the user's
home directory, followed by the system default directory,
which is <filename><replaceable>libdir</replaceable>/gtk-4.0/modules</filename>.
(If <envar>GTK_EXE_PREFIX</envar> is defined, <replaceable>libdir</replaceable> is
<filename>$GTK_EXE_PREFIX/lib</filename>. Otherwise it is the libdir
specified when GTK+ was configured, usually
specified when GTK was configured, usually
<filename>/usr/lib</filename>, or
<filename>/usr/local/lib</filename>.)
For each directory in this list, GTK+ actually looks in a
For each directory in this list, GTK actually looks in a
subdirectory
<filename><replaceable>directory</replaceable>/<replaceable>version</replaceable>/<replaceable>host</replaceable>/<replaceable>type</replaceable></filename>
Where <replaceable>version</replaceable> is derived from the
version of GTK+ (use <literal>pkg-config
--variable=gtk_binary_version gtk+-3.0</literal> to determine this from a
version of GTK (use <literal>pkg-config
--variable=gtk_binary_version gtk4</literal> to determine this from a
script), <replaceable>host</replaceable> is the architecture on
which GTK+ was built. (use <literal>pkg-config
--variable=gtk_host gtk+-3.0</literal> to determine this from a
which GTK was built. (use <literal>pkg-config
--variable=gtk_host gtk4</literal> to determine this from a
script), and <replaceable>type</replaceable> is a directory
specific to the type of modules; currently it can be
<literal>modules</literal>, <literal>engines</literal>,
<literal>immodules</literal>, <literal>filesystems</literal> or
<literal>printbackends</literal>, corresponding to the types of
modules mentioned above. Either <replaceable>version</replaceable>,
<replaceable>host</replaceable>, or both may be omitted. GTK+ looks
<replaceable>host</replaceable>, or both may be omitted. GTK looks
first in the most specific directory, then in directories with
fewer components.
The components of GTK_PATH are separated by the ':' character on
Linux and Unix, and the ';' character on Windows.
</para>
<warning>
Note that this environment variable is read by GTK+ 2.x and GTK+ 3.x too,
Note that this environment variable is read by GTK 2.x and GTK 3.x too,
which makes it unsuitable for setting it system-wide (or session-wide),
since doing so will cause applications using different GTK+ versions
since doing so will cause applications using different GTK versions
to see incompatible modules.
</warning>
</formalpara>
@@ -179,7 +179,7 @@ additional environment variables.
<literal>Gtk/IMModule</literal>, that will be used for the default
IM module.
This also can be a colon-separated list of input-methods, which
GTK+ will try in turn until it finds one available on the system.
GTK will try in turn until it finds one available on the system.
</para>
</formalpara>
@@ -187,8 +187,8 @@ additional environment variables.
<title><envar>GTK_EXE_PREFIX</envar></title>
<para>
If set, GTK+ uses <filename>$GTK_EXE_PREFIX/lib</filename> instead of
the libdir configured when GTK+ was compiled.
If set, GTK uses <filename>$GTK_EXE_PREFIX/lib</filename> instead of
the libdir configured when GTK was compiled.
</para>
</formalpara>
@@ -196,8 +196,8 @@ additional environment variables.
<title><envar>GTK_DATA_PREFIX</envar></title>
<para>
If set, makes GTK+ use <filename>$GTK_DATA_PREFIX</filename>
instead of the prefix configured when GTK+ was compiled.
If set, makes GTK use <filename>$GTK_DATA_PREFIX</filename>
instead of the prefix configured when GTK was compiled.
</para>
</formalpara>
@@ -205,7 +205,7 @@ additional environment variables.
<title><envar>GTK_THEME</envar></title>
<para>
If set, makes GTK+ use the named theme instead of the theme
If set, makes GTK use the named theme instead of the theme
that is specified by the gtk-theme-name setting. This is intended
mainly for easy debugging of theme issues.
</para>
@@ -217,7 +217,7 @@ additional environment variables.
<para>
The following environment variables are used by GdkPixbuf, GDK or
Pango, not by GTK+ itself, but we list them here for completeness
Pango, not by GTK itself, but we list them here for completeness
nevertheless.
</para>
@@ -229,7 +229,7 @@ nevertheless.
This environment variable overrides the default value
<filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/loaders.cache</filename>
(<replaceable>libdir</replaceable> is the sysconfdir specified when
GTK+ was configured, usually <filename>/usr/local/lib</filename>.)
GTK was configured, usually <filename>/usr/local/lib</filename>.)
</para>
<para>
The <filename>loaders.cache</filename> file is generated by the
@@ -241,7 +241,7 @@ nevertheless.
<title><envar>GDK_DEBUG</envar></title>
<para>
If GTK+ has been configured with <option>--enable-debug=yes</option>,
If GTK has been configured with <option>--enable-debug=yes</option>,
this variable can be set to a list of debug options, which cause GDK
to print out different types of debugging information.
<variablelist>
@@ -331,7 +331,7 @@ nevertheless.
<title><envar>GSK_DEBUG</envar></title>
<para>
If GTK+ has been configured with <option>--enable-debug=yes</option>,
If GTK has been configured with <option>--enable-debug=yes</option>,
this variable can be set to a list of debug options, which cause GSK
to print out different types of debugging information.
<variablelist>
@@ -406,7 +406,7 @@ nevertheless.
<para>
If set, selects the GDK backend to use. Selecting a backend requires that
GTK+ is compiled with support for that backend. The following backends can
GTK is compiled with support for that backend. The following backends can
be selected, provided they are included in the GDK libraries you are using:
<variablelist>
@@ -498,7 +498,7 @@ nevertheless.
<para>
The default value of this environment variable is 1. If changed to 0, this
disables the default use of client-side decorations on GTK+ windows, thus
disables the default use of client-side decorations on GTK windows, thus
making the window manager responsible for drawing the decorations of
windows that do not have a custom titlebar widget.
</para>
@@ -512,7 +512,7 @@ nevertheless.
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>
<para>
GTK+ uses these environment variables to locate icon themes
GTK uses these environment variables to locate icon themes
and MIME information. For more information, see
<ulink url="https://freedesktop.org/Standards/icon-theme-spec">Icon Theme Specification</ulink>,
the <ulink url="https://freedesktop.org/Standards/shared-mime-info-spec">Shared MIME-info Database</ulink>
@@ -524,9 +524,9 @@ nevertheless.
<title><envar>DESKTOP_STARTUP_ID</envar></title>
<para>
GTK+ uses this environment variable to provide startup notification
GTK uses this environment variable to provide startup notification
according to the <ulink url="https://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">Startup Notification Spec</ulink>.
Following the specification, GTK+ unsets this variable after reading
Following the specification, GTK unsets this variable after reading
it (to keep it from leaking to child processes). So, if you need its
value for your own purposes, you have to read it before calling
gtk_init().
@@ -541,20 +541,20 @@ nevertheless.
<inlinegraphic fileref="inspector.png" format="PNG"></inlinegraphic>
<para>
GTK+ includes an interactive debugger, called the GTK+ Inspector, which
lets you explore the widget tree of any GTK+ application at runtime, as
GTK includes an interactive debugger, called the GTK Inspector, which
lets you explore the widget tree of any GTK application at runtime, as
well as tweak the theme and trigger visual debugging aids. You can
easily try out changes at runtime before putting them into the code.
</para>
<para>
Note that the GTK+ inspector can only show GTK+ internals. It can not
understand the application-specific logic of a GTK+ application. Also,
the fact that the GTK+ inspector is running in the application process
Note that the GTK inspector can only show GTK internals. It can not
understand the application-specific logic of a GTK application. Also,
the fact that the GTK inspector is running in the application process
limits what it can do. It is meant as a complement to full-blown debuggers
and system tracing facilities such as DTrace, not as a replacement.
</para>
<para>
To enable the GTK+ inspector, you can use the Control-Shift-I or
To enable the GTK inspector, you can use the Control-Shift-I or
Control-Shift-D keyboard shortcuts, or set the
<envar>GTK_DEBUG=interactive</envar> environment variable.
</para>
@@ -567,7 +567,7 @@ nevertheless.
<para>
In some situations, it may be inappropriate to give users access to the
GTK+ inspector. The keyboard shortcuts can be disabled with the
GTK inspector. The keyboard shortcuts can be disabled with the
`enable-inspector-keybinding` key in the `org.gtk.Settings.Debug`
GSettings schema.
</para>

View File

@@ -18,14 +18,14 @@
<title>Conceptual Overview</title>
<para>
GTK+ has an extremely powerful framework for multiline text editing. The
GTK has an extremely powerful framework for multiline text editing. The
primary objects involved in the process are #GtkTextBuffer, which represents the
text being edited, and #GtkTextView, a widget which can display a #GtkTextBuffer.
Each buffer can be displayed by any number of views.
</para>
<para>
One of the important things to remember about text in GTK+ is that it's in the
One of the important things to remember about text in GTK is that it's in the
UTF-8 encoding. This means that one character can be encoded as multiple
bytes. Character counts are usually referred to as
<firstterm>offsets</firstterm>, while byte counts are called
@@ -197,7 +197,7 @@ foreground color &mdash; use CSS to override their default values.
<para>
The <application>gtk-demo</application> application that comes with
GTK+ contains more example code for #GtkTextView.
GTK contains more example code for #GtkTextView.
</para>
</refsect1>

Some files were not shown because too many files have changed in this diff Show More