Compare commits

..

452 Commits

Author SHA1 Message Date
Timm Bäder
184424ae40 treeview: Remove the pixel cache
This has caused numerous issues for users, especially in the
filechooser, which have not been fixed in all the years since the pixel
cache has been introduced.

If anyone seriously has complaints about the treeview performance (and
those did not exist with the pixel cache), feel free to revert this
commit *and* fix the pixel cache issues.

Closes #503
Closes #1691
Closes #466
2019-05-21 19:09:18 +02:00
Christoph Reiter
9711c2ad45 Merge branch 'remove-mingw-SetupDiGetDevicePropertyW-check-3-24' into 'gtk-3-24'
build: Remove mingw check for SetupDiGetDevicePropertyW

See merge request GNOME/gtk!862
2019-05-21 15:11:04 +00:00
Emmanuele Bassi
d449a9e657 Merge branch 'issue-302' into 'gtk-3-24'
docs: Fix the override for GdkAtom

See merge request GNOME/gtk!863
2019-05-21 13:46:46 +00:00
Emmanuele Bassi
ac490ee8a4 docs: Fix the override for GdkAtom
GdkAtom is a typedef to a pointer to an opaque structure. We need to
tell GTK-Doc how to override it, so that the documentation is accurate.

Fixes: #302
2019-05-21 14:27:33 +01:00
Christoph Reiter
6536646720 build: Remove mingw check for SetupDiGetDevicePropertyW
It was mssing when the check was added in 2016, but was fixed upstream
in https://github.com/mirror/mingw-w64/commit/9ef49367378c50553943bd
shortly after.

Assume everyone has updated by now.

See !861 for a related change on the master branch.
2019-05-21 09:18:55 +02:00
John Ralls
4d7d44c717 Replace obsolete GdkScreen-based method of finding the toplevel at point.
With the more current GdkDisplay function.
Also separate the if statements with blank lines.
2019-05-20 14:35:32 -07:00
John Ralls
9c33adf118 Don't call g_object_ref on NULL, it whines.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1822
2019-05-20 14:35:32 -07:00
Timm Bäder
1a29a2f03f Merge branch 'fix-non-csd-menu-corners-gtk3' into 'gtk-3-24'
Adwaita: Don't round the non-csd menu corners (GTK3)

See merge request GNOME/gtk!834
2019-05-17 13:45:50 +00:00
Matthias Clasen
9cde2186bf emoji chooser: populate incrementally
It takes half a second on my system to initially
populate the Emoji chooser. That is too long. Do
the work in 8 millisecond chunks to give GTK a
chance to get some frames done.
2019-05-16 17:14:04 +00:00
nana-4
d942a31750 Adwaita: Don't round the non-csd menu corners
Otherwise, the menu will have ugly black corners.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1661
2019-05-12 17:41:41 +09:00
Marek Kašík
be271db028 Merge branch 'cups-deprecation-warnings-3-24' into 'gtk-3-24'
Cups deprecation warnings for gtk-3-24

See merge request GNOME/gtk!833
2019-05-10 15:46:45 +00:00
Marek Kasik
4e804ff4a7 Require CUPS >= 2.0 in configure.ac
Require CUPS 2.0 and newer to simplify code.
This removes all ifdefs dependent on CUPS version.
2019-05-10 16:40:58 +02:00
Emmanuele Bassi
a7e207abe2 Require CUPS >= 2.0
Drop support for versions of CUPS < 2.0, to simplify the backend code
and drop a lot of conditional blocks.
2019-05-10 16:40:58 +02:00
Emmanuele Bassi
9236ee0564 cups: Use non-deprecated API
The http* family of functions was deprecated after CUPS 1.7. We can
conditionally use it when built against a newer version of CUPS. The
additional parameters are taken directly from the fallback values
inside CUPS itself.
2019-05-10 16:40:58 +02:00
Emmanuele Bassi
91cc9b58f3 Detect CUPS ≥ 1.7
We support CUPS ≥ 1.2, but we use API that was introduced and deprecated
at a later point.
2019-05-10 16:40:58 +02:00
Matthias Clasen
7bd9cdc8fb Merge branch 'gdk-win32-unimplement-vfuncs-3.24' into 'gtk-3-24'
GdkSurface - Don't call unimplemented NULL set_startup_id() vfunc on Win32

See merge request GNOME/gtk!826
2019-05-07 15:01:45 +00:00
Sebastian Dröge
02d4fbe29e GdkWindow - Don't call unimplemented NULL set_startup_id() vfunc on Win32
GdkWindow::set_startup_id() is NULL on Win32 and would cause a segfault
if called.

While the documentation of the main caller of set_startup_id(),
gtk_window_set_startup_id(), mentions that it's not implemented on
Windows it can still be automatically called via Glade and simply doing
nothing on Win32 is going to be less disruptive than a segfault.
2019-05-07 10:04:01 +03:00
Fabio Tomat
8af587c189 Update Friulian translation 2019-05-06 16:55:44 +00:00
Matthias Clasen
60f9dbf676 Merge branch 'header-bar-leak3' into 'gtk-3-24'
GtkHeaderBar: Don't leak decoration layout

See merge request GNOME/gtk!823
2019-05-06 14:17:05 +00:00
Guido Günther
b1b9de6836 GtkHeaderBar: Don't leak decoration layout
Currently we leak priv->decoration_layout if the layout is set
multiple times.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2019-05-06 13:14:02 +02:00
Matthias Clasen
2957b86f72 Add a reftest for multiple font families
This tests that listing multiple font
families in the css font-family property
works as expected.
2019-05-03 16:38:22 -04:00
Matthias Clasen
4f9ea5e54b css: Use multiple font-family values
Pango API to support this, so we can implement
this very easily.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1854
2019-05-03 16:38:13 -04:00
Matthias Clasen
4273b6ad92 Merge branch 'wip/ernestask/tree-view-rubberband-null-node' into 'gtk-3-24'
treeview: Draw rubber band rectangle more often

See merge request GNOME/gtk!803
2019-05-01 21:20:33 +00:00
Ernestas Kulik
b558f7c9ee treeview: Draw rubber band rectangle more often
If the cursor coordinates are outside of the content (the GtkRBTree),
gtk_tree_view_bin_draw() will return and not draw the rubber band
rectangle.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1859
2019-05-01 22:18:50 +02:00
Rico Tzschichholz
c860a2db85 Add a few placeholder documentation block to have g-i annotations 2019-05-01 15:06:15 +02:00
Matthias Clasen
fbf88d285e Merge branch 'xdg-output-3-24' into 'gtk-3-24'
[3.24] wayland: Add support for xdg-output

See merge request GNOME/gtk!750
2019-05-01 03:35:19 +00:00
Chun-wei Fan
56cfc65909 Merge branch 'ime-preedit-hidpi-3' into 'gtk-3-24'
gtkimcontextime.c: Fix preedit window placement on HiDPI

See merge request GNOME/gtk!775
2019-04-30 03:37:59 +00:00
Jakub Steiner
c734c7e918 Adwaita: tone down lowres icon aid
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1818
2019-04-29 15:07:10 +02:00
Matthias Clasen
09bdd4531a Merge branch 'textbuf-serialize-fix-format-string' into 'gtk-3-24'
GtkTextBufferSerialize: Check and fix format string arguments

See merge request GNOME/gtk!779
2019-04-27 13:17:20 +00:00
Felix Riemann
370d8242e7 GtkTextBufferSerialize: Add missing format string argument
The format string has two string parameters however only one was supplied.
2019-04-27 14:41:48 +02:00
Felix Riemann
0dcbbc3344 GtkTextBufferSerialize: Add G_GNUC_PRINTF() to set_error()
This allows the compiler to warn if format string and arguments do not match.
2019-04-27 14:36:35 +02:00
Chun-wei Fan
c073a062b6 gtkimcontextime.c: Fix preedit window placement on HiDPI
We must also take the scaling factor into account for placing the IME
preedit window that is often used for Chinese and Japanese input on
Windows.
2019-04-25 12:15:43 +08:00
Matthias Clasen
abb43f3364 Merge branch 'fix-dnd-macos' into 'gtk-3-24'
quartz: Add missing g_object_ref

See merge request GNOME/gtk!768
2019-04-23 01:24:50 +00:00
James Westman
b7ec3b163f quartz: Add missing g_object_ref
A g_object_ref() call was missing, sometimes causing crashes during
drag-and-drop operations. The matching g_object_unref() is at
gdk/gdkdnd.c:261.

The logic in this function is still wrong--it finds the wrong GdkWindow under
some circumstances--but this commit fixes the crash.

Part of #1840.
2019-04-22 19:59:14 -05:00
Matthias Clasen
a7c5f26d24 Merge branch 'wip/carlosg/tablet-cursors-hidpi' into 'gtk-3-24'
gdk/wayland: Listen to wl_surface events on tablet cursors

See merge request GNOME/gtk!759
2019-04-18 16:55:54 +00:00
Carlos Garnacho
e9757b9afc gdk/wayland: Listen to wl_surface events on tablet cursors
And update the surface accordingly (eg. scale on hidpi). The mechanism
that did that for wl_pointer has been made generic so it can be shared
with tablets too.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1675
2019-04-18 18:05:19 +02:00
Jonas Ådahl
ceeb55eac2 Merge branch 'wayland-hotspot-3' into 'gtk-3-24'
wayland: Avoid using uninitialized memory

See merge request GNOME/gtk!758
2019-04-18 14:54:02 +00:00
Matthias Clasen
ac739b2a72 wayland: Avoid using uninitialized memory
_gdk_wayland_cursor_get_buffer was not initializing
its out variables in the 'not found' case. This
was showing up in protocol traces as garbage hotspots
being sent to the compositor.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1328
2019-04-18 10:40:09 -04:00
Chun-wei Fan
983e82b750 state-record.c: Include header for write()/close()
Avoid an "implicit declaration of ..." warning/error for using
close()/write().
2019-04-18 15:06:54 +08:00
Rico Tzschichholz
0fcfa1f266 meson: Add missing files to gtk3-demo to fix build 2019-04-17 17:47:12 +02:00
Matthias Clasen
ec1e8fb20f widget-factory: Update copyright line
Update the years to 2019, and use some better typography.
2019-04-16 19:57:46 -04:00
Matthias Clasen
849b7faac8 widget-factory: Add an Inspector menu item
Just because we can.
2019-04-16 19:56:37 -04:00
Olivier Fourdan
1f64689c31 wayland: Add support for xdg-output
Previously, the GDK backend for Wayland would deduce the logical size
of the monitors from the wl_output size and scale.

With the addition of fractional scaling which advertises a larger scale
value and then scale down the client surface, the computed logical size
of the monitors in GDK would be wrong and confuse applications which
insist on using the monitor size and position (like Firefox).

The xdg-output protocol aims at describing outputs in a way which is more
in line with the concept of an output on desktop oriented systems by
presenting the outputs using their logical size and position appropriately
transformed.

Add support for the optional xdg-output protocol so that the size and
position of the monitors as reported by GDK is correct even when using
fractional scaling.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1828
2019-04-16 16:14:24 +02:00
Timm Bäder
81c8efc863 imcontextwayland: (Hopefully) fix if expression
Backport from master: f9a5a474f0
2019-04-16 00:12:24 +02:00
Carlos Garnacho
b819fcac74 Merge branch 'event_window' into 'gtk-3-24'
gdk/wayland: Use event window to calculate coordinatess for show_window_menu()

See merge request GNOME/gtk!749
2019-04-15 17:11:05 +00:00
Robert Mader
df6ea75a04 gdk/wayland: Use event window to calculate coordinatess for show_window_menu()
The previously used window always was the xdg_toplevel window.
2019-04-14 12:26:45 +02:00
Christoph Reiter
77c1424582 meson: add tools tests 2019-04-13 13:11:23 +02:00
Christoph Reiter
014320bfb0 meson: add a11y test 2019-04-13 12:49:27 +02:00
Christoph Reiter
0f957ca4f7 meson: underscorify immodule name when using it as a macro name
This resulted in -DINCLUDE_IM_ti-et getting passed to gcc resulting in
lots of warnings. Use underscorify() so we get the correct -DINCLUDE_IM_ti_et instead.
2019-04-12 20:59:14 +02:00
Nirbheek Chauhan
6bdc1137f2 Merge branch 'fix-meson-on-macos' into 'gtk-3-24'
meson: Fix build on macOS

See merge request GNOME/gtk!735
2019-04-12 06:12:29 +00:00
Chun-wei Fan
a4410e9c01 meson.build: Clean up previous commit
Don't hardcode things, and move only deduce `current` for non-Visual
Studio builds, as it is only used there.
2019-04-12 14:01:31 +08:00
James Westman
9d9b023166 meson: Fix build on macOS
Previously, Meson failed to run on macOS. This was because a value that should
have been an array of strings was instead a single string.
2019-04-12 00:30:23 -05:00
Chun-wei Fan
f5408e5061 meson.build: Fix Visual Studio builds
Commits a04fef4 and cc7f9c4 inadvertedly broke Visual Studio builds as
it caused the following to show up when configuring:

gdk\meson.build:281:0: ERROR: Invalid Shared library version "vs9.2404.4". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.

Since we do not set a library version that mingles with the minor and
micro versions, along with libtool current for any Visual Studio builds,
just set those versions as 3 on Visual Studio builds, and things should
work the way they did before.
2019-04-12 11:29:52 +08:00
Aurimas Černius
1373bf1d76 Updated Lithuanian translation 2019-04-11 22:49:59 +03:00
Christoph Reiter
cc7f9c44e4 meson: Also add a library version for libgailutil
See a04fef4b9e
2019-04-11 21:21:50 +02:00
Emmanuele Bassi
ce86b411f8 meson: Update versions
GTK 3.24.8 was just released.
2019-04-11 19:34:06 +01:00
Emmanuele Bassi
a04fef4b9e meson: Preserve compatibility with Autotools build
The Meson build is missing the libtool versioning of the shared
libraries.
2019-04-11 19:33:25 +01:00
Chris Williams
3246d6a738 gdkframeclockidle: Don't permanently skew frame time
Since commit 3b2f9395, the frame time may be set into the future, so
only ensure monotonicity, and don't store the offset. This prevents the
frame time from becoming out of sync with g_get_monotonic_time().

Fixes #1612
2019-04-11 13:25:18 -04:00
Matthias Clasen
bcb9babc5f Merge branch 'gtk-3-24-meson' into 'gtk-3-24'
GTK 3 meson port

See merge request GNOME/gtk!716
2019-04-11 16:34:47 +00:00
Chun-wei Fan
e96c6c40f8 testsuite/gtk/builder.c: Export the needed symbols
Those symbols need to be properly exported for Visual Studio builds for
things to work properly.  Fixes the test on Visual Studio builds.
2019-04-11 16:46:22 +02:00
Chun-wei Fan
9f1b954fff README.win32: Add instructions on Meson builds
This adds a set of instructions, notes and known issues for the
Meson builds on Windows, especially Visual Studio.
2019-04-11 16:46:22 +02:00
Chun-wei Fan
651715b8e8 meson: Fix building with builtin immodules
We also need to ensure that we pass in -DINCLUDE_IM_xxxx when building
the GTK DLL/.so, in addition to building the respective (static)
immodules, so that we did really link in the immodules into the final
GTK DLL/.so.
2019-04-11 16:46:22 +02:00
Chun-wei Fan
b6b15508d5 meson/MSVC: Copy xxx-3.lib to xxx-3.0.lib upon post-install
This ensures that current Visual Studio project files and NMake
Makefiles (which do not use pkg-config files) do not break with the
Meson-built GTK-3.x libraries.
2019-04-11 16:46:22 +02:00
Christoph Reiter
5aba13f62d autotools: dist gen-c-array.py and gen-rc.py 2019-04-11 16:46:22 +02:00
Christoph Reiter
749a58ab26 meson: simplify builtin_immodules build option
Make it a yes/no/auto combo. "yes" means all modules are built into libgtk,
"no" that none are and "auto" uses the platform defaults, yes on win32,
no otherwise.

If we need more we can always extend it later.
2019-04-11 16:46:22 +02:00
Christoph Reiter
3462fcf9a0 meson: Follow gnome conventions for build option names 2019-04-11 16:46:22 +02:00
Chun-wei Fan
0432b22e02 meson.build: Output DLL names similar to the MSVC projects
This makes the DLL names match those that are produced by the Visual
Studio projects by default.

This, currently, however, names the .lib files same as the ones that
are produced for other platforms (i.e. <libname>-3.lib).  This is
actually not that bad as one can just copy those .lib's into
<libname>-3.0.lib when needed and the binaries that link to those .lib's
ultimately link to the same DLLs, so this should not harm binary
compatibility.
2019-04-11 16:46:22 +02:00
Chun-wei Fan
33589f154e meson.build: Fix generating .pc files
It may be so that Cairo is not found using pkg-config files, so we
cannot just use .name() on the Cairo deps directly.

Since we already have a similar mechanism for generating the GDK .pc
files, re-use and share that mechanism.
2019-04-11 16:46:22 +02:00
Chun-wei Fan
d2ef356f1d meson.build: MSVC-Add fallback dep search for HarfBuzz
It seems that Meson 0.50.0 broke dependency search using CMake for
HarfBuzz at least, so we add a workaround for it to look for the
HarfBuzz headers and libraries manually when we couldn't find HarfBuzz
using the pkg-config and CMake method.
2019-04-11 16:46:22 +02:00
Christoph Reiter
c5789127a7 meson: set soversion to 'vs<VSVer>' for MSVC
This should result in <libname>-vs<VSVer>.dll filenames.
2019-04-11 16:46:22 +02:00
Christoph Reiter
28833783cc meson: Various config.h related fixes
Various adjustments to make the config.h output between autotools
and meson more similar by testing on Linux and Windows/MSYS2.

Setting things to 1 instead of true and shifting things around is motivated
by reducing the diff between the generated files.
2019-04-11 16:46:22 +02:00
Christoph Reiter
2d31112a7f CI: disable building with cloudproviders; breaks tests
See #33
2019-04-11 16:46:22 +02:00
Christoph Reiter
52edd6b192 CI: install dbus-x11 for dbus-launch and iso-codes (optional build dep) 2019-04-11 16:46:22 +02:00
Christoph Reiter
940126c427 meson: fix code examples in the gtk docs build
getting_started.xml uses relative paths for including code examples
and for some reason the base path is different with meson than with autotools.

Switch both autotools and meson to generate the file and insert the absolute
source path instead.

This also cleans up the content file list: the expand content files have to
be in the content file list as well, so just append them there.
2019-04-11 16:45:37 +02:00
Christoph Reiter
8cfbf63c5a meson: static immodules: depend on generated headers 2019-04-11 16:45:37 +02:00
Christoph Reiter
068f7f7423 meson: set the soversion to just '0' everywhere
This is what glib did for the meson port, so can't be that wrong.
This also makes the DLL names match the autotools Windows DLLs.
2019-04-11 16:45:37 +02:00
Christoph Reiter
65f2fe828c meson: statically link immodules under mingw by default
To match what the autotools build does right now.
2019-04-11 16:45:37 +02:00
Christoph Reiter
b5a8bd5fe3 meson: Don't depend on meson 0.50
The install arg doesn't add anything here anyway.
2019-04-11 16:45:37 +02:00
Christoph Reiter
2445f46e01 meson: gtk docs: set ENABLE_ON_X11 2019-04-11 16:45:36 +02:00
Christoph Reiter
1d40ba250f meson: only install broadway man pages if it's enabled 2019-04-11 16:45:36 +02:00
Christoph Reiter
e47440def5 meson: Don't make the man pages build depend on the documentation option
Include all meson build files under docs/ and check with get_option() there.
2019-04-11 16:45:36 +02:00
Christoph Reiter
6a37e2d19e CI: Install sassc
In case sassc is installed the build systems will try to regenerate the css
files. This makes sure we test that code path.
2019-04-11 16:45:36 +02:00
Christoph Reiter
7391a078b3 meson: build print backends
This changes the configure option into two states:
auto: build all that can be build (default)
A list of backend names: build them and fail if we can't

"papi" is missing because it's not in Debian and I can't test it.
2019-04-11 16:45:36 +02:00
Christoph Reiter
d52dad2042 autotools: dist all meson related build files 2019-04-11 16:45:36 +02:00
Christoph Reiter
26d32f3bd0 meson: build all input modules; fix static build on Linux 2019-04-11 16:45:36 +02:00
Christoph Reiter
e41ec3c62e meson: install public broadway headers 2019-04-11 16:45:36 +02:00
Christoph Reiter
cb89ad18a2 meson: immodules: unset the name_prefix to match autotools 2019-04-11 16:45:36 +02:00
Christoph Reiter
fd758bb2e9 meson: install unix-print headers 2019-04-11 16:45:36 +02:00
Christoph Reiter
1882ff9be3 CI: enable broadway and xinerama 2019-04-11 16:45:36 +02:00
Christoph Reiter
fb9e3e1830 CI: autotools: test with srcdir!=buildir 2019-04-11 16:45:36 +02:00
Christoph Reiter
310dc4b6c4 meson: cloudproviders fixes
Set min cloudproviders version.
Add libcloudproviders to gdk Requires.private.
CI: build/test with cloudproviders
2019-04-11 16:45:36 +02:00
Christoph Reiter
b1bc86e905 meson: mkenums: only write basenames in the comments
The autotools build uses relative filenames here while with meson
we get absolute paths. Switch to basename so we get the same result
for both and don't break reproducible builds with absolute paths
in public headers.
2019-04-11 16:45:36 +02:00
Christoph Reiter
59055fd9f7 meson: set interface age; pass soversion to libgdk as well 2019-04-11 16:45:36 +02:00
Christoph Reiter
a33bf3da56 meson: Install gail-3.0.pc and gtk-3.0.m4 2019-04-11 16:45:36 +02:00
Christoph Reiter
490cf8dff6 meson: make the gtk/gdk .pc files match autotools on Linux
Try to include the same things and in a similar order so differences
are easier to catch.

This also adds the backend specific .pc files for gdk like gdk-x11-3.0.pc
2019-04-11 16:45:36 +02:00
Christoph Reiter
331a92d559 meson: gtk gir: depend on xlib and include gtkx.h if X11 is enabled
To match what the autotools build does.
2019-04-11 16:45:36 +02:00
Christoph Reiter
1bbd244517 meson: install desktop/gschema files for demos 2019-04-11 16:45:36 +02:00
Christoph Reiter
c9d4f53cfc meson: install gtkbuilder.rng/its/loc files 2019-04-11 16:45:36 +02:00
Christoph Reiter
dbf7e1d23b meson: widget-factory: install icons 2019-04-11 16:45:36 +02:00
Christoph Reiter
212efbdd81 meson: build docs and man pages
Lots of warnings, so something is probably still missing.
2019-04-11 16:45:36 +02:00
Christoph Reiter
5a84730b4a meson: build and install translations 2019-04-11 16:45:36 +02:00
Christoph Reiter
1ee995fd0f meson: Install im-multipress.conf 2019-04-11 16:45:36 +02:00
Christoph Reiter
9709d7eb61 meson: Install key themes 2019-04-11 16:45:36 +02:00
Christoph Reiter
7bc1aeef8e CI: run the tests with meson
Not all are ported I think, but this is a start.
2019-04-11 16:45:36 +02:00
Christoph Reiter
73fcf0d3d4 CI: save meson build logs 2019-04-11 16:45:36 +02:00
Christoph Reiter
fb083b6de2 tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson
Under autotools the compiled schemas are in the build directory and with
meson they are in the root build dir. Avoid changing the autotools build for
now and add a special GTK_TEST_MESON env var which we can use to differentiate
the two.

See 1253e7bfcb for a similar fix on master.
2019-04-11 16:45:36 +02:00
Christoph Reiter
09fe0b0edc meson: disable some broken immodules for now
To fix the build.
We need to port the source generation logic from gtk4 for this.
2019-04-11 16:45:36 +02:00
Christoph Reiter
857b9a55a4 meson: fix build of immultipress.c with mingw
There is no need to escape the quotes since we are not in a shell here
and things get passed to the compiler as is.
2019-04-11 16:45:36 +02:00
Christoph Reiter
dc5698ad55 CI: add meson build jobs for Fedora and MSYS2 2019-04-11 16:45:36 +02:00
Christoph Reiter
b185f69334 meson: check for and set HAVE_IPRINTDIALOGCALLBACK
It's needed under mingw in the print backend
2019-04-11 16:45:36 +02:00
Christoph Reiter
ca33855793 meson: gdk: add missing pangowin32 dep 2019-04-11 16:45:36 +02:00
Christoph Reiter
74f6832001 meson: add fribidi dep 2019-04-11 16:45:36 +02:00
Chun-wei Fan
6db8e62ae7 meson: Install the icons for the demo programs
Those should be installed as well, and will also eliminate the error
that gtk-update-icon-cache failed during the post install.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
c1e40a5fbd meson: Really fix Broadway builds
We must also feed rawinflate.min.js into gen-c-array.py, so that the
windows really show up in the browser when running GTK programs using
broadway.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
7586e88204 meson: Build libgail-util
This adds libgail-util to the build process.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
5e8edec254 meson: Build the input modules
Build the input modules for GTK+, either as modules or built directly
into GTK.  Also provide a configure option to build the specified
immodules, or all, or the backend immodule(s) or none of the immodules
into GTK.  Note that for Visual Studio all immodules are built into
the GTK DLL by default, like what is done in the Visual Studio projects.

Note that building the backend immodules for Quartz, X11 and Wayland are
currently untested.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
6b079afa0a meson: Fix GDK-Win32 build
We have a new source file that we must build,
gdkwin32langnotification.c.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
e24e0dd8a5 meson: Make post-install script a Python script
This is so that the post install script will work on environments where
*NIX shell scripts are not supported, such as on Windows cmd.exe for
Visual Studio builds.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
1cd99d63d1 meson: Build the .rc files on Windows
This will ensure that the version info is easily visible from the
GDK/GTK+ DLLs, and ensure that the print dialogs will have a more modern
look and feel.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
0e24d35e3b tests/: Declare variables at the top-of-block
This will ensure that the code will build for pre-C99 compilers.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
92206fe23b tests/animated-resizing.c: Include gtk/fallback-c89.c
This is to ensure that compilers that do not have round() in math.h can
still build the code.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
7d0364a127 testsuite/gtk/stylecontext.c: Declare variables at top-of-block
This will ensure the code builds on pre-C99 compilers.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
988d2dd077 examples/bp/bloatpad.c: Declare variables at top-of-block
This is to ensure that the code will build on pre-C99 compilers.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
397471d604 demos/gtk-demo/meson.build: Build gtk3-demo-application
This should also get built as well.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
b0a31fefd7 meson: Fix Broadway builds
Make sure the source files are in line with GTK+-3.x Broadway backend
sources.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
4da82356bc meson: Enable GLES Windows builds via libANGLE
Check whether the libepoxy library is built on Windows with support for
GLES.  If so, enable GLES/EGL support on Windows as well.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
ac1f66a35b gdk/meson.build: Force-export gdk_win32_display_manager_get_type()
...on Visual Studio builds, as it seems that the linker is optimizing
that symbol out (hence it is not exported in the DLL).  This is to
ensure that the introspection files for GdkWin32 build.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
2912363104 gdk/meson.build: Fix typo for GdkWin32 Introspection
It is gdk_win32_gir, not gdk_x11_gir...
2019-04-11 16:45:36 +02:00
Chun-wei Fan
1e7988531a meson: Only use fallbacks for PangoFT2 and FreeType when needed
PangoFT2 is optional on Windows, so we only really need the fallback if
when it is required.

Along with that, since FreeType does not typically ship with pkg-config
files in its CMake builds, check for the needed headers, .lib and
function and then use the fallback when they could not be found and
PangoFT2 is used.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
2d2ad0a997 meson: Only use cairo fallbacks when needed
On Visual Studio builds, since Cairo builds tend not to generate
pkg-config files for us, look for the headers and .lib's, before
attempting to download the Cairo repo (which is quite large) and
building it.

We can simplify this process when Meson gains the ability to check
for the dependencies in a declarative fashion, but before that, this
is what must be done.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
8dc95560e2 meson.build: Bump version 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
dbce9ee870 meson: Add wrap files for building with subprojects 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
ead77a4628 meson: Cleanup tests and gdk testsuite 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
20c29fd8c0 meson: Fix introspection generation on Linux 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
a8ffb42739 meson: Don't target gnu89 as the c_std
Meson propagates c_std to all subprojects, including those that
require gnu99 or c11, etc.

