Commit Graph

260 Commits

Author SHA1 Message Date
Alexander Mikhaylenko
8bd44cb3eb Add GtkWindowHandle
This will allow to move the titlebar handling logic out from GtkWindow.
2020-05-07 23:57:58 +05:00
Matthias Clasen
3c165b3b77 Drop GtkBin
It is no longer used anywhere.
2020-05-04 22:53:08 -04:00
Alexander Mikhaylenko
4aa8f6f73c Add GtkWindowControls
Move some code out of GtkHeaderBar and into a separate widget, making it
reusable in process.

See https://gitlab.gnome.org/GNOME/gtk/issues/2242
2020-04-26 15:13:15 +05:00
Benjamin Otte
8b1e857a67 Merge branch 'fix-icontheme-invalidation' into 'master'
Fix icontheme invalidation

See merge request GNOME/gtk!1733
2020-04-23 00:13:26 +00:00
Emmanuele Bassi
c0d18ebff2 Fix annotations for GtkCustomLayout
Silence the warnings from the introspection scanner.
2020-04-22 19:24:45 +01:00
Matthias Clasen
2ddff872cd css: Drop the -gtk-icon-theme property
We want to always use the current icon theme, and only
have the minimum amount of custom properties.
2020-04-22 12:35:30 -04:00
Matthias Clasen
6870159c1d build: Prepare library versioning
Set version and soversion separately for the library.
When we do the 4.0 release, we will set:

gtk_soversion = '1'
gtk_library_version = '1.0.0'

See https://gitlab.gnome.org/GNOME/gtk/-/issues/1963
2020-04-14 09:15:31 -04:00
Jonas Ådahl
5425edff82 wayland: Move popups with xdg_popup.reposition
The third version of xdg-shell introduces support for explicit popup
repositioning. If available, make use of this to implement popup
repositioning.

Note that this does *NOT* include atomic parent-child state
synchronization. For that,
https://gitlab.freedesktop.org/wayland/wayland-protocols/issues/13 will
be needed.

This currently uses my own fork of wayland-protocols which adds meson
support, so that we can use it as a subproject. Eventually when
wayland-protocols' meson support lands upstream, we should change it to
point there.

Silence some meson warnings while at it to make CI happy.

This also bumps the glib requirement, since g_warning_once() is used.
2020-04-08 23:32:47 +02:00
Emmanuele Bassi
37c3ba2645 Do not parse all GDK-X11 source files
We don't need all of them, only the ones that contain public API. This
allows us to reduce the chance of a stray symbol getting incorrectly
added to the introspection data.
2020-04-07 18:06:08 +01:00
Matthias Clasen
b4722b43a1 Drop GtkKeyHash 2020-03-25 23:14:45 -04:00
Benjamin Otte
cd0332aad5 shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
bca1f6b64f gtk: Remove GtkAccelMap
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-25 23:14:27 -04:00
Benjamin Otte
62f96bfda6 Remove GtkMnemonicHash
It's not used anymore.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
aab10ea43b Add GtkShortcutManager
This adds an interface for taking care of shortcut controllers with
managed scope.

Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-25 23:14:27 -04:00
Benjamin Otte
9a03c8b4d8 gtk: Remove bindings
The whole binding functionality is now handled by shortcuts.
2020-03-25 23:14:27 -04:00
Matthias Clasen
6d452f1eb8 shortcut: Add GtkShortcutTrigger
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d8603864a9 gtk: Add GtkShortcut
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-25 22:36:03 -04:00
Benjamin Otte
a232107122 shortcutcontroller: Introduce
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.

And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-25 22:36:03 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Benjamin Otte
0c81698911 shortcuts: Mananage managed shortcuts with a custom model
Reduce the amount of special casing by using a list model
for global and managed shortcuts, too.

This way, the ListModel API will work for the ShortcutController in the
GtkShortcutManager and GtkRoot.

The only special case remaining is shortcut activation, which needs to
pass the right widget to the controller in the global/managed case.
2020-03-18 23:00:51 -04:00
Benjamin Otte
e6d0560a82 shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
 - Activate a GAction
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
b28da74e90 gtk: Remove GtkAccelMap
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-18 23:00:51 -04:00
Benjamin Otte
20cfa2e280 Remove GtkMnemonicHash
It's not used anymore.
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
09400b6bfe Add GtkShortcutManager
This adds an interface for taking care of shortcut controllers with
managed scope.

Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-18 23:00:50 -04:00
Benjamin Otte
fb99f834e6 gtk: Remove bindings
The whole binding functionality is now handled by shortcuts.
2020-03-18 23:00:50 -04:00
Matthias Clasen
78f9940ddc shortcut: Add GtkShortcutTrigger
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-18 23:00:49 -04:00
Benjamin Otte
ff13ee4b66 gtk: Add GtkShortcut
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-18 23:00:49 -04:00
Benjamin Otte
5c6be5c0cd shortcutcontroller: Introduce
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.

And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-18 23:00:49 -04:00
Georges Basile Stavracas Neto
8e14b21e52 build: Install gtkeventcontrollerfocus.h
It's a public class, and is included by gtk.h. Ship it.
2020-03-03 00:38:13 -03:00
Benjamin Otte
a411959c91 droptarget: Redo
This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.

Highlights:

- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
  GtkDropTarget is the simple one that only works with GTypes and offers
  a synchronous interface.
  GtkDropTargetAsync retains the full old functionality and allows
  handling mime types.

