Commit Graph

73 Commits

Author SHA1 Message Date
Emmanuele Bassi
1262d0c6e5 Avoid absolute paths when building the API reference
We should always use relative paths, or include_directories objects, to
allow using GTK as a subproject.
2018-05-08 14:20:00 +01:00
Benjamin Otte
48fc18c37b gdk: Get rid of GdkDrawingContext
All information is kept in GdkDrawContext these days, so use that one.
2018-04-24 23:16:58 +02:00
Benjamin Otte
f396786051 gdk: Add GdkCairoContext
This does nothing but disallow passing NULL to gdk_surface_begin_paint()
and instead require this context.

The ultimate goal is to split out Cairo drawing into its own source file
so it doesn't clutter up the generic rendering path.
2018-04-24 23:16:12 +02:00
Timm Bäder
8d11e7685a build: Remove 'name' kwarg from has_function calls
They cause warnings with later meson versions.
2018-04-21 19:30:12 +02:00
Alexander Larsson
890080ebf7 GdkWindow -> GdkSurface: File renames
Rename all *window.[ch] source files.

This is an automatic operation, done by the following commands:

for i in $(git ls-files gdk | grep window); do
    git mv $i $(echo $i | sed s/window/surface/);
    git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ;
done

git checkout NEWS* po-properties po
2018-03-20 11:46:11 +01:00
Benjamin Otte
ea84e974e6 snapshot: Turn into GObject
This makes GdkSnapshot the base class for GtkSnapshot and hopefully
stops confusing bindings.

C code should see no difference to before.
2018-03-18 19:21:33 +01:00
Benjamin Otte
a4e16ce3cc texture: Implement GdkPaintable
This is kind of evil because we need to link to GTK to be able to
snapshot, but I hope nobody notices.
2018-03-16 06:04:44 +01:00
Benjamin Otte
8f43d7e188 gdk: Add GdkPaintable 2018-03-16 06:04:44 +01:00
Benjamin Otte
e5813b3ae7 texture: Export gdk_memory_texture_new() and GdkMemoryFormat
Also add tests for all these newfangled formats.
2018-03-12 17:21:45 +01:00
Benjamin Otte
8920639a2b texture: Add GdkMemoryTexture
GdkMemoryTexture is a texture implementation for holding data in memory
(read: GBytes). You specify the GdkMemoryFormat that data is in and off
you go.

Renderers can use this to add uploads in various different formats and
don't need to fallback to GDK doing the conersion on the CPU.

Supported formats can be extended if we need new ones, for now I just
added the relevant ones for Cairo and GdkPixbuf.

The constructor is also private still, because I'm not sure we want to
export GdkMemoryFormat.
Wrappers that do from_cairo_surface() and for_pixbuf() do exist though.
2018-03-07 16:17:15 +01:00
Benjamin Otte
160e6ad6f6 gdk: Split out GL texture
Put GdkGLTexture into its own file and rename the API to
gdk_gl_texture_foo() instead of gdk_texture_foo_for_gl().

Apart from naming, no actual code changes.
2018-03-07 16:17:15 +01:00
Patrick Griffis
971f46e1f2 build: Error if no backends enabled 2018-02-27 13:42:28 -05:00
Emmanuele Bassi
3b0e6720af build: Use pkg-config to find Vulkan
The standard Vulkan SDK ships with a pkg-config file, like a modern
library should.

We should fall back to finding the library and header only for platforms
where pkg-config is not really a thing.

Based on a patch by: Daniel Stone <daniels@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=793181
2018-02-05 14:01:59 +00:00
Matthias Clasen
fd25a8cdf2 Drop the mir backend
Mir is in the process of switching over to the Wayland protocol,
so we don't need to maintain a separate backend, going forward.
2018-02-05 07:50:17 +01:00
Emmanuele Bassi
2432e53652 Remove all gdk_threads_* entry points
Now that we don't use them anywhere, it's time for them to go.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:07:10 +01:00
Benjamin Otte
a4b42f0b73 gdk: Remove selection defines
And with it, remove the selections section from the docs.