https://github.com/mesonbuild/meson/issues/1889
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
d9000a0740 meson: Disable discarded-qualifiers warning
This branch is not going to receive the reworks required fix warnings
about discarding of const qualifiers, so disable that warning instead.
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
3b246fbc56 gtk: Fix compiler warning about deprecated declaration 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
ca63c98447 meson: Add fallback subprojects for more dependencies 2019-04-11 16:45:36 +02:00
Philippe Normand
215c2be76f meson: Set the compatibility version correctly on macOS
And bump to Meson 0.48 as this feature requires it.
2019-04-11 16:45:36 +02:00
Philippe Normand
4eb2f297f1 meson: Disable --export-dynamic for clang
It doesn't seem to be supported, at least when compiling on macOS.
2019-04-11 16:45:36 +02:00
Philippe Normand
89d5c543ac meson: Build fixes for macOS 2019-04-11 16:45:36 +02:00
Philippe Normand
cde5a3f4b4 gtk: Fix paste/clipboard usage on macOS
In Mojave the build fails because declareTypes is nil. Instead use the
clearContents method, although I'm not really sure this is the same.
2019-04-11 16:45:36 +02:00
Philippe Normand
9109efb19e meson: Disable X11 support on Darwin
The Quartz backend should fulfill most requirements anyway.
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
ea6e3b3ddf meson_options.txt: Disable introspection by default
It's broken. Fix later.
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
00842f4d4e gtk-launch: Fix compilation with MSVC 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
a4fe15d9f0 meson: Sync build files with master and update to 3.24 2019-04-11 16:45:27 +02:00
Chun-wei Fan
8caa937739 tests: Include system headers appropriately
Don't include unistd.h on Windows, and include the appropriate headers on
Windows as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2019-04-11 16:40:33 +02:00
Nirbheek Chauhan
8ec004cc08 Import meson build files from an 3.22
Specifically, from 6dd6660c68
2019-04-11 16:40:33 +02:00
Matthias Clasen
c19ae9635e Merge branch 'uajain/clean-gtktypefuncs' into 'gtk-3-24'
gtk/Makefile: Add generated gtktypefuncs.c to DISTCLEANFILES

See merge request GNOME/gtk!732
2019-04-11 13:55:55 +00:00
Jakub Steiner
152e65f07a Adwaita: less purple OSD style
- one of the bits that escaped the purple cast is the osd background color
2019-04-11 15:31:31 +02:00
Umang Jain
adbd9b22d6 gtk/Makefile: Add generated gtktypefuncs.c to DISTCLEANFILES
Otherwise, it errors out on make distcleancheck in debian packaging

```
ERROR: files left in build directory after distclean:
./gtk/gtktypefuncs.c
make[1]: *** [Makefile:1005: distcleancheck] Error 1
```
2019-04-11 11:27:21 +05:30
Matthias Clasen
5428379fad 3.24.8 2019-04-10 17:12:29 -04:00
Matthias Clasen
08e20ce597 Silence a compiler warning 2019-04-10 15:46:31 -04:00
Marek Černocký
bc0b9840de Updated Czech translation 2019-04-10 16:36:02 +02:00
Matthias Clasen
af58e05531 Merge branch 'wip/cellrendererpixbuf-fallbacks-3-24' into 'gtk-3-24'
cellrendererpixbuf: Use fallback icons with icon-name

See merge request GNOME/gtk!729
2019-04-08 15:41:04 +00:00
Iain Lane
d151223b1b cellrendererpixbuf: Use fallback icons with icon-name
This gives us a better chance of finding an icon to show.

Closes: #1809
(cherry picked from commit fbe0e32813)
2019-04-08 16:30:03 +01:00
Ask Hjorth Larsen
6cb72d7f8c Updated Danish translation of gtk 2019-04-08 00:03:54 +02:00
Matthias Clasen
d1a9ba2c93 Merge branch 'gtk-3-24-gtkplacessidebar-add-loop-devices' into 'gtk-3-24'
gtkplacessidebar: Add loop devices

See merge request GNOME/gtk!722
2019-04-06 15:33:54 +00:00
Jordi Mas
7af43fb98c Update Catalan translation 2019-04-06 06:40:52 +02:00
Jordi Mas
d875ef88ff Update Catalan translation 2019-04-05 21:01:47 +02:00
segfault
3f77da62bd gtkplacessidebar: Add loop devices 2019-04-05 18:59:50 +02:00
Marek Kašík
8b85f38093 Merge branch 'gtk-3-24' into 'gtk-3-24'
Print dialog, CUPS: Check unknown option values whether they are actually custom settings - Backport to GTK 3.24

See merge request GNOME/gtk!717
2019-04-05 16:29:03 +00:00
Till Kamppeter
b9e91b9419 print: Check unknown option values whether they are actually custom settings
Set always correct custom page size.
2019-04-05 16:29:03 +00:00
Daniel Mustieles
7c10ed9193 Update Spanish translation 2019-04-05 10:39:18 +00:00
Emmanuele Bassi
505a177398 Merge branch 'autotools-remove-gail-checks' into 'gtk-3-24'
build: remove unused checks for sockaddr_un.sun_len

See merge request GNOME/gtk!708
2019-04-03 10:29:07 +00:00
Christian Kirbach
e47865dba6 Update German translation 2019-04-03 09:33:21 +00:00
Daniel Șerbănescu
3f250959b6 Update Romanian translation 2019-04-02 18:21:32 +00:00
Christoph Reiter
9fe71ccdc1 build: remove unused checks for sockaddr_un.sun_len
It sets HAVE_SOCKADDR_UN_SUN_LEN which is unused since d3ab2fe19c
2019-04-02 18:46:38 +02:00
Emin Tufan Çetin
47c797f63d Update Turkish translation 2019-04-02 16:22:36 +00:00
Matthias Clasen
3a770b1b80 Merge branch 'adwaita-selected-row-switch-fix' into 'gtk-3-24'
Adwaita: Fix switch slider border on selected row

See merge request GNOME/gtk!703
2019-04-02 15:49:29 +00:00
Alex Monday
3770defce7 Adwaita: Fix switch slider border on selected row
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1802
2019-04-02 20:12:56 +05:00
Matthias Clasen
741a32ff7c Merge branch 'autotools-remove-gnu-ftw-check' into 'gtk-3-24'
build: remove unused check for GNU ftw

See merge request GNOME/gtk!700
2019-04-02 14:27:24 +00:00
Carlos Garnacho
a6eb593370 Merge branch 'startup-id-private' into 'gtk-3-24'
Centralize DESKTOP_STARTUP/AUTOSTART_ID handling

See merge request GNOME/gtk!659
2019-04-02 12:38:18 +00:00
Matthias Clasen
89e38ba343 Merge branch 'issue-137' into 'gtk-3-24'
Set the a11y name of the "create folder" button

See merge request GNOME/gtk!697
2019-04-02 10:46:09 +00:00
Jan Alexander Steffens (heftig)
2d3936cbe6 Centralize DESKTOP_STARTUP/AUTOSTART_ID handling
Add private API to GDK to move these variables from the environment into
static scope. Also move the DESKTOP_STARTUP_ID validation here to reduce
code duplication.

Use constructors to read them as early as possible; however, do not
unset them until first requested. This avoids breaking gnome-shell and
gnome-settings-daemon, which want to use the DESKTOP_AUTOSTART_ID in
their own gnome-session clients.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1761
2019-04-02 09:14:35 +02:00
Christoph Reiter
1b52b48814 build: remove unused check for GNU ftw
It sets HAVE_GNU_FTW which is unused since 4acbcf9e97
2019-04-02 08:52:31 +02:00
Emmanuele Bassi
6ed7d60a20 Set the a11y name of the "create folder" button
Otherwise it'll get a generic "Menu" name.

https://gitlab.gnome.org/GNOME/gtk/issues/137
2019-04-01 14:44:25 +01:00
Carlos Garnacho
892abdd41b Merge branch 'wayland_window_menu' into 'gtk-3-24'
gdk/wayland: Properly calculate coordinates for show_window_menu()

See merge request GNOME/gtk!684
2019-04-01 11:10:54 +00:00
Robert Mader
35c4627fac gdk/wayland: Properly calculate coordinates for show_window_menu()
The event received in `gdk_wayland_window_show_window_menu()` can
come from widgets with a GdkWindow. In those cases the coordinates
are relative to the widget, not the root window.
This results in a misplaced window menu.

Properly calculate the coordinates by iterating to the toplevel
window as suggested by Carlos Garnacho.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/684
2019-04-01 11:11:12 +02:00
Matthias Clasen
59a272fdef Close a documentation gap 2019-03-31 18:36:38 -04:00
LRN
7b3f1fd233 Merge branch 'WindowsPrintDriverPreferences' into 'gtk-3-24'
Fixed bug that prevented GTK from storing printer driver preferences in the…

See merge request GNOME/gtk!396
2019-03-31 21:07:25 +00:00
Rick Yorgason
446659e80f Fixed bug that prevented GTK from storing printer driver preferences in the print dialogue on Windows. Also saving devmode->dmDeviceName so the dialogue remembers which printer your selected last, and doesn't try to feed to saved preferences to the wrong printer. 2019-03-31 13:57:12 -07:00
Daniel Șerbănescu
426a0be531 Update Romanian translation 2019-03-30 20:08:45 +00:00
Christoph Reiter
09e0881a51 gdk/Makefile.am: dist gdkconstructor.h
The file was added in 05bc2f4dc1
2019-03-30 20:03:44 +01:00
Piotr Drąg
3d7fd8c897 Update Polish translation 2019-03-30 14:46:12 +01:00
Matthias Clasen
e20b7a3a8d Merge branch 'gir-gdkx11-missing-sources' into 'gtk-3-24'
build: Add missing sources for the GdkX11 gir build

See merge request GNOME/gtk!689
2019-03-30 12:28:59 +00:00
Matthias Clasen
ae69bc53f2 Merge branch 'gdk-gir-include-built-sources' into 'gtk-3-24'
build: Include all generated sources for the gdk gir build

See merge request GNOME/gtk!688
2019-03-30 12:28:05 +00:00
Matthias Clasen
8a15a7bd5f Merge branch 'fix-1788' into 'gtk-3-24'
flowbox: children per line may not be 0

See merge request GNOME/gtk!687
2019-03-30 12:27:10 +00:00
Christoph Reiter
15a7a93d10 build: Add missing sources for the GdkX11 gir build
Noticed while diffing .gir files with the meson port.
2019-03-30 11:57:50 +01:00
Christoph Reiter
8034ba4803 build: Include all generated sources for the gdk gir build
The main one is gdkversionmacros.h which resulted in
GDK_MAJOR_VERSION, GDK_MINOR_VERSION and GDK_MICRO_VERSION not being included
in the Gdk-3.0.gir.

Noticed while diffing girs with the meson port.
2019-03-30 11:14:33 +01:00
Kukuh Syafaat
352c8180d0 Update Indonesian translation 2019-03-30 07:35:20 +00:00
Benjamin Otte
cd4b6a77a4 flowbox: children per line may not be 0 2019-03-29 23:59:52 -05:00
Matthias Clasen
6b8c08525d Merge branch 'wip/chergert/fix-flowboxchild-crash-on-selection' into 'gtk-3-24'
flowbox: check for flowbox when updating selection

See merge request GNOME/gtk!686
2019-03-29 23:54:28 +00:00
Christian Hergert
8dfb33fb5f flowbox: check for flowbox when updating selection 2019-03-29 16:26:20 -07:00
Matthias Clasen
f9e19dca49 Merge branch 'portal-session-state' into 'gtk-3-24'
Portal session state

See merge request GNOME/gtk!519
2019-03-29 23:22:47 +00:00
Matthias Clasen
08da4a2377 application: Add a query-end signal
This lets us take just-in-time inhibitors, and makes
the session support a little more real.
2019-03-29 19:12:40 -04:00
Matthias Clasen
a3e070f59c Application: Support sandboxed session state changes
React to the session-state in StateChanged signals from
the inhibit portal and call QueryEndResponse as appropriate.
2019-03-29 19:12:20 -04:00
Matthias Clasen
a6f35772e7 Merge branch 'separate-marks-margins-on-scales' into 'gtk-3-24'
themes: Optimize code for marks margins on scales

See merge request GNOME/gtk!612
2019-03-29 22:58:49 +00:00
Matthias Clasen
5058f4ef7d Merge branch 'gtk3-fix-gettext-domain' into 'gtk-3-24'
Fix some translation domains in .ui files copied from gtk4

See merge request GNOME/gtk!683
2019-03-29 22:44:14 +00:00
Matthias Clasen
d8b558ead2 Merge branch 'gtk3-pc-fix-fribidi-private-version' into 'gtk-3-24'
build: Fix fribidi version reqs in Requires.private

See merge request GNOME/gtk!685
2019-03-29 22:05:54 +00:00
Christoph Reiter
30f34ba224 build: Fix fribidi version reqs in Requires.private
This resulted in "fribidi_required_dep" being written to the .pc file
instead of the version number.
2019-03-29 22:01:23 +01:00
Balázs Úr
2c4c47fe42 Update Hungarian translation 2019-03-29 20:58:09 +00:00
Christoph Reiter
567cc15132 Fix some translation domains in .ui files copied from gtk4
gtk40->gtk30
2019-03-29 17:35:35 +01:00
Matthias Clasen
1e2bd15b22 Merge branch 'wip/jimmac/list-image-buttons' into 'gtk-3-24'
list image buttons

See merge request GNOME/gtk!656
2019-03-29 14:26:13 +00:00
Rafael Fontenelle
0c948802cd Update Brazilian Portuguese translation 2019-03-29 13:52:30 +00:00
Milo Casagrande
339e20f598 Update Italian translation 2019-03-29 13:31:48 +00:00
Anders Jonsson
2b768edd43 Update Swedish translation 2019-03-29 10:50:54 +00:00
Ignacio Casal Quinteiro
c605a23346 Merge branch 'wip/nobody/517-quartz-gl-context' into 'gtk-3-24'
Quartz GLArea

See merge request GNOME/gtk!146
2019-03-29 10:45:05 +00:00
Philip Chimento
f264e0dbf9 quartz: Update GL context on window resize
The previous version of this patch sent an update message to the
NSOpenGLContext in a GdkGLContext::update vfunc, but that vfunc does not
exist any more.

See: #517
2019-03-29 11:25:29 +01:00
Brion Vibber
f34709807f quartz: implement GdkGLContext for Quartz backend
Current problems:
* other widgets in a GL-painted window are low-resolution on Retina
  display
* something wrong with paint updates; gdkgears demo only updates every
  couple of seconds but reports ~30fps

See: #517
2019-03-29 11:25:29 +01:00
Emmanuele Bassi
ecf3431d3f Merge branch 'gl3-shaders' into 'gtk-3-24'
Use GLSL 3.30 shaders

See merge request GNOME/gtk!671
2019-03-29 09:57:21 +00:00
Emmanuele Bassi
bfcd062e8e Use GLSL 3.30 shaders
We currently ask for anything above 3.2 GL contexts, but we're still
using GLSL 1.50 shaders all over the place. If a GL driver supports GL
3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
happening are really small.
2019-03-27 16:03:43 +00:00
Matthias Clasen
1bb106012a Merge branch 'fix-gi-build-with-lto' into 'gtk-3-24'
Fix the introspection build with "-Wl,--as-needed -flto -O2". Fixes #1692

See merge request GNOME/gtk!665
2019-03-27 05:56:15 +00:00
Benjamin Otte
bbb70857be gtk: Remove all gtk_widget_set_redraw_on_allocate() calls
They're either wrong (when using FALSE because the widgets don't account
for changes to the CSS) or unnecessary (when using TRUE because it's the
default).

Fixes !1777
2019-03-27 00:02:34 +01:00
Matthias Clasen
f35ce26336 color editor: Don't warn if editing is cancelled
Thats a valid way to end color picking.
2019-03-25 16:52:40 -04:00
Jakub Steiner
fc3317138e Adwaita: tone down app icon shadows
- based on Tobias' and Allan's feedback, the app icon dropshadow
  were too prominent.
2019-03-25 17:59:24 +01:00
Christoph Reiter
55e73682cc Fix the introspection build with "-Wl,--as-needed -flto -O2". Fixes #1692
The above flags in combination with "-fvisibility=hidden" break the
g-i build because it results in the g-i generated dumper executable not
linking against the libraries because they are detected as unused and
thrown out.

Fix by only using -fvisibility=hidden for the library and not g-i.
2019-03-25 09:54:54 +01:00
Benjamin Otte
df5d18a5b1 Merge branch 'inspector-theme-find' into 'gtk-3-24'
Inspector: Find themes the same way GtkCSSProvider does

See merge request GNOME/gtk!663
2019-03-22 23:44:14 +00:00
Руслан Ижбулатов
c33f9a2769 Inspector: Find themes the same way GtkCSSProvider does
Look for subdirectories named "gtk-3.x", where 'x' starts as current
minor version and counts down to 14, then drops to 0.
Only look for gtk.css in these directories though. If a theme only
provides gtk-dark.css, it won't be found.
2019-03-22 23:31:18 +00:00
LRN
cddd88064c Merge branch 'ime-load-fix' into 'gtk-3-24'
GDK W32: Test for IME correctly

See merge request GNOME/gtk!658
2019-03-22 15:00:56 +00:00
Руслан Ижбулатов
2e1a55118a GDK W32: Fix property setting to correctly use static strings
The strings that are set are static, so g_value_set_static_string() should
be used to set them instead of g_value_set_string().
2019-03-22 14:52:23 +00:00
Руслан Ижбулатов
3b244c9f11 GDK W32: Test for IME correctly
ImmIsIME() doesn't work (always returns TRUE) since Vista.
Use ITfActiveLanguageProfileNotifySink to detect TSF changes,
which are equal to IME changes for us.

Also make sure that IMMultiContext re-loads the IM when keyboard layout
changes, otherwise there's a subtle bug that could happen:
* Run GTK application with non-IME layout (US, for example)
* Focus on an editable widget (GtkEntry, for example)
* IM Context is initialized to use the simple IM
* Switch to an IME layout (such as Korean)
* Start typing
* Since IME module is not loaded yet, keypresses are handled
  by a default MS IME handler
* Once IME commits a character, GDK will get a WM_KEYDOWN,
  which will trigger a GdkKeyEvent, which will be handled by
  an event filter in IM Context, which will finally re-evaluate
  its status and load IME, and only after that GTK will get
  to handle IME by itself - but by that point input would
  already be broken.
To avoid this we can emit a dummy event (with Void keyval),
which will cause IM Context to load the appropriate module
immediately.
2019-03-22 14:52:18 +00:00
John Ralls
024cb267dd [GdkQuartz] Fix two build issues
1. NSRect and CGRect aren't toll-free bridged in 32 bit builds.
2. NSWindowCollectionBehavior(Dis)AllowTiling is defined beginning in 10.11.
2019-03-21 16:01:51 -07:00
Matthias Clasen
17665f06e3 Merge branch 'wip/jimmac/adwaita-selection-checked-buttons' into 'gtk-3-24'
Adwaita: checked buttons workaround

See merge request GNOME/gtk!657
2019-03-20 14:05:23 +00:00
Matthias Clasen
17dc55474b Merge branch 'adwaita-headerbar-switch-margins' into 'gtk-3-24'
Adwaita: Adjust switch margins on headerbars

See merge request GNOME/gtk!650
2019-03-20 14:04:32 +00:00
Jakub Steiner
e60b55626e Adwaita: focus ring radius
- backport from master

fixes https://gitlab.gnome.org/GNOME/gtk/issues/1756
2019-03-20 13:40:21 +01:00
Nathan Follens
5d224a1827 Update Dutch translation 2019-03-20 11:14:09 +00:00
Jakub Steiner
e7e31a4835 Adwaita: only tone down image buttons
- Rather than making labeled buttons inside lists toned down,
  only tone down image buttons, so that we don't have to include
  icon-only actions. Places like Software can continue using label
  buttons with no change without having those less visible.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1748
2019-03-20 11:31:50 +01:00
Jakub Steiner
c9cfdf7a91 Adwaita: checked buttons workaround
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1642 once and for all

(until it resurfaces)
2019-03-19 17:22:42 +01:00
Alex Monday
430caaa167 Adwaita: Adjust switch margins on headerbars
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1759
2019-03-19 19:46:00 +05:00
Kristian Rietveld
91f2ad4a2f Bug 743717 - Crashes on clipboard operation, influence by clipboard ...
The problem here was that NSPasteboard would release the clipboard
owner if all data items were transferred. When trying to re-use this
owner at a later point, GTK+ would attempt a retain call on a released
object and crash.

Fix this by not immediately releasing the owner after declaring types,
so by keeping our own reference around.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/529
2019-03-18 14:00:51 -07:00
John Ralls
93bf85e92f [Quartz] Fix some compile warnings in gtkclipboard-quartz.c. 2019-03-18 13:33:40 -07:00
John Ralls
5c039a1aa0 [GdkQuartz] Set the toplevel for the pointer if it's NULL.
Gdk sometimes misses crossing events on popups, so the cached toplevel
may be NULL. If it is, find the toplevel under the pointer and set it.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/623
2019-03-18 13:01:11 -07:00
Matthias Clasen
aac83b20c1 Merge branch 'wip/carlosg/startup-notification-fixes' into 'gtk-3-24'
Startup notification fixes

See merge request GNOME/gtk!647
2019-03-18 12:23:52 +00:00
Carlos Garnacho
ed9a6f755d gdk/wayland: Preserve stored startup id for gtk_surface1.request_focus
The use of the startup ID is now twofold, we reply back with it to end any
corresponding startup notification, but we also use it on
gtk_surface1.request_focus to acknowledge that the activation might raise
the corresponding window.

We should preserve the startup ID for the second to work properly, so avoid
clearing it here. It is inconsequential if the underlying
gtk_shell1.set_startup_id request happens multiple times on no longer existing
startup IDs, so don't bother preventing that from happening.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754
2019-03-18 12:28:57 +01:00
Carlos Garnacho
224a53d97b gtkapplication: Stash DESKTOP_STARTUP_ID on a constructor
It might be too late to do it at GtkApplication::add_platform_data time,
since the envvar may be consumed earlier on if gdk_display_open() happened
to be called before (eg. through gtk_get_option_group(TRUE)).

Stash the envvar in a constructor function, so its ensured to happen before
it can get consumed.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754
2019-03-18 12:28:48 +01:00
Matthias Clasen
967c5f7f7f Merge branch 'wip/carlosg/include-constructors-header-3-24' into 'gtk-3-24'
gdk: Include copy of glib/gconstructor.h

See merge request GNOME/gtk!643
2019-03-18 01:09:40 +00:00
Carlos Garnacho
05bc2f4dc1 gdk: Include copy of glib/gconstructor.h
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
2019-03-17 21:50:35 +01:00
John Ralls
3a959e984f Force a window resize if the content view frame changes.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1029

Should fix most if not all other cases where system-caused changes to
the NSWindow result in the Gdk coordinates not mapping correctly to the
AppKit coordinates.
2019-03-17 10:15:30 -07:00
Jordi Mas
0b4e511d05 Fix to Catalan translation 2019-03-16 22:03:09 +01:00
Jordi Mas
a533d106af Fix to Catalan translation 2019-03-16 22:01:51 +01:00
Matthias Clasen
7b2c731fae entry: Use a better icon for Caps Lock warning
Use the same icon we use in master now.
2019-03-15 18:57:46 -04:00
Matthias Clasen
9e658cb51d Merge branch 'wip/kalev/gtk_window_present-runtime-warnings' into 'gtk-3-24'
window: Undo runtime gtk_window_present deprecation warnings

See merge request GNOME/gtk!632
2019-03-15 00:46:51 +00:00
Руслан Ижбулатов
3fe8b66b3b Fix UAC manifest RC file
CREATEPROCESS_MANIFEST_RESOURCE_ID is a macro defined in winbase.h,
so we need an include to resolve that macro to its value, 1.

Without that it stays as a literal CREATEPROCESS_MANIFEST_RESOURCE_ID,
and ends up in the .exe file as-is, and Windows can't find it by that name,
resulting in UAC manifest not working and gtk-update-icon-cache bringing
up UAC prompt.
2019-03-14 09:24:17 +00:00
Matthias Clasen
67f1113370 Merge branch 'adwaita-remove-selectionmode-assets' into 'gtk-3-24'
Adwaita: Drop checkbox-selectionmode assets

See merge request GNOME/gtk!633
2019-03-14 03:07:19 +00:00
Emmanuele Bassi
094d85f293 Merge branch 'issue-1746' into 'gtk-3-24'
Move the gtkunixprint.h include in the gtk-doc stanza

See merge request GNOME/gtk!636
2019-03-13 19:39:26 +00:00
Emmanuele Bassi
7771869ab3 Move the gtkunixprint.h include in the gtk-doc stanza
Every time a new <INCLUDE> directive is used inside a gtk-doc
sections.txt file it overrides the current include header until the next
<INCLUDE> directive. This has the unfortunate effect of making every
single section following the print-related ones to generate
documentation that says to include gtkunixprint.h.

In order to avoid re-arranging the gtk3-sections.txt file, we can tell
gtk-doc what's the default header to include for GTK, and override it
using `@Include` directives directly into the gtk-doc stanzas of the
sections that require a different header.

Fixes: #1746
2019-03-13 17:44:32 +00:00
Alex Monday
1edf11774c Adwaita: Drop checkbox-selectionmode assets 2019-03-13 14:13:42 +05:00
Kalev Lember
a8bbcf33ec window: Undo runtime gtk_window_present deprecation warnings
Now that gtk_window_present is no longer deprecated, remove the runtime
warnings as well.
2019-03-12 21:50:04 +01:00
Matthias Clasen
d9a382d689 3.24.7 2019-03-12 16:25:10 -04:00
Matthias Clasen
f88e8ea6fe Undo the gtk_window_present deprecation
It doesn't make sense to have it in 3.x if we don't
have it in master.
2019-03-12 16:25:10 -04:00
Matej Urbančič
c3e065374f Updated Slovenian translation 2019-03-12 20:25:07 +01:00
Matthias Clasen
34e64ce5c2 3.24.6 2019-03-12 14:54:36 -04:00
Matthias Clasen
2ceff6df9c Fix a11y tests 2019-03-12 14:31:49 -04:00
Matthias Clasen
e910ee2c19 Merge branch 'control-enter' into 'gtk-3-24'
atk key: Always convert control character events into key names

See merge request GNOME/gtk!630
2019-03-12 18:13:10 +00:00
Samuel Thibault
728f6869cb atk key: Always convert control character events into key names
including when the control modifier is present, i.e. when one is typing
control-I for instance.

Orca would convert them back to the corresponding ASCII letter anyway, and
when pressing control-tab, we do want to pass "tab", not pass "\t" that Orca
would erroneously convert to "control-I".

Fixes #1743
2019-03-12 18:22:36 +01:00
Jakub Steiner
ff6b519286 Merge branch 'monday15/gtk-adwaita-selectionmode-checkboxes2' into gtk-3-24 2019-03-12 17:24:41 +01:00
Alex Monday
a58d7573f6 Adwaita: Fix selection-mode checkboxes
Use object-select-symbolic as a check icon, adjust styles.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/28
2019-03-12 17:24:19 +01:00
Matthias Clasen
9d7c7e8a67 Updates 2019-03-12 02:44:31 -04:00
John Ralls
942a2dede5 [GtkSearchEngineQuartz]Don't create file paths from NULL. 2019-03-11 17:58:38 -07:00
John Ralls
75b8abbf24 [GtkSearchEngineQuartz] Limit the scope of the Spotlight search.
If the query has a non-null location, set the scope to that directory,
otherwise set it to the local computer.

There is unfortunately no way to get Spotlight to search
non-recursively, nor does NSFileManager offer a convenient search of
the contents of a directory's regular files.
2019-03-11 17:58:38 -07:00
John Ralls
0f5603e74f Use n_displays for all monitor counts. 2019-03-11 16:52:07 -07:00
John Ralls
0524362721 Reverse signs on gdk <-> ns x coordinate transforms.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1711
2019-03-11 16:28:23 -07:00
John Ralls
261f1dc395 Switch quartz monitors collection from hash table to ptr array.
It's easier to find in a ptr array than to iterate over a hash table.
2019-03-11 16:28:19 -07:00
John Ralls
3bd9a3453f Change computation of coordinates.
Transform GdkQuartzMonitor geometry to Gdk coordinate system.
Move computation of Display geometry from GdkQuartzScreen to
GdkQuartzDisplay and use AppKit coordinates.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1593
2019-03-11 16:26:50 -07:00
John Ralls
28848176e5 Don't scan the seat's slave list for keyboards.
There aren't any, just the master_keyboard which one accesses with
gdk_seat_get_keyboard().
2019-03-11 16:16:47 -07:00
John Ralls
9a0e40b6da Restore switching keyWindow when changing windows.
Inadvertently removed when converting from gdkdevicemanager to gdkseat.
2019-03-11 16:16:46 -07:00
John Ralls
db84dc8e58 Fix crash when closing a fullscreen window. 2019-03-11 16:16:46 -07:00
Matthias Clasen
e74622b0b8 Merge branch 'clipboard-quartz' into 'gtk-3-24'
gtkclipboard-quartz: Update annotations for gtk_clipboard_wait_for_targets

