Compare commits

..

269 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
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
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
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
Daniel Boles
a350192ea2 EventControllerKey: Add missing documentation bits 2018-12-14 23:28:54 +00: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
549 changed files with 39546 additions and 44521 deletions

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);
}

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

@@ -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>
@@ -179,7 +178,6 @@
<file>links.c</file>
<file>listbox.c</file>
<file>list_store.c</file>
<file>listview.c</file>
<file>markup.c</file>
<file>menus.c</file>
<file>modelbutton.c</file>
@@ -224,11 +222,6 @@
<file>messages.txt</file>
<file>apple-red.png</file>
</gresource>
<gresource prefix="/listview">
<file>listview.ui</file>
<file>messages.txt</file>
<file>apple-red.png</file>
</gresource>
<gresource prefix="/popover">
<file>popover.ui</file>
</gresource>

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

@@ -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

@@ -9,11 +9,16 @@
#include <stdlib.h>
#include <string.h>
#include "message.h"
static GdkPixbuf *avatar_pixbuf_other;
static GtkWidget *window = NULL;
#define GTK_TYPE_MESSAGE (gtk_message_get_type ())
#define GTK_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_CAST ((message), GTK_TYPE_MESSAGE, GtkMessage))
#define GTK_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE, GtkMessageClass))
#define GTK_IS_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_TYPE ((message), GTK_TYPE_MESSAGE))
#define GTK_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE))
#define GTK_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE, GtkMessageClass))
#define GTK_TYPE_MESSAGE_ROW (gtk_message_row_get_type ())
#define GTK_MESSAGE_ROW(message_row) (G_TYPE_CHECK_INSTANCE_CAST ((message_row), GTK_TYPE_MESSAGE_ROW, GtkMessageRow))
#define GTK_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE_ROW, GtkMessageRowClass))
@@ -21,10 +26,33 @@ static GtkWidget *window = NULL;
#define GTK_IS_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE_ROW))
#define GTK_MESSAGE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE_ROW, GtkMessageRowClass))
typedef struct _GtkMessage GtkMessage;
typedef struct _GtkMessageClass GtkMessageClass;
typedef struct _GtkMessageRow GtkMessageRow;
typedef struct _GtkMessageRowClass GtkMessageRowClass;
typedef struct _GtkMessageRowPrivate GtkMessageRowPrivate;
struct _GtkMessage
{
GObject parent;
guint id;
char *sender_name;
char *sender_nick;
char *message;
gint64 time;
guint reply_to;
char *resent_by;
int n_favorites;
int n_reshares;
};
struct _GtkMessageClass
{
GObjectClass parent_class;
};
struct _GtkMessageRow
{
GtkListBoxRow parent;
@@ -55,10 +83,84 @@ struct _GtkMessageRowPrivate
GtkButton *expand_button;
};
GType gtk_message_get_type (void) G_GNUC_CONST;
GType gtk_message_row_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (GtkMessage, gtk_message, G_TYPE_OBJECT);
static void
gtk_message_finalize (GObject *obj)
{
GtkMessage *msg = GTK_MESSAGE (obj);
g_free (msg->sender_name);
g_free (msg->sender_nick);
g_free (msg->message);
g_free (msg->resent_by);
G_OBJECT_CLASS (gtk_message_parent_class)->finalize (obj);
}
static void
gtk_message_class_init (GtkMessageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_message_finalize;
}
static void
gtk_message_init (GtkMessage *msg)
{
}
static void
gtk_message_parse (GtkMessage *msg, const char *str)
{
char **strv;
int i;
strv = g_strsplit (str, "|", 0);
i = 0;
msg->id = strtol (strv[i++], NULL, 10);
msg->sender_name = g_strdup (strv[i++]);
msg->sender_nick = g_strdup (strv[i++]);
msg->message = g_strdup (strv[i++]);
msg->time = strtol (strv[i++], NULL, 10);
if (strv[i])
{
msg->reply_to = strtol (strv[i++], NULL, 10);
if (strv[i])
{
if (*strv[i])
msg->resent_by = g_strdup (strv[i]);
i++;
if (strv[i])
{
msg->n_favorites = strtol (strv[i++], NULL, 10);
if (strv[i])
{
msg->n_reshares = strtol (strv[i++], NULL, 10);
}
}
}
}
g_strfreev (strv);
}
static GtkMessage *
gtk_message_new (const char *str)
{
GtkMessage *msg;
msg = g_object_new (gtk_message_get_type (), NULL);
gtk_message_parse (msg, str);
return msg;
}
G_DEFINE_TYPE_WITH_PRIVATE (GtkMessageRow, gtk_message_row, GTK_TYPE_LIST_BOX_ROW);
static void
gtk_message_row_update (GtkMessageRow *row)
{
@@ -231,48 +333,15 @@ row_activated (GtkListBox *listbox, GtkListBoxRow *row)
gtk_message_row_expand (GTK_MESSAGE_ROW (row));
}
static void
update_count (GtkListBox *listbox, GtkLabel *label)
{
GList *children = gtk_container_get_children (GTK_CONTAINER (listbox));
guint n_items = g_list_length (children);
g_list_free (children);
char *text = g_strdup_printf ("%u rows", n_items);
gtk_label_set_label (label, text);
g_free (text);
}
static GtkWidget *header_label;
static void
add_more (GtkListBox *listbox)
{
GBytes *data;
char **lines;
int i;
data = g_resources_lookup_data ("/listbox/messages.txt", 0, NULL);
lines = g_strsplit (g_bytes_get_data (data, NULL), "\n", 0);
for (i = 0; lines[i] != NULL && *lines[i]; i++)
{
GtkMessage *message = gtk_message_new (lines[i]);
GtkMessageRow *row = gtk_message_row_new (message);
gtk_container_add (GTK_CONTAINER (listbox), GTK_WIDGET (row));
}
g_strfreev (lines);
g_bytes_unref (data);
update_count (listbox, GTK_LABEL (header_label));
}
GtkWidget *
do_listbox (GtkWidget *do_widget)
{
GtkWidget *scrolled, *listbox, *vbox, *label;
GtkWidget *header, *more;
GtkMessage *message;
GtkMessageRow *row;
GBytes *data;
char **lines;
int i;
if (!window)
{
@@ -281,43 +350,43 @@ do_listbox (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
gtk_window_set_title (GTK_WINDOW (window), "List Box");
gtk_window_set_default_size (GTK_WINDOW (window),
400, 600);
/* NULL window variable when window is closed */
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
listbox = gtk_list_box_new ();
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "List View");
header_label = gtk_label_new ("");
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), header_label);
more = gtk_button_new_from_icon_name ("list-add");
g_signal_connect_swapped (more, "clicked", G_CALLBACK (add_more), listbox);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), more);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
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);
gtk_list_box_set_sort_func (GTK_LIST_BOX (listbox), (GtkListBoxSortFunc)gtk_message_row_sort, listbox, NULL);
gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (listbox), FALSE);
g_signal_connect (listbox, "row-activated", G_CALLBACK (row_activated), NULL);
add_more (listbox);
update_count (listbox, header_label);
data = g_resources_lookup_data ("/listbox/messages.txt", 0, NULL);
lines = g_strsplit (g_bytes_get_data (data, NULL), "\n", 0);
for (i = 0; lines[i] != NULL && *lines[i]; i++)
{
message = gtk_message_new (lines[i]);
row = gtk_message_row_new (message);
gtk_widget_show (GTK_WIDGET (row));
gtk_container_add (GTK_CONTAINER (listbox), GTK_WIDGET (row));
}
g_strfreev (lines);
g_bytes_unref (data);
}
if (!gtk_widget_get_visible (window))

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