So selections are gone for good now.
2017-12-14 03:05:34 +01:00
Benjamin Otte
25c3895836 clipboard: Add serialization
This completes the local clipboard code.
2017-12-03 05:46:47 +01:00
Benjamin Otte
12ca641ff5 clipboard: Implement local fallback clipboard transfers
This requires implementing a "pipe" so we can have 2 streams running:
  contentprovider => serializer => outputstream
  inputstream => deserializer => reader
And the pipe shoves the data from the outputstream into the inputstream.
2017-12-03 05:46:47 +01:00
Benjamin Otte
888e5257e0 clipboard: Introduce GdkContentProvider
GdkContentProvider is the object that represents local data in the
clipboard.

This patch only introduces the object and adds the clipboard properties,
it does not yet provide a way for the actual implementations to access
it.

The only access that is implemented is the local shortcut GValue access.
2017-12-03 05:46:47 +01:00
Benjamin Otte
91910ba013 gdk: Im[plement content deserializing
Add infrastructure to do GInputStream => GType conversions. Use that to
implement gdk_clipboard_read_value() which reads into GValues.
2017-12-03 05:46:27 +01:00
Matthias Clasen
e94b9b9a62 gdk: A GdkClipboard API draft
This commit adds a GdkClipboard object which is intended to
replace GtkClipboard, eventually.
2017-12-03 05:43:24 +01:00
Matthias Clasen
05149a391f Drop GdkDeviceManager entirely
Nothing uses it anymore.
2017-11-25 11:04:15 -05:00
Benjamin Otte
0638bbb5d5 gdk: Move GtkTargetList to GDK
It's gonna be renamed next, so put it in the right source file already.

For now retain the old name to keep the diff small.
2017-11-20 23:12:33 +01:00
Matthias Clasen
6263286c4a Drop gdkscreen.h
Nothing uses GdkScreen anymore, so we can get rid of it.
2017-11-17 13:54:04 -05:00
Matthias Clasen
fc0f7dc217 Remove gdkprivate.h
This is one-too-many private headers. Move the few
declarations here to gdkinternals.h.
2017-11-17 00:34:04 -05:00
Matthias Clasen
38c8310969 Drop gdkmain.h 2017-11-17 00:16:09 -05:00
Matthias Clasen
26d5b04124 Drop an empty file
Nothing deprecated left!
2017-11-17 00:08:24 -05:00
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Matthias Clasen
a16a25151c Drop GdkScreen from public api
It is still used by some of the backends, so keep the
files around.
2017-11-01 19:44:29 -04:00
Matthias Clasen
0411cc5620 Drop GdkVisual
This type was unused except for serving as a parent
for GdkX11Visual. Just move the fields to that type.
2017-10-31 22:44:15 -04:00
Matthias Clasen
29ffecb39c Drop gdkvisual.h from the installed headers. 2017-10-31 22:07:34 -04:00
Chun-wei Fan
18abb78bfd Meson: Support Windows builds
Add the necessary machinery into the Meson definition files so that we
can build for Windows.

Since we don't have Wayland or X support for our use case here, disable
them once we know that we are building for Windows, as they are
(otherwise) enabled by default, and enable the items that need to be
built for Windows builds.

Exclude gtk4-launch from Windows builds as that is something that
is not supported on Windows.

As we won't have gio-unix on Windows, and PangoFT2 is optional, don't use
fallbacks for them when we are on Windows (but do use fallbacks for
gio-win32, as it will be used).

Also, clean up meson.build a bit as we can just force-include
msvc_recommended_pragmas.h from GLib since we depend on GLib, and so we
can handle these warnings from msvc_recommended_pragmas.h instead.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-10-20 17:30:58 +08:00
Carlos Garnacho
c7431f46b5 gdk: Make GdkEvent structs/union opaque
All users are forced to deal with events as opaque pointers, only
using API to access the info.
2017-09-19 18:39:02 +02:00
Nirbheek Chauhan
aa3e8ee097 build: Add dependency fallbacks for libs with meson ports
With these changes gtk+ builds for me using fallbacks for all libraries
with fallbacks available. Needs the following changes:

https://github.com/ebassi/graphene/pull/109 (graphene)
https://bugzilla.gnome.org/show_bug.cgi?id=787414 (pango)
https://github.com/mesonbuild/meson/pull/2291 (will be in meson 0.42.1)

https://bugzilla.gnome.org/show_bug.cgi?id=787416
2017-09-12 00:24:58 +05:30
Timm Bäder
7685d157bc build: Remove more wrong kwargs
declare_dependency does not take a depends: kwarg and meson 0.42.0
started warning about that.
2017-08-15 14:56:13 +02:00
Marc-Antoine Perennou
49d0b4ccb8 meson: install gdkvulkancontext.h
https://bugzilla.gnome.org/show_bug.cgi?id=782981

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-08-14 22:26:59 +01:00
Marc-Antoine Perennou
c9caa6167e meson: install gdkdrawcontext.h
https://bugzilla.gnome.org/show_bug.cgi?id=782981

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-08-14 22:26:59 +01:00
Marc-Antoine Perennou
807c744c8d gdk: fix headers installation path
https://bugzilla.gnome.org/show_bug.cgi?id=782981

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-08-14 22:26:59 +01:00
Emmanuele Bassi
0dad501d16 meson: Remove G_LOG_USE_STRUCTURED from target C flags
The G_LOG_USE_STRUCTURED symbol is defined in the project flags, so we
don't need to add it again in the per-target flags.
2017-05-03 16:22:52 +01:00
Emmanuele Bassi
9b7148cdbd build: Use link_whole for GDK backends
When linking libgdk4 to each backend's static library, we want to use
the whole-archive support.
2017-05-03 15:10:58 +01:00
Emmanuele Bassi
d09ccaaf35 build: Define G_LOG_USE_STRUCTURED in GDK
We want to use the new structured logging support in GLib.
2017-05-03 15:10:58 +01:00
Emmanuele Bassi
d35d82fb35 build: Rename GSK resource generator script
Maintain the naming convention, since we have similar scripts for GDK
and GTK already.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
5e2eaa5dbc build: Add introspection generation
Currently, no platform-specific introspection is generated; there will
be a follow-up commit.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
e18d9a85ca build: Use the common linker flags in GDK and GSK
Instead of hard-coding `-Bsymbolic`.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
68039b610b build: Add compiler warnings and errors
We don't want to build buggy code.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
9105227b56 build: Do not mix private and public GDK headers
The type generation script inside gtk/ will use the `gdk_headers`
variable, and that must not contain private headers.
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
e850973956 meson: build input modules
We have to work around some ordering problems here. We still
manage to keep most of the guts in modules/input/meson.build,
so it's not too ugly overall.

(The autotools build solves this with a 'make -C ../../input/modules'
inside gtk/Makefile, but that's not something we can or want to do.)
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
2f3c975058 meson: remove duplicate libm variable
Only need one of libm and mlib
2017-05-03 15:10:55 +01:00
Tim-Philipp Müller
f67a9d58db meson: make sure gsk/gdk generated headers exist for libgtk_dep users
Add back dependencies on libgdk_dep and libsk_dep which are declared
dependencies. We removed this before because these declarations had
link_with: lines that dragged in the static libgdk.a and libgsk.a libs
which are linked into libgtk-4.so anyway and thus shouldn't be used
when linking internal exes/tools against libgtk-4. Remove the static
libs from the declared dependencies and have libgtk link those in
explicitly, so that the declared deps now just provide all the built
dependencies and include dirs and such for declared libgtk_dep users
such as the internal exes/tools, which want all the generated gsk/gdk/gtk
headers to exist before attempting to compile anything against the
gtk+ headers.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
07ffb19c42 meson: gdk, gsk: fix install path of generated files 2017-05-03 15:10:54 +01:00