See merge request GNOME/gtk!624
2019-03-11 15:13:37 +00:00
Jakub Steiner
e8e2f5163c Merge branch 'adwaita-radii-fixes' into 'gtk-3-24'
Adwaita radii fixes

See merge request GNOME/gtk!619
2019-03-11 10:59:55 +00:00
Tomasz Miąsko
593025a917 gtkclipboard-quartz: Update annotations for gtk_clipboard_wait_for_targets
Copy documentation for gtk_clipboard_wait_for_targets from gtk/gtkclipboard.c
to quartz implementation. Primarily to add transfer container annotation as
otherwise pygobject tries to deallocate individual GdkAtoms.

Issue #1584.
2019-03-10 20:54:46 +01:00
Daniel Șerbănescu
ba216dea1c Update Romanian translation 2019-03-10 18:40:35 +00:00
Nathan Follens
5b75be73d5 Update Dutch translation 2019-03-10 13:01:27 +00:00
Matthias Clasen
31a33593cd Merge branch 'adwaita-fix-backdrop-label' into 'gtk-3-24'
Adwaita: Fix label color on backdrop devel window

See merge request GNOME/gtk!623
2019-03-10 01:04:44 +00:00
Alex Monday
22d9241ab4 Adwaita: Fix label color on backdrop devel window
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1734
2019-03-10 00:52:48 +05:00
Matej Urbančič
29ab9926a2 Updated Slovenian translation 2019-03-08 18:09:26 +01:00
Matthias Clasen
54899a369e Merge branch 'adwaita-typo-fix' into 'gtk-3-24'
Adwaita: Fix typo (missing comma)

See merge request GNOME/gtk!617
2019-03-04 17:35:55 +00:00
Alex Monday
1d960d7028 Adwaita: Adjust entry border-radius
Replace entry border-radius value with $button_radius variable.
2019-03-04 22:25:37 +05:00
Alex Monday
44fcc0435c Adwaita: Replace spinbutton border-radii with variables
Replace hardcoded border-radius values with $button_radius
variable on spinbuttons.
2019-03-04 22:25:11 +05:00
Alex Monday
625a0e3d6c Adwaita: Replace all %linked radii with variables
Some of hardcoded border-radius values on linked elements were left
unchanged during Adwaita refresh.
2019-03-04 22:24:20 +05:00
Alex Monday
0b61d6f6ae Adwaita: Fix typo (missing comma)
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1713
2019-03-04 20:30:43 +05:00
Benjamin Otte
28ea04efca Merge branch 'treeview-separator-fix-drawing-zero-height' into 'gtk-3-24'
treeview: make sure separator nodes have a height > 0

See merge request GNOME/gtk!614
2019-03-04 12:22:42 +00:00
John Ralls
c91ca69c2c Merge branch 'aux-window' into gtk-3-24 2019-03-03 20:27:41 -08:00
John Ralls
03c5b92da2 [quartz] Full-screen only "normal" windows and splashscreens.
So dialogs, pop-ups, etc. behave as expected when parent is in
full-screen.

Tiling is allowed for normal windows and splash screens and disallowed
for others.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1627
2019-03-03 20:05:13 -08:00
Matthias Clasen
23eca11c3f Merge branch 'cherry-pick-95c0f072' into 'gtk-3-24'
Merge branch 'master' into 'master'

See merge request GNOME/gtk!615
2019-03-03 20:30:43 +00:00
Emmanuele Bassi
c830ab2d55 Merge branch 'master' into 'master'
A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells

See merge request GNOME/gtk!505

(cherry picked from commit 95c0f07295)

a52431d2 A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells
2019-03-03 20:22:09 +00:00
Christoph Reiter
af6dd6bf35 treeview: make sure separator nodes have a height > 0
In case the theme doesn't set a height/min-height for the treeview
separator the treeview drawing gets confused and draws rows on top of each
other depending on the redraw area.

This is due to gtk_tree_view_get_row_height() assuming that a node with a
height <= 0 is not set and not a separator and it will default to the
expander size.

Ideally gtk_tree_view_get_row_height() would know if it operates on a separator,
but there are too many calls/levels, so just make sure the separator height
is at least 1 (Adwaita already sets "min-height: 2px", so no change there)
2019-03-03 10:44:52 +01:00
Matej Urbančič
93e7c60bd2 Updated Slovenian translation 2019-03-02 20:57:30 +01:00
Daniel Șerbănescu
3abb57a9e7 Update Romanian translation 2019-03-02 16:47:36 +00:00
Asier Sarasua Garmendia
5e89e1d0a9 Update Basque translation 2019-03-02 12:17:46 +00:00
Alex Monday
deba92f729 themes: Optimize code for marks margins on scales
Separate marks margins for horizontal/vertical scales. Prevents
generation of unused margins.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1703
2019-03-02 14:20:02 +05:00
Марко Костић
95e2e48582 Update Serbian translation 2019-03-01 13:07:55 +00:00
Марко Костић
dc927ee698 Update Serbian translation 2019-02-28 18:26:06 +00:00
Jakub Steiner
2cd62574ac Adwaita: define insensitive links
- tone down the disabled/insensitive links.

Fixes issue #1645
2019-02-27 12:10:56 +01:00
Jakub Steiner
1a91c953eb Adwaita: scrolled context menus
- fix margins as per merg request #547
2019-02-27 11:45:27 +01:00
Changwoo Ryu
344baa18e9 Update Korean translation 2019-02-26 16:55:55 +00:00
Changwoo Ryu
6e641932ac Update Korean translation 2019-02-26 16:54:18 +00:00
Jiri Grönroos
288a9341fd Update Finnish translation 2019-02-25 18:31:04 +00:00
Justin van Steijn
12770e505e Update Dutch translation 2019-02-25 18:02:05 +00:00
Emmanuele Bassi
0c81e7a2e6 Merge branch 'tchaik/gtk-menu-accel-group-prop' into 'gtk-3-24'
menu: Fix accel-group property reset

See merge request GNOME/gtk!576
2019-02-23 12:10:42 +00:00
Martin Blanchard
d6840ad3dd menu: Fix accel-group property reset
GtkMenu's "accel-group" property setter, gtk_menu_set_accel_group(),
currently returns in failure if the caller passes it a NULL `accel_group`
argument. This argument is annotated with `(allow-none)`. This patch
add support for the NULL case.
2019-02-23 10:42:23 +00:00
Bastien Nocera
e5b83f1a87 window: Advise using gtk_window_present_with_time()
Rather than gtk_window_present()
2019-02-22 18:38:13 -05:00
Bastien Nocera
8ed0471785 window: Warn when gtk_window_present_with_time() is passed 0
When 0 or GDK_CURRENT_TIME is passed to gtk_window_present_with_time(),
print a warning so that the application developer knows that this isn't
a supported use of the function, but carry on working for now.
2019-02-22 18:38:13 -05:00
Bastien Nocera
5d7183ee0c all: Don't warn about deprecated gtk_window_present usage
Avoid compilation warnings about internal users of gtk_window_present().
2019-02-22 18:38:11 -05:00
Bastien Nocera
2ca4a3cb41 window: Deprecate gtk_window_present()
And expect gtk_window_present_with_time() to be used instead.
2019-02-22 18:34:24 -05:00
Jakub Steiner
864e1ca526 Adwaita: circles for .circular buttons
- doesn't catch all cases, but most buttons need uniform paddings
  to remain circular, not elliptical.

fixes issue #1695
2019-02-22 12:35:32 +01:00
Sveinn í Felli
736dbfef42 Update Icelandic translation 2019-02-21 11:57:06 +00:00
Chun-wei Fan
1a4d396d6f Visual Studio projects: Add include path for FriBidi
The Fribidi headers tend to be under $(PREFIX)\include\fribidi\, so we
want to try to look for these headers in there as well.
2019-02-21 16:44:06 +08:00
Chun-wei Fan
638b136e34 Visual Studio projects: Link to FriBidi
We now need to link to fribidi.lib explicitly in both GDK and GTK.
Since the Pango we require in 3.24.x already requires a FriBidi
installation, the .lib and DLL should already be available for the
build.
2019-02-21 10:19:21 +08:00
John Ralls
512da66761 Silence incompatible type warning. 2019-02-19 11:08:02 -08:00
John Ralls
f3b1704a99 Remove unnecessary casts and silence may-not-return-value warning.
NSPoint and NSRect are typedefs of CGPoint and CGRect so the casts
were unnecessary and confused llvm when compiling 32-bit.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1640
2019-02-19 11:08:02 -08:00
Matthias Clasen
34d6c028b0 Merge branch 'issue-1681' into 'gtk-3-24'
treeview: Don't show empty tooltips

See merge request GNOME/gtk!586
2019-02-18 19:44:57 +00:00
Emmanuele Bassi
2934482aee treeview: Don't show empty tooltips
If the column used for the GtkTreeView:tooltip-column contains NULL
we're already skipping a tooltip; let's ignore empty strings as well,
as an empty tooltip is pretty much pointless.

Close #1681
2019-02-18 17:44:17 +00:00
John Ralls
6afd174162 Merge branch 'suyuan/fix-macos-accented-char-input' into gtk-3-24. 2019-02-17 13:04:20 -08:00
Baurzhan Muftakhidinov
9d12953ccf Update Kazakh translation 2019-02-17 07:25:02 +00:00
Baurzhan Muftakhidinov
347d0de65b Update Kazakh translation 2019-02-17 07:16:07 +00:00
Matej Urbančič
d7a4143a68 Updated Slovenian translation 2019-02-14 18:34:18 +01:00
Matthias Clasen
65edea0406 Merge branch 'issue-1662' into 'gtk-3-24'
Use C locale when building gtktypefuncs.c

See merge request GNOME/gtk!577
2019-02-14 17:13:51 +00:00
Emmanuele Bassi
6058495f50 Use C locale when building gtktypefuncs.c
We're using [a-z] ranges with sed and grep, and POSIX does not specify
their behaviour in non-ASCII locales:

  In the POSIX locale, a range expression represents the set of
  collating elements that fall between two elements in the collation
  sequence, inclusive. In other locales, a range expression has
  unspecified behavior
    -- IEEE Std 1003.1-2017, § 9.3.5 (7)

This can lead to no results, or invalid replacements, which in turn can
lead to broken builds or broken build artifacts.

Fixes: #1662
2019-02-14 17:06:49 +00:00
Jiri Grönroos
68a7da71e3 Update Finnish translation 2019-02-09 18:38:51 +00:00
Matthias Clasen
9f3141fc5c Merge branch 'wip/carlosg/toggle-osk-sparingly' into 'gtk-3-24'
imwayland: Toggle OSK more sparingly

See merge request GNOME/gtk!569
2019-02-08 23:40:00 +00:00
Carlos Garnacho
38a4c4dd37 imwayland: Toggle OSK more sparingly
Specifically it is avoided to be toggled if:
- Just received focus (in order to preserve OSK state across focus changes)
- Moving cursor around. Still allow some jitter as perfect accuracy is not
  possible.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1277
2019-02-09 00:29:56 +01:00
Jakub Steiner
03394c559d Adwaita: lost selectionmode resources
- somehow we lost the selection mode image resources
- FIXME: checkbox-active-selectionmode is not being used.
2019-02-08 15:53:00 +01:00
Matthias Clasen
1d4eac211c Merge branch 'wip/fix-submenu-size' into 'gtk-3-24'
Fix submenu size

See merge request GNOME/gtk!565
2019-02-07 21:29:22 +00:00
Jonas Ådahl
57300b4960 menu: Fixate size calculated by gdk_window_move_to_rect()
When we receive a size from the move-to-rect implementation, force GTK
to continue using that size until reconfigured by move-to-rect, or
when remapped.

Fixes: #1651
2019-02-07 10:01:05 +01:00
Jonas Ådahl
7298e73c44 menu: Force recalculation of size before positioning
On X11, the position of the menu is calculated synchronously by
gdk_window_move_to_rect(). This means that calculating the window size
when showing is too late, as that'd mean the size used when calculating
the position is out-of-date. The first time a menu is mapped, however,
the size is calculated during realization; but a window is only realized
once, so it doesn't work for subsequent maps.

Currently, this is harmless, as a GtkMenu can change its size however it
wants after it has been mapped. This, however, is problematic, as it
means the position calculated by gdk_window_move_to_rect() might no
longer be valid, or constraints made by the same function might no
longer be respected.

Thus, this is a preparation for making GtkMenu popups stay the same size
until they are remapped again at a later point.
2019-02-07 10:01:05 +01:00
Jonas Ådahl
461f5fde03 window: Add private API to force-resize
Sometimes (read for GtkMenu on X11) it's not enough to resize on show,
and relying on the size to be calculated on realization only works the
first time a menu is popped up, so add an API that GtkMenu can use to
ensure the size of a menu is "refreshed" before passing anything along
to gdk_window_move_to_rect().
2019-02-07 10:01:05 +01:00
Jonas Ådahl
edb57a9202 window: Add private API to fixate size
This causes window size guessing to always use the remembered size (the
size of the GdkWindow). This will be useful for menus which size is
managed by gdk_window_move_to_rect(), to avoid overriding the size
calculated by the move-to-rect implementation.
2019-02-06 19:34:20 +01:00
Emmanuele Bassi
5b360f2198 Merge branch '3-24-warn-fixes' into 'gtk-3-24'
Fix various compiler warnings

See merge request GNOME/gtk!561
2019-02-05 14:47:26 +00:00
Emmanuele Bassi
43980583e3 sw: Do not cast clear function in g_clear_pointer()
We don't need to do it, since g_clear_pointer() will do it for us, and
will also check if the function conforms to a GDestroyNotify. Using an
explicit cast will generate a compiler warning.
2019-02-05 15:35:27 +01:00
Emmanuele Bassi
8f8b68f847 Terminate strncpy() buffers correctly
When using strncpy() with a buffer we need to account for the
terminating NUL character. GCC 8 started warning when using PPD_MAX_NAME
as the buffer length for strncpy() because the buffer we're copying into
has the same length — which means that the terminating NUL may be
skipped if the source string has a length of PPD_MAX_NAME.

The appropriate way to handle the case where we're copying a source with
a length bigger than of PPD_MAX_NAME is, as reported in the strncpy()
documentation, to copy `PPD_MAX_NAME - 1` bytes, and explicitly NUL
terminate the destination buffer. This has the additional benefit of
avoiding the compiler warning.
2019-02-05 15:34:08 +01:00
Matthias Clasen
df77965153 Update css node tests
The GtkSwitch now has two image nodes.
2019-02-05 09:33:37 -05:00
Emmanuele Bassi
eb732b3f68 container: Disable deprecation warnings
We know we're using deprecated GtkContainer API, because we're
implementing it.
2019-02-05 15:23:09 +01:00
Emmanuele Bassi
c2ddb932b2 popover: Disable deprecation warning
For gtk_render_frame_gap().
2019-02-05 15:22:06 +01:00
Emmanuele Bassi
d9d3ec7cad menu: Fix condition check
A logical "and" became a binary "and" in commit c35878ec.
2019-02-05 15:18:41 +01:00
Alexander Larsson
1bbff35383 Merge branch '1633-gtk-3-24' into 'gtk-3-24'
Issue #1633 - Ensure focus on click

See merge request GNOME/gtk!560
2019-02-05 13:22:01 +00:00
Mickael Istria
9b394d8753 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-05 14:13:22 +01:00
Matthias Clasen
47e4a111c2 Try again
We only want fribidi as a private dependency.
2019-02-05 08:04:14 -05:00
Matthias Clasen
f533ef8650 Link gdk against fribidi
It is required now.
2019-02-05 07:17:07 -05:00
Matthias Clasen
bf60bf15de 3.24.5 2019-02-04 11:48:56 -05:00
Jakub Steiner
224213dad6 Adwaita: selection mode buttons fix
- don't allow the headerbar :active darkening (bug #1588) to override
  selection-mode blue buttons.

Fixes issue #1642
2019-02-04 17:24:55 +01:00
Jakub Steiner
1661e2888a Merge branch 'wip/jimmac/adwaita-3-32' into 'gtk-3-24'
Wip/jimmac/adwaita 3 32

See merge request GNOME/gtk!551
2019-02-04 14:27:58 +00:00
Alex Monday
7c325ed852 HighContrast: Add style for overflow buttons
Add missing style for overflow buttons located on scrollable dropdown
menus.
2019-02-04 15:08:07 +01:00
Alex Monday
950480cea4 HighContrast: Add menu padding
Add 1px padding to menus, to prevent menuitems and overflow buttons
overlapping with menu's border.
2019-02-04 15:07:56 +01:00
Jakub Steiner
57ba052522 Revert "HighContrast: Add style for overflow buttons"
This reverts commit ff4dcf5fa4.
2019-02-04 15:05:43 +01:00
Jakub Steiner
af3bcc6adc Revert "HighContrast: Add menu padding"
Revert conflicting patches to rebase adwaita-3-32 easily. will apply afterwards.

This reverts commit a7ea8248ce.
2019-02-04 15:05:43 +01:00
Balázs Úr
391469e365 Update Hungarian translation 2019-02-04 15:05:43 +01:00
Balázs Úr
cca1cf03df Update Hungarian translation 2019-02-04 15:05:43 +01:00
Matthias Clasen
ffa8fef2fa gtk: Stop using deprecated pango api 2019-02-04 15:05:43 +01:00
Matthias Clasen
13c126b277 gtk: 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 15:05:43 +01:00
Matthias Clasen
148650c23a gdk: Stop using deprecated pango api 2019-02-04 15:05:43 +01:00
Matthias Clasen
8c973bd837 gdk: Add a copy of pango_unichar_direction
This api has been deprecated in pango.
2019-02-04 15:05:43 +01:00
Matthias Clasen
3e5a7bb898 Add an explicit fribidi dependency
We already depend on it indirectly, via pango.
And we will use it to replace deprecated pango apis.
2019-02-04 15:05:43 +01:00
Christian Hergert
53767ce1d3 quartz: release linked list as we process it
Rather than performing the list iteration and the list free as separate
steps, free the list link while iterating.
2019-02-04 15:05:43 +01:00
Alex Monday
806e98d67e HighContrast: Add style for overflow buttons
Add missing style for overflow buttons located on scrollable dropdown
menus.
2019-02-04 15:05:43 +01:00
Alex Monday
377b2872be HighContrast: Add menu padding
Add 1px padding to menus, to prevent menuitems and overflow buttons
overlapping with menu's border.
2019-02-04 15:05:43 +01:00
Emmanuele Bassi
e28c7a41ee switch: Take gadget clip into account
Now that we've switched the on and off states to gadgets, we need to
ensure that the widget's clip take into account the clip of every
gadget.

Fixes #1631
2019-02-04 15:05:43 +01:00
Tomasz Miąsko
7644c0866b g-i: Add transfer none annotations for frame clock timings getters 2019-02-04 15:05:43 +01:00
Alex Monday
933765204f Adwaita: Horizontal OSD spinbutton entry fix
Add placeholder to hande horizontal spinbutton entries,
add instructions for horizontal OSD spinbutton entry to use this
placeholder.
2019-02-04 15:05:43 +01:00
Balázs Úr
43b6541eae Update Hungarian translation 2019-02-03 13:57:00 +00:00
Balázs Úr
3937fb4ebe Update Hungarian translation 2019-02-02 14:55:21 +00:00
Benjamin Otte
df890474ed Merge branch 'pango-deprecations' into 'gtk-3-24'
Pango deprecations

See merge request GNOME/gtk!544
2019-01-31 20:08:30 +00:00
Matthias Clasen
a3f1e02b9b gtk: Stop using deprecated pango api 2019-01-31 14:07:28 -05:00
Matthias Clasen
c23e07f60f gtk: 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-01-31 14:07:28 -05:00
Matthias Clasen
3da6497d9f gdk: Stop using deprecated pango api 2019-01-31 14:07:28 -05:00
Matthias Clasen
998314b8ba gdk: Add a copy of pango_unichar_direction
This api has been deprecated in pango.
2019-01-31 14:07:28 -05:00
Matthias Clasen
417c57e5b7 Add an explicit fribidi dependency
We already depend on it indirectly, via pango.
And we will use it to replace deprecated pango apis.
2019-01-31 14:07:28 -05:00
Christian Hergert
99d013994b quartz: release linked list as we process it
Rather than performing the list iteration and the list free as separate
steps, free the list link while iterating.
2019-01-31 17:55:19 +01:00
Alex Monday
ff4dcf5fa4 HighContrast: Add style for overflow buttons
Add missing style for overflow buttons located on scrollable dropdown
menus.
2019-01-31 16:43:39 +01:00
Alex Monday
a7ea8248ce HighContrast: Add menu padding
Add 1px padding to menus, to prevent menuitems and overflow buttons
overlapping with menu's border.
2019-01-31 16:43:30 +01:00
Alex Monday
7395160e5b Adwaita: Improve dropdown menu buttons
Improve overflow arrow buttons drawing on a scrollable dropdown menu:
reduce top button's margin-top to match size of a bottom button, add
margin-top for bottom button to compensate bottom margin (otherwise
button overlaps with menu content).

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1539
2019-01-31 16:42:32 +01:00
Suyuan Chang
cfad43b80d macOS: Fix bug that entry cannot press and hold a key to input accented character.
There're two issues in GdkQuartzView's NSTextInputClient implementation
causes this bug.

1. The -(NSRange)selectedRange should not return [NSNotFound, 0] if
   there's no selection. The accented character window will not show
   if returned NSRange's location is NSNotFound. Instead of that, the
   NSRange's location should be the caret position in the text input
   buffer.

2. The accented character window will invoke
   -(void)insertText:replacementRange: with non-empty replacement
   range, to replace non-accented character with accented character
   after user select it from accented character window. This case is
   not implemented in original code. Here I use another gobject data
   to pass the information to input module and convert it into
   'delete-surrounding' event.

Besides these, there's another bug cause gtk_im_context_filter_keypress()
return wrong value while user press and hold a key. When user press
and hold a key, the accented character window will consume the
repeating key down event. Is this case, gtk_im_context_filter_keypress()
should return TRUE, indicate the key press is filtered by input
method module. But it will return FALSE because
gtk_im_context_filter_keypress() assume that every key press event
will generate some text from input method module.

Fixes #1618
2019-01-30 22:07:23 -08:00
Benjamin Otte
2c15e59c16 Merge branch 'issue-1631' into 'gtk-3-24'
switch: Take gadget clip into account

See merge request GNOME/gtk!543
2019-01-30 19:20:46 +00:00
Emmanuele Bassi
0a9aa768d8 switch: Take gadget clip into account
Now that we've switched the on and off states to gadgets, we need to
ensure that the widget's clip take into account the clip of every
gadget.

Fixes #1631
2019-01-30 18:41:24 +00:00
Christoph Reiter
a0129f556b Merge branch 'get-timings-transfer-3' into 'gtk-3-24'
g-i: Add transfer none annotations for frame clock timings getters

See merge request GNOME/gtk!512
2019-01-29 10:36:19 +00:00
Jakub Steiner
64c28f40a0 Merge branch 'adwaita-osd-spinbutton-entry-fix-3-24' into 'gtk-3-24'
Horizontal OSD spinbutton entry fix

See merge request GNOME/gtk!331
2019-01-29 09:40:51 +00:00
Jakub Steiner
b522c59880 Adwaita: switches with no labels
- it's less busy and still clearer without the label
- It may be right that color alone is a poor differentiator,
  but labels do still exist for the accessible theme.
2019-01-28 12:34:48 +01:00
Jakub Steiner
519ff2ac6a Merge branch 'fix-button-icon-position' into 'wip/jimmac/adwaita-3-32'
Adwaita: Fix wrong icon position in some buttons

See merge request GNOME/gtk!533
2019-01-28 11:57:42 +01:00
Jakub Steiner
6f1e611c3b Merge branch 'wip/jimmac/adwaita-3-32' into 'fix-button-icon-position'
# Conflicts:
#   gtk/theme/Adwaita/_common.scss
#   gtk/theme/Adwaita/gtk-contained-dark.css
#   gtk/theme/Adwaita/gtk-contained.css
2019-01-28 10:46:48 +00:00
Sam Hewitt
17ab084f28 Adwaita: fix padding and rounding on menubar submenus 2019-01-28 11:43:54 +01:00
Jakub Steiner
4d08be5d03 Adwaita: selection mode labels
- when not in focus, make sure labels are legible
  but flat.

Fixes issue #1562
2019-01-28 11:43:54 +01:00
Jakub Steiner
b6082efdc0 Adwaita: use neutral greys for dark
- the hint of warm color is too subtle to even notice for most people

Fixes issue #1589
2019-01-28 11:43:54 +01:00
Jakub Steiner
aa1e565fb5 Adwaita: darken dark mode
- match lightness of the old theme.

Fixes issue #1605
2019-01-28 11:43:54 +01:00
feichtmeier
fec7874d0e Reduce vertical menu padding from 8px to 4px 2019-01-28 11:43:54 +01:00
Jakub Steiner
72010d7894 Adwaita: do show labels on switches
- now that we have I/O and not ON/OFF
2019-01-28 11:43:54 +01:00
Jakub Steiner
25bf546eee Adwaita: headerbar buttons separators
- make the border more aparent for when two :active buttons
  are neighboring (Builder panel toggles).
2019-01-28 11:43:54 +01:00
Jakub Steiner
24e6995d92 Adwaita: headerbar togglebuttons backdrop
- redefine overriden backdrop state
2019-01-28 11:43:54 +01:00
Jakub Steiner
079aef0b8d Adwaita: expand the headerbar button styling
- it's not just stackswitcher buttons, apparently. Builder uses
  togglebuttons.
2019-01-28 11:43:54 +01:00
Jakub Steiner
7da52e5255 Adwaita: don't do undershoot
- No need to indicate overflown content. No other OS does this.

fixes #1591
2019-01-28 11:43:54 +01:00
Jakub Steiner
568ea3b7f9 Adwaita: update image assets
- mainly sliders

fixes #1590
2019-01-28 11:43:54 +01:00
Jakub Steiner
0f764eb16e Adwaita: make switcher buttons' active darker
- create more contrast against the headerbar background without lowering
  contrast with the label and border.
- top border shaded for extra aid of the state being pressed (in the two button   scenatio)

Addesses issue #1588
2019-01-28 11:43:54 +01:00
Jakub Steiner
de1f87b1f4 Adwaita: tone down the window roundounding 2019-01-28 11:43:54 +01:00
Jakub Steiner
86acf52032 Adwaita: button-alt toning down
- checkboxes and radios were too 3d
2019-01-28 11:43:54 +01:00
Jakub Steiner
c514cf75e4 Adwaita: darker active state for buttons 2019-01-28 11:43:54 +01:00
Jakub Steiner
5c67d7d7b1 Adwaita: selection dropdown vcentering
- somewhat odd off-center vertical centering on the selection
  filter popover
2019-01-28 11:43:54 +01:00
Jakub Steiner
5a7fc7e352 Adwaita: remove chin from circular buttons
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:54 +01:00
Jakub Steiner
3b81932981 Adwaita: colored/darker button tweaks
- less contrasty border on colored buttons
- tone down edge highlight on darker buttons

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:54 +01:00
Jakub Steiner
71cfb8e077 Adwaita: rounding of popovers
- you give Tobias a finger and he grbs the whole arm

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
37c47d70f6 Adwaita: no hardsh bottom shading
- felt like an inset shadow in some situations

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
0e95206697 Adwaita: non-square buttons rejiggle
- rather than squishing vertically, stretch horizontally.
  The previous method made some non-button widgets odd looking.

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
99a48fe7e7 Adwaita: headerbar radius
- last occurence of window border radius, I swear :)

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
60230b4653 Adwaita: window radius
- found the lapo magic to fix the non-csd corner anti-aliasing
- csd headerbars to do

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
9b820cde49 Adwaita: a *hair* lighter shadows
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
15bd30d222 Adwaita: move button shadows down a pixel
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
8d205fd518 Adwaita: slightly larger radius for windows
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
b06712d3c9 Adwaita: modals also need the rame rounding
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
83a45d3bb0 Adwaita: increase window radius
- to match the button radius, increase the windwo border radius

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
aa1593505d Adwaita: no 'chin' for buttons
- box-shadow doesn't mix with the chin

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
501bce47ea Adwaita: buttons cast a shadow
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
585569f66e Adwaita: squash buttons as per reqs
- not a big fan of this one

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
5541152724 Adwaita: hide close separator
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
1c5071c346 Adwaita: round buttons
- Grumpy old man commits the first thing he dislikes on
  Allan's proposal.

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-28 11:43:53 +01:00
Jakub Steiner
7e623b4f12 Adwaita: GNOME 3.32 changes
- colorsheme based on the new icon HIG color palette
- new switches
- darker headerbar to contrast with unfocused windows
- raised buttons derived from the icon style
2019-01-28 11:43:53 +01:00
Balázs Úr
3215c0a3a9 Update Hungarian translation 2019-01-27 20:01:56 +00:00
nana-4
d82edf0c91 Adwaita: Fix wrong icon position in some buttons
This commit reverts min-width sizes and changes horizontal padding instead in
order to avoid off-centered button icons.