- Drop events are handled differently
  Instead of picking a single drop target and sending all DND events to
  it, every event is sent to every drop target. The first one to handle
  the event gets to call gdk_drop_status(), further handlers do not
  interact with the GdkDrop.
  Of course, for the ultimate GDK_DROP_STARTING event, only the first
  one to accept the drop gets to handle it.
  This allows stacking DND event controllers that aren't necessarily
  interested in handling the event or that might decide later to drop
  it.

- Port all widgets to either of those
  Both have a somewhat changed API due to the new event handling.
  For the ones who should use the sync version, lots of cleanup was
  involved to operate on a sync API.
2020-03-02 03:18:55 +01:00
Benjamin Otte
a62d78bf70 selection: Remove GtkSelectionData 2020-02-23 01:59:00 +01:00
Benjamin Otte
34e5f36fdf Add GtkDropControllerMotion 2020-02-22 07:33:40 +01:00
Matthias Clasen
5a2f829a40 Split off GtkEventControllerFocus
Split the focus tracking into a separate
GtkEventControllerFocus, and change the API one more time.
We are back to having ::focus-in and ::focus-out signals.

Update all users.
2020-02-21 00:51:03 -05:00
Matthias Clasen
6c6b3d0d11 Merge branch 'ci-pages' into 'master'
Rename the SCSS files for our themes

Closes #2423

See merge request GNOME/gtk!1423
2020-02-12 22:35:58 +00:00
Emmanuele Bassi
2ab9be54fb Rename the SCSS files for our themes
It seems that Meson's gnome.compile_resources() cannot deal with two
files with the same name under different directories, which breaks the
build parallelism because the GResource file ends up not depending on
either the Adwaita or the HighContrast gtk-contained.css file.

This commit only changes the on-disk names of the Adwaita and
HighContrast SCSS files, and the corresponding generated CSS files; the
files in the GResource are going to be aliased to the old file names, to
minimise the breakage. We might want to change the theme entry points at
some later date, if we decide to commit to this naming scheme.

Fixes: #2423

See Meson bug: https://github.com/mesonbuild/meson/issues/6615
2020-02-12 20:22:43 +00:00
Georges Basile Stavracas Neto
1b95cd27bc build: Install gtkemojichooser.h
It was made public at ef7172dc1e, but the header file
wasn't added to the public headers list.

Add the header file to the list.
2020-02-12 15:41:49 -03:00
Benjamin Otte
44e153d8a8 GtkToolbar: remove 2020-02-07 14:08:26 +01:00
Matthias Clasen
79c8a16b8d Remove simple search engine 2020-01-31 16:52:27 +01:00
Christoph Reiter
4071e1e734 build: require sassc and drop generated .css files
Instead of requiring sassc to be installed add meson subprojects
which build libsass and sassc (currently both forks of mine, tested
under linux/mingw/msvc) when needed.

This allows us to drop the generated .css files and build scripts from git.

See #1502
2020-01-30 20:45:38 +01:00
Alexander Larsson
f7cd2a782b Fix warnings in gdk gir build
We now have graphene arguments in a gdk function, so add that to the
dependencies.
2020-01-30 10:53:43 +01:00
Alexander Larsson
6a15e9169d Rename GtkIcon widget to GtkBuiltinIcon
This is an internal widget whose name is not very important, and we
want to rename GtkIconInfo to GtkIcon, so lets rename this.
2020-01-30 10:53:33 +01:00
Benjamin Otte
8b93ea9238 css: Get rid of GtkCssMatcher 2020-01-28 02:17:02 +01:00
Benjamin Otte
49b47c9133 Remove GtkWidgetPath
... and all associated demos and tests.
2020-01-28 02:17:02 +01:00
Timm Bäder
7ccd6597c3 Remove gtkutils{.c,private.h}
All but one functions are unused. Move the remaining one into
gtkmodules.c, its only caller.
2020-01-26 18:21:07 +01:00
Timm Bäder
45455f1bdb Remove GtkCssShadowsValue
Previously, we wrapped all GtkCssShadowValues in a GtkCssShadowsValue,
even if it was just one shadow. This causes an unnecessary bloat in
css values.

Make each GtkCssShadowValue able to handle multiple shadows instead, and
use gtk_css_shadow_value* API everywhere.
2020-01-18 08:49:52 +01:00
Timm Bäder
67991ed0f4 Remove GtkCssRgbaValue
The differenciation between a literal color value and an RGBA value
caused problems in various situations. Just treat the two the same but
don't allow access to the rgba value of a non-literal color value.

This gets rid of around 1.6k rgba values in the widget-factory.
2020-01-18 08:49:51 +01:00
Christian Hergert
c1e9523f0e build: fix gtkdragicon header installation 2020-01-13 09:07:24 -08:00
Matthias Clasen
f5daecf353 Merge branch 'dnd-gestures-2' into 'master'
Add new dnd api

See merge request GNOME/gtk!1278
2020-01-11 06:09:58 +00:00
Matthias Clasen
112aed590f Remove builtin icons altogether
This removes support for GtkCssImageBuiltin and
GtkCssImageBuiltinType from everywhere.
2020-01-10 14:34:56 -05:00
Matthias Clasen
f3be49838f Move code over
Move remaining code from gtkdnd.c to gtkdragdest.c
and nuke gtkdnd.c and gtkdndprivate.h.
2020-01-08 18:48:21 -05:00