@@ -1,323 +0,0 @@
/* List View
*
* GtkListView allows lists with complicated layouts, using
* models to hold the data, and creating rows on demand.
*/
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include "message.h"
static GdkPixbuf *avatar_pixbuf_other;
static GtkWidget *window = NULL;
#define GTK_TYPE_MSG_ROW (gtk_msg_row_get_type ())
#define GTK_MSG_ROW(msg_row) (G_TYPE_CHECK_INSTANCE_CAST ((msg_row), GTK_TYPE_MSG_ROW, GtkMsgRow))
#define GTK_MSG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MSG_ROW, GtkMsgRowClass))
#define GTK_IS_MSG_ROW(msg_row) (G_TYPE_CHECK_INSTANCE_TYPE ((msg_row), GTK_TYPE_MSG_ROW))
#define GTK_IS_MSG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MSG_ROW))
#define GTK_MSG_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MSG_ROW, GtkMsgRowClass))
typedef struct _GtkMsgRow GtkMsgRow;
typedef struct _GtkMsgRowClass GtkMsgRowClass;
struct _GtkMsgRow
{
GtkBin parent;
GtkMessage *message;
GtkRevealer *details_revealer;
GtkImage *avatar_image;
GtkWidget *extra_buttons_box;
GtkLabel *content_label;
GtkLabel *source_name;
GtkLabel *source_nick;
GtkLabel *short_time_label;
GtkLabel *detailed_time_label;
GtkBox *resent_box;
GtkLinkButton *resent_by_button;
GtkLabel *n_favorites_label;
GtkLabel *n_reshares_label;
GtkButton *expand_button;
};
struct _GtkMsgRowClass
{
GtkBinClass parent_class;
};
static GType gtk_msg_row_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (GtkMsgRow, gtk_msg_row, GTK_TYPE_BIN);
static void
gtk_msg_row_update (GtkMsgRow *row)
{
GDateTime *t;
char *s;
gtk_label_set_text (row->source_name, row->message->sender_name);
gtk_label_set_text (row->source_nick, row->message->sender_nick);
gtk_label_set_text (row->content_label, row->message->message);
t = g_date_time_new_from_unix_utc (row->message->time);
s = g_date_time_format (t, "%e %b %y");
gtk_label_set_text (row->short_time_label, s);
g_free (s);
s = g_date_time_format (t, "%X - %e %b %Y");
gtk_label_set_text (row->detailed_time_label, s);
g_free (s);
g_date_time_unref (t);
gtk_widget_set_visible (GTK_WIDGET(row->n_favorites_label),
row->message->n_favorites != 0);
s = g_strdup_printf ("<b>%d</b>\nFavorites", row->message->n_favorites);
gtk_label_set_markup (row->n_favorites_label, s);
g_free (s);
gtk_widget_set_visible (GTK_WIDGET(row->n_reshares_label),
row->message->n_reshares != 0);
s = g_strdup_printf ("<b>%d</b>\nReshares", row->message->n_reshares);
gtk_label_set_markup (row->n_reshares_label, s);
g_free (s);
gtk_widget_set_visible (GTK_WIDGET (row->resent_box), row->message->resent_by != NULL);
if (row->message->resent_by)
gtk_button_set_label (GTK_BUTTON (row->resent_by_button), row->message->resent_by);
if (strcmp (row->message->sender_nick, "@GTKtoolkit") == 0)
{
gtk_image_set_from_icon_name (row->avatar_image, "gtk3-demo");
gtk_image_set_icon_size (row->avatar_image, GTK_ICON_SIZE_LARGE);
}
else
gtk_image_set_from_pixbuf (row->avatar_image, avatar_pixbuf_other);
}
static void
gtk_msg_row_expand (GtkMsgRow *row)
{
gboolean expand;
expand = !gtk_revealer_get_reveal_child (row->details_revealer);
gtk_revealer_set_reveal_child (row->details_revealer, expand);
if (expand)
gtk_button_set_label (row->expand_button, "Hide");
else
gtk_button_set_label (row->expand_button, "Expand");
}
static void
expand_clicked (GtkMsgRow *row,
GtkButton *button)
{
gtk_msg_row_expand (row);
}
static void
reshare_clicked (GtkMsgRow *row,
GtkButton *button)
{
row->message->n_reshares++;
gtk_msg_row_update (row);
}
static void
favorite_clicked (GtkMsgRow *row,
GtkButton *button)
{
row->message->n_favorites++;
gtk_msg_row_update (row);
}
static void
gtk_msg_row_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state_flags)
{
GtkMsgRow *row = GTK_MSG_ROW (widget);
GtkStateFlags flags;
flags = gtk_widget_get_state_flags (widget);
gtk_widget_set_visible (row->extra_buttons_box,
flags & (GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED));
GTK_WIDGET_CLASS (gtk_msg_row_parent_class)->state_flags_changed (widget, previous_state_flags);
}
static void
gtk_msg_row_finalize (GObject *obj)
{
G_OBJECT_CLASS (gtk_msg_row_parent_class)->finalize(obj);
}
static void
gtk_msg_row_class_init (GtkMsgRowClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_msg_row_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/listview/listview.ui");
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, content_label);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, source_name);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, source_nick);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, short_time_label);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, detailed_time_label);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, extra_buttons_box);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, details_revealer);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, avatar_image);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, resent_box);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, resent_by_button);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, n_reshares_label);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, n_favorites_label);
gtk_widget_class_bind_template_child (widget_class, GtkMsgRow, expand_button);
gtk_widget_class_bind_template_callback (widget_class, expand_clicked);
gtk_widget_class_bind_template_callback (widget_class, reshare_clicked);
gtk_widget_class_bind_template_callback (widget_class, favorite_clicked);
widget_class->state_flags_changed = gtk_msg_row_state_flags_changed;
}
static void
row_activated (GtkGestureMultiPress *gesture,
int n_press,
double x,
double y,
GtkMsgRow *row)
{
if (n_press == 2)
gtk_msg_row_expand (row);
}
static void
gtk_msg_row_init (GtkMsgRow *row)
{
GtkGesture *double_click;
gtk_widget_init_template (GTK_WIDGET (row));
double_click = gtk_gesture_multi_press_new ();
g_signal_connect (double_click, "pressed", G_CALLBACK (row_activated), row);
gtk_widget_add_controller (GTK_WIDGET (row), GTK_EVENT_CONTROLLER (double_click));
}
static int
gtk_message_sort (gconstpointer a, gconstpointer b, gpointer data)
{
return ((const GtkMessage *)b)->time - ((const GtkMessage *)a)->time;
}
static void
bind_msg_row (GObject *list_item, GParamSpec *pspec, gpointer data)
{
GtkMessage *message = (GtkMessage *)gtk_list_item_get_item (GTK_LIST_ITEM (list_item));
GtkMsgRow *row = (GtkMsgRow *) gtk_bin_get_child (GTK_BIN (list_item));
row->message = message;
if (message)
gtk_msg_row_update (row);
}
static void
setup_row (GtkListItem *item,
gpointer data)
{
g_signal_connect (item, "notify::item", G_CALLBACK (bind_msg_row), data);
gtk_container_add (GTK_CONTAINER (item), g_object_new (gtk_msg_row_get_type (), NULL));
}
static void
update_count (GListModel *model, guint position, guint removed, guint added, GtkLabel *label)
{
guint n_items = g_list_model_get_n_items (model);
char *text = g_strdup_printf ("%u rows", n_items);
gtk_label_set_label (label, text);
g_free (text);
}
static void
add_more (GListModel *model)
{
GBytes *data;
char **lines;
int i;
data = g_resources_lookup_data ("/listview/messages.txt", 0, NULL);
lines = g_strsplit (g_bytes_get_data (data, NULL), "\n", 0);
for (i = 0; lines[i] != NULL && *lines[i]; i++)
{
GtkMessage *message = gtk_message_new (lines[i]);
g_list_store_append (G_LIST_STORE (model), message);
}
g_strfreev (lines);
g_bytes_unref (data);
}
GtkWidget *
do_listview (GtkWidget *do_widget)
{
GtkWidget *scrolled, *listview, *vbox, *label;
GtkWidget *header, *header_label, *more;
GListModel *model;
if (!window)
{
avatar_pixbuf_other = gdk_pixbuf_new_from_resource_at_scale ("/listbox/apple-red.png", 32, 32, FALSE, NULL);
model = G_LIST_MODEL (g_list_store_new (gtk_message_get_type ()));
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
/* NULL window variable when window is closed */
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "List View");
header_label = gtk_label_new ("");
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), header_label);
more = gtk_button_new_from_icon_name ("list-add");
g_signal_connect_swapped (more, "clicked", G_CALLBACK (add_more), model);
g_signal_connect (model, "items-changed", G_CALLBACK (update_count), header_label);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), more);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
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);
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);
listview = gtk_list_view_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listview);
gtk_list_view_set_functions (GTK_LIST_VIEW (listview), setup_row, NULL, NULL, NULL);
gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (gtk_sort_list_model_new (model, gtk_message_sort, NULL, NULL)));
add_more (model);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@@ -1,302 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<!-- interface-requires gtk+ 3.10 -->
<!-- interface-requires gtkdemo 3.10 -->
<object class="GtkMenu" id="menu1">
<child>
<object class="GtkMenuItem" id="menuitem1">
<property name="label" translatable="yes">Email message</property>
<property name="use-underline">1</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem2">
<property name="label" translatable="yes">Embed message</property>
<property name="use-underline">1</property>
</object>
</child>
</object>
<template class="GtkMsgRow" parent="GtkBin">
<child>
<object class="GtkGrid" id="grid1">
<property name="hexpand">1</property>
<child>
<object class="GtkImage" id="avatar_image">
<property name="width-request">32</property>
<property name="height-request">32</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<property name="margin-start">8</property>
<property name="margin-end">8</property>
<property name="icon-name">image-missing</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="height">5</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="hexpand">1</property>
<property name="baseline-position">top</property>
<child>
<object class="GtkButton" id="button2">
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="valign">baseline</property>
<property name="relief">none</property>
<child>
<object class="GtkLabel" id="source_name">
<property name="valign">baseline</property>
<property name="label" translatable="0">Username</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="source_nick">
<property name="valign">baseline</property>
<property name="label" translatable="0">@nick</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="short_time_label">
<property name="valign">baseline</property>
<property name="label" translatable="yes">38m</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="content_label">
<property name="halign">start</property>
<property name="valign">start</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="0">Message</property>
<property name="wrap">1</property>
<accessibility>
<role type="static"/>
</accessibility>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="resent_box">
<child>
<object class="GtkImage" id="image2">
<property name="icon-name">media-playlist-repeat</property>
</object>
</child>
<child>
<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">
<property name="label" translatable="0">reshareer</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box3">
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="expand_button">
<property name="label" translatable="yes">Expand</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="relief">none</property>
<signal name="clicked" handler="expand_clicked" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkBox" id="extra_buttons_box">
<property name="visible">0</property>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="reply-button">
<property name="label" translatable="yes">Reply</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="relief">none</property>
</object>
</child>
<child>
<object class="GtkButton" id="reshare-button">
<property name="label" translatable="yes">Reshare</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<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">
<property name="label" translatable="yes">Favorite</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<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">
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="relief">none</property>
<property name="popup">menu1</property>
<child>
<object class="GtkLabel" id="label7">
<property name="label" translatable="yes">More...</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="details_revealer">
<child>
<object class="GtkBox" id="box5">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box7">
<property name="margin-top">2</property>
<property name="margin-bottom">2</property>
<property name="spacing">8</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="shadow-type">none</property>
<child>
<object class="GtkLabel" id="n_reshares_label">
<property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt;
Reshares</property>
<property name="use-markup">1</property>
</object>
</child>
<child type="label_item"/>
</object>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="shadow-type">none</property>
<child>
<object class="GtkLabel" id="n_favorites_label">
<property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt;
FAVORITES</property>
<property name="use-markup">1</property>
</object>
</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">
<child>
<object class="GtkLabel" id="detailed_time_label">
<property name="label" translatable="0">4:25 AM - 14 Jun 13 </property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="button5">
<property name="label" translatable="yes">Details</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="relief">none</property>
<style>
<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>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
</object>
</child>
</template>
</interface>

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);
}

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',
@@ -36,7 +35,6 @@ demos = files([
'infobar.c',
'links.c',
'listbox.c',
'listview.c',
'flowbox.c',
'list_store.c',
'markup.c',
@@ -77,7 +75,7 @@ demos = files([
gtkdemo_deps = [ libgtk_dep, ]
extra_demo_sources = files(['main.c', 'gtkfishbowl.c', 'fontplane.c', 'gtkgears.c', 'puzzlepiece.c', 'message.c'])
extra_demo_sources = files(['main.c', 'gtkfishbowl.c', 'fontplane.c', 'gtkgears.c', 'puzzlepiece.c'])
if harfbuzz_dep.found() and pangoft_dep.found()
demos += files('font_features.c')

View File

@@ -1,79 +0,0 @@
#include <gtk/gtk.h>
#include "message.h"
#include <stdlib.h>
#include <string.h>
G_DEFINE_TYPE (GtkMessage, gtk_message, G_TYPE_OBJECT);
static void
gtk_message_finalize (GObject *obj)
{
GtkMessage *msg = GTK_MESSAGE (obj);
g_free (msg->sender_name);
g_free (msg->sender_nick);
g_free (msg->message);
g_free (msg->resent_by);
G_OBJECT_CLASS (gtk_message_parent_class)->finalize (obj);
}
static void
gtk_message_class_init (GtkMessageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_message_finalize;
}
static void
gtk_message_init (GtkMessage *msg)
{
}
static void
gtk_message_parse (GtkMessage *msg, const char *str)
{
char **strv;
int i;
strv = g_strsplit (str, "|", 0);
i = 0;
msg->id = strtol (strv[i++], NULL, 10);
msg->sender_name = g_strdup (strv[i++]);
msg->sender_nick = g_strdup (strv[i++]);
msg->message = g_strdup (strv[i++]);
msg->time = strtol (strv[i++], NULL, 10);
if (strv[i])
{
msg->reply_to = strtol (strv[i++], NULL, 10);
if (strv[i])
{
if (*strv[i])
msg->resent_by = g_strdup (strv[i]);
i++;
if (strv[i])
{
msg->n_favorites = strtol (strv[i++], NULL, 10);
if (strv[i])
{
msg->n_reshares = strtol (strv[i++], NULL, 10);
}
}
}
}
g_strfreev (strv);
}
GtkMessage *
gtk_message_new (const char *str)
{
GtkMessage *msg;
msg = g_object_new (gtk_message_get_type (), NULL);
gtk_message_parse (msg, str);
return msg;
}

View File

@@ -1,34 +0,0 @@
#pragma once
#define GTK_TYPE_MESSAGE (gtk_message_get_type ())
#define GTK_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_CAST ((message), GTK_TYPE_MESSAGE, GtkMessage))
#define GTK_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE, GtkMessageClass))
#define GTK_IS_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_TYPE ((message), GTK_TYPE_MESSAGE))
#define GTK_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE))
#define GTK_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE, GtkMessageClass))
typedef struct _GtkMessage GtkMessage;
typedef struct _GtkMessageClass GtkMessageClass;
struct _GtkMessage
{
GObject parent;
guint id;
char *sender_name;
char *sender_nick;
char *message;
gint64 time;
guint reply_to;
char *resent_by;
int n_favorites;
int n_reshares;
};
struct _GtkMessageClass
{
GObjectClass parent_class;
};
GType gtk_message_get_type (void) G_GNUC_CONST;
GtkMessage * gtk_message_new (const char *str);

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

@@ -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

@@ -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

@@ -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

@@ -407,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>
@@ -472,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">
@@ -486,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">
@@ -497,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">
@@ -519,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">
@@ -588,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">
@@ -599,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">
@@ -610,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>
@@ -806,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">
@@ -828,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">
@@ -839,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">
@@ -851,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">
@@ -866,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">
@@ -882,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">
@@ -892,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">
@@ -903,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">
@@ -923,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">
@@ -976,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">
@@ -1008,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>
@@ -1039,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">
@@ -1066,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">
@@ -1092,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>
@@ -1129,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">
@@ -1187,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">
@@ -1203,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">
@@ -1219,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">
@@ -1335,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">
@@ -1379,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">
@@ -1463,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">
@@ -1519,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">
@@ -1575,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>
@@ -3057,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>
@@ -3090,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>
@@ -3151,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"/>
@@ -3289,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">
@@ -3328,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">
@@ -3449,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>
@@ -50,24 +50,24 @@
<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,7 +151,7 @@
</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="@SRC_DIR@/examples/hello-world.c" parse="text">
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
@@ -160,7 +160,7 @@
<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>
@@ -238,7 +238,7 @@
<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,7 +250,7 @@
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>
@@ -264,7 +264,7 @@
<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>
@@ -368,7 +368,7 @@
</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>
@@ -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>
@@ -1007,7 +1007,7 @@ 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>
@@ -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>
@@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win)
<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>
@@ -71,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>
@@ -83,14 +82,12 @@
<xi:include href="xml/gtkrevealer.xml" />
<xi:include href="xml/gtklistbox.xml" />
<xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtklistview.xml" />
<xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" />
<xi:include href="xml/gtkstacksidebar.xml" />
<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" />
@@ -331,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" />
@@ -346,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" />
@@ -357,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>
@@ -374,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" />
@@ -388,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
@@ -466,44 +435,6 @@ GTK_TYPE_SELECTION_MODEL
gtk_selection_model_get_type
</SECTION>
<SECTION>
<FILE>gtklistitem</FILE>
<TITLE>GtkListItem</TITLE>
GtkListItem
gtk_list_item_get_item
gtk_list_item_get_position
gtk_list_item_get_selected
gtk_list_item_get_selectable
gtk_list_item_set_selectable
<SUBSECTION Standard>
GTK_LIST_ITEM
GTK_LIST_ITEM_CLASS
GTK_LIST_ITEM_GET_CLASS
GTK_IS_LIST_ITEM
GTK_IS_LIST_ITEM_CLASS
GTK_TYPE_LIST_ITEM
<SUBSECTION Private>
gtk_list_item_get_type
</SECTION>
<SECTION>
<FILE>gtklistview</FILE>
<TITLE>GtkListView</TITLE>
GtkListView
gtk_list_view_new
gtk_list_view_set_model
gtk_list_view_get_model
<SUBSECTION Standard>
GTK_LIST_VIEW
GTK_LIST_VIEW_CLASS
GTK_LIST_VIEW_GET_CLASS
GTK_IS_LIST_VIEW
GTK_IS_LIST_VIEW_CLASS
GTK_TYPE_LIST_VIEW
<SUBSECTION Private>
gtk_list_view_get_type
</SECTION>
<SECTION>
<FILE>gtkbuildable</FILE>
GtkBuildable
@@ -1679,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>
@@ -3424,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
@@ -5438,7 +5351,6 @@ GtkPrintOperationPrivate
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintunixdialog</FILE>
<TITLE>GtkPrintUnixDialog</TITLE>
GtkPrintUnixDialog
@@ -5786,7 +5698,6 @@ gtk_print_context_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintjob</FILE>
<TITLE>GtkPrintJob</TITLE>
GtkPrintJob
@@ -5838,7 +5749,6 @@ gtk_print_job_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkpagesetupunixdialog</FILE>
<TITLE>GtkPageSetupUnixDialog</TITLE>
GtkPageSetupUnixDialog

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
@@ -91,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',
@@ -412,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>

View File

@@ -17,7 +17,7 @@
<refsect1>
<title>Overview</title>
<para>
To create a tree or list in GTK+, use the #GtkTreeModel interface in
To create a tree or list in GTK, use the #GtkTreeModel interface in
conjunction with the #GtkTreeView widget. This widget is
designed around a <firstterm>Model/View/Controller</firstterm>
design and consists of four major parts:
@@ -46,7 +46,7 @@
<refsect1>
<title>Creating a model</title>
<para>
GTK+ provides two simple models that can be used: the #GtkListStore
GTK provides two simple models that can be used: the #GtkListStore
and the #GtkTreeStore. GtkListStore is used to model list widgets,
while the GtkTreeStore models trees. It is possible to develop a new
type of model, but the existing models should be satisfactory for all
@@ -164,7 +164,7 @@ tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
</para>
<para>
Cell renderers are used to draw the data in the tree model in a
way. There are a number of cell renderers that come with GTK+,
way. There are a number of cell renderers that come with GTK,
including the #GtkCellRendererText, #GtkCellRendererPixbuf and
the #GtkCellRendererToggle.
It is relatively easy to write a custom renderer.

View File

@@ -4,23 +4,23 @@
]>
<refentry id="gtk-wayland">
<refmeta>
<refentrytitle>Using GTK+ with Wayland</refentrytitle>
<refentrytitle>Using GTK with Wayland</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ with Wayland</refname>
<refname>Using GTK with Wayland</refname>
<refpurpose>
Wayland-specific aspects of using GTK+
Wayland-specific aspects of using GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ with Wayland</title>
<title>Using GTK with Wayland</title>
<para>
The GDK Wayland backend provides support for running GTK+ applications
The GDK Wayland backend provides support for running GTK applications
under the Wayland display server. To run your application in this way,
select the Wayland backend by setting <literal>GDK_BACKEND=wayland</literal>.
</para>

View File

@@ -4,24 +4,24 @@
]>
<refentry id="gtk-windows">
<refmeta>
<refentrytitle>Using GTK+ on Windows</refentrytitle>
<refentrytitle>Using GTK on Windows</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ on Windows</refname>
<refname>Using GTK on Windows</refname>
<refpurpose>
Windows-specific aspects of using GTK+
Windows-specific aspects of using GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ on Windows</title>
<title>Using GTK on Windows</title>
<para>
The Windows port of GTK+ is an implementation of GDK (and therefore GTK+)
on top of the Win32 API. When compiling GTK+ on Windows, this backend is
The Windows port of GTK is an implementation of GDK (and therefore GTK)
on top of the Win32 API. When compiling GTK on Windows, this backend is
the default.
</para>
@@ -82,7 +82,7 @@ additional environment variables.
<title><envar>GDK_IGNORE_WINTAB</envar></title>
<para>
If this variable is set, GTK+ doesn't use
If this variable is set, GTK doesn't use
the Wintab API for tablet support.
</para>
</formalpara>
@@ -91,7 +91,7 @@ the Wintab API for tablet support.
<title><envar>GDK_USE_WINTAB</envar></title>
<para>
If this variable is set, GTK+ uses the Wintab API for
If this variable is set, GTK uses the Wintab API for
tablet support. This is the default.
</para>
</formalpara>
@@ -120,7 +120,7 @@ When any other cursor theme is used, GTK will prefer cursors from that theme,
falling back to Windows cursors and built-in X cursors.
</para>
<para>
Theme can be changed by setting <literal>gtk-cursor-theme-name</literal> GTK+ setting. Users can override GTK+ settings in the <filename>settings.ini</filename> file or at runtime in the GTK+ Inspector.
Theme can be changed by setting <literal>gtk-cursor-theme-name</literal> GTK setting. Users can override GTK settings in the <filename>settings.ini</filename> file or at runtime in the GTK Inspector.
</para>
<para>
Themes are loaded from normal Windows variants of the XDG locations:
@@ -135,9 +135,9 @@ The <literal>gtk-cursor-theme-size</literal> setting is ignored, GTK will use th
</refsect2>
<para>
More information about GTK+ on Windows, including detailed build
More information about GTK on Windows, including detailed build
instructions, binary downloads, etc, can be found
<ulink url="https://wiki.gnome.org/Projects/GTK+/Win32">online</ulink>.
<ulink url="https://wiki.gnome.org/Projects/GTK/Win32">online</ulink>.
</para>
</refsect1>

View File

@@ -4,23 +4,23 @@
]>
<refentry id="gtk-x11">
<refmeta>
<refentrytitle>Using GTK+ on the X Window System</refentrytitle>
<refentrytitle>Using GTK on the X Window System</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ on the X Window System</refname>
<refname>Using GTK on the X Window System</refname>
<refpurpose>
X11-specific aspects of using GTK+
X11-specific aspects of using GTK
</refpurpose>
</refnamediv>
<refsect1>
<title>GTK+ for the X Window System</title>
<title>GTK for the X Window System</title>
<para>
On UNIX, the X backend is the default build for GTK+.
On UNIX, the X backend is the default build for GTK.
So you don't need to do anything special when compiling it,
and everything should "just work."
</para>
@@ -145,7 +145,7 @@ url="http://www.freedesktop.org/standards/">convention</ulink>.
</para>
<para>
GTK+ has functions for asking the window manager to do various things;
GTK has functions for asking the window manager to do various things;
see for example <link
linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link
linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link

View File

@@ -1,8 +1,8 @@
The doc shooter is used to take screenshots of widgets for the GTK+
The doc shooter is used to take screenshots of widgets for the GTK
reference manuals. We use these images for both the headers of the
images, and for the visual index of GNOME images. They aren't part of
the docs build. Instead, the images are taken, and then copied by hand
into gtk+/docs/reference/gtk/images/
into gtk/docs/reference/gtk/images/
Ideally, the images should be taken once a release, and all images
should be updated at the same time. A simple theme should be used to

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