Fixes #1621
2019-01-25 21:02:47 +09:00
Sam Hewitt
cde6ae938e Adwaita: fix padding and rounding on menubar submenus 2019-01-24 11:32:25 -05:00
Jakub Steiner
e7d7cb580e Adwaita: selection mode labels
- when not in focus, make sure labels are legible
  but flat.

Fixes issue #1562
2019-01-22 12:15:47 +01:00
Jakub Steiner
f2c3481b5c Adwaita: use neutral greys for dark
- the hint of warm color is too subtle to even notice for most people

Fixes issue #1589
2019-01-22 11:59:40 +01:00
Jakub Steiner
393a016c5a Adwaita: darken dark mode
- match lightness of the old theme.

Fixes issue #1605
2019-01-22 11:55:10 +01:00
Jakub Steiner
1f9ee936e8 Merge branch 'Menus_based_on_wip/jimmac/adwaita-3-32' into 'wip/jimmac/adwaita-3-32'
Reduce vertical menu padding from 8px to 4px

See merge request GNOME/gtk!520
2019-01-21 21:24:44 +01:00
feichtmeier
254719ee50 Reduce vertical menu padding from 8px to 4px 2019-01-21 20:31:19 +01:00
Jakub Steiner
dc144d1266 Adwaita: do show labels on switches
- now that we have I/O and not ON/OFF
2019-01-21 19:34:33 +01:00
Jakub Steiner
c82d6f9872 Adwaita: headerbar buttons separators
- make the border more aparent for when two :active buttons
  are neighboring (Builder panel toggles).
2019-01-21 13:16:42 -05:00
Jakub Steiner
6ff9e5ab7d Adwaita: headerbar togglebuttons backdrop
- redefine overriden backdrop state
2019-01-21 13:16:42 -05:00
Jakub Steiner
b8d142f8b8 Adwaita: expand the headerbar button styling
- it's not just stackswitcher buttons, apparently. Builder uses
  togglebuttons.
2019-01-21 13:16:42 -05:00
Jakub Steiner
e66c0a45d4 Adwaita: don't do undershoot
- No need to indicate overflown content. No other OS does this.

fixes #1591
2019-01-21 13:16:42 -05:00
Jakub Steiner
83dcdaa402 Adwaita: update image assets
- mainly sliders

fixes #1590
2019-01-21 13:16:42 -05:00
Jakub Steiner
091b189ce3 Adwaita: make switcher buttons' active darker
- create more contrast against the headerbar background without lowering
  contrast with the label and border.
- top border shaded for extra aid of the state being pressed (in the two button   scenatio)

Addesses issue #1588
2019-01-21 13:16:42 -05:00
Jakub Steiner
0fc284bf61 Adwaita: tone down the window roundounding 2019-01-21 13:16:42 -05:00
Jakub Steiner
e51f08bda0 Adwaita: button-alt toning down
- checkboxes and radios were too 3d
2019-01-21 13:16:42 -05:00
Jakub Steiner
1efa376b83 Adwaita: darker active state for buttons 2019-01-21 13:16:42 -05:00
Jakub Steiner
6d391b89b8 Adwaita: selection dropdown vcentering
- somewhat odd off-center vertical centering on the selection
  filter popover
2019-01-21 13:16:42 -05:00
Jakub Steiner
4300a5c609 Adwaita: remove chin from circular buttons
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
914813c44a Adwaita: colored/darker button tweaks
- less contrasty border on colored buttons
- tone down edge highlight on darker buttons

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
c529de1765 Adwaita: rounding of popovers
- you give Tobias a finger and he grbs the whole arm

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
71a97accf2 Adwaita: no hardsh bottom shading
- felt like an inset shadow in some situations

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
7a51da1e69 Adwaita: non-square buttons rejiggle
- rather than squishing vertically, stretch horizontally.
  The previous method made some non-button widgets odd looking.

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
2badd5f45a Adwaita: headerbar radius
- last occurence of window border radius, I swear :)

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
92ebd74101 Adwaita: window radius
- found the lapo magic to fix the non-csd corner anti-aliasing
- csd headerbars to do

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:42 -05:00
Jakub Steiner
df40f2cc2b Adwaita: a *hair* lighter shadows
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
2dd73b7f76 Adwaita: move button shadows down a pixel
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
034103b078 Adwaita: slightly larger radius for windows
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
9f885ba16c Adwaita: modals also need the rame rounding
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
d5fcc8d522 Adwaita: increase window radius
- to match the button radius, increase the windwo border radius

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
213aeffd62 Adwaita: no 'chin' for buttons
- box-shadow doesn't mix with the chin

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
25148ac344 Adwaita: buttons cast a shadow
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
8fc57f144c Adwaita: squash buttons as per reqs
- not a big fan of this one

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
8a7023fe33 Adwaita: hide close separator
https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
6ef7c2ef29 Adwaita: round buttons
- Grumpy old man commits the first thing he dislikes on
  Allan's proposal.

https://gitlab.gnome.org/GNOME/gtk/issues/1510
2019-01-21 13:16:41 -05:00
Jakub Steiner
3fa0e4b0be Adwaita: GNOME 3.32 changes
- colorsheme based on the new icon HIG color palette
- new switches
- darker headerbar to contrast with unfocused windows
- raised buttons derived from the icon style
2019-01-21 13:16:41 -05:00
Tomasz Miąsko
ea286fe8f9 g-i: Add transfer none annotations for frame clock timings getters 2019-01-17 10:13:29 +01:00
Alex Monday
bbcc832393 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:26:20 +05:00
481 changed files with 40973 additions and 20778 deletions

View File

@@ -1,4 +1,4 @@
image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1
image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2
stages:
- build
@@ -7,12 +7,38 @@ cache:
paths:
- _ccache/
build:
fedora-autotools:
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh
- bash -x ./.gitlab-ci/test-docker-autotools.sh
msys2-mingw32:
fedora-meson:
stage: build
script:
- bash -x ./.gitlab-ci/test-docker-meson.sh
artifacts:
when: always
name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
msys2-mingw32-meson:
variables:
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
stage: build
tags:
- win32
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh"
artifacts:
when: always
name: "gtk3-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
paths:
- "_build/meson-logs"
msys2-mingw32-autotools:
when: manual
variables:
MSYSTEM: "MINGW32"
@@ -22,4 +48,4 @@ msys2-mingw32:
- win32
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-autotools.sh"

View File

@@ -1,4 +1,4 @@
FROM fedora:28
FROM fedora:29
RUN dnf -y install \
adwaita-icon-theme \
@@ -10,6 +10,7 @@ RUN dnf -y install \
ccache \
colord-devel \
cups-devel \
dbus-x11 \
fribidi-devel \
gcc \
gcc-c++ \
@@ -23,8 +24,10 @@ RUN dnf -y install \
graphene-devel \
gtk-doc \
hicolor-icon-theme \
iso-codes \
itstool \
json-glib-devel \
libcloudproviders-devel \
libepoxy-devel \
libmount-devel \
librsvg2 \
@@ -42,12 +45,19 @@ RUN dnf -y install \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
meson \
ninja-build \
pango-devel \
python3 \
python3-pip \
python3-wheel \
redhat-rpm-config \
rest-devel \
sassc \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
xorg-x11-server-Xvfb
xorg-x11-server-Xvfb \
&& dnf clean all
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}

View File

@@ -8,7 +8,7 @@
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1"
TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2"
# HOST_USER_ID gets used to create a user with the same ID so that files
# created in the mounted volume have the same owner

View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -e
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
mkdir _build
cd _build
../autogen.sh \
--enable-cloudproviders \
--enable-broadway-backend \
--enable-xinerama \
--enable-gtk-doc
make -j8

29
.gitlab-ci/test-docker-meson.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -e
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
export PATH="${HOME}/.local/bin:${PATH}"
python3 -m pip install --user meson==0.49.2
meson \
-Dgtk_doc=true \
-Dman=true \
-Dbroadway_backend=true \
-Dxinerama=yes \
-Dprint_backends="file,lpr,test,cloudprint,cups" \
_build
cd _build
ninja
xvfb-run -a -s "-screen 0 1024x768x24" \
meson test \
--timeout-multiplier 4 \
--print-errorlogs \
--suite=gtk+-3.0 \
ninja gail-libgail-util3-doc gdk3-doc gtk3-doc

View File

@@ -1,10 +0,0 @@
#!/bin/bash
set -e
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
./autogen.sh
make -j8

View File

@@ -14,7 +14,6 @@ pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
git \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \

View File

@@ -0,0 +1,49 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export MSYS2_ARCH="i686"
else
export MSYS2_ARCH="x86_64"
fi
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-gdk-pixbuf2 \
mingw-w64-$MSYS2_ARCH-glib2 \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-libepoxy \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-meson \
mingw-w64-$MSYS2_ARCH-ninja \
mingw-w64-$MSYS2_ARCH-gtk-doc \
mingw-w64-$MSYS2_ARCH-sassc
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# Build
ccache --zero-stats
ccache --show-stats
meson \
-Dman=true \
-Dbroadway_backend=true \
_build
ninja -C _build
ccache --show-stats

View File

@@ -22,7 +22,13 @@ EXTRA_DIST += \
sanitize-la.sh \
po/README.translators \
po/po2tbl.sed.in \
make-pot
make-pot \
meson_options.txt \
meson.build \
po/meson.build \
po-properties/meson.build \
build-aux/meson/post-install.py \
config.h.meson
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \

97
NEWS
View File

@@ -1,3 +1,100 @@
Overview of Changes in GTK+ 3.24.8
==================================
* Color editor: don't warn if editing is cancelled
* Always redraw on allocate - not doing so is
not safe when any widget can have a background
* Use GLSL 3.30 for shaders
* Quartz: add a preliminary GdkGLContext implementation
* Win32: Fix a bug that prevented storing printer driver prefs
* Wayland: properly place window menus
* GtkApplication: support session state changes in
sandboxes, using the inhibit portal
* Fix a problem with autostart notification
* Places: Show loop devices as reported by gvfs
* Translation updates:
Brazilian Portuguese
Catalan
Czech
German
Hungarian
Indonesian
Italian
Polish
Romanian
Spanish
Swedish
Turkish
Overview of Changes in GTK+ 3.24.7
==================================
* Undeprecate gtk_window_present
Overview of Changes in GTK+ 3.24.6
==================================
* Link against fribidi
* Broadway: Ensure focus on click
* Fix some compiler warnings
* Improve menu positioning with move-to-rect
* Improve activation of the onscreen keyboard
* Use C locale when generating code
* Treeview: Make sure separator nodes have height > 0
* theme
- Fix some inconsistences for radii
* quartz:
- Full-screen only normal windows
- Restore key-window switching when changing windows
- Change monitor geometry calculation
- search: Limit the cop of Spotlight search
* Translation updates:
Basque
Dutch
Finnish
Icelandic
Kazakh
Korean
Romanian
Serbian
Slovenian
Overview of Changes in GTK+ 3.24.5
==================================
* Adwaita: Refresh the theme
* HighContrast: Refresh the theme
* Wayland: Implement gdk_window_present
* GtkSwitch: Use icons instead of glyphs
* Translation updates:
Hungarian
Overview of Changes in GTK+ 3.24.4
==================================

View File

@@ -181,6 +181,96 @@ instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
3) Using Meson (for Visual Studio and MinGW builds)
---
Meson can now be used to build GTK+-3.x with either MinGW or Visual Studio.
You will need the following items in addition to all the dependencies
listed above:
- Python 3.5 or later
- Meson build system, 0.48.0 or later
- Ninja (if not using the Visual Studio project generator for
Visual Studio 2010, 2015, 2017, 2019)
- CMake (optional, used for dependency searching)
- pkg-config (optional, or some compatible tool, highly recommended)
For all Windows builds, note that unless -Dbuiltin_immodules=no is specified,
the input modules (immodules) are built directly into the GTK DLL.
For building with Meson using Visual Studio, do the following:
Create an empty build directory somewhere that is on the same drive
as the source tree, and launch the Visual Studio command prompt that
matches the build configuration (Visual Studio version and architecture),
and run the following:
- Ensure that both the installation directory of Python and its script
directory is in your PATH, as well as the Ninja, CMake and pkg-config
executables (if used). If a pkg-config compatible drop-in replacement
tool is being used, ensure that PKG_CONFIG is set to point to the
executable of that tool as well.
- For non-GNOME dependencies (such as Cairo and Harfbuzz), where pkg-config
files or CMake files could not be properly located, set INCLUDE and LIB
to ensure that their header files and .lib files can be found respectively.
The DLLs of those dependencies should also be in the PATH during the build
as well, especially if introspection files are to be built.
- For GNOME dependencies, the pkg-config files for those dependencies should
be searchable by pkg-config (or a compatible tool). Verify this by running
$(PKG_CONFIG) --modversion <dependency>.
- Run the following:
meson <path_to_directory_of_this_file> --buildtype=... --prefix=...,
where buildtype can be release, debugoptimized, debug or plain. Please
refer to the Meson documentation for more details. You may also wish to
pass in -Dbroadway_backend=true if building the Broadway GDK backend is
desired, and/or pass in -Dbuiltin_immodules=no to build the immodules as
standalone DLLs that can be loaded by GTK dynamically. For Visual Studio
2010, 2015, 2017 and 2019 builds, you may pass in --backend=vs to generate
Visual Studio project files to be used to carry out the builds.
If you are building with Visual Studio 2008, note the following items as well:
- For x64 builds, the compiler may hang when building the certain files, due
to optimization issues in the compiler. If this happens, use the Windows
Task Manager and terminate all cl.exe processes, and the build will fail
with the source files that did not finish compiling due to the hang.
Look for them in build.ninja in the build directory, and change their compiler
flag "/O2" to "/O1", and the compilation and linking should proceed normally.
At this time of writing, the following files are known to cause this hang:
gtk\gtkfilechoosernativewin32.c
gtk\gtkfilesystemmodel.c
gtk\gtktextsegment.c
gtk\gtktextbtree.c
gtk\gtkrbtree.c
testsuite\gtk\treemodel.c
testsuite\gtk\textbuffer.c
testsuite\gtk\rbtree.c
testsuite\gtk\icontheme.c
- Upon running install (via "ninja install"), it is likely that
gtk-query-immodules-3.0.exe will fail to run as it cannot find msvcr90.dll or
msvcr90D.dll. You can ignore this if you did not specify -Dbuiltin_immodules=no
when configuring via Meson. If -Dbuiltin_immodules=no is specified, you need to
run the following after embedding the manifests as outlined in the next point:
<gtk_install_prefix>\bin\gtk-query-immodules-3.0.exe > <gtk_install_prefix>\lib\gtk-3.0\3.0.0\immodules.cache
- You will need to run the following upon completing install, from the build
directory in the Visual Studio 2008/SDK 6.0 command prompt (third line is not
needed unless -Dbuiltin_immodules=no is specified) so that the built binaries
can run:
for /r %f in (*.dll.manifest) do if exist <gtk_install_prefix>\bin\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\bin\%~nf;2
for /r %f in (*.exe.manifest) do if exist <gtk_install_prefix>\bin\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\bin\%~nf;1
for /r %f in (*.dll.manifest) do if exist <gtk_install_prefix>\lib\gtk-3.0\3.0.0\immodules\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\lib\gtk-3.0\3.0.0\immodules\%~nf;2
- The more modern visual style for the print dialog is not applied for Visual
Studio 2008 builds. Any solutions to this is really appreciated.
Using GTK+ on Win32
===================

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env python3
import os
import shutil
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_bindir = sys.argv[3]
gtk_libdir = sys.argv[4]
gtk_datadir = sys.argv[5]
gtk_query_immodules = os.path.join(gtk_bindir, 'gtk-query-immodules-' + gtk_api_version)
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
if os.name == 'nt':
for lib in ['gdk', 'gtk', 'gailutil']:
# Make copy for MSVC-built .lib files, e.g. xxx-3.lib->xxx-3.0.lib
installed_lib = os.path.join(gtk_libdir, lib + '-' + gtk_api_version.split('.')[0] + '.lib')
installed_lib_dst = os.path.join(gtk_libdir, lib + '-' + gtk_api_version + '.lib')
if os.path.isfile(installed_lib):
shutil.copyfile(installed_lib, installed_lib_dst)
print('Compiling GSettings schemas...')
subprocess.call(['glib-compile-schemas',
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
subprocess.call(['gtk-update-icon-cache', '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
immodule_cache_file = open(os.path.join(gtk_moduledir, 'immodules.cache'), 'w')
subprocess.call([gtk_query_immodules], stdout=immodule_cache_file)
immodule_cache_file.close()
# Untested!
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_printmodule_dir])

View File

@@ -10,7 +10,7 @@
<GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="Gdk"</GdkDefines>
<GtkIncludedImmodulesDefines>INCLUDE_IM_am_et;INCLUDE_IM_cedilla;INCLUDE_IM_cyrillic_translit;INCLUDE_IM_ime;INCLUDE_IM_inuktitut;INCLUDE_IM_ipa;INCLUDE_IM_multipress;INCLUDE_IM_thai;INCLUDE_IM_ti_er;INCLUDE_IM_ti_et;INCLUDE_IM_viqr</GtkIncludedImmodulesDefines>
<GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="i686-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED</GtkDefines>
<GtkGdkCommonLibs>pangowin32-1.0.lib;imm32.lib</GtkGdkCommonLibs>
<GtkGdkCommonLibs>pangowin32-1.0.lib;fribidi.lib;imm32.lib</GtkGdkCommonLibs>
<GdkAdditionalLibs>winmm.lib;dwmapi.lib;setupapi.lib;$(GtkGdkCommonLibs)</GdkAdditionalLibs>
<GdkBroadwayAdditionalLibs>ws2_32.lib</GdkBroadwayAdditionalLibs>
<GtkAdditionalLibs>atk-1.0.lib;winspool.lib;comctl32.lib;$(GtkGdkCommonLibs)</GtkAdditionalLibs>
@@ -26,7 +26,7 @@ nmake -f gtk-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstall
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\fribidi;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<MultiProcessorCompilation>true</MultiProcessorCompilation>

View File

@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include"
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\fribidi;$(GlibEtcInstallRoot)\include"
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;_USE_MATH_DEFINES"
ForcedIncludeFiles="msvc_recommended_pragmas.h"
AdditionalOptions="/MP"
@@ -45,7 +45,7 @@
/>
<UserMacro
Name="GtkGdkCommonLibs"
Value="pangowin32-1.0.lib imm32.lib"
Value="pangowin32-1.0.lib fribidi.lib imm32.lib"
/>
<UserMacro
Name="GdkBroadwayAdditionalLibs"

292
config.h.meson Normal file
View File

@@ -0,0 +1,292 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#mesondefine ENABLE_NLS
/* The prefix for our gettext translation domains. */
#mesondefine GETTEXT_PACKAGE
/* Disable deprecation warnings from glib */
#mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#mesondefine HAVE_BIND_TEXTDOMAIN_CODESET
/* Define if libcloudproviders is available */
#mesondefine HAVE_CLOUDPROVIDERS
/* define if we have colord */
#mesondefine HAVE_COLORD
/* Define to 1 if you have the <crt_externs.h> header file. */
#mesondefine HAVE_CRT_EXTERNS_H
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#mesondefine HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
*/
#mesondefine HAVE_DECL_ISINF
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
*/
#mesondefine HAVE_DECL_ISNAN
/* Define to 1 if you have the <dev/evdev/input.h> header file. */
#mesondefine HAVE_DEV_EVDEV_INPUT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#mesondefine HAVE_DLFCN_H
/* Define to 1 if you have the `exp2' function. */
#mesondefine HAVE_EXP2
/* Define to 1 if you have the `flockfile' function. */
#mesondefine HAVE_FLOCKFILE
/* Define to 1 if you have the <ftw.h> header file. */
#mesondefine HAVE_FTW_H
/* Define to 1 if you have the `getpagesize' function. */
#mesondefine HAVE_GETPAGESIZE
/* Define to 1 if you have the `getresuid' function. */
#mesondefine HAVE_GETRESUID
/* Define if gio-unix is available */
#mesondefine HAVE_GIO_UNIX
/* defines whether we have HarfBuzz */
#mesondefine HAVE_HARFBUZZ
/* Define to 1 if you have the `httpGetAuthString' function. */
#mesondefine HAVE_HTTPGETAUTHSTRING
/* Define if cups http_t authstring field is accessible */
#mesondefine HAVE_HTTP_AUTHSTRING
/* Define to 1 if you have the <inttypes.h> header file. */
#mesondefine HAVE_INTTYPES_H
/* Define to 1 if the system has the type `IPrintDialogCallback'. */
#mesondefine HAVE_IPRINTDIALOGCALLBACK
/* Define to 1 if you have the <linux/input.h> header file. */
#mesondefine HAVE_LINUX_INPUT_H
/* Define to 1 if you have the <linux/memfd.h> header file. */
#mesondefine HAVE_LINUX_MEMFD_H
/* Define to 1 if you have the `localtime_r' function. */
#mesondefine HAVE_LOCALTIME_R
/* Define to 1 if you have the `log2' function. */
#mesondefine HAVE_LOG2
/* Define to 1 if you have the `lstat' function. */
#mesondefine HAVE_LSTAT
/* Define to 1 if you have the `mallinfo' function. */
#mesondefine HAVE_MALLINFO
/* Define to 1 if you have the <memory.h> header file. */
#mesondefine HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#mesondefine HAVE_MKSTEMP
/* Define to 1 if you have a working `mmap' system call. */
#mesondefine HAVE_MMAP
/* Define to 1 if you have the `nearbyint' function. */
#mesondefine HAVE_NEARBYINT
/* defines whether we have pangoft2 */
#mesondefine HAVE_PANGOFT
/* Define to 1 if libpapi available */
#mesondefine HAVE_PAPI
/* Define to 1 if you have the `posix_fallocate' function. */
#mesondefine HAVE_POSIX_FALLOCATE
/* Have the Xrandr extension library */
#mesondefine HAVE_RANDR
/* Have the Xrandr 1.5 extension library */
#mesondefine HAVE_RANDR15
/* Define to 1 if you have the `rint' function. */
#mesondefine HAVE_RINT
/* Define to 1 if you have the `round' function. */
#mesondefine HAVE_ROUND
/* Define to 1 if you have the `sincos' function. */
#mesondefine HAVE_SINCOS
/* Define to 1 if solaris xinerama is available */
#mesondefine HAVE_SOLARIS_XINERAMA
/* Define to 1 if you have the <stdint.h> header file. */
#mesondefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#mesondefine HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/param.h> header file. */
#mesondefine HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H
/* Define to 1 if sys/sysinfo.h is available */
#mesondefine HAVE_SYS_SYSINFO_H
/* Define to 1 if sys/systeminfo.h is available */
#mesondefine HAVE_SYS_SYSTEMINFO_H
/* Define to 1 if you have the <sys/time.h> header file. */
#mesondefine HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#mesondefine HAVE_SYS_TYPES_H
/* Define to 1 if you have the `trunc' function. */
#mesondefine HAVE_TRUNC
/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H
/* Have the XCOMPOSITE X extension */
#mesondefine HAVE_XCOMPOSITE
/* Have the Xcursor library */
#mesondefine HAVE_XCURSOR
/* Have the XDAMAGE X extension */
#mesondefine HAVE_XDAMAGE
/* Have the XFIXES X extension */
#mesondefine HAVE_XFIXES
/* Define to 1 if XFree Xinerama is available */
#mesondefine HAVE_XFREE_XINERAMA
/* Have XGenericEvent */
#mesondefine HAVE_XGENERICEVENTS
/* Define to 1 if xinerama is available */
#mesondefine HAVE_XINERAMA
/* Define to use XKB extension */
#mesondefine HAVE_XKB
/* Have the SYNC extension library */
#mesondefine HAVE_XSYNC
/* Define to 1 if you have the `_lock_file' function. */
#mesondefine HAVE__LOCK_FILE
/* Define if _NL_MEASUREMENT_MEASUREMENT is available */
#mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT
/* Define if _NL_PAPER_HEIGHT is available */
#mesondefine HAVE__NL_PAPER_HEIGHT
/* Define if _NL_PAPER_WIDTH is available */
#mesondefine HAVE__NL_PAPER_WIDTH
/* Define if _NL_TIME_FIRST_WEEKDAY is available */
#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
/* Define to 1 if you have the `_NSGetEnviron' function. */
#mesondefine HAVE__NSGETENVIRON
/* Define if <X11/extensions/XIproto.h> needed for xReply */
#mesondefine NEED_XIPROTO_H_FOR_XREPLY
/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#mesondefine PACKAGE_NAME
/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#mesondefine PACKAGE_TARNAME
/* Define to the home page for this package. */
#mesondefine PACKAGE_URL
/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION
/* Use NSBundle functions to determine load paths for libraries, translations,
etc. */
#mesondefine QUARTZ_RELOCATION
/* The size of `DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', as computed by sizeof.
*/
#mesondefine SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY
/* Define to 1 if XInput 2.0 is available */
#mesondefine XINPUT_2
/* Define to 1 if XInput 2.2 is available */
#mesondefine XINPUT_2_2
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#mesondefine _FILE_OFFSET_BITS
/* defines how to decorate public symbols while building */
#mesondefine _GDK_EXTERN
/* Define for large files, on AIX-style hosts. */
#mesondefine _LARGE_FILES
/* Define to 1 if on MINIX. */
#mesondefine _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#mesondefine _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#mesondefine _POSIX_SOURCE
/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine gid_t
/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine uid_t
#mesondefine GTK_DATADIR
#mesondefine GTK_LIBDIR
#mesondefine GTK_PRINT_BACKENDS
/* Define the location where the catalogs will be installed */
#mesondefine GTK_LOCALEDIR
#mesondefine ISO_CODES_PREFIX

View File

@@ -29,9 +29,6 @@
/* Define to 1 if you have the <crt_externs.h> header file. */
/* #undef HAVE_CRT_EXTERNS_H */
/* Define to 1 if CUPS 1.2 API is available */
/* #undef HAVE_CUPS_API_1_2 */
/* Define to 1 if you have the `dcgettext' function. */
#define HAVE_DCGETTEXT 1
@@ -77,9 +74,6 @@
/* Define if gio-unix is available */
/* #undef HAVE_GIO_UNIX */
/* Have GNU ftw */
/* #undef HAVE_GNU_FTW */
/* Define to 1 if you have the `httpGetAuthString' function. */
/* #undef HAVE_HTTPGETAUTHSTRING */
@@ -157,9 +151,6 @@
/* Define to 1 if sincos() is available */
/* #undef HAVE_SINCOS */
/* Have the sockaddr_un.sun_len member */
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
/* Define to 1 if solaris xinerama is available */
/* #undef HAVE_SOLARIS_XINERAMA */

View File

@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [4])
m4_define([gtk_interface_age], [0])
m4_define([gtk_micro_version], [8])
m4_define([gtk_interface_age], [4])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -55,6 +55,7 @@ m4_define([glib_max_allowed_version], m4_join([_], [GLIB_VERSION], glib_required
GLIB_VERSION_CFLAGS="-DGLIB_MIN_REQUIRED_VERSION=glib_min_required_version -DGLIB_MAX_ALLOWED_VERSION=glib_max_allowed_version"
m4_define([pango_required_version], [1.41.0])
m4_define([fribidi_required_version], [0.19.7])
m4_define([atk_required_version], [2.15.1])
m4_define([cairo_required_version], [1.14.0])
m4_define([gdk_pixbuf_required_version], [2.30.0])
@@ -585,6 +586,7 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
[glib-2.0 >= glib_required_version dnl
atk >= atk_required_version dnl
pango >= pango_required_version dnl
fribidi >= fribidi_required_version dnl
cairo >= cairo_required_version dnl
cairo-gobject >= cairo_required_version dnl
gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
@@ -749,32 +751,6 @@ AS_CASE([$host_os],
[AC_MSG_ERROR([DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY is unavailable])],
[AC_MSG_RESULT([DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY is not OK])]
)
AC_MSG_CHECKING([for SetupDiGetDevicePropertyW])
gtk_save_LIBS="$LIBS"
LIBS="-lsetupapi $LIBS"
AC_TRY_LINK(
[
#define _WIN32_WINNT 0x0600
#include <windows.h>
#include <devpropdef.h>
#include <setupapi.h>
],
[return SetupDiGetDevicePropertyW(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0);],
[have_SetupDiGetDevicePropertyW=yes],
[have_SetupDiGetDevicePropertyW=no]
)
AS_IF(
[test x$have_SetupDiGetDevicePropertyW = xyes],
[
AC_DEFINE(
[HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W],
[1],
[Define to 1 if SetupDiGetDevicePropertyW() is available]
)
]
)
AC_MSG_RESULT([$have_SetupDiGetDevicePropertyW])
LIBS="$gtk_save_LIBS"
],
[]
)
@@ -839,19 +815,6 @@ AC_CHECK_HEADERS(ftw.h,
AC_DEFINE(HAVE_FTW_H, 1,
[Define to 1 if ftw.h is available]))
AC_MSG_CHECKING([for GNU ftw extensions])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#include <ftw.h>]],
[[int flags = FTW_ACTIONRETVAL;]])],
[gtk_ok=yes],[gtk_ok=no])
if test $gtk_ok = yes; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
else
AC_MSG_RESULT([no])
fi
#
# Disable deprecation checks for all libraries we depend on on stable branches.
# This is so newer versions of those libraries don't cause more warnings with
@@ -1375,7 +1338,7 @@ CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES"
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES fribidi >= fribidi_required_version"
PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
@@ -1409,7 +1372,7 @@ fi
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version fribidi >= fribidi_required_version"
if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
fi
@@ -1514,37 +1477,6 @@ AC_SUBST(GTK_XIM_FLAGS)
GDK_PIXBUF_LIBS=`$PKG_CONFIG --libs gdk-pixbuf-2.0`
AC_SUBST(GDK_PIXBUF_LIBS)
########################
# Checks needed for gail
########################
old_LIBS="$LIBS"
dnl Checks for inet libraries:
AC_SEARCH_LIBS(gethostent, nsl)
AC_SEARCH_LIBS(setsockopt, socket)
AC_SEARCH_LIBS(connect, inet)
dnl check for the sockaddr_un.sun_len member
AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[struct_sockaddr_un_sun_len=true],
[struct_sockaddr_un_suin_len=false],
[#include <sys/types.h>
#include <sys/un.h>]
)
case $struct_sockaddr_un_sun_len in
true)
AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_UN_SUN_LEN, 1,
[Have the sockaddr_un.sun_len member])
;;
*)
;;
esac
GAIL_INET_LIBS="$LIBS"
AC_SUBST([GAIL_INET_LIBS])
LIBS="$old_LIBS"
################################################################
# Printing system checks
################################################################
@@ -1576,15 +1508,8 @@ else
CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
if test $CUPS_API_MAJOR -lt 1 -o \
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 2; then
AC_MSG_ERROR([CUPS >= 1.2 not found])
fi
if test $CUPS_API_MAJOR -gt 1 -o \
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6; then
AC_DEFINE(HAVE_CUPS_API_1_6, 1,
[Define to 1 if CUPS 1.6 API is available])
have_cups_api_1_6=yes
if test $CUPS_API_MAJOR -lt 2; then
AC_MSG_ERROR([CUPS >= 2.0 not found])
fi
AC_SUBST(CUPS_API_MAJOR)
@@ -2025,6 +1950,7 @@ docs/reference/gdk/version.xml
docs/reference/gtk/Makefile
docs/reference/gtk/gtk3.types
docs/reference/gtk/version.xml
docs/reference/gtk/getting_started.xml
docs/reference/libgail-util/Makefile
docs/reference/libgail-util/version.xml
docs/tools/Makefile

View File

@@ -3,4 +3,7 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = gtk-demo widget-factory icon-browser
EXTRA_DIST = \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -117,7 +117,9 @@ EXTRA_DIST += \
demo.gresource.xml \
$(resource_files) \
org.gtk.Demo.gschema.xml \
demos.h.win32
demos.h.win32 \
meson.build \
geninclude.py
gsettings_SCHEMAS = \
org.gtk.Demo.gschema.xml

View File

@@ -50,7 +50,6 @@
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<property name="font">Sans 12</property>
<property name="level">style|size|variations|features</property>
<signal name="font-set" handler="font_changed" swapped="no"/>
</object>
</child>

108
demos/gtk-demo/geninclude.py Executable file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import re
import os
from collections import *
out_file = sys.argv[1]
in_files = sys.argv[2:]
file_output = """
typedef GtkWidget *(*GDoDemoFunc) (GtkWidget *do_widget);
typedef struct _Demo Demo;
struct _Demo
{
gchar *name;
gchar *title;
gchar *filename;
GDoDemoFunc func;
Demo *children;
};
"""
# Demo = namedtuple('Demo', ['name', 'title', 'file', 'func'])
demos = []
for demo_file in in_files:
filename = demo_file[demo_file.rfind('/')+1:]
demo_name = filename.replace(".c", "")
with open(demo_file, 'r') as f:
title = f.readline().replace("/*", "").strip()
file_output += "GtkWidget *do_" + demo_name + " (GtkWidget *do_widget);\n"
# demos += Demo(name = demo_name,
# title = title,
# file = demo_file,
# func = "do_" + title)
demos.append((demo_name, title, filename, "do_" + demo_name, -1))
# Generate a List of "Parent names"
parents = []
parent_ids = []
parent_index = 0
for demo in demos:
if "/" in demo[1]:
slash_index = demo[1].index('/')
parent_name = demo[1][:slash_index]
do_break = False
# Check for duplicates
if not parent_name in parents:
parents.append(parent_name)
parent_ids.append(parent_index)
demos.append(("NULL", parent_name, "NULL", "NULL", parent_index))
parent_index = parent_index + 1
# For every child with a parent, generate a list of child demos
i = 0
for parent in parents:
id = parent_ids[i]
file_output += "\nDemo child" + str(id) + "[] = {\n"
# iterate over all demos and check if the name starts with the given parent name
for child in demos:
if child[1].startswith(parent + "/"):
title = child[1][child[1].rfind('/') + 1:]
file_output += " { \"" + child[0] + "\", \"" + title + "\", \"" + child[2] + "\", " + child[3] + ", NULL },\n"
file_output += " { NULL }\n};\n"
i = i + 1
# Sort demos by title
demos = sorted(demos, key=lambda x: x[1])
file_output += "\nDemo gtk_demos[] = {\n"
for demo in demos:
# Do not generate one of these for demos with a parent demo
if "/" not in demo[1]:
child_array = "NULL"
name = demo[0];
title = demo[1];
file = demo[2]
if name != "NULL":
name = "\"" + name + "\""
if title != "NULL":
title = "\"" + title + "\""
if file != "NULL":
file = "\"" + file + "\""
if demo[4] != -1:
child_array = "child" + str(demo[4])
file_output += " { " + name + ", " + title + ", " + file + ", " + demo[3] + ", " + child_array + " },\n"
file_output += " { NULL }\n};\n"
ofile = open(out_file, "w")
ofile.write(file_output)
ofile.close()

148
demos/gtk-demo/meson.build Normal file
View File

@@ -0,0 +1,148 @@
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos = files([
'application_demo.c',
'assistant.c',
'builder.c',
'button_box.c',
'changedisplay.c',
'clipboard.c',
'colorsel.c',
'combobox.c',
'css_accordion.c',
'css_basics.c',
'css_blendmodes.c',
'css_multiplebgs.c',
'css_pixbufs.c',
'css_shadows.c',
'cursors.c',
'dialog.c',
'drawingarea.c',
'editable_cells.c',
'entry_buffer.c',
'entry_completion.c',
'event_axes.c',
'expander.c',
'filtermodel.c',
'fishbowl.c',
'foreigndrawing.c',
'gestures.c',
'glarea.c',
'headerbar.c',
'hypertext.c',
'iconview.c',
'iconview_edit.c',
'images.c',
'infobar.c',
'links.c',
'listbox.c',
'flowbox.c',
'list_store.c',
'markup.c',
'menus.c',
'modelbutton.c',
'offscreen_window.c',
'offscreen_window2.c',
'overlay.c',
'overlay2.c',
'paint.c',
'panes.c',
'pickers.c',
'pixbufs.c',
'popover.c',
'printing.c',
'revealer.c',
'rotated_text.c',
'scale.c',
'search_entry.c',
'search_entry2.c',
'shortcuts.c',
'sidebar.c',
'sizegroup.c',
'spinbutton.c',
'spinner.c',
'stack.c',
'tabs.c',
'textmask.c',
'textview.c',
'textscroll.c',
'theming_style_classes.c',
'toolpalette.c',
'transparent.c',
'tree_store.c',
])
gtkdemo_deps = [libgtk_dep]
if harfbuzz_dep.found() and pangoft_dep.found()
demos += files('font_features.c')
gtkdemo_deps += [harfbuzz_dep, pangoft_dep]
endif
if os_unix
demos += files('pagesetup.c')
endif
gtkdemo_sources = demos + files([
'gtkfishbowl.c',
'gtkfishbowl.h',
'main.c',
])
geninclude = find_program('geninclude.py')
demos_h = custom_target(
'gtk3 demo header',
output : 'demos.h',
input : demos,
command : [geninclude, '@OUTPUT@', '@INPUT@'],
)
gtkdemo_resources = gnome.compile_resources(
'gtkdemo_resources',
'demo.gresource.xml',
source_dir: '.'
)
gtkdemo = executable(
'gtk3-demo',
gtkdemo_sources,
demos_h,
gtkdemo_resources,
dependencies: gtkdemo_deps,
include_directories : confinc,
install: true
)
gtkapplicationdemo = executable(
'gtk3-demo-application',
'application.c',
demos_h,
gtkdemo_resources,
dependencies: gtkdemo_deps,
include_directories : confinc,
install: true
)
gtk_settings_schemas = [
'org.gtk.Settings.FileChooser.gschema.xml',
'org.gtk.Settings.ColorChooser.gschema.xml',
'org.gtk.Settings.EmojiChooser.gschema.xml',
'org.gtk.Settings.Debug.gschema.xml',
]
foreach s: [ '16', '22', '24', '32', '48', '256']
icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps')
icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo.png'),
join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo-symbolic.symbolic.png')]
install_data(icons, install_dir: icon_destdir)
endforeach
# desktop file
install_data('gtk3-demo.desktop', install_dir: gtk_applicationsdir)
# GSettings
install_data('org.gtk.Demo.gschema.xml', install_dir: gtk_schemasdir)
gnome.compile_schemas(depend_files: files(['org.gtk.Demo.gschema.xml']))

View File

@@ -34,7 +34,8 @@ EXTRA_DIST = \
menus.ui \
iconbrowser.gresource.xml \
window.ui \
icon.list
icon.list \
meson.build
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gtk3-icon-browser

View File

@@ -0,0 +1,24 @@
iconbrowser_sources = [
'main.c',
'iconbrowserapp.c',
'iconbrowserwin.c',
'iconstore.c'
]
iconbrowser_resources = gnome.compile_resources(
'iconbrowser_resources',
'iconbrowser.gresource.xml',
source_dir: '.'
)
iconbrowser = executable(
'gtk3-icon-browser',
iconbrowser_sources,
iconbrowser_resources,
dependencies: libgtk_dep,
include_directories : confinc,
install: true
)
# desktop file
install_data('gtk3-icon-browser.desktop', install_dir: gtk_applicationsdir)

3
demos/meson.build Normal file
View File

@@ -0,0 +1,3 @@
subdir('icon-browser')
subdir('widget-factory')
subdir('gtk-demo')

View File

@@ -66,6 +66,7 @@ EXTRA_DIST += \
help-overlay.ui \
widget-factory.gresource.xml \
data/source.svg \
data/symbolic-source.svg
data/symbolic-source.svg \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,29 @@
widgetfactory_sources = [
'widget-factory.c'
]
widgetfactory_resources = gnome.compile_resources(
'widgetfactory_resources',
'widget-factory.gresource.xml',
source_dir: '.'
)
foreach s: [ '16', '22', '24', '32', '48', '256']
icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps')
icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory.png'),
join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory-symbolic.symbolic.png')]
install_data(icons, install_dir: icon_destdir)
endforeach
widget_factory = executable(
'gtk3-widget-factory',
widgetfactory_sources,
widgetfactory_resources,
dependencies: libgtk_dep,
include_directories : confinc,
install: true
)
# desktop file
install_data('gtk3-widget-factory.desktop', install_dir: gtk_applicationsdir)

View File

@@ -211,15 +211,15 @@ activate_about (GSimpleAction *action,
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", "© 19972019 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", "gtk3-widget-factory",
"title", "About GTK+ Widget Factory",
"title", "About GTK Widget Factory",
NULL);
g_free (version);
@@ -246,6 +246,14 @@ activate_quit (GSimpleAction *action,
}
}
static void
activate_inspector (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
gtk_window_set_interactive_debugging (TRUE);
}
static void
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
@@ -1968,6 +1976,7 @@ main (int argc, char *argv[])
static GActionEntry app_entries[] = {
{ "about", activate_about, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
{ "inspector", activate_inspector, NULL, NULL, NULL },
{ "main", NULL, "s", "'steak'", NULL },
{ "wine", NULL, NULL, "false", NULL },
{ "beer", NULL, NULL, "false", NULL },

View File

@@ -17,6 +17,10 @@
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Inspector</attribute>
<attribute name="action">app.inspector</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>

View File

@@ -5,4 +5,7 @@ SUBDIRS = gdk gtk libgail-util
GITIGNOREFILES = */*.1
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -198,7 +198,9 @@ endif
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
EXTRA_DIST += \
version.xml.in \
meson.build
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = cd $(srcdir) && \

View File

@@ -1,8 +1,9 @@
# GdkAtom is an opaque typedef
<STRUCT>
<TYPEDEF>
<NAME>GdkAtom</NAME>
</STRUCT>
typedef struct _GdkAtom *GdkAtom;
</TYPEDEF>
<MACRO>
<NAME>GDK_WINDOWING_X11</NAME>

View File

@@ -0,0 +1,180 @@
private_headers = [
'gdkintl.h',
'gdkmarshalers.h',
'gdkkeysyms.h',
'gdkinternals.h',
'gdkprivate.h',
'gdk-private.h',
'gdkapplaunchcontextprivate.h',
'gdkcursorprivate.h',
'gdkdevicemanagerprivate.h',
'gdkdeviceprivate.h',
'gdkdisplaymanagerprivate.h',
'gdkdisplayprivate.h',
'gdkdndprivate.h',
'gdkframeclockprivate.h',
'gdkglcontextprivate.h',
'gdkkeysprivate.h',
'gdkscreenprivate.h',
'gdkseatdefaultprivate.h',
'gdkseatprivate.h',
'gdkvisualprivate.h',
'keyname-table.h',
'win32',
'x11',
'quartz',
'broadway',
'wayland',
]
images = [
'images/rotated-text.png',
'images/X_cursor.png',
'images/arrow.png',
'images/based_arrow_down.png',
'images/based_arrow_up.png',
'images/boat.png',
'images/bogosity.png',
'images/bottom_left_corner.png',
'images/bottom_right_corner.png',
'images/bottom_side.png',
'images/bottom_tee.png',
'images/box_spiral.png',
'images/center_ptr.png',
'images/circle.png',
'images/clock.png',
'images/coffee_mug.png',
'images/cross.png',
'images/cross_reverse.png',
'images/crosshair.png',
'images/diamond_cross.png',
'images/dot.png',
'images/dotbox.png',
'images/double_arrow.png',
'images/draft_large.png',
'images/draft_small.png',
'images/draped_box.png',
'images/exchange.png',
'images/fleur.png',
'images/gobbler.png',
'images/gumby.png',
'images/hand1.png',
'images/hand2.png',
'images/heart.png',
'images/icon.png',
'images/iron_cross.png',
'images/left_ptr.png',
'images/left_side.png',
'images/left_tee.png',
'images/leftbutton.png',
'images/ll_angle.png',
'images/lr_angle.png',
'images/man.png',
'images/middlebutton.png',
'images/mouse.png',
'images/pencil.png',
'images/pirate.png',
'images/plus.png',
'images/question_arrow.png',
'images/right_ptr.png',
'images/right_side.png',
'images/right_tee.png',
'images/rightbutton.png',
'images/rtl_logo.png',
'images/sailboat.png',
'images/sb_down_arrow.png',
'images/sb_h_double_arrow.png',
'images/sb_left_arrow.png',
'images/sb_right_arrow.png',
'images/sb_up_arrow.png',
'images/sb_v_double_arrow.png',
'images/shuttle.png',
'images/sizing.png',
'images/spider.png',
'images/spraycan.png',
'images/star.png',
'images/target.png',
'images/tcross.png',
'images/top_left_arrow.png',
'images/top_left_corner.png',
'images/top_right_corner.png',
'images/top_side.png',
'images/top_tee.png',
'images/trek.png',
'images/ul_angle.png',
'images/umbrella.png',
'images/ur_angle.png',
'images/watch.png',
'images/xterm.png',
'images/alias_cursor.png',
'images/all_scroll_cursor.png',
'images/cell_cursor.png',
'images/col_resize_cursor.png',
'images/copy_cursor.png',
'images/crosshair_cursor.png',
'images/default_cursor.png',
'images/e_resize_cursor.png',
'images/ew_resize_cursor.png',
'images/grabbing_cursor.png',
'images/grab_cursor.png',
'images/hand_cursor.png',
'images/context_menu_cursor.png',
'images/help_cursor.png',
'images/move_cursor.png',
'images/ne_resize_cursor.png',
'images/nesw_resize_cursor.png',
'images/no_drop_cursor.png',
'images/not_allowed_cursor.png',
'images/n_resize_cursor.png',
'images/ns_resize_cursor.png',
'images/nw_resize_cursor.png',
'images/nwse_resize_cursor.png',
'images/pointer_cursor.png',
'images/progress_cursor.png',
'images/row_resize_cursor.png',
'images/se_resize_cursor.png',
'images/s_resize_cursor.png',
'images/sw_resize_cursor.png',
'images/text_cursor.png',
'images/vertical_text_cursor.png',
'images/wait_cursor.png',
'images/w_resize_cursor.png',
'images/X_cursor.png',
'images/zoom_in_cursor.png',
'images/zoom_out_cursor.png',
]
src_dir = [ gdkinc ]
if x11_enabled
src_dir += [ gdkx11_inc ]
endif
if wayland_enabled
src_dir += [ gdkwayland_inc ]
endif
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gdk3',
mode: 'none',
main_xml: 'gdk-docs.sgml',
src_dir: src_dir,
dependencies: libgdk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
],
html_assets: images,
install: true)
endif

View File

@@ -276,7 +276,7 @@ GTKDOC_LIBS = \
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--output-format=xml --name-space=gtk
MKDB_OPTIONS=--output-format=xml --name-space=gtk --default-includes=gtk/gtk.h
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
content_files = \
@@ -287,7 +287,7 @@ content_files = \
css-overview.xml \
css-properties.xml \
drawing-model.xml \
getting_started.xml \
$(builddir)/getting_started.xml \
glossary.xml \
gtk3-demo-application.xml \
gtk3-demo.xml \
@@ -324,7 +324,7 @@ content_files = \
expand_content_files = \
compiling.sgml \
drawing-model.xml \
getting_started.xml \
$(builddir)/getting_started.xml \
glossary.xml \
input-handling.xml \
migrating-2to3.xml \
@@ -496,7 +496,7 @@ endif
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in gtk3.types.in
EXTRA_DIST += version.xml.in gtk3.types.in getting_started.xml.in
########################################################################
@@ -543,7 +543,9 @@ endif
MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES)
EXTRA_DIST += $(man_MANS)
EXTRA_DIST += \
$(man_MANS) \
meson.build
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = cd $(srcdir) && \

View File

@@ -44,7 +44,7 @@
<informalexample>
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>
@@ -153,7 +153,7 @@
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<para>Create a new file with the following content named example-1.c.</para>
<programlisting><xi:include href="../../../../examples/hello-world.c" parse="text">
<programlisting><xi:include href="@abs_top_srcdir@/examples/hello-world.c" parse="text">
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
@@ -233,7 +233,7 @@
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<para>Create a new file with the following content named example-2.c.</para>
<programlisting><xi:include href="../../../../examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
@@ -257,9 +257,9 @@
<example>
<title>Packing buttons with GtkBuilder</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="../../../../examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<para>Create a new file with the following content named builder.ui.</para>
<programlisting><xi:include href="../../../../examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
@@ -346,7 +346,7 @@
of our application class.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>All the application logic is in the application class, which
@@ -364,7 +364,7 @@
GIO <ulink url="https://developer.gnome.org/gio/2.36/GApplication.html#GApplication.description">documentation</ulink>.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Another important class that is part of the application support
@@ -373,7 +373,7 @@
window.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>As part of the initial setup of our application, we also
@@ -388,7 +388,7 @@
</informalfigure>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
@@ -420,7 +420,7 @@
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make use of this file in our application, we revisit
@@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>This file has to be converted into a C source file that will be
@@ -598,7 +598,7 @@ example_app_window_open (ExampleAppWindow *win,
in a ui file, and add it as a resource to our binary.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To associate the app menu with the application, we have to call
@@ -697,7 +697,7 @@ example_app_class_init (ExampleAppClass *class)
GSettings requires a schema that describes our settings:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Before we can make use of this schema in our application,
@@ -749,13 +749,13 @@ example_app_window_init (ExampleAppWindow *win)
<para>Lets start with the template.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Next comes the dialog subclass.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Now we revisit the <literal>preferences_activated(<!-- -->)</literal> function in our
@@ -807,7 +807,7 @@ preferences_activated (GSimpleAction *action,
to slide out the search bar below the header bar.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Implementing the search needs quite a few code changes that
@@ -887,7 +887,7 @@ example_app_window_init (ExampleAppWindow *win)
which demonstrates #GtkMenuButton, #GtkRevealer and #GtkListBox.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>The code to populate the sidebar with buttons for the words
@@ -898,7 +898,7 @@ example_app_window_init (ExampleAppWindow *win)
ui file.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To connect the menuitem to the show-words setting, we use
@@ -957,7 +957,7 @@ example_app_window_init (ExampleAppWindow *win)
triggers the show-lines action:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make this menu item do something, we create a property
@@ -1017,7 +1017,7 @@ example_app_window_init (ExampleAppWindow *win)
be a direct child of the window, and set its type to be titlebar.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>A small extra bonus of using a header bar is that we get
@@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win)
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-4.c.</para>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:

View File

@@ -1,6 +1,3 @@
<INCLUDE>gtk/gtk.h</INCLUDE>
<SECTION>
<FILE>gtkaboutdialog</FILE>
<TITLE>GtkAboutDialog</TITLE>
@@ -7089,7 +7086,6 @@ GtkPrintOperationPrivate
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintunixdialog</FILE>
<TITLE>GtkPrintUnixDialog</TITLE>
GtkPrintUnixDialog
@@ -7436,7 +7432,6 @@ gtk_print_context_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintjob</FILE>
<TITLE>GtkPrintJob</TITLE>
GtkPrintJob
@@ -7488,7 +7483,6 @@ gtk_print_job_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkpagesetupunixdialog</FILE>
<TITLE>GtkPageSetupUnixDialog</TITLE>
GtkPageSetupUnixDialog

View File

@@ -0,0 +1,535 @@
private_headers = [
'inspector',
'a11y',
'gtkaccelgroupprivate.h',
'gtkaccelmapprivate.h',
'gtkadjustmentprivate.h',
'gtkallocatedbitmaskprivate.h',
'gtkappchooserprivate.h',
'gtkapplicationaccelsprivate.h',
'gtkapplicationprivate.h',
'gtkbindingsprivate.h',
'gtkbitmaskprivate.h',
'gtkboxprivate.h',
'gtkbuilderprivate.h',
'gtkbuttonprivate.h',
'gtkcairoblurprivate.h',
'gtkcellareaboxcontextprivate.h',
'gtkclipboardprivate.h',
'gtkcolorchooserprivate.h',
'gtkcoloreditorprivate.h',
'gtkcolorplaneprivate.h',
'gtkcolorscaleprivate.h',
'gtkcolorswatchprivate.h',
'gtkcomboboxprivate.h',
'gtkcontainerprivate.h',
'gtkcssanimatedstyleprivate.h',
'gtkcssanimationprivate.h',
'gtkcssarrayvalueprivate.h',
'gtkcssbgsizevalueprivate.h',
'gtkcssbordervalueprivate.h',
'gtkcsscolorvalueprivate.h',
'gtkcsscornervalueprivate.h',
'gtkcsscustompropertyprivate.h',
'gtkcsseasevalueprivate.h',
'gtkcssenginevalueprivate.h',
'gtkcssenumvalueprivate.h',
'gtkcssiconthemevalueprivate.h',
'gtkcssimagebuiltinprivate.h',
'gtkcssimagecrossfadeprivate.h',
'gtkcssimagegradientprivate.h',
'gtkcssimageiconthemeprivate.h',
'gtkcssimagelinearprivate.h',
'gtkcssimageprivate.h',
'gtkcssimagescaledprivate.h',
'gtkcssimagesurfaceprivate.h',
'gtkcssimageurlprivate.h',
'gtkcssimagevalueprivate.h',
'gtkcssimagewin32private.h',
'gtkcssinheritvalueprivate.h',
'gtkcssinitialvalueprivate.h',
'gtkcsskeyframesprivate.h',
'gtkcsslookupprivate.h',
'gtkcssmatcherprivate.h',
'gtkcssnodeprivate.h',
'gtkcssnodedeclarationprivate.h',
'gtkcssnumbervalueprivate.h',
'gtkcsspathnodeprivate.h',
'gtkcssparserprivate.h',
'gtkcsspositionvalueprivate.h',
'gtkcssproviderprivate.h',
'gtkcssrepeatvalueprivate.h',
'gtkcssrgbavalueprivate.h',
'gtkcsssectionprivate.h',
'gtkcssselectorprivate.h',
'gtkcssshadowsvalueprivate.h',
'gtkcssshadowvalueprivate.h',
'gtkcssshorthandpropertyprivate.h',
'gtkcssstaticstyleprivate.h',
'gtkcssstringvalueprivate.h',
'gtkcssstylefuncsprivate.h',
'gtkcssstyleprivate.h',
'gtkcssstylepropertyprivate.h',
'gtkcsstransformvalueprivate.h',
'gtkcsstransientnodeprivate.h',
'gtkcsstransitionprivate.h',
'gtkcsstypedvalueprivate.h',
'gtkcsstypesprivate.h',
'gtkcssunsetvalueprivate.h',
'gtkcssvalueprivate.h',
'gtkcsswidgetnodeprivate.h',
'gtkdialogprivate.h',
'gtkentryprivate.h',
'gtkeventcontrollerprivate.h',
'gtkfilechooserprivate.h',
'gtkfilechooserwidgetprivate.h',
'gtkfontchooserprivate.h',
'gtkgesturedragprivate.h',
'gtkgesturelongpressprivate.h',
'gtkgesturemultipressprivate.h',
'gtkgesturepanprivate.h',
'gtkgestureprivate.h',
'gtkgesturerotateprivate.h',
'gtkgesturesingleprivate.h',
'gtkgestureswipeprivate.h',
'gtkgesturezoomprivate.h',
'gtkheaderbarprivate.h',
'gtkhslaprivate.h',
'gtkiconhelperprivate.h',
'gtkiconviewprivate.h',
'gtkimageprivate.h',
'gtkimmoduleprivate.h',
'gtklabelprivate.h',
'gtklockbuttonprivate.h',
'gtkmagnifierprivate.h',
'gtkmenubuttonprivate.h',
'gtkmenuitemprivate.h',
'gtkmenuprivate.h',
'gtkmenushellprivate.h',
'gtkmodulesprivate.h',
'gtkmountoperationprivate.h',
'gtkorientableprivate.h',
'gtkpixelcacheprivate.h',
'gtkplacessidebarprivate.h',
'gtkplacesviewprivate.h',
'gtkplacesviewrowprivate.h',
'gtkpopoverprivate.h',
'gtkprinter-private.h',
'gtkprintoperation-private.h',
'gtkprivate.h',
'gtkrangeprivate.h',
'gtkrecentchooserprivate.h',
'gtkrenderbackgroundprivate.h',
'gtkrenderborderprivate.h',
'gtkrendericonprivate.h',
'gtkrenderprivate.h',
'gtkroundedboxprivate.h',
'gtkscaleprivate.h',
'gtksearchengine.h',
'gtksearchenginemodel.h',
'gtksearchenginequartz.h',
'gtksearchenginesimple.h',
'gtksearchenginetracker.h',
'gtksearchentryprivate.h',
'gtkselectionprivate.h',
'gtksettingsprivate.h',
'gtksidebarrowprivate.h',
'gtksizegroup-private.h',
'gtksizerequestcacheprivate.h',
'gtksocketprivate.h',
'gtkstyleanimationprivate.h',
'gtkstylecascadeprivate.h',
'gtkstylecontextprivate.h',
'gtkstylepropertyprivate.h',
'gtkstyleproviderprivate.h',
'gtktextattributesprivate.h',
'gtktextchildprivate.h',
'gtktexthandleprivate.h',
'gtktextiterprivate.h',
'gtktextmarkprivate.h',
'gtktexttagprivate.h',
'gtktogglebuttonprivate.h',
'gtktoolbarprivate.h',
'gtktoolpaletteprivate.h',
'gtktooltipprivate.h',
'gtktooltipwindowprivate.h',
'gtktreeprivate.h',
'gtkwidgetprivate.h',
'gtkwin32themeprivate.h',
'gtkwindowprivate.h',
'fnmatch.h',
'gtkactionmuxer.h',
'gtkactionobserver.h',
'gtkactionobservable.h',
'gtk9slice.h',
'gtkanimationdescription.h',
'gtkbitmaskprivateimpl.h',
'gtkbookmarksmanager.h',
'gtkdbusgenerated.c',
'gtkdbusgenerated.h',
'gtkdebug.h',
'gtkactionhelper.h',
'gtkdndcursors.h',
'gtkfilechooserdefault.h',
'gtkfilechooserembed.h',
'gtkfilechooserentry.h',
'gtkfilechoosersettings.h',
'gtkfilechooserutils.h',
'gtkfilesystem.h',
'gtkfilesystemmodel.h',
'gtkfilesystemunix.h',
'gtkfilesystemwin32.h',
'gtkfontchooserutils.h',
'gtkiconcache.h',
'gtkiconcachevalidator.h',
'gtkiconthemeparser.h',
'gtkintl.h',
'gtkkeyhash.h',
'gtkkineticscrolling.h',
'gtkmarshal.h',
'gtkmnemonichash.h',
'gtkmenutracker.h',
'gtkmenutrackeritem.h',
'gtkmenusectionbox.h',
'gtkmodelmenu.h',
'gtkmodelmenuitem.h',
'gtkmodifierstyle.h',
'gtkpathbar.h',
'gtkprintbackend.h',
'gtkprinteroption.h',
'gtkprinteroptionset.h',
'gtkprinteroptionwidget.h',
'gtkprint-win32.h',
'gtkprintutils.h',
'gtkprivate.h',
'gtkprivatetypebuiltins.h',
'gtkquery.h',
'gtkrbtree.h',
'gtkrecentchooserdefault.h',
'gtkrecentchooserutils.h',
'gtksearchengine.h',
'gtksearchenginetracker.h',
'gtksearchenginesimple.h',
'gtksearchenginequartz.h',
'gtksequence.h',
'gtksocketprivate.h',
'gtktextbtree.h',
'gtktextbufferserialize.h',
'gtktextdisplay.h',
'gtktextlayout.h',
'gtktextsegment.h',
'gtktexttypes.h',
'gtktextutil.h',
'gtktimeline.h',
'gtkthemes.h',
'gtktrashmonitor.h',
'gtktrayicon.h',
'gtktreedatalist.h',
'gtktreemenu.h',
'gtktypebuiltins.h',
'gtkxembed.h',
'gtkwin32embed.h',
'gtkwin32embedwidget.h',
'gtkwindow-decorate.h',
'xdgmime',
'xembed.h',
]
images = [
'images/aboutdialog.png',
'images/accel-label.png',
'images/action-bar.png',
'images/appchooserbutton.png',
'images/appchooserdialog.png',
'images/assistant.png',
'images/box-packing.png',
'images/box-expand.png',
'images/button.png',
'images/check-button.png',
'images/color-button.png',
'images/colorchooser.png',
'images/combo-box.png',
'images/combo-box-entry.png',
'images/combo-box-text.png',
'images/entry.png',
'images/figure-hierarchical-drawing.png',
'images/figure-windowed-label.png',
'images/file-button.png',
'images/filechooser.png',
'images/font-button.png',
'images/fontchooser.png',
'images/frame.png',
'images/glarea.png',
'images/headerbar.png',
'images/icon-view.png',
'images/image.png',
'images/info-bar.png',
'images/label.png',
'images/levelbar.png',
'images/link-button.png',
'images/list-and-tree.png',
'images/lock-button.png',
'images/lockbutton.png',
'images/lockbutton-locked.png',
'images/lockbutton-unlocked.png',
'images/lockbutton-sorry.png',
'images/menubar.png',
'images/menu-button.png',
'images/messagedialog.png',
'images/multiline-text.png',
'images/notebook.png',
'images/panes.png',
'images/pagesetupdialog.png',
'images/placessidebar.png',
'images/popup-anchors.png',
'images/popup-flip.png',
'images/popup-slide.png',
'images/printdialog.png',
'images/progressbar.png',
'images/radio-group.png',
'images/recentchooserdialog.png',
'images/scales.png',
'images/scrollbar.png',
'images/scrolledwindow.png',
'images/search-bar.png',
'images/search-entry.png',
'images/separator.png',
'images/sidebar.png',
'images/spinbutton.png',
'images/spinner.png',
'images/stack.png',
'images/stackswitcher.png',
'images/statusbar.png',
'images/toggle-button.png',
'images/toolbar.png',
'images/toolpalette.png',
'images/tree-view-coordinates.png',
'images/volumebutton.png',
'images/window.png',
'images/layout-btlr.png',
'images/layout-btrl.png',
'images/layout-lrbt.png',
'images/layout-lrtb.png',
'images/layout-rlbt.png',
'images/layout-rltb.png',
'images/layout-tblr.png',
'images/layout-tbrl.png',
'images/widget-hvalign.png',
'images/window-default.png',
'images/hello-world.png',
'images/grid-packing.png',
'images/drawing.png',
'images/switch.png',
'images/linear.png',
'images/ease.png',
'images/ease-in-out.png',
'images/ease-in.png',
'images/ease-out.png',
'images/gradient1.png',
'images/gradient2.png',
'images/gradient3.png',
'images/gradient4.png',
'images/border1.png',
'images/border2.png',
'images/border3.png',
'images/slices.png',
'images/checks.png',
'images/options.png',
'images/arrows.png',
'images/expanders.png',
'images/background.png',
'images/frames.png',
'images/frame-gap.png',
'images/sliders.png',
'images/focus.png',
'images/handles.png',
'images/extensions.png',
'images/numerableicon.png',
'images/numerableicon2.png',
'images/bloatpad-osx.png',
'images/bloatpad-gnome.png',
'images/bloatpad-xfce.png',
'images/down-center.png',
'images/down-end.png',
'images/down-start.png',
'images/left-center.png',
'images/left-end.png',
'images/left-start.png',
'images/right-center.png',
'images/right-end.png',
'images/right-start.png',
'images/up-center.png',
'images/up-end.png',
'images/up-start.png',
'images/list-box.png',
'images/getting-started-app1.png',
'images/getting-started-app2.png',
'images/getting-started-app3.png',
'images/getting-started-app4.png',
'images/getting-started-app6.png',
'images/getting-started-app7.png',
'images/getting-started-app8.png',
'images/getting-started-app9.png',
'images/getting-started-app10.png',
'images/exampleapp.png',
'images/flow-box.png',
'images/inspector.png',
'images/gedit-shortcuts.png',
'images/clocks-shortcuts.png',
'images/builder-shortcuts.png',
]
content_files = [
'broadway.xml',
'broadwayd.xml',
'building.sgml',
'css-overview.xml',
'css-properties.xml',
'gtk3-demo-application.xml',
'gtk3-demo.xml',
'gtk3-icon-browser.xml',
'gtk3-widget-factory.xml',
'gtk-builder-tool.xml',
'gtk-encode-symbolic-svg.xml',
'gtk-launch.xml',
'gtk-query-immodules-3.0.xml',
'gtk-query-settings.xml',
'gtk-update-icon-cache.xml',
'mir.xml',
'osx.sgml',
'overview.xml',
'resources.sgml',
'running.sgml',
'visual_index.xml',
'wayland.xml',
'windows.sgml',
'x11.sgml',
]
expand_content_files = [
'compiling.sgml',
'drawing-model.xml',
join_paths(meson.current_build_dir(), 'getting_started.xml'),
'glossary.xml',
'input-handling.xml',
'migrating-2to3.xml',
'migrating-3xtoy.xml',
'migrating-checklist.sgml',
'migrating-GtkGrid.xml',
'migrating-GtkStyleContext.xml',
'migrating-smclient-GtkApplication.xml',
'migrating-unique-GtkApplication.xml',
'question_index.sgml',
'text_widget.sgml',
'tree_widget.sgml',
]
content_files += expand_content_files
types_conf = configuration_data()
if os_win32
types_conf.set('DISABLE_ON_W32', '%')
else
types_conf.set('DISABLE_ON_W32', '')
endif
if os_darwin
types_conf.set('DISABLE_ON_QUARTZ', '%')
else
types_conf.set('DISABLE_ON_QUARTZ', '')
endif
if x11_enabled
types_conf.set('ENABLE_ON_X11', '')
else
types_conf.set('ENABLE_ON_X11', '%')
endif
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf)
gnome.gtkdoc('gtk3',
mode: 'none',
main_xml: 'gtk-docs.sgml',
src_dir: [
gtkinc,
],
dependencies: libgtk_dep,
gobject_typesfile: configure_file(
input: 'gtk3.types.in',
output: 'gtk3.types',
configuration: types_conf,
),
scan_args: [
'--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')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
'--extra-dir=../gdk',
],
content_files: content_files,
expand_content_files: expand_content_files,
html_assets: images,
install: true)
endif
xsltproc = find_program('xsltproc', required: false)
if get_option('man') and not xsltproc.found()
error('No xsltproc found, but man pages were explicitly enabled')
endif
if get_option('man') and xsltproc.found()
xlstproc_flags = [
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
]
man_files = [
[ 'gtk-query-immodules-3.0', '1', ],
[ 'gtk-update-icon-cache', '1', ],
[ 'gtk-encode-symbolic-svg', '1', ],
[ 'gtk-launch', '1', ],
[ 'gtk3-demo', '1', ],
[ 'gtk3-demo-application', '1', ],
[ 'gtk3-widget-factory', '1', ],
[ 'gtk3-icon-browser', '1', ],
[ 'gtk-builder-tool', '1', ],
[ 'gtk-query-settings', '1', ],
]
if broadway_enabled
man_files += [[ 'broadwayd', '1', ]]
endif
foreach man: man_files
man_name = man.get(0)
man_section = man.get(1, '1')
custom_target('@0@.@1@'.format(man_name, man_section),
input: '@0@.xml'.format(man_name),
output: '@0@.@1@'.format(man_name, man_section),
command: [
xsltproc,
xlstproc_flags,
'-o', '@OUTPUT@',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)))
endforeach
endif

View File

@@ -34,6 +34,8 @@ HTML_IMAGES =
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
EXTRA_DIST += \
version.xml.in \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,21 @@
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gail-libgail-util3',
mode: 'none',
main_xml: 'gail-libgail-util-docs.sgml',
src_dir: libgailutilinc,
dependencies: [libgtk_dep, libgailutil],
gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=../gtk',
],
install: true)
endif

View File

@@ -0,0 +1,22 @@
if get_option('gtk_doc')
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix')
cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo')
gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix')
gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf')
docpath = join_paths(gtk_datadir, 'gtk-doc', 'html')
version_conf = configuration_data()
version_conf.set('GTK_VERSION', meson.project_version())
src_dir_conf = configuration_data()
src_dir_conf.set('abs_top_srcdir', meson.source_root())
endif
subdir('gdk')
subdir('gtk')
subdir('libgail-util')

View File

@@ -20,6 +20,9 @@ LDADDS = \
$(GDK_DEP_LIBS) \
-lm
EXTRA_DIST += \
meson.build
if USE_X11
noinst_PROGRAMS = \
doc-shooter

12
docs/tools/meson.build Normal file
View File

@@ -0,0 +1,12 @@
if x11_enabled
doc_shooter_sources = [
'shadow.c',
'shooter.c',
'widgets.c',
'../../tests/gtkgears.c',
]
doc_shooter = executable('doc-shooter', doc_shooter_sources,
include_directories: [ confinc, gdkinc, gtkinc, testinc, ],
dependencies: libgtk_dep)
endif

View File

@@ -31,6 +31,8 @@ noinst_PROGRAMS = \
search-bar \
listbox-dnd
EXTRA_DIST = builder.ui
EXTRA_DIST = \
builder.ui \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -17,4 +17,7 @@ exampleapp_SOURCES = \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h
EXTRA_DIST = \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,11 @@
app1 = executable(
'exampleapp',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
dependencies: libgtk_dep
)

View File

@@ -41,7 +41,8 @@ EXTRA_DIST = \
prefs.ui \
gears-menu.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,23 @@
app10_resources = gnome.compile_resources(
'exampleapp10 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app10_schemas = gnome.compile_schemas()
app10 = executable(
'exampleapp10',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
'exampleappprefs.c',
'exampleappprefs.h',
app10_resources,
app10_schemas,
dependencies: libgtk_dep
)

View File

@@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui
EXTRA_DIST = \
window.ui \
exampleapp.gresource.xml
exampleapp.gresource.xml \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,17 @@
app2_resources = gnome.compile_resources(
'exampleapp2 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app2 = executable(
'exampleapp2',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
app2_resources,
dependencies: libgtk_dep
)

View File

@@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui
EXTRA_DIST = \
window.ui \
exampleapp.gresource.xml
exampleapp.gresource.xml \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,17 @@
app3_resources = gnome.compile_resources(
'exampleapp3 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app3 = executable(
'exampleapp3',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
app3_resources,
dependencies: libgtk_dep
)

View File

@@ -27,6 +27,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
EXTRA_DIST = \
window.ui \
app-menu.ui \
exampleapp.gresource.xml
exampleapp.gresource.xml \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,17 @@
app4_resources = gnome.compile_resources(
'exampleapp4 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app4 = executable(
'exampleapp4',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
app4_resources,
dependencies: libgtk_dep
)

View File

@@ -38,7 +38,8 @@ EXTRA_DIST = \
window.ui \
app-menu.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,21 @@
app5_resources = gnome.compile_resources(
'exampleapp5 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app5_schemas = gnome.compile_schemas()
app5 = executable(
'exampleapp5',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
app5_resources,
app5_schemas,
dependencies: libgtk_dep
)

View File

@@ -40,7 +40,8 @@ EXTRA_DIST = \
app-menu.ui \
prefs.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,23 @@
app6_resources = gnome.compile_resources(
'exampleapp6 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app6_schemas = gnome.compile_schemas()
app6 = executable(
'exampleapp6',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
'exampleappprefs.c',
'exampleappprefs.h',
app6_resources,
app6_schemas,
dependencies: libgtk_dep
)

View File

@@ -40,7 +40,8 @@ EXTRA_DIST = \
app-menu.ui \
prefs.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,23 @@
app7_resources = gnome.compile_resources(
'exampleapp7 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app7_schemas = gnome.compile_schemas()
app7 = executable(
'exampleapp7',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
'exampleappprefs.c',
'exampleappprefs.h',
app7_resources,
app7_schemas,
dependencies: libgtk_dep
)

View File

@@ -41,7 +41,8 @@ EXTRA_DIST = \
prefs.ui \
gears-menu.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,23 @@
app8_resources = gnome.compile_resources(
'exampleapp8 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app8_schemas = gnome.compile_schemas()
app8 = executable(
'exampleapp8',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
'exampleappprefs.c',
'exampleappprefs.h',
app8_resources,
app8_schemas,
dependencies: libgtk_dep
)

View File

@@ -41,7 +41,8 @@ EXTRA_DIST = \
prefs.ui \
gears-menu.ui \
exampleapp.gresource.xml \
org.gtk.exampleapp.gschema.xml
org.gtk.exampleapp.gschema.xml \
meson.build
CLEANFILES = \
gschemas.compiled

View File

@@ -0,0 +1,23 @@
app9_resources = gnome.compile_resources(
'exampleapp9 resources',
'exampleapp.gresource.xml',
source_dir: '.'
)
app9_schemas = gnome.compile_schemas()
app9 = executable(
'exampleapp9',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
'exampleappprefs.c',
'exampleappprefs.h',
app9_resources,
app9_schemas,
dependencies: libgtk_dep
)

View File

@@ -27,6 +27,8 @@ bloatpad-gresources.c: $(resource_files)
CLEANFILES = bloatpad-gresources.c
EXTRA_DIST = $(resource_files)
EXTRA_DIST = \
$(resource_files) \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -537,6 +537,7 @@ bloat_pad_startup (GApplication *application)
{ "win.justify::center", { "<Primary>m", NULL } },
{ "win.justify::right", { "<Primary>r", NULL } }
};
const gchar *new_accels[] = { "<Primary>n", "<Primary>t", NULL };
G_APPLICATION_CLASS (bloat_pad_parent_class)
->startup (application);
@@ -604,7 +605,6 @@ bloat_pad_startup (GApplication *application)
g_object_unref (item);
g_object_unref (icon);
const gchar *new_accels[] = { "<Primary>n", "<Primary>t", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
dump_accels (GTK_APPLICATION (application));

13
examples/bp/meson.build Normal file
View File

@@ -0,0 +1,13 @@
bp_resources = gnome.compile_resources(
'bloatpad resources',
'bloatpad.gresources.xml',
source_dir: '.'
)
bloatpad = executable(
'bloatpad',
'bloatpad.c',
bp_resources,
dependencies: libgtk_dep
)

60
examples/meson.build Normal file
View File

@@ -0,0 +1,60 @@
builder_example = executable(
'builder_example',
'builder.c',
dependencies: libgtk_dep
)
drawing = executable(
'drawing',
'drawing.c',
dependencies: libgtk_dep
)
grid_packing = executable(
'grid-packing',
'grid-packing.c',
dependencies: libgtk_dep
)
hello_world = executable(
'hello-world',
'hello-world.c',
dependencies: libgtk_dep
)
plugman = executable(
'plugman',
'plugman.c',
dependencies: libgtk_dep
)
search_bar = executable(
'search-bar',
'search-bar.c',
dependencies: libgtk_dep
)
sunny = executable(
'sunny',
'sunny.c',
dependencies: libgtk_dep
)
window_default = executable(
'window-default',
'window-default.c',
dependencies: libgtk_dep
)
subdir('bp')
subdir('application1')
subdir('application2')
subdir('application3')
subdir('application4')
subdir('application5')
subdir('application6')
subdir('application7')
subdir('application8')
subdir('application9')
subdir('application10')

View File

@@ -31,7 +31,10 @@ EXTRA_DIST += \
makefile.msc \
gdkenumtypes.c.template \
gdkenumtypes.h.template \
gdkversionmacros.h.in
gdkversionmacros.h.in \
meson.build \
gen-gdk-gresources-xml.py \
gdkconfig.h.meson
GDK_CFLAGS_DEFINES = \
-DG_LOG_USE_STRUCTURED=1 \
@@ -112,6 +115,7 @@ gdk_h_sources = \
gdk_private_headers = \
gdk-private.h \
gdkapplaunchcontextprivate.h \
gdkconstructor.h \
gdkcursorprivate.h \
gdkdevicemanagerprivate.h \
gdkdeviceprivate.h \
@@ -243,8 +247,7 @@ if HAVE_INTROSPECTION
introspection_files = \
$(filter-out gdkkeysyms-compat.h, $(gdk_h_sources)) \
$(gdk_c_sources) \
gdkenumtypes.c \
gdkenumtypes.h
$(gdk_built_sources)
Gdk-3.0.gir: libgdk-3.la Makefile
Gdk_3_0_gir_SCANNERFLAGS = \
@@ -274,8 +277,10 @@ x11_introspection_files = \
x11/gdkeventsource.c \
x11/gdkeventtranslator.c \
x11/gdkgeometry-x11.c \
x11/gdkglcontext-x11.c \
x11/gdkkeys-x11.c \
x11/gdkmain-x11.c \
x11/gdkmonitor-x11.c \
x11/gdkproperty-x11.c \
x11/gdkscreen-x11.c \
x11/gdkselection-x11.c \
@@ -298,7 +303,9 @@ x11_introspection_files = \
x11/gdkx11display.h \
x11/gdkx11displaymanager.h \
x11/gdkx11dnd.h \
x11/gdkx11glcontext.h \
x11/gdkx11keys.h \
x11/gdkx11monitor.h \
x11/gdkx11property.h \
x11/gdkx11screen.h \
x11/gdkx11selection.h \

View File

@@ -108,6 +108,10 @@ EXTRA_DIST += $(broadway_built_sources)
BUILT_SOURCES = $(broadway_built_sources)
EXTRA_DIST += \
meson.build \
gen-c-array.py
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk3-broadway broadwayd

View File

@@ -10,6 +10,6 @@ body { overflow: hidden; }
<script type="text/javascript" src="broadway.js"></script>
</head>
<body onload="connect()">
<body onload="connect()" onclick="if (!document.hasFocus() && window.topElement !== window.self) { window.focus(); }">
</body>
</html>

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--array-name', help='The name of the array variable')
parser.add_argument('--output', metavar='FILE', help='Output file',
type=argparse.FileType('w'),
default=sys.stdout)
parser.add_argument('input', metavar='FILE', help='The input file',
type=argparse.FileType('r'), nargs='+')
args = parser.parse_args()
args.output.write('static const char {}[] = {{\n'.format(args.array_name))
for input in args.input:
for line in input:
for ch in line:
args.output.write(' 0x{:02x},\n'.format(ord(ch)))
args.output.write('};')

78
gdk/broadway/meson.build Normal file
View File

@@ -0,0 +1,78 @@
gdk_broadway_sources = files(
'gdkcursor-broadway.c',
'gdkdevice-broadway.c',
'gdkdevicemanager-broadway.c',
'gdkdisplay-broadway.c',
'gdkdnd-broadway.c',
'gdkeventsource.c',
'gdkglobals-broadway.c',
'gdkkeys-broadway.c',
'gdkmonitor-broadway.c',
'gdkproperty-broadway.c',
'gdkscreen-broadway.c',
'gdkselection-broadway.c',
'gdktestutils-broadway.c',
'gdkvisual-broadway.c',
'gdkwindow-broadway.c',
'gdkbroadway-server.c',
)
gdk_broadway_public_headers = files(
'gdkbroadwaydisplay.h',
'gdkbroadwaywindow.h',
'gdkbroadwaycursor.h',
'gdkbroadwaymonitor.h',
'gdkbroadwayvisual.h',
)
install_headers(gdk_broadway_public_headers, subdir: 'gtk-3.0/gdk/broadway/')
install_headers('gdkbroadway.h', subdir: 'gtk-3.0/gdk/')
gdk_broadway_deps = [shmlib]
gen_c_array = find_program('gen-c-array.py')
clienthtml_h = custom_target('clienthtml.h',
input : 'client.html',
output : 'clienthtml.h',
command : [
gen_c_array,
'--array-name=client_html',
'--output=@OUTPUT@',
'@INPUT@',
],
)
broadwayjs_h = custom_target('broadwayjs.h',
input : ['broadway.js', 'rawinflate.min.js'],
output : 'broadwayjs.h',
command : [
gen_c_array,
'--array-name=broadway_js',
'--output=@OUTPUT@',
'@INPUT0@','@INPUT1@',
],
)
libgdk_broadway = static_library('gdk-broadway',
clienthtml_h, broadwayjs_h,
gdk_broadway_sources, gdkconfig, gdkenum_h,
include_directories: [confinc, gdkinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_args: common_ldflags,
dependencies: [gdk_deps, gdk_broadway_deps])
# gtk4-broadwayd
broadwayd_syslib = os_win32 ? cc.find_library('ws2_32') : shmlib
executable('broadwayd',
clienthtml_h, broadwayjs_h,
'broadwayd.c', 'broadway-server.c', 'broadway-buffer.c', 'broadway-output.c',
include_directories: [confinc, gdkinc, include_directories('.')],
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
dependencies : [broadwayd_syslib, gdk_deps],
install : true)

View File

@@ -17,6 +17,8 @@ gdk__private__ (void)
gdk_display_set_rendering_mode,
gdk_display_get_debug_updates,
gdk_display_set_debug_updates,
gdk_get_desktop_startup_id,
gdk_get_desktop_autostart_id,
};
return &table;

View File

@@ -31,6 +31,9 @@ gboolean gdk_display_get_debug_updates (GdkDisplay *display);
void gdk_display_set_debug_updates (GdkDisplay *display,
gboolean debug_updates);
const gchar * gdk_get_desktop_startup_id (void);
const gchar * gdk_get_desktop_autostart_id (void);
typedef struct {
/* add all private functions here, initialize them in gdk-private.c */
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
@@ -56,6 +59,9 @@ typedef struct {
gboolean (* gdk_display_get_debug_updates) (GdkDisplay *display);
void (* gdk_display_set_debug_updates) (GdkDisplay *display,
gboolean debug_updates);
const gchar * (* gdk_get_desktop_startup_id) (void);
const gchar * (* gdk_get_desktop_autostart_id) (void);
} GdkPrivateVTable;
GDK_AVAILABLE_IN_ALL

View File

@@ -38,9 +38,13 @@
#include "gdkkeysyms.h"
#endif
#include "gdkconstructor.h"
#include <string.h>
#include <stdlib.h>
#include <fribidi.h>
/**
* SECTION:general
@@ -1113,3 +1117,98 @@ gdk_disable_multidevice (void)
_gdk_disable_multidevice = TRUE;
}
PangoDirection
gdk_unichar_direction (gunichar ch)
{
FriBidiCharType fribidi_ch_type;
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
fribidi_ch_type = fribidi_get_bidi_type (ch);
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
return PANGO_DIRECTION_NEUTRAL;
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
return PANGO_DIRECTION_RTL;
else
return PANGO_DIRECTION_LTR;
}
#ifdef G_HAS_CONSTRUCTORS
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_startup_id)
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_autostart_id)
#endif
G_DEFINE_CONSTRUCTOR(stash_startup_id)
G_DEFINE_CONSTRUCTOR(stash_autostart_id)
#endif
static char *desktop_startup_id = NULL;
static char *desktop_autostart_id = NULL;
static void
stash_startup_id (void)
{
const char *startup_id = g_getenv ("DESKTOP_STARTUP_ID");
if (startup_id == NULL || startup_id[0] == '\0')
return;
if (!g_utf8_validate (startup_id, -1, NULL))
{
g_warning ("DESKTOP_STARTUP_ID contains invalid UTF-8");
return;
}
desktop_startup_id = g_strdup (startup_id);
}
static void
stash_autostart_id (void)
{
const char *autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
desktop_autostart_id = g_strdup (autostart_id ? autostart_id : "");
}
const gchar *
gdk_get_desktop_startup_id (void)
{
static gsize init = 0;
if (g_once_init_enter (&init))
{
#ifndef G_HAS_CONSTRUCTORS
stash_startup_id ();
#endif
/* Clear the environment variable so it won't be inherited by
* child processes and confuse things.
*/
g_unsetenv ("DESKTOP_STARTUP_ID");
g_once_init_leave (&init, 1);
}
return desktop_startup_id;
}
const gchar *
gdk_get_desktop_autostart_id (void)
{
static gsize init = 0;
if (g_once_init_enter (&init))
{
#ifndef G_HAS_CONSTRUCTORS
stash_autostart_id ();
#endif
/* Clear the environment variable so it won't be inherited by
* child processes and confuse things.
*/
g_unsetenv ("DESKTOP_AUTOSTART_ID");
g_once_init_leave (&init, 1);
}
return desktop_autostart_id;
}

20
gdk/gdkconfig.h.meson Normal file
View File

@@ -0,0 +1,20 @@
#ifndef __GDKCONFIG_H__
#define __GDKCONFIG_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <glib.h>
G_BEGIN_DECLS
#mesondefine GDK_WINDOWING_X11
#mesondefine GDK_WINDOWING_BROADWAY
#mesondefine GDK_WINDOWING_WAYLAND
#mesondefine GDK_WINDOWING_WIN32
G_END_DECLS
#endif /* __GDKCONFIG_H__ */

120
gdk/gdkconstructor.h Normal file
View File

@@ -0,0 +1,120 @@
/*
If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
destructors, in a sane way, including e.g. on library unload. If not you're on
your own.
Some compilers need #pragma to handle this, which does not work with macros,
so the way you need to use this is (for constructors):
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
#endif
G_DEFINE_CONSTRUCTOR(my_constructor)
static void my_constructor(void) {
...
}
*/
#ifndef __GTK_DOC_IGNORE__
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define G_HAS_CONSTRUCTORS 1
#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
/* Visual studio 2008 and later has _Pragma */
#define G_HAS_CONSTRUCTORS 1
/* We do some weird things to avoid the constructors being optimized
* away on VS2015 if WholeProgramOptimization is enabled. First we
* make a reference to the array from the wrapper to make sure its
* references. Then we use a pragma to make sure the wrapper function
* symbol is always included at the link stage. Also, the symbols
* need to be extern (but not dllexport), even though they are not
* really used from another object file.
*/
/* We need to account for differences between the mangling of symbols
* for Win32 (x86) and x64 programs, as symbols on Win32 are prefixed
* with an underscore but symbols on x64 are not.
*/
#ifdef _WIN64
#define G_MSVC_SYMBOL_PREFIX ""
#else
#define G_MSVC_SYMBOL_PREFIX "_"
#endif
#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
#define G_MSVC_CTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _wrapper(void) { _func(); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
__pragma(section(".CRT$XCU",read)) \
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
#define G_MSVC_DTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
__pragma(section(".CRT$XCU",read)) \
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
#elif defined (_MSC_VER)
#define G_HAS_CONSTRUCTORS 1
/* Pre Visual studio 2008 must use #pragma section */
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
section(".CRT$XCU",read)
#define G_DEFINE_CONSTRUCTOR(_func) \
static void _func(void); \
static int _func ## _wrapper(void) { _func(); return 0; } \
__declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
section(".CRT$XCU",read)
#define G_DEFINE_DESTRUCTOR(_func) \
static void _func(void); \
static int _func ## _constructor(void) { atexit (_func); return 0; } \
__declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
#elif defined(__SUNPRO_C)
/* This is not tested, but i believe it should work, based on:
* http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
*/
#define G_HAS_CONSTRUCTORS 1
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
init(_func)
#define G_DEFINE_CONSTRUCTOR(_func) \
static void _func(void);
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
fini(_func)
#define G_DEFINE_DESTRUCTOR(_func) \
static void _func(void);
#else
/* constructors not supported for this compiler */
#endif
#endif /* __GTK_DOC_IGNORE__ */

View File

@@ -14,7 +14,7 @@ G_BEGIN_DECLS
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/

View File

@@ -442,8 +442,8 @@ _gdk_frame_clock_begin_frame (GdkFrameClock *frame_clock)
* for the current frame or a recent frame. The #GdkFrameTimings
* object may not yet be complete: see gdk_frame_timings_get_complete().
*
* Returns: (nullable): the #GdkFrameTimings object for the specified
* frame, or %NULL if it is not available. See
* Returns: (nullable) (transfer none): the #GdkFrameTimings object for
* the specified frame, or %NULL if it is not available. See
* gdk_frame_clock_get_history_start().
* Since: 3.8
*/
@@ -475,10 +475,10 @@ gdk_frame_clock_get_timings (GdkFrameClock *frame_clock,
*
* Gets the frame timings for the current frame.
*
* Returns: (nullable): the #GdkFrameTimings for the frame currently
* being processed, or even no frame is being processed, for the
* previous frame. Before any frames have been processed, returns
* %NULL.
* Returns: (nullable) (transfer none): the #GdkFrameTimings for the
* frame currently being processed, or even no frame is being
* processed, for the previous frame. Before any frames have been
* processed, returns %NULL.
* Since: 3.8
*/
GdkFrameTimings *

View File

@@ -37,9 +37,6 @@
struct _GdkFrameClockIdlePrivate
{
GTimer *timer;
/* timer_base is used to avoid ever going backward */
gint64 timer_base;
gint64 frame_time;
gint64 min_next_frame_time;
gint64 sleep_serial;
@@ -160,22 +157,12 @@ compute_frame_time (GdkFrameClockIdle *idle)
{
GdkFrameClockIdlePrivate *priv = idle->priv;
gint64 computed_frame_time;
gint64 elapsed;
elapsed = g_get_monotonic_time () + priv->timer_base;
if (elapsed < priv->frame_time)
{
/* clock went backward. adapt to that by forevermore increasing
* timer_base. For now, assume we've gone forward in time 1ms.
*/
/* hmm. just fix GTimer? */
computed_frame_time = g_get_monotonic_time ();
/* ensure monotonicity of frame time */
if (computed_frame_time <= priv->frame_time)
computed_frame_time = priv->frame_time + 1;
priv->timer_base += (priv->frame_time - elapsed) + 1;
}
else
{
computed_frame_time = elapsed;
}
return computed_frame_time;
}

View File

@@ -558,6 +558,8 @@ cairo_surface_t * _gdk_offscreen_window_create_surface (GdkWindow *window,
gint width,
gint height);
PangoDirection gdk_unichar_direction (gunichar ch);
G_END_DECLS
#endif /* __GDK_INTERNALS_H__ */

View File

@@ -10275,7 +10275,7 @@ gdk_window_create_similar_image_surface (GdkWindow * window,
* @window: a #GdkWindow
* @timestamp: timestamp of the event triggering the window focus
*
* Sets keyboard focus to @window. In most cases, gtk_window_present()
* Sets keyboard focus to @window. In most cases, gtk_window_present_with_time()
* should be used on a #GtkWindow, rather than calling this function.
*
**/
@@ -10500,7 +10500,10 @@ void
gdk_window_set_startup_id (GdkWindow *window,
const gchar *startup_id)
{
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_startup_id (window, startup_id);
GdkWindowImplClass *klass = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (klass->set_startup_id)
klass->set_startup_id (window, startup_id);
}
/**
@@ -10749,7 +10752,7 @@ gdk_window_iconify (GdkWindow *window)
* Attempt to deiconify (unminimize) @window. On X11 the window manager may
* choose to ignore the request to deiconify. When using GTK+,
* use gtk_window_deiconify() instead of the #GdkWindow variant. Or better yet,
* you probably want to use gtk_window_present(), which raises the window, focuses it,
* you probably want to use gtk_window_present_with_time(), which raises the window, focuses it,
* unminimizes it, and puts it on the current desktop.
*
**/

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
#
# Generate gdk.gresources.xml
#
# Usage: gen-gdk-gresources-xml SRCDIR_GDK [OUTPUT-FILE]
import os, sys
srcdir = sys.argv[1]
xml = '''<?xml version='1.0' encoding='UTF-8'?>
<gresources>
<gresource prefix='/org/gtk/libgdk'>
'''
def get_files(subdir,extension):
return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir))))
for f in get_files('resources/glsl', '.glsl'):
xml += ' <file alias=\'glsl/{0}\'>resources/glsl/{0}</file>\n'.format(f)
xml += '''
</gresource>
</gresources>'''
if len(sys.argv) > 2:
outfile = sys.argv[2]
f = open(outfile, 'w')
f.write(xml)
f.close()
else:
print(xml)

377
gdk/meson.build Normal file
View File

@@ -0,0 +1,377 @@
deprecated_gdk_sources = files('deprecated/gdkcolor.c')
gdk_sources = files(
'gdk-private.c',
'gdk.c',
'gdkapplaunchcontext.c',
'gdkcairo.c',
'gdkcursor.c',
'gdkdeprecated.c',
'gdkdevice.c',
'gdkdevicemanager.c',
'gdkdevicepad.c',
'gdkdisplay.c',
'gdkdisplaymanager.c',
'gdkdnd.c',
'gdkevents.c',
'gdkframetimings.c',
'gdkgl.c',
'gdkglcontext.c',
'gdkglobals.c',
'gdkkeys.c',
'gdkkeyuni.c',
'gdkoffscreenwindow.c',
'gdkframeclock.c',
'gdkframeclockidle.c',
'gdkpango.c',
'gdkpixbuf-drawable.c',
'gdkproperty.c',
'gdkrectangle.c',
'gdkrgba.c',
'gdkscreen.c',
'gdkselection.c',
'gdkvisual.c',
'gdkwindow.c',
'gdkwindowimpl.c',
'gdkseat.c',
'gdkseatdefault.c',
'gdkdevicetool.c',
'gdkdrawingcontext.c',
'gdkmonitor.c'
)
gdk_gir_public_headers = files(
'gdk.h',
'gdk-autocleanup.h',
'gdkapplaunchcontext.h',
'gdkcairo.h',
'gdkcursor.h',
'gdkdevice.h',
'gdkdevicetool.h',
'gdkdevicemanager.h',
'gdkdevicepad.h',
'gdkdisplay.h',
'gdkdisplaymanager.h',
'gdkdnd.h',
'gdkdrawingcontext.h',
'gdkevents.h',
'gdkframetimings.h',
'gdkglcontext.h',
'gdkkeys.h',
'gdkkeysyms.h',
'gdkmain.h',
'gdkmonitor.h',
'gdkpango.h',
'gdkframeclock.h',
'gdkpixbuf.h',
'gdkprivate.h',
'gdkproperty.h',
'gdkrectangle.h',
'gdkrgba.h',
'gdkscreen.h',
'gdkseat.h',
'gdkselection.h',
'gdktestutils.h',
'gdkthreads.h',
'gdktypes.h',
'gdkvisual.h',
'gdkwindow.h',
)
gdk_nogir_public_headers = [files('gdkkeysyms-compat.h')]
gdk_public_headers = gdk_gir_public_headers + gdk_nogir_public_headers
install_headers(gdk_public_headers, subdir : 'gtk-3.0/gdk')
deprecated_h_sources = files('deprecated/gdkcolor.h')
install_headers(deprecated_h_sources, subdir : 'gtk-3.0/gdk/deprecated')
# This variable is unused, but added just for completeness
gdk_private_headers = files(
'gdkseatdefaultprivate.h',
'gdkdevicetoolprivate.h',
'gdkdrawingcontextprivate.h',
'gdkmonitorprivate.h',
'gdkprivate.h',
)
gdk_wayland_sources = files(
'wayland/gdkapplaunchcontext-wayland.c',
'wayland/gdkcursor-wayland.c',
'wayland/gdkdevice-wayland.c',
'wayland/gdkdisplay-wayland.c',
'wayland/gdkdnd-wayland.c',
'wayland/gdkeventsource.c',
'wayland/gdkglcontext-wayland.c',
'wayland/gdkkeys-wayland.c',
'wayland/gdkmonitor-wayland.c',
'wayland/gdkscreen-wayland.c',
'wayland/gdkselection-wayland.c',
'wayland/gdkwindow-wayland.c',
'wayland/wm-button-layout-translation.c',
)
gdk_broadway_sources = files([
'broadway/gdkdisplay-broadway.c',
'broadway/gdkscreen-broadway.c',
'broadway/broadway-output.c',
'broadway/broadway-server.c',
'broadway/gdkbroadway-server.c',
'broadway/gdkcursor-broadway.c',
'broadway/gdkvisual-broadway.c',
'broadway/gdkselection-broadway.c',
'broadway/gdkwindow-broadway.c',
'broadway/gdkmonitor-broadway.c',
'broadway/gdkkeys-broadway.c',
'broadway/gdkglobals-broadway.c',
'broadway/gdkeventsource.c',
'broadway/gdkdnd-broadway.c',
'broadway/broadwayd.c',
'broadway/gdkdevicemanager-broadway.c',
'broadway/gdkdevice-broadway.c',
'broadway/broadway-buffer.c',
'broadway/gdktestutils-broadway.c',
'broadway/gdkproperty-broadway.c'
])
gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml',
input : 'gen-gdk-gresources-xml.py',
command : [find_program('gen-gdk-gresources-xml.py'),
meson.current_source_dir(), '@OUTPUT@'])
gdkresources = gnome.compile_resources('gdkresources',
gdk_gresource_xml,
source_dir: '.',
c_name: '_gdk',
extra_args: '--manual-register'
)
gdk_enums = gnome.mkenums('gdkenumtypes',
sources: gdk_public_headers,
c_template : 'gdkenumtypes.c.template',
h_template : 'gdkenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'),
install_header : true)
gdkenum_h = gdk_enums[1]
gdk_marshalers = gnome.genmarshal('gdkmarshalers',
sources : 'gdkmarshalers.list',
prefix : '_gdk_marshal',
valist_marshallers : true)
gdkmarshal_h = gdk_marshalers[1]
gdkconfig_cdata = configuration_data()
gdkconfig_cdata.set('GDK_WINDOWING_X11', x11_enabled)
gdkconfig_cdata.set('GDK_WINDOWING_WAYLAND', wayland_enabled)
gdkconfig_cdata.set('GDK_WINDOWING_WIN32', win32_enabled)
gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled)
gdkconfig = configure_file(
input : 'gdkconfig.h.meson',
output : 'gdkconfig.h',
configuration : gdkconfig_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'))
gdkversion_cdata = configuration_data()
gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
gdkversion_cdata.set('GTK_API_VERSION', gtk_api_version)
gdkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version)
gdkversion_cdata.set('GTK_VERSION', meson.project_version())
gdkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion)
gdkversionmacros = configure_file(
input : 'gdkversionmacros.h.in',
output : 'gdkversionmacros.h',
configuration: gdkversion_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'))
gdkinc = include_directories('.')
gdkx11_inc = include_directories('x11')
gdkwayland_inc = include_directories('wayland')
wlinc = include_directories('.')
gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros]
gdk_deps = [
libm,
pixbuf_dep,
cairo_dep,
pango_dep,
fribidi_dep,
cairogobj_dep,
glib_dep,
epoxy_dep,
fontconfig_dep,
platform_gio_dep,
pangocairo_dep
]
if win32_enabled
gdk_deps += [cc.find_library('advapi32'),
cc.find_library('comctl32'),
cc.find_library('dwmapi'),
cc.find_library('imm32'),
cc.find_library('setupapi'),
cc.find_library('winmm')]
gdk_rc = configure_file(
input: 'win32/rc/gdk.rc.in',
output: 'gdk.rc',
configuration: gdkversion_cdata,
)
gdk_res = import('windows').compile_resources(gdk_rc, include_directories: include_directories('win32/rc'))
gdk_sources += gdk_res
endif
gdk_sources = [
# Generated
gdkconfig,
gdk_enums,
gdk_marshalers,
gdkresources,
gdkversionmacros,
# Static
gdk_sources,
deprecated_gdk_sources,
]
if wayland_enabled or broadway_enabled
if cc.has_function('shm_open')
shmlib = []
elif cc.has_function('shm_open', args : '-lrt')
shmlib = cc.find_library('rt')
else
shmlib = []
endif
endif
gdk_backends = []
gdk_backends_gen_headers = [] # non-public generated headers
foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11']
if get_variable('@0@_enabled'.format(backend))
subdir(backend)
gdk_deps += get_variable('gdk_@0@_deps'.format(backend))
gdk_backends += get_variable('libgdk_@0@'.format(backend))
# Special-case this for now to work around Meson bug with get_variable()
# fallback being an empty array, or any array (#1481)
if backend == 'wayland'
gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend))
endif
if backend == 'quartz'
common_cflags += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c']
endif
endif
endforeach
if gdk_backends.length() == 0
error('No backends enabled')
endif
gdk_link_args = common_ldflags
# Somehow gdk_win32_display_manager_get_type is not being exported as it
# seems that it was optimized out by the MSVC linker. Force-export it here.
if cc.get_id() == 'msvc'
gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ]
endif
libgdk = shared_library('gdk-3',
soversion: gtk_soversion,
version: gtk_library_version,
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps,
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: [
'-DGDK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_whole: gdk_backends,
link_args: gdk_link_args,
darwin_versions : gtk_osxversions,
install: true)
gdk_dep_sources = [gdkconfig, gdkenum_h]
# Introspection
if build_gir
gir_args = ['--quiet']
# We may build some of the dependencies as sub-projects; this means
# that we need to depend on the built introspection data, instead of
# the installed one
gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ]
if pixbuf_dep.type_name() == 'internal'
gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0)
else
gdk_gir_inc += 'GdkPixbuf-2.0'
endif
if pango_dep.type_name() == 'internal'
gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0)
else
gdk_gir_inc += 'Pango-1.0'
endif
gdk_gir_sources = gdk_gir_public_headers + deprecated_h_sources
gdk_gir_sources += gdk_sources + gdk_enums + [gdkconfig]
gdk_gir = gnome.generate_gir(libgdk,
sources: gdk_gir_sources,
namespace: 'Gdk',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gdk-3.0',
includes: gdk_gir_inc,
header: 'gdk/gdk.h',
install: true,
extra_args: gir_args + [
'-DGDK_COMPILATION',
])
gdk_gir_dep = declare_dependency(sources: gdk_gir)
gdk_dep_sources += gdk_gir
if x11_enabled
gdk_x11_gir = gnome.generate_gir(libgdk,
sources: gdk_x11_public_headers + gdk_x11_sources,
namespace: 'GdkX11',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gdk-x11-3.0',
includes: gdk_gir_inc + [ gdk_gir[0], 'xlib-2.0', ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/gdkx.h',
extra_args: gir_args + [
'-DGDK_COMPILATION',
])
gdk_dep_sources += gdk_x11_gir
endif
if win32_enabled
gdk_win32_gir = gnome.generate_gir(libgdk,
sources: gdk_win32_public_headers + gdk_win32_sources,
namespace: 'GdkWin32',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gdk-win32-3.0',
includes: gdk_gir_inc + [gdk_gir[0]],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/gdkwin32.h',
extra_args: gir_args + [
'-DGDK_COMPILATION',
])
gdk_dep_sources += gdk_win32_gir
endif
endif
libgdk_dep = declare_dependency(
link_with: libgdk,
sources: gdk_dep_sources,
include_directories: [confinc, gdkx11_inc, wlinc],
dependencies: gdk_deps)

View File

@@ -278,7 +278,7 @@
screen:screen];
[self setAcceptsMouseMovedEvents:YES];
[self setDelegate:self];
[self setDelegate:(id<NSWindowDelegate>)self];
[self setReleasedWhenClosed:YES];
return self;
@@ -384,40 +384,34 @@
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
{
return [super convertPointToScreen: point];
}
return [super convertPointToScreen: point];
#endif
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectToScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
return [self convertBaseToScreen:point];
if (gdk_quartz_osx_version () < GDK_OSX_LION)
return [self convertBaseToScreen:point];
#endif
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectToScreen: inrect];
return outrect.origin;
}
}
- (NSPoint)convertPointFromScreen:(NSPoint)point
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
{
return [super convertPointFromScreen: point];
}
return [super convertPointFromScreen: point];
#endif
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectFromScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
return [self convertScreenToBase:point];
if (gdk_quartz_osx_version () < GDK_OSX_LION)
return [self convertScreenToBase:point];
#endif
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectFromScreen: inrect];
return outrect.origin;
}
}
- (BOOL)trackManualMove
@@ -794,7 +788,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
wh = gdk_window_get_height (win);
if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh)
event->dnd.context->dest_window = win;
event->dnd.context->dest_window = g_object_ref (win);
break;
}
}

View File

@@ -31,8 +31,9 @@
if ((self = [super initWithFrame: frameRect]))
{
markedRange = NSMakeRange (NSNotFound, 0);
selectedRange = NSMakeRange (NSNotFound, 0);
selectedRange = NSMakeRange (0, 0);
}
[self setValue: @(YES) forKey: @"postsFrameChangedNotifications"];
return self;
}
@@ -57,6 +58,16 @@
-(void) keyDown: (NSEvent *) theEvent
{
/* NOTE: When user press Cmd+A, interpretKeyEvents: will call noop:
method. When user press and hold A to show the accented char window,
it consumed repeating key down events for key 'A' do NOT call
any other method. We use this behavior to determine if this key
down event is filtered by interpretKeyEvents.
*/
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_FILTERED));
GDK_NOTE (EVENTS, g_message ("keyDown"));
[self interpretKeyEvents: [NSArray arrayWithObject: theEvent]];
}
@@ -124,7 +135,8 @@
-(void)unmarkText
{
GDK_NOTE (EVENTS, g_message ("unmarkText"));
markedRange = selectedRange = NSMakeRange (NSNotFound, 0);
selectedRange = NSMakeRange (0, 0);
markedRange = NSMakeRange (NSNotFound, 0);
g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, NULL, g_free);
}
@@ -209,8 +221,15 @@
else
{
str = [string UTF8String];
selectedRange = NSMakeRange ([string length], 0);
}
if (replacementRange.length > 0)
{
g_object_set_data (G_OBJECT (gdk_window), TIC_INSERT_TEXT_REPLACE_LEN,
GINT_TO_POINTER (replacementRange.length));
}
g_object_set_data_full (G_OBJECT (gdk_window), TIC_INSERT_TEXT, g_strdup (str), g_free);
GDK_NOTE (EVENTS, g_message ("insertText: set %s (%p, nsview %p): %s",
TIC_INSERT_TEXT, gdk_window, self,
@@ -537,6 +556,8 @@
-(void)noop: (id)sender
{
GDK_NOTE (EVENTS, g_message ("noop"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
/* --------------------------------------------------------------- */
@@ -707,6 +728,9 @@
-(void)setFrame: (NSRect)frame
{
if (GDK_WINDOW_DESTROYED (gdk_window))
return;
[super setFrame: frame];
if ([self window])

View File

@@ -24,6 +24,7 @@
#define TIC_SELECTED_POS "tic-selected-pos"
#define TIC_SELECTED_LEN "tic-selected-len"
#define TIC_INSERT_TEXT "tic-insert-text"
#define TIC_INSERT_TEXT_REPLACE_LEN "tic-insert-text-replace-len"
#define TIC_IN_KEY_DOWN "tic-in-key-down"
/* GtkIMContext */

View File

@@ -64,6 +64,7 @@ libgdkquartzinclude_HEADERS = \
gdkquartzdisplay.h \
gdkquartzdisplaymanager.h \
gdkquartzdnd.h \
gdkquartzglcontext.h \
gdkquartzkeys.h \
gdkquartzmonitor.h \
gdkquartzscreen.h \
@@ -71,5 +72,7 @@ libgdkquartzinclude_HEADERS = \
gdkquartzvisual.h \
gdkquartzwindow.h
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

View File

@@ -31,6 +31,35 @@
#include "gdkmonitorprivate.h"
#include "gdkdisplay-quartz.h"
#include "gdkmonitor-quartz.h"
#include "gdkglcontext-quartz.h"
/* Note about coordinates: There are three coordinate systems at play:
*
* 1. Core Graphics starts at the origin at the upper right of the
* main window (the one with the menu bar when you look at arrangement
* in System Preferences>Displays) and increases down and to the
* right; up and to the left are negative values of y and x
* respectively.
*
* 2. AppKit (functions beginning with "NS" for NextStep) coordinates
* also have their origin at the main window, but it's the *lower*
* left corner and coordinates increase up and to the
* right. Coordinates below or left of the origin are negative.
*
* 3. Gdk coordinates origin is at the upper left corner of the
* imaginary rectangle enclosing all monitors and like Core Graphics
* increase down and to the right. There are no negative coordinates.
*
* We need to deal with all three because AppKit's NSScreen array is
* recomputed with new pointers whenever the monitor arrangement
* changes so we can't cache the references it provides. CoreGraphics
* screen IDs are constant between reboots so those are what we use to
* map GdkMonitors and screens, but the sizes and origins must be
* converted to Gdk coordinates to make sense to Gdk and we must
* frequently convert between Gdk and AppKit coordinates when
* determining the drawable area of a monitor and placing windows and
* views (the latter containing our cairo surfaces for drawing on).
*/
static gint MONITORS_CHANGED = 0;
@@ -220,32 +249,45 @@ gdk_quartz_display_pop_error_trap (GdkDisplay *display, gboolean ignore)
*/
int
get_active_displays (CGDirectDisplayID **screens)
get_active_displays (CGDirectDisplayID **displays)
{
unsigned int displays = 0;
unsigned int n_displays = 0;
CGGetActiveDisplayList (0, NULL, &displays);
if (screens)
CGGetActiveDisplayList (0, NULL, &n_displays);
if (displays)
{
*screens = g_new0 (CGDirectDisplayID, displays);
CGGetActiveDisplayList (displays, *screens, &displays);
*displays = g_new0 (CGDirectDisplayID, n_displays);
CGGetActiveDisplayList (n_displays, *displays, &n_displays);
}
return displays;
return n_displays;
}
static inline GdkRectangle
cgrect_to_gdkrect (CGRect cgrect)
{
GdkRectangle gdkrect = {(int)trunc (cgrect.origin.x),
(int)trunc (cgrect.origin.y),
(int)trunc (cgrect.size.width),
(int)trunc (cgrect.size.height)};
return gdkrect;
}
static void
configure_monitor (GdkMonitor *monitor)
configure_monitor (GdkMonitor *monitor,
GdkQuartzDisplay *display)
{
GdkQuartzMonitor *quartz_monitor = GDK_QUARTZ_MONITOR (monitor);
CGSize disp_size = CGDisplayScreenSize (quartz_monitor->id);
gint width = (int)trunc (disp_size.width);
gint height = (int)trunc (disp_size.height);
CGRect disp_bounds = CGDisplayBounds (quartz_monitor->id);
GdkRectangle disp_geometry = {(int)trunc (disp_bounds.origin.x),
(int)trunc (disp_bounds.origin.y),
(int)trunc (disp_bounds.size.width),
(int)trunc (disp_bounds.size.height)};
CGRect main_bounds = CGDisplayBounds (CGMainDisplayID());
/* Change origin to Gdk coordinates. */
disp_bounds.origin.x = disp_bounds.origin.x + display->geometry.origin.x;
disp_bounds.origin.y =
display->geometry.origin.y - main_bounds.size.height + disp_bounds.origin.y;
GdkRectangle disp_geometry = cgrect_to_gdkrect (disp_bounds);
CGDisplayModeRef mode = CGDisplayCopyDisplayMode (quartz_monitor->id);
gint refresh_rate = (int)trunc (CGDisplayModeGetRefreshRate (mode));
@@ -265,13 +307,58 @@ configure_monitor (GdkMonitor *monitor)
monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
}
static void
display_rect (GdkQuartzDisplay *display)
{
uint32_t disp, n_displays = 0;
float min_x = 0.0, max_x = 0.0, min_y = 0.0, max_y = 0.0;
float min_x_mm = 0.0, max_x_mm = 0.0, min_y_mm = 0.0, max_y_mm = 0.0;
float main_height;
CGDirectDisplayID *displays;
n_displays = get_active_displays (&displays);
for (disp = 0; disp < n_displays; ++disp)
{
CGRect bounds = CGDisplayBounds (displays[disp]);
CGSize disp_size = CGDisplayScreenSize (displays[disp]);
float x_scale = disp_size.width / bounds.size.width;
float y_scale = disp_size.height / bounds.size.height;
if (disp == 0)
main_height = bounds.size.height;
min_x = MIN (min_x, bounds.origin.x);
min_y = MIN (min_y, bounds.origin.y);
max_x = MAX (max_x, bounds.origin.x + bounds.size.width);
max_y = MAX (max_y, bounds.origin.y + bounds.size.height);
min_x_mm = MIN (min_x_mm, bounds.origin.x / x_scale);
min_y_mm = MIN (min_y_mm, main_height - (bounds.size.height + bounds.origin.y) / y_scale);
max_x_mm = MAX (max_x_mm, (bounds.origin.x + bounds.size.width) / x_scale);
max_y_mm = MAX (max_y_mm, (bounds.origin.y + bounds.size.height) / y_scale);
}
g_free (displays);
/* Adjusts the origin to AppKit coordinates. */
display->geometry = NSMakeRect (-min_x, main_height - min_y,
max_x - min_x, max_y - min_y);
display->size = NSMakeSize (max_x_mm - min_x_mm, max_y_mm - min_y_mm);
}
static gboolean
same_monitor (gconstpointer a, gconstpointer b)
{
GdkQuartzMonitor *mon_a = GDK_QUARTZ_MONITOR (a);
CGDirectDisplayID disp_id = (CGDirectDisplayID)GPOINTER_TO_INT (b);
if (!mon_a)
return FALSE;
return mon_a->id == disp_id;
}
static void
display_reconfiguration_callback (CGDirectDisplayID cg_display,
CGDisplayChangeSummaryFlags flags,
void *data)
{
GdkQuartzDisplay *display = data;
GdkQuartzMonitor *monitor;
/* Ignore the begin configuration signal. */
if (flags & kCGDisplayBeginConfigurationFlag)
@@ -281,27 +368,44 @@ display_reconfiguration_callback (CGDirectDisplayID cg_display,
kCGDisplaySetMainFlag | kCGDisplayDesktopShapeChangedFlag |
kCGDisplayMirrorFlag | kCGDisplayUnMirrorFlag))
{
monitor = g_hash_table_lookup (display->monitors,
GINT_TO_POINTER (cg_display));
if (!monitor)
GdkQuartzMonitor *monitor = NULL;
guint index;
if (!g_ptr_array_find_with_equal_func (display->monitors,
GINT_TO_POINTER (cg_display),
same_monitor,
&index))
{
monitor = g_object_new (GDK_TYPE_QUARTZ_MONITOR,
"display", display, NULL);
monitor->id = cg_display;
g_hash_table_insert (display->monitors, GINT_TO_POINTER (monitor->id),
monitor);
g_ptr_array_add (display->monitors, monitor);
gdk_display_monitor_added (GDK_DISPLAY (display),
GDK_MONITOR (monitor));
}
configure_monitor (GDK_MONITOR (monitor));
else
{
monitor = g_ptr_array_index (display->monitors, index);
}
display_rect (display);
configure_monitor (GDK_MONITOR (monitor), display);
}
else if (flags & (kCGDisplayRemoveFlag | kCGDisplayDisabledFlag))
{
GdkMonitor *monitor = g_hash_table_lookup (display->monitors,
GINT_TO_POINTER (cg_display));
gdk_display_monitor_removed (GDK_DISPLAY (display),
GDK_MONITOR (monitor));
g_hash_table_remove (display->monitors, GINT_TO_POINTER (cg_display));
guint index;
if (g_ptr_array_find_with_equal_func (display->monitors,
GINT_TO_POINTER (cg_display),
same_monitor,
&index))
{
GdkQuartzMonitor *monitor = g_ptr_array_index (display->monitors,
index);
gdk_display_monitor_removed (GDK_DISPLAY (display),
GDK_MONITOR (monitor));
g_ptr_array_remove_fast (display->monitors, monitor);
}
}
g_signal_emit (display, MONITORS_CHANGED, 0);
@@ -311,7 +415,8 @@ display_reconfiguration_callback (CGDirectDisplayID cg_display,
static int
gdk_quartz_display_get_n_monitors (GdkDisplay *display)
{
return get_active_displays (NULL);
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
return quartz_display->monitors->len;
}
static GdkMonitor *
@@ -319,13 +424,10 @@ gdk_quartz_display_get_monitor (GdkDisplay *display,
int monitor_num)
{
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
CGDirectDisplayID *screens = NULL;
int n_displays = gdk_quartz_display_get_n_monitors (display);
int count = get_active_displays (&screens);
if (monitor_num >= 0 && monitor_num < count)
return g_hash_table_lookup (quartz_display->monitors,
GINT_TO_POINTER (screens[monitor_num]));
if (monitor_num >= 0 && monitor_num < n_displays)
return g_ptr_array_index (quartz_display->monitors, monitor_num);
return NULL;
}
@@ -335,9 +437,15 @@ gdk_quartz_display_get_primary_monitor (GdkDisplay *display)
{
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
CGDirectDisplayID primary_id = CGMainDisplayID ();
GdkMonitor *monitor = NULL;
guint index;
return g_hash_table_lookup (quartz_display->monitors,
GINT_TO_POINTER (primary_id));
if (g_ptr_array_find_with_equal_func (quartz_display->monitors,
GINT_TO_POINTER (primary_id),
same_monitor, &index))
monitor = g_ptr_array_index (quartz_display->monitors, index);
return monitor;
}
static GdkMonitor *
@@ -347,10 +455,27 @@ gdk_quartz_display_get_monitor_at_window (GdkDisplay *display,
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
NSWindow *nswindow = impl->toplevel;
NSScreen *screen = [nswindow screen];
CGDirectDisplayID id = [[[screen deviceDescription]
objectForKey: @"NSScreenNumber"] unsignedIntValue];
return g_hash_table_lookup (GDK_QUARTZ_DISPLAY (display)->monitors,
GINT_TO_POINTER (id));
GdkMonitor *monitor = NULL;
if (screen)
{
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
guint index;
CGDirectDisplayID disp_id =
[[[screen deviceDescription]
objectForKey: @"NSScreenNumber"] unsignedIntValue];
if (g_ptr_array_find_with_equal_func (quartz_display->monitors,
GINT_TO_POINTER (disp_id),
same_monitor, &index))
monitor = g_ptr_array_index (quartz_display->monitors, index);
}
if (!monitor)
{
GdkRectangle rect = cgrect_to_gdkrect (NSRectToCGRect ([nswindow frame]));
monitor = gdk_display_get_monitor_at_point (display,
rect.x + rect.width/2,
rect.y + rect.height /2);
}
return monitor;
}
G_DEFINE_TYPE (GdkQuartzDisplay, gdk_quartz_display, GDK_TYPE_DISPLAY)
@@ -358,36 +483,35 @@ G_DEFINE_TYPE (GdkQuartzDisplay, gdk_quartz_display, GDK_TYPE_DISPLAY)
static void
gdk_quartz_display_init (GdkQuartzDisplay *display)
{
uint32_t max_displays = 0, disp;
uint32_t n_displays = 0, disp;
CGDirectDisplayID *displays;
CGGetActiveDisplayList (0, NULL, &max_displays);
display->monitors = g_hash_table_new_full (g_direct_hash, NULL,
NULL, g_object_unref);
displays = g_new0 (CGDirectDisplayID, max_displays);
CGGetActiveDisplayList (max_displays, displays, &max_displays);
for (disp = 0; disp < max_displays; ++disp)
display_rect(display); /* Initialize the overall display coordinates. */
n_displays = get_active_displays (&displays);
display->monitors = g_ptr_array_new_full (n_displays, g_object_unref);
for (disp = 0; disp < n_displays; ++disp)
{
GdkQuartzMonitor *monitor = g_object_new (GDK_TYPE_QUARTZ_MONITOR,
"display", display, NULL);
monitor->id = displays[disp];
g_hash_table_insert (display->monitors, GINT_TO_POINTER (monitor->id),
monitor);
configure_monitor (GDK_MONITOR (monitor));
g_ptr_array_add (display->monitors, monitor);
configure_monitor (GDK_MONITOR (monitor), display);
}
g_free (displays);
CGDisplayRegisterReconfigurationCallback (display_reconfiguration_callback,
display);
/* So that monitors changed will keep display->geometry syncronized. */
g_signal_emit (display, MONITORS_CHANGED, 0);
}
static void
gdk_quartz_display_dispose (GObject *object)
{
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (object);
g_hash_table_destroy (display_quartz->monitors);
g_ptr_array_free (quartz_display->monitors, TRUE);
CGDisplayRemoveReconfigurationCallback (display_reconfiguration_callback,
display_quartz);
quartz_display);
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->dispose (object);
}
@@ -461,6 +585,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
display_class->get_monitor = gdk_quartz_display_get_monitor;
display_class->get_primary_monitor = gdk_quartz_display_get_primary_monitor;
display_class->get_monitor_at_window = gdk_quartz_display_get_monitor_at_window;
display_class->make_gl_context_current = gdk_quartz_display_make_gl_context_current;
/**
* GdkQuartzDisplay::monitors-changed:

View File

@@ -32,7 +32,9 @@ G_BEGIN_DECLS
struct _GdkQuartzDisplay
{
GdkDisplay parent_instance;
GHashTable *monitors;
NSRect geometry; /* In AppKit coordinates. */
NSSize size; /* Aggregate size of displays in millimeters. */
GPtrArray *monitors;
};
struct _GdkQuartzDisplayClass

View File

@@ -608,11 +608,26 @@ find_toplevel_under_pointer (GdkDisplay *display,
info = _gdk_display_get_pointer_info (display, gdk_seat_get_pointer (seat));
toplevel = info->toplevel_under_pointer;
if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
get_window_point_from_screen_point (toplevel, screen_point, x, y);
if (!(toplevel && WINDOW_IS_TOPLEVEL (toplevel)))
{
gint gdk_x = 0, gdk_y = 0;
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y);
toplevel = gdk_display_get_window_at_pointer (display, &gdk_x, &gdk_y);
if (toplevel && ! WINDOW_IS_TOPLEVEL (toplevel))
toplevel = gdk_window_get_toplevel (toplevel);
if (toplevel)
info->toplevel_under_pointer = g_object_ref (toplevel);
else
info->toplevel_under_pointer = NULL;
}
if (toplevel)
{
get_window_point_from_screen_point (toplevel, screen_point, x, y);
/* If the coordinates are out of window bounds, this toplevel is not
* under the pointer and we thus return NULL. This can occur when
* toplevel under pointer has not yet been updated due to a very recent
@@ -629,33 +644,15 @@ find_toplevel_under_pointer (GdkDisplay *display,
static GdkWindow *
find_toplevel_for_keyboard_event (NSEvent *nsevent)
{
GList *list, *l;
GdkWindow *window;
GdkDisplay *display;
GdkQuartzView *view;
GdkSeat *seat;
GdkQuartzView *view = (GdkQuartzView *)[[nsevent window] contentView];
GdkWindow *window = [view gdkWindow];
GdkDisplay *display = gdk_window_get_display (window);
GdkSeat *seat = gdk_display_get_default_seat (display);
GdkDevice *device = gdk_seat_get_keyboard (seat);
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (display, device);
view = (GdkQuartzView *)[[nsevent window] contentView];
window = [view gdkWindow];
display = gdk_window_get_display (window);
seat = gdk_display_get_default_seat (display);
list = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
for (l = list; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
GdkDevice *device = l->data;
grab = _gdk_display_get_last_device_grab (display, device);
if (grab && grab->window && !grab->owner_events)
{
window = gdk_window_get_effective_toplevel (grab->window);
break;
}
}
g_list_free (list);
if (grab && grab->window && !grab->owner_events)
window = gdk_window_get_effective_toplevel (grab->window);
return window;
}
@@ -1540,6 +1537,9 @@ gdk_event_translate (GdkEvent *event,
grab = _gdk_display_get_last_device_grab (_gdk_display,
gdk_seat_get_pointer (seat));
if (!grab)
[impl->toplevel makeKeyWindow];
}
}

View File

@@ -24,16 +24,175 @@
#include "gdkglcontext-quartz.h"
#include "gdkquartzdisplay.h"
#include "gdkquartzglcontext.h"
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkinternals.h"
#include "gdkintl.h"
G_DEFINE_TYPE (GdkQuartzGLContext, gdk_quartz_gl_context, GDK_TYPE_GL_CONTEXT)
static void gdk_quartz_gl_context_dispose (GObject *gobject);
void
gdk_quartz_window_invalidate_for_new_frame (GdkWindow *window,
cairo_region_t *update_area)
{
cairo_rectangle_int_t window_rect;
/* Minimal update is ok if we're not drawing with gl */
if (window->gl_paint_context == NULL)
return;
window_rect.x = 0;
window_rect.y = 0;
window_rect.width = gdk_window_get_width (window);
window_rect.height = gdk_window_get_height (window);
/* If nothing else is known, repaint everything so that the back
buffer is fully up-to-date for the swapbuffer */
cairo_region_union_rectangle (update_area, &window_rect);
}
static gboolean
gdk_quartz_gl_context_realize (GdkGLContext *context,
GError **error)
{
return TRUE;
}
static void
gdk_quartz_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
GdkQuartzGLContext *context_quartz = GDK_QUARTZ_GL_CONTEXT (context);
[context_quartz->gl_context flushBuffer];
}
static void
gdk_quartz_gl_context_class_init (GdkQuartzGLContextClass *klass)
{
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
context_class->realize = gdk_quartz_gl_context_realize;
context_class->end_frame = gdk_quartz_gl_context_end_frame;
gobject_class->dispose = gdk_quartz_gl_context_dispose;
}
static void
gdk_quartz_gl_context_init (GdkQuartzGLContext *self)
{
}
gboolean
gdk_quartz_display_init_gl (GdkDisplay *display)
{
return TRUE;
}
GdkGLContext *
gdk_quartz_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLContext *share,
GError **error)
{
/* FIXME: implement */
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
_("Not implemented on OS X"));
return NULL;
GdkDisplay *display = gdk_window_get_display (window);
GdkQuartzGLContext *context;
NSOpenGLContext *ctx;
NSOpenGLPixelFormatAttribute attrs[] =
{
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
0
};
NSOpenGLPixelFormat *format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
if (format == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL pixel format"));
return NULL;
}
ctx = [[NSOpenGLContext alloc] initWithFormat:format
shareContext:share ? GDK_QUARTZ_GL_CONTEXT (share)->gl_context : nil];
if (ctx == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return NULL;
}
[format release];
if (attached)
{
NSView *view = gdk_quartz_window_get_nsview (window);
if ([view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
[view setWantsBestResolutionOpenGLSurface:YES];
GLint sync_to_framerate = 1;
[ctx setValues:&sync_to_framerate forParameter:NSOpenGLCPSwapInterval];
[ctx setView:view];
}
GDK_NOTE (OPENGL,
g_print ("Created NSOpenGLContext[%p]\n", ctx));
context = g_object_new (GDK_TYPE_QUARTZ_GL_CONTEXT,
"window", window,
"display", display,
"shared-context", share,
NULL);
context->gl_context = ctx;
context->is_attached = attached;
return GDK_GL_CONTEXT (context);
}
static void
gdk_quartz_gl_context_dispose (GObject *gobject)
{
GdkQuartzGLContext *context_quartz = GDK_QUARTZ_GL_CONTEXT (gobject);
if (context_quartz->gl_context != NULL)
{
[context_quartz->gl_context clearDrawable];
[context_quartz->gl_context release];
context_quartz->gl_context = NULL;
}
G_OBJECT_CLASS (gdk_quartz_gl_context_parent_class)->dispose (gobject);
}
gboolean
gdk_quartz_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context)
{
GdkQuartzGLContext *context_quartz;
if (context == NULL)
{
[NSOpenGLContext clearCurrentContext];
return TRUE;
}
context_quartz = GDK_QUARTZ_GL_CONTEXT (context);
[context_quartz->gl_context makeCurrentContext];
return TRUE;
}

View File

@@ -24,17 +24,40 @@
#define __GDK_QUARTZ_GL_CONTEXT__
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkvisual.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>
#import <AppKit/AppKit.h>
G_BEGIN_DECLS
struct _GdkQuartzGLContext
{
GdkGLContext parent_instance;
NSOpenGLContext *gl_context;
gboolean is_attached;
};
struct _GdkQuartzGLContextClass
{
GdkGLContextClass parent_class;
};
gboolean gdk_quartz_display_init_gl (GdkDisplay *display);
GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window,
gboolean attach,
GdkGLContext *share,
GError **error);
void gdk_quartz_window_invalidate_for_new_frame (GdkWindow *window,
cairo_region_t *update_area);
gboolean gdk_quartz_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);
G_END_DECLS

View File

@@ -21,7 +21,7 @@
#include <gio/gio.h>
#include "gdkmonitor-quartz.h"
#include "gdkscreen-quartz.h"
#include "gdkdisplay-quartz.h"
G_DEFINE_TYPE (GdkQuartzMonitor, gdk_quartz_monitor, GDK_TYPE_MONITOR)
@@ -30,19 +30,30 @@ static void
gdk_quartz_monitor_get_workarea (GdkMonitor *monitor,
GdkRectangle *dest)
{
GdkQuartzScreen *quartz_screen = GDK_QUARTZ_SCREEN(gdk_display_get_default_screen (monitor->display));
GdkQuartzMonitor *quartz_monitor = GDK_QUARTZ_MONITOR(monitor);
GDK_QUARTZ_ALLOC_POOL;
NSArray *array = [NSScreen screens];
if (quartz_monitor->monitor_num < [array count])
NSScreen* screen;
for (id obj in array)
{
NSScreen *screen = [array objectAtIndex:quartz_monitor->monitor_num];
NSRect rect = [screen visibleFrame];
CGDirectDisplayID screen_id =
[[[obj deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue];
GdkQuartzMonitor *q_mon = GDK_QUARTZ_MONITOR (monitor);
if (screen_id == q_mon->id)
{
screen = obj;
break;
}
}
dest->x = rect.origin.x - quartz_screen->min_x;
dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y;
if (screen)
{
GdkQuartzDisplay *display =
GDK_QUARTZ_DISPLAY (gdk_monitor_get_display (monitor));
NSRect rect = [screen visibleFrame];
dest->x = (int)trunc (display->geometry.origin.x + rect.origin.x);
dest->y = (int)trunc (display->geometry.origin.y -
rect.origin.y - rect.size.height);
dest->width = rect.size.width;
dest->height = rect.size.height;
}

View File

@@ -29,7 +29,6 @@
struct _GdkQuartzMonitor
{
GdkMonitor parent;
gint monitor_num;
CGDirectDisplayID id;
};

View File

@@ -0,0 +1,45 @@
/* GDK - The GIMP Drawing Kit
*
* gdkquartzglcontext.h: Quartz specific OpenGL wrappers
*
* Copyright © 2014 Emmanuele Bassi
* Copyright © 2014 Brion Vibber
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_QUARTZ_GL_CONTEXT_H__
#define __GDK_QUARTZ_GL_CONTEXT_H__
#if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkquartz.h> can be included directly."
#endif
#include <gdk/gdk.h>
G_BEGIN_DECLS
#define GDK_TYPE_QUARTZ_GL_CONTEXT (gdk_quartz_gl_context_get_type ())
#define GDK_QUARTZ_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_QUARTZ_GL_CONTEXT, GdkQuartzGLContext))
#define GDK_QUARTZ_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_QUARTZ_GL_CONTEXT))
typedef struct _GdkQuartzGLContext GdkQuartzGLContext;
typedef struct _GdkQuartzGLContextClass GdkQuartzGLContextClass;
GDK_AVAILABLE_IN_3_24
GType gdk_quartz_gl_context_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GDK_QUARTZ_GL_CONTEXT_H__ */

View File

@@ -60,11 +60,12 @@
* but GDK coordinates can *not*!
*/
static void gdk_quartz_screen_dispose (GObject *object);
static void gdk_quartz_screen_finalize (GObject *object);
static void gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen);
static void gdk_quartz_screen_reconfigure (GdkQuartzDisplay *dispplay,
GdkQuartzScreen *screen);
static void gdk_quartz_screen_dispose (GObject *object);
static void gdk_quartz_screen_finalize (GObject *object);
static void gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
GdkQuartzDisplay *display);
static void gdk_quartz_screen_reconfigure (GdkQuartzDisplay *display,
GdkQuartzScreen *screen);
static const double dpi = 72.0;
@@ -88,7 +89,7 @@ gdk_quartz_screen_init (GdkQuartzScreen *quartz_screen)
G_CALLBACK (gdk_quartz_screen_reconfigure), quartz_screen);
/* The first monitors-changed should have fired already. */
_gdk_screen_set_resolution (screen, dpi);
gdk_quartz_screen_calculate_layout (quartz_screen);
gdk_quartz_screen_calculate_layout (quartz_screen, NULL);
quartz_screen->emit_monitors_changed = FALSE;
}
@@ -118,45 +119,24 @@ gdk_quartz_screen_finalize (GObject *object)
@end
static void
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen)
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
GdkQuartzDisplay *display)
{
int i, monitors;
int max_x, max_y;
GdkDisplay *display = gdk_screen_get_display (GDK_SCREEN (screen));
screen->width = 0;
screen->height = 0;
screen->min_x = 0;
screen->min_y = 0;
max_x = max_y = 0;
screen->mm_width = 0;
screen->mm_height = 0;
if (!display)
display = GDK_QUARTZ_DISPLAY (gdk_screen_get_display (GDK_SCREEN (screen)));
/* We determine the minimum and maximum x and y coordinates
* covered by the monitors. From this we can deduce the width
* and height of the root screen.
*/
monitors = gdk_display_get_n_monitors (display);
for (i = 0; i < monitors; ++i)
{
GdkQuartzMonitor *monitor =
GDK_QUARTZ_MONITOR (gdk_display_get_monitor (display, i));
GdkRectangle rect;
/* Display geometry is the origin and size in AppKit coordinates. AppKit computes */
screen->width = (int)trunc (display->geometry.size.width);
screen->height = (int)trunc (display->geometry.size.height);
screen->orig_x = -(int)trunc (display->geometry.origin.x);
screen->orig_y = (int)trunc (display->geometry.origin.y);
screen->mm_width = (int)trunc (display->size.width);
screen->mm_height = (int)trunc (display->size.height);
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &rect);
screen->min_x = MIN (screen->min_x, rect.x);
max_x = MAX (max_x, rect.x + rect.width);
screen->min_y = MIN (screen->min_y, rect.y);
max_y = MAX (max_y, rect.y + rect.height);
screen->mm_height += GDK_MONITOR (monitor)->height_mm;
screen->mm_width += GDK_MONITOR (monitor)->width_mm;
}
screen->width = max_x - screen->min_x;
screen->height = max_y - screen->min_y;
}
}
void
_gdk_quartz_screen_update_window_sizes (GdkScreen *screen)
@@ -201,7 +181,7 @@ gdk_quartz_screen_reconfigure (GdkQuartzDisplay *display, GdkQuartzScreen *scree
width = gdk_screen_get_width (GDK_SCREEN (screen));
height = gdk_screen_get_height (GDK_SCREEN (screen));
gdk_quartz_screen_calculate_layout (GDK_QUARTZ_SCREEN (screen));
gdk_quartz_screen_calculate_layout (screen, display);
_gdk_quartz_screen_update_window_sizes (GDK_SCREEN (screen));

View File

@@ -29,9 +29,9 @@ struct _GdkQuartzScreen
GdkDisplay *display;
/* Origin of "root window" in Cocoa coordinates */
gint min_x;
gint min_y;
/* Origin of "root window" in AppKit coordinates */
gint orig_x;
gint orig_y;
gint width;
gint height;

View File

@@ -26,6 +26,7 @@
#include "gdkwindowimpl.h"
#include "gdkprivate-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkquartzglcontext.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
@@ -208,6 +209,11 @@ gdk_window_impl_quartz_finalize (GObject *object)
if (impl->transient_for)
g_object_unref (impl->transient_for);
if (impl->view)
[[NSNotificationCenter defaultCenter] removeObserver: impl->toplevel
name: @"NSViewFrameDidChangeNotification"
object: impl->view];
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -430,7 +436,6 @@ _gdk_quartz_display_before_process_all_updates (GdkDisplay *display)
void
_gdk_quartz_display_after_process_all_updates (GdkDisplay *display)
{
GSList *old_update_nswindows = update_nswindows;
GSList *tmp_list = update_nswindows;
update_nswindows = NULL;
@@ -448,11 +453,9 @@ _gdk_quartz_display_after_process_all_updates (GdkDisplay *display)
#endif
[nswindow release];
tmp_list = tmp_list->next;
tmp_list = g_slist_remove_link (tmp_list, tmp_list);
}
g_slist_free (old_update_nswindows);
in_process_all_updates = FALSE;
if (gdk_quartz_osx_version() >= GDK_OSX_EL_CAPITAN)
@@ -612,10 +615,10 @@ _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
GdkQuartzScreen *screen_quartz = GDK_QUARTZ_SCREEN (_gdk_screen);
if (ns_y)
*ns_y = screen_quartz->height - gdk_y + screen_quartz->min_y;
*ns_y = screen_quartz->orig_y - gdk_y;
if (ns_x)
*ns_x = gdk_x + screen_quartz->min_x;
*ns_x = gdk_x + screen_quartz->orig_x;
}
void
@@ -627,10 +630,10 @@ _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
GdkQuartzScreen *screen_quartz = GDK_QUARTZ_SCREEN (_gdk_screen);
if (gdk_y)
*gdk_y = screen_quartz->height - ns_y + screen_quartz->min_y;
*gdk_y = screen_quartz->orig_y - ns_y;
if (gdk_x)
*gdk_x = ns_x - screen_quartz->min_x;
*gdk_x = ns_x - screen_quartz->orig_x;
}
void
@@ -912,6 +915,10 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = [[GdkQuartzView alloc] initWithFrame:content_rect];
[impl->view setGdkWindow:window];
[impl->toplevel setContentView:impl->view];
[[NSNotificationCenter defaultCenter] addObserver: impl->toplevel
selector: @selector (windowDidResize:)
name: @"NSViewFrameDidChangeNotification"
object: impl->view];
[impl->view release];
}
break;
@@ -1318,6 +1325,9 @@ move_resize_window_internal (GdkWindow *window,
}
}
if (window->gl_paint_context != NULL)
[GDK_QUARTZ_GL_CONTEXT (window->gl_paint_context)->gl_context update];
GDK_QUARTZ_RELEASE_POOL;
}
@@ -2172,6 +2182,46 @@ _gdk_quartz_window_update_has_shadow (GdkWindowImplQuartz *impl)
[impl->toplevel setHasShadow: has_shadow];
}
static void
_gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
GdkWindowTypeHint hint)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 10110
#define GDK_QUARTZ_ALLOWS_TILING NSWindowCollectionBehaviorFullScreenAllowsTiling
#define GDK_QUARTZ_DISALLOWS_TILING NSWindowCollectionBehaviorFullScreenDisallowsTiling
#else
#define GDK_QUARTZ_ALLOWS_TILING 1 << 11
#define GDK_QUARTZ_DISALLOWS_TILING 1 << 12
#endif
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
{
/* Fullscreen Collection Behavior */
NSWindowCollectionBehavior behavior = [nswindow collectionBehavior];
switch (hint)
{
case GDK_WINDOW_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
behavior &= ~(NSWindowCollectionBehaviorFullScreenAuxiliary &
GDK_QUARTZ_DISALLOWS_TILING);
behavior |= (NSWindowCollectionBehaviorFullScreenPrimary |
GDK_QUARTZ_ALLOWS_TILING);
break;
default:
behavior &= ~(NSWindowCollectionBehaviorFullScreenPrimary &
GDK_QUARTZ_ALLOWS_TILING);
behavior |= (NSWindowCollectionBehaviorFullScreenAuxiliary |
GDK_QUARTZ_DISALLOWS_TILING);
break;
}
[nswindow setCollectionBehavior:behavior];
}
#undef GDK_QUARTZ_ALLOWS_TILING
#undef GDK_QUARTZ_DISALLOWS_TILING
#endif
}
static void
gdk_quartz_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint)
@@ -2191,6 +2241,8 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
return;
_gdk_quartz_window_update_has_shadow (impl);
if (impl->toplevel)
_gdk_quartz_window_set_collection_behavior (impl->toplevel, hint);
[impl->toplevel setLevel: window_type_hint_to_level (hint)];
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
}
@@ -2442,7 +2494,6 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
if (new_mask == GDK_QUARTZ_BORDERLESS_WINDOW)
{
[impl->toplevel setContentSize:rect.size];
[impl->toplevel setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
else
[impl->toplevel setFrame:rect display:YES];
@@ -2701,6 +2752,9 @@ _gdk_quartz_window_update_fullscreen_state (GdkWindow *window)
gboolean is_fullscreen;
gboolean was_fullscreen;
if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window))
return;
is_fullscreen = window_is_fullscreen (window);
was_fullscreen = (gdk_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) != 0;
@@ -3023,6 +3077,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->delete_property = _gdk_quartz_window_delete_property;
impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
impl_class->invalidate_for_new_frame = gdk_quartz_window_invalidate_for_new_frame;
impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;

57
gdk/quartz/meson.build Normal file
View File

@@ -0,0 +1,57 @@
add_languages(['objc'])
gdk_quartz_sources = files(
'GdkQuartzView.c',
'GdkQuartzNSWindow.c',
'gdkcursor-quartz.c',
'gdkdevice-core-quartz.c',
'gdkdevicemanager-core-quartz.c',
'gdkdisplay-quartz.c',
'gdkdisplaymanager-quartz.c',
'gdkdnd-quartz.c',
'gdkevents-quartz.c',
'gdkeventloop-quartz.c',
'gdkglcontext-quartz.c',
'gdkglobals-quartz.c',
'gdkkeys-quartz.c',
'gdkmonitor-quartz.c',
'gdkproperty-quartz.c',
'gdkscreen-quartz.c',
'gdkselection-quartz.c',
'gdktestutils-quartz.c',
'gdkutils-quartz.c',
'gdkvisual-quartz.c',
'gdkwindow-quartz.c',
)
gdk_quartz_public_headers = files(
'gdkquartzcursor.h',
'gdkquartzdevice-core.h',
'gdkquartzdevicemanager-core.h',
'gdkquartzdisplay.h',
'gdkquartzdisplaymanager.h',
'gdkquartzdnd.h',
'gdkquartzkeys.h',
'gdkquartzmonitor.h',
'gdkquartzscreen.h',
'gdkquartzutils.h',
'gdkquartzvisual.h',
'gdkquartzwindow.h',
)
install_headers(gdk_quartz_public_headers, subdir: 'gtk-3.0/gdk/quartz')
install_headers('gdkquartz.h', subdir: 'gtk-3.0/gdk')
core_graphics_dep = dependency('appleframeworks', modules : 'CoreGraphics', required : true)
appkit_dep = dependency('appleframeworks', modules : 'AppKit', required : true)
cocoa_dep = dependency('appleframeworks', modules : 'Cocoa', required : true)
carbon_dep = dependency('appleframeworks', modules : 'Carbon', required : true)
gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep ]
libgdk_quartz = static_library('gdk-quartz',
gdk_quartz_sources, gdkconfig, gdkenum_h,
include_directories: [confinc, gdkinc],
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-xobjective-c'],
dependencies: [gdk_deps, gdk_quartz_deps])

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