Commit Graph

1577 Commits

Author SHA1 Message Date
Matthias Clasen
96f822434f testsuite: Add a builder test for shortcut controllers 2020-03-30 20:08:25 -04:00
Matthias Clasen
8acd9ffc76 testsuite: Fix notify test no not fail on the 30th
We are setting the month property to 10 different values,
checking that the change succeeds. But the calendar defaults
to the current date, so on every 30th of the month, we
try to set a date of Febuary 30, which fails.

Lets fix this before the 31st, by setting the calendar
to a good date.
2020-03-29 09:04:19 -04:00
Emmanuele Bassi
b1327167e2 Improve GtkShortcutTrigger parsing tests
Split off all possible cases into sub-tests, and add more thorough
checks on the invalid strings unit.
2020-03-27 14:56:05 +00:00
Emmanuele Bassi
6719d3044d Add parsing for GtkAlternativeTrigger
Alternative triggers are separate by a pipe character.
2020-03-27 14:35:00 +00:00
Emmanuele Bassi
c75fdda8dd tests: Add more cases for the trigger parser 2020-03-27 13:57:19 +00:00
Emmanuele Bassi
6e8c78714d Turn GtkShortcutAction into a GObject
Just like we did for GtkShortcutTrigger.

This allows language bindings to properly deal with all the actions.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
457b6657bb Turn GtkShortcutTrigger into an object
The lightweight inheritance mechanism used for GtkShortcutTrigger is not
going to be usable by bindings, because boxed types cannot have derived
types.

We could use GTypeInstance and derive everything from that, like
GParamSpec, but in the end shortcuts are not really a performance
critical paths, unlike CSS values or render nodes.
2020-03-25 23:14:45 -04:00
Matthias Clasen
d66121c61e Drop the keyhash test
GtkKeyHash is going away.
2020-03-25 23:14:45 -04:00
Matthias Clasen
586e7749d5 shortcuttrigger: Do elaborate matching for key events
Copy the logic from GtkKeyHash for matching key events
to shortcuts.

Adapt shortcuts test to work with the better matching,
by creating more complete key events.
2020-03-25 23:14:45 -04:00
Matthias Clasen
904835d4b1 shortcuttrigger: Introduce partial matches
Allow GtkShortcutTrigger to return partial matches.
Currently, no triggers produce such results, and
GtkShortcutController treats partial matches like
exact ones.
2020-03-25 23:14:45 -04:00
Matthias Clasen
cb821d5df3 Add tests for shortcut actions 2020-03-25 23:14:45 -04:00
Matthias Clasen
ff056af249 Add a test for shortcut triggers 2020-03-25 23:14:45 -04:00
Matthias Clasen
778d884f70 Use an action for the context menu keybinding
The ::popup-menu signal is going away.
2020-03-25 23:14:44 -04:00
Benjamin Otte
cac39526a9 testsuite: Remove GtkAccelGroup usage 2020-03-25 23:14:28 -04:00
Benjamin Otte
90a34312d4 accel: Add display arg to gtk_accelerator_parse_with_keycode()
It was using the default display unconditionally.
2020-03-25 23:14:28 -04:00
Benjamin Otte
580863b112 accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-25 23:14:28 -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
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
Matthias Clasen
5870d9d72a testsuite: Set NO_AT_BRIDGE for gtk tests
The a11y stack insists on spewing hard to control warnings
that make our tests fail. So, no accessibility for gtk tests :(
2020-03-25 17:03:58 -04:00
Marc-Antoine Perennou
eb8e0910c3 testsuite/gtk/flattenlistmodel.c: fix build
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-03-22 10:53:59 +01:00
Christian Hergert
ccac404f28 widget: fix class private data usage to be _init() safe
Before this commit, adding GtkWidgetAction to class private data would
require copying the actions to each subclass as they were built or
modified. This was convenient in that it is a sort of "copy on write"
semantic.

However, due to the way that GTypeInstance works with base _init()
functions, the "g_class" pointer in GTypeInstance is updated as each
_init() function is called. That means you cannot access the subclasses
class private data, but only the parent class private data.

If instead we use a singly linked list of GtkWidgetAction, each subclass
has their own "head" yet all subclasses share the tail of the
GtkWidgetAction chain.

This creates one bit of complexity though. You need a stable way to know
which "bit" is the "enabled" bit of the action so we can track enabled
GAction state. That is easily solved by calculating the distance to the
end of the chain for a given action so that base classes sort ahead of
subclasses. Since the parent class always knows its parent's actions, the
position is stable.

A new dynamic bitarray helper also helps us avoid allocations in all the
current cases (up to 64 actions per widget) and dynamically switches to
malloc if that is to ever be exceeded.
2020-03-20 11:17:56 -07:00
Matthias Clasen
c7caa53917 testsuite: disable performance tests
For some reason, these tests are flaky in ci,
they always work locally for me. So, until
we use the data these tests produce for something,
lets just turn them off.
2020-03-20 13:47:58 -04:00
Matthias Clasen
9eda683060 testsuite: Fix an a11y test
The derive test wasn't producing TAP, so
running it as part of a tap testsuite wasn't
going well. Fix that.
2020-03-20 12:09:21 -04:00
Matthias Clasen
cbb0ca4902 testsuite: Tell meson we use TAP
This makes meson actually parse the individual test
results. Most of the time, it does not make a difference,
but one case where it does is when all the individual
tests of a binary are skipped, meson will mark the
test as skipped.
2020-03-20 11:55:26 -04:00
Matthias Clasen
9403f44aef reftests: Fix an xfail to work
The background-image-multiple.ref.ui file uses
non-existing properties, which gives us a g_warning,
and the glib test framework insists on treating
warnings as fatal, so we end up doing exit(133),
which in turn makes the meson TAP parser ignore
its xfails.

Comment out the nonexisting properties, so we can
fail properly, and then in turn xfail properly.
2020-03-20 11:55:26 -04:00
Matthias Clasen
dc4b7131f1 testsuite: Don't exit unsuccessfully when using TAP
The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.
2020-03-20 11:55:26 -04:00
Matthias Clasen
c893f79023 reftests: Don't run tests with --verbose
Unexpected output tends to break TAP.
2020-03-20 10:43:25 -04:00
Matthias Clasen
cf7dc5b2bb testsuite: Don't g_print from tests
This breaks the TAP output.
2020-03-20 10:03:04 -04:00
Matthias Clasen
068ec58287 testsuite: Fix the accessible test
This test was happily doing nothing.
2020-03-20 10:03:04 -04:00
Matthias Clasen
f6fc3073fb temporarily disable window test
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 18:08:06 -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
Matthias Clasen
89b537bd8a Fix the action test
We have a test that enumerates the GtkText actions,
so when a new open appears, the test needs to be updated.
2020-03-19 14:29:37 -04:00
Matthias Clasen
2e70b4c323 temporarily disable window test
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 11:25:38 -04:00
Benjamin Otte
93bb3f7144 testsuite: Remove GtkAccelGroup usage 2020-03-18 23:00:51 -04:00
Benjamin Otte
94ef20ea36 accel: Add display arg to gtk_accelerator_parse_with_keycode()
It was using the default display unconditionally.
2020-03-18 23:00:51 -04:00
Benjamin Otte
87df17e4ce accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-18 23:00:51 -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
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
Matthias Clasen
33db28c288 Merge branch 'fix-tools-tests' into 'master'
Fix tools tests

See merge request GNOME/gtk!1524
2020-03-13 20:36:54 +00:00
Matthias Clasen
7db490ef2a testsuite: Specify the test protocol
If we don't specify protocol: 'tap', meson things
all is good even though my test yells "not ok".
2020-03-13 15:53:19 -04:00
Matthias Clasen
8b1301cecd Update the ui file conversion output
This changed because the popover property got renamed.
2020-03-13 15:53:19 -04:00
Matthias Clasen
bc6953a081 testsuite: Update the settings test output 2020-03-13 15:53:19 -04:00
Matthias Clasen
4b71ed3f5e testsuite: Update tools tests
These tests need to test GTK4 ui file syntax.
2020-03-13 15:34:54 -04:00
Matthias Clasen
8fd51d761b testsuite: Actually run tools tests
The script was looking in the wrong place for the tests.
2020-03-13 15:11:07 -04:00
Matthias Clasen
66a0a8d53e Merge branch 'wip/baedert/test-cflags' into 'master'
Pass (almost) all our cflags to tests, testsuite, examples, demos, ...

See merge request GNOME/gtk!1516
2020-03-13 18:40:46 +00:00
Matthias Clasen
e7ef4a57ca testsuite: Stop using type-hints 2020-03-11 19:36:04 -04:00
Matthias Clasen
aec3705717 testsuite: Stop using type-hint 2020-03-11 19:35:56 -04:00
Matthias Clasen
c488e86caa testsuite: Update a11y test output 2020-03-11 19:35:55 -04:00
Matthias Clasen
ad322c154c testsuite: Stop using GtkSpinner::active
This property was renamed to ::spinning.
2020-03-11 19:35:55 -04:00
Matthias Clasen
d70c9453ba disable popover test
This is failing atm
2020-03-11 19:35:55 -04:00
Timm Bäder
7553649c47 testsuite/gtk: Add common_cflags to build
With a few exceptions.
2020-03-07 16:28:04 +01:00
Timm Bäder
6fcd5d5ab5 testsuite/reftests: Add common_cflags to build 2020-03-06 18:24:58 +01:00
Timm Bäder
e759358402 testsuite/a11y: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
01bd7910ce testsuite/css: Add common_cflags to build
And fix all the errors coming from that.
2020-03-06 18:22:01 +01:00
Timm Bäder
79c60bb7fd testsuite/gdk: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
b3c332ad9c testsuite/performance: Add common_cflags to build 2020-03-06 18:22:01 +01:00
Timm Bäder
83982a28e7 testuite/gsk: Add common_cflags to build
And fix all the warnings and errors.
2020-03-06 18:22:01 +01:00
Benjamin Otte
b1a257c0c3 reftest: Plug memleak 2020-03-06 05:52:44 +01:00
Benjamin Otte
b231a40106 testsuite: Avoid passing NULL to strcmp()
Use g_strcmp0() instead.
2020-03-06 05:43:56 +01: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
d9fa839097 testsuite: Use g_assert() in tests 2020-03-02 03:18:55 +01:00
Matthias Clasen
fa75d7f480 builder-tool: Fix a thinko
We can't rely on the pspec for a removed property.
This code worked until I actually removed the properties.

Update the tests to reflect this.
2020-02-26 10:01:38 -05:00
Matthias Clasen
37a2cae10e Small fixups
Trying to get the ci style test to pass.
2020-02-26 08:13:45 -05:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7 Drop the expand property
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Matthias Clasen
2d4e1e248d update testsuite
Update the expected results of the tools tests that are
affected by the new property handling for expand and margin.
2020-02-25 18:28:55 -05:00
Matthias Clasen
648a67085f testsuite: Remove outdated exclusions
There were mentions of GtkCList and GtkColorSelection
in these test. The memories!
2020-02-24 23:08:34 -05:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Matthias Clasen
7f46b25c04 Merge branch 'wip/ebassi/filechooser-new' into 'master'
Clean up the GtkFileChooser API

Closes #2455

See merge request GNOME/gtk!1454
2020-02-24 00:32:23 +00:00
Benjamin Otte
cc7c1fe108 gdk: Remove GdkAtom
finally!!!!!
2020-02-23 01:59:26 +01:00
Emmanuele Bassi
4a3742979d Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
We don't need a whole separate action, now that the file chooser widget
can create folders; we can create use SELECT_FOLDER and create one.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
b09e7df81b Remove GtkFileChooser:local-only
Now that the whole API goes through GFile we don't have the weird split
between local-only and non-local-only modes.
2020-02-22 15:22:06 +00:00
Benjamin Otte
6f0a0ce7f1 testsuite: Don't use g_return_if_fail()
Use g_assert()
2020-02-22 07:44:52 +01:00
Benjamin Otte
18d7187e4b testsuite: Don't use return_if_fail()
Use assert() instead
2020-02-22 07:35:23 +01:00
Benjamin Otte
2a8fd25a4b testsuite: Check proper notify emissions, too
This is in particular relevant for the ::is-focus property, because
updating that one doesn't cause enter/leave events.

But it also checks that notify and enter/leave happen in the right
order.
2020-02-22 07:33:40 +01:00
Benjamin Otte
7597f6b594 transform: Don't crash for gsk_transform_transform (id, id)
See attached tests
2020-02-21 18:30:13 +01:00
Benjamin Otte
b50093d044 transform: Make sure the identity transform is equal to NULL 2020-02-21 18:25:05 +01:00
Matthias Clasen
cadeca74e2 Go back to ::enter/::leave for pointer changes
These signals are behaving a little differently from
what ::focus-in/::focus-out used to do.
2020-02-21 00:51:03 -05: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
4098653974 Update the focus test
This needs an update to handle the new focus-change signal.
2020-02-21 00:51:03 -05:00
Matthias Clasen
4cf63f3eb3 wip: Use event constructors in the testsuite
This doesn't work because the constructors aren't exported,
so remove the gestures text temporarily, until we figure
out how to deal with it.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9330158f11 Make a11y testsuite pass 2020-02-21 00:39:12 -05:00
Timm Bäder
5097c1defc Merge branch 'file-filter-name-property' into 'master'
GtkFileFilter: Add a GObject property for the name

See merge request GNOME/gtk!376
2020-02-19 07:43:51 +00:00
Matthias Clasen
66307f00f1 icontheme: Update the api
Add properties, and use string arrays instead of lists.

Among other things, this renames gtk_icon_theme_list_icons
to gtk_icon_theme_get_icon_names.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2410
2020-02-18 20:32:17 -05:00
Matthias Clasen
723b894c19 testsuite: Stop using gdk_surface_new_temp
We can just use regular toplevels here.
2020-02-14 21:19:29 +01:00
Benjamin Otte
222e6e5d6e testsuite: Use GtkTextDirection instead of GtkWindowType
GtkWindowType is aout to be dropped, so use another enum for the enum
tests - one that is likely to survive for a long time.
2020-02-14 21:18:49 +01:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Benjamin Otte
c2bd4bc3cb testsuite: Replace popups with toplevels
The tests do not depend on the window being a popup.
2020-02-14 21:18:49 +01:00
Benjamin Otte
fb856d96cd builder: Use different construct-only property
The window type is going away, so use the css name instead.
2020-02-14 21:18:49 +01:00
Benjamin Otte
ad23ce23ad testsuite: Remove popup property from simplify tools
I'm not even sure a popup GtkAssistant should be a thing...
2020-02-14 21:18:49 +01:00
Benjamin Otte
41bdf16b23 testsuite: Turn all CSS test ui files into regular windows
Use undecorated windows instead of popups.
2020-02-14 21:18:49 +01:00
Benjamin Otte
2c843362a0 testsuite: Make a11y tests use regular windows 2020-02-14 21:18:49 +01:00
Benjamin Otte
980934f82d reftests: Change popup windows to non-decorated windows
This allows getting rid of popup windows.
2020-02-14 17:54:38 +01:00
Benjamin Otte
d303b5b0eb slicelistmodel: Fix two wrong computations
Both of those are thinkos during math.
Found by Mohammed Sadiq.

Testcases triggering both have been added.
2020-02-14 03:15:22 +01:00
Matthias Clasen
cdee2ac173 testsuite: Handle icontheme test better
Skip just the failing tests in release builds.
2020-02-13 10:56:26 -05:00
Matthias Clasen
47f2a6cafd Remove border-half-pixel reftest from xfail
It passes both locally and on ci now.
2020-02-13 09:39:27 -05:00
Benjamin Otte
75b130ed6b testsuite: Add tests for rounded rect code
... including the bug that was fixed in the parent commit.
2020-02-13 07:36:38 +01:00
Benjamin Otte
16e38701b6 testsuite: Don't use gdk_cairo_get_clip_rectangle()
I want to remove it.
2020-02-13 06:15:44 +01:00
Benjamin Otte
9d8ceb0cb2 testsuite: Don't destroy surfaces that are still used
Coercing the surfaces must not unref the old surface, because the old
surface is going to be saved to a file.
2020-02-13 06:15:44 +01:00
Benjamin Otte
c313a71c3a testsuite: Remove accidentally checked in file
This file should go in the listview branch I guess.
2020-02-13 06:14:05 +01:00
Matthias Clasen
e1d85aeeb0 testsuite: Warn if a necessary env var is missing
Better to warn if we know why the tests are
going to fail. Saves headscratching later.
2020-02-12 12:18:59 -05:00
Matthias Clasen
cc8506ca15 Move performance tests to the right testsuite
This was a copy-paste error.
2020-02-12 12:18:59 -05:00
Emmanuele Bassi
b99a4da939 testsuite/gtk: Add xfail tests
Some tests are expected to fail.

Some tests are expected to fail in non-debugging builds.

The icontheme test is the latter.
2020-02-11 14:53:57 +00:00
Matthias Clasen
7ac2982617 Revert "Add the label-wrap-justify reftest to xfails"
This reverts commit 5e746d35b2.

Turns out label-wrap-justify isn't failing in ci, and this is
now making ci fail :(
2020-02-11 07:44:01 -05:00
Matthias Clasen
5e746d35b2 Add the label-wrap-justify reftest to xfails
Seems just like the other label tests, down to details
of text rendering.
2020-02-10 15:19:13 -05:00
Matthias Clasen
d711ca3a67 Drop the toplevel-vs-popup reftest
Popups look different from toplevels. I don't think
a reftest that tries to prove otherwise has much
leg to stand on.
2020-02-10 15:15:05 -05:00
Matthias Clasen
564a43cd3a Disable the buttons a11y test
The test fails because radio buttons are currently broken.
2020-02-10 15:06:56 -05:00
Matthias Clasen
17a5e9b2aa Update expected test output
The a11y test for GtkAssistant produces different
output due to headerbar changes.
2020-02-10 15:03:47 -05:00
Matthias Clasen
0677bfeb7f testsuite: Update expected output
The output for combo boxes in a11y tests has changed
because they use popovers now.
2020-02-10 13:55:37 -05:00
Alexander Larsson
7d23b6dad5 Fix gestures test
This tests was testing gestures by faking an event in the
middle of a window that has a hbox with an expanding image in it.
For me (and I guess this depends on all sorts of issues like whether
CSD is enabled, font sizes, etc) the hbox ended up centered horizontally
but not vertically (probably because of csd at the top), so no events
ever hit the inner widgets.

This is fixed by emitting the events at allocation.x/y of the
hbox, which should contain both the hbox and the image (as it expands).
2020-02-10 16:24:03 +01:00
Matthias Clasen
59b935af38 Merge branch 'mainloop-cleanup' into 'master'
Mainloop cleanup

See merge request GNOME/gtk!1404
2020-02-10 14:32:09 +00:00
Alexander Larsson
1698369d52 Merge branch 'icon-theme-api-rework' into 'master'
Icon theme api rework

See merge request GNOME/gtk!1390
2020-02-10 12:45:56 +00:00
Alexander Larsson
ad0e901061 icon-theme: Add back and fix test for handling non-square icons
We test this by looking at the produced render nodes now that
we don't actualluy scale the icon. Also, it turns out that this
code was broken due to some typos, so we also fix those.
2020-02-10 13:17:15 +01:00
Alexander Larsson
904eecd1ed icon paintable: Replace get_filename and get_resource_path with get_file()
This returns a GFile which can represent both the above.
2020-02-10 12:33:17 +01:00
Matthias Clasen
a8db322be6 Drop gtk_get_main_thread
This is not a very useful api, and if you need it,
you can just as easily keep track yourself which thread
called gtk_init().
2020-02-09 23:13:13 -05:00
Matthias Clasen
a6c5466900 Stop using gtk_main and gtk_main_quit
Replace these calls with direct use of GMainContext api.
2020-02-09 23:12:32 -05:00
Matthias Clasen
c789711652 Stop using gtk_main_quit
Stop using gtk_main and gtk_main_quit in tests and
examples. These APIs are on the way out.
2020-02-09 23:12:32 -05:00
Matthias Clasen
24917ac353 tests: Stop using gtk_events_pending
Just use the GMainContext api directly.
2020-02-09 23:11:49 -05:00
Matthias Clasen
ebc24d75af testsuite: Stop using gtk_main_do_event
Instead, emit ::event on the surface. Neither of
these is a proper test api, but one works as well
as the other.
2020-02-09 10:54:26 -05:00
Timm Bäder
01ba11fc71 css: Remove outline border radius properties
These are always set to the same value as the corresponding border
radius properties. They are also non-standard, so remove them and
replace them with the border radius properties everywhere.

Fixes #2414
2020-02-08 20:43:16 +01:00
Benjamin Otte
d72301b3c1 testsuite: Get rid of GtkToolbar
Just use GtkBox instead
2020-02-07 14:08:08 +01:00
Matthias Clasen
e45b668e04 testsuite: Misc. updates of expected output
The a11y dumps for action and header bars
have changed in harmless ways.
2020-02-06 18:04:36 -05:00
Matthias Clasen
048effdc5a testsuite: Clean up a11y menu tests
We don't need some of the tests anymore, since
we just have popovers now.
2020-02-06 17:21:06 -05:00
Matthias Clasen
b916723baf testsuite: Improve --generate support
When using the test binary to generate expected
output, don't initialize the test machinery, since
that pollutes the output with noise.
2020-02-06 16:54:59 -05:00
Matthias Clasen
2dba92fd0c tests: Fix infobars in ui files
GtkInfoBar no longer exposes the content_area
as internal child.
2020-02-06 16:54:59 -05:00
Matthias Clasen
a11b1bd08e testsuite: Update expected output 2020-02-06 16:54:59 -05:00
Matthias Clasen
580384e962 tests: Update expected output
The stackswitcher is no longer a box, so it doesn't
have the horizontal state anymore.
2020-02-06 16:54:59 -05:00
Matthias Clasen
18965eec83 testsuite: Update some a11y tests
GtkMenuButton::use-popover no longer exists, remove it
from test files.
2020-02-06 16:54:59 -05:00
Alexander Larsson
57ecb2829a Add gtk_icon_paintable_get_icon_name()
This allows you to see which icon was actually chosen.
2020-02-06 17:47:57 +01:00
Alexander Larsson
6317fd3529 Replace last users of gtk_icon_paintable_download_texture ()
These now render the paintable to a cairo surface and convert that
to a texture. This is sort of a hack, but its only used in two
special cases internally and in two hacky test apps.
2020-02-06 17:47:56 +01:00
Alexander Larsson
8282698201 textview: Use paintables instead of textures, and fix the support
This changes gtk_text_buffer_insert_texture() to
gtk_text_buffer_insert_paintable() which is strictly more useful
(as textures are paintables). It also fixes the code to actually
support drawing the paintables (as well as tracking changes
to the paintables.
2020-02-06 17:47:56 +01:00
Alexander Larsson
d69f7fd63e IconTheme: Never fail a lookup or icon load
If icon lookup fails or if loading it fails later, just always
fall back to the built in image-missing icon. Nobody is handling
missing icons in a sane way anyway.

If you *truly* need to handle missing icons, you need to manually
use gtk_icon_theme_has_icon().

While changing the loading code I also fixed an issue where it
was always passing "png" to pixbuf, now it also handles "xpm" if
that is the filename suffix.
2020-02-06 09:38:25 +01:00
Alexander Larsson
b529f77827 IconTheme: Simplify icon scaling
We had a pretty complex setup where we tried to avoid scaling up themes from dirs
that specified a size. However, not only was it very complex, but it didn't quite
work with window scales, because when using e.g. a size 32 directory for 16@2x
the dir size is wrong anyway. Additionally it turns out most code either picks
an existing icon size, or uses the FORCE_SIZE flags, so it doesn't seem
like a useful behaviour.

This change drops the FORCE_SIZE flags, and always scales
icons. Additionally it moves the scaling of the icon to rendering,
which seems more modern, and allows us to (later) share icons loaded
for different sizes that happened to use the same source file (at
different scales).

Note that this changes the behaviour of
gtk_icon_paintable_download_texture() is it now returns the unscaled
source icon. However, ignore thats, as I plan to remove this function
and replace it with a way to render a paintable to a cairo-surface
instead.
2020-02-06 09:38:25 +01:00
Matthias Clasen
8703c7b7ac Merge branch 'better-test-isolation-2' into 'master'
Better test isolation

See merge request GNOME/gtk!1391
2020-02-06 04:53:07 +00:00
Matthias Clasen
e41e8072b1 css tests: Ignore ".csd" vs ".solid-csd"
It it hard to control which of the csd style classes we get,
since it depends on details of the X server or compositor.

Explicitly ignore this difference by replacing .solid-csd
with .csd in the output.
2020-02-05 23:35:39 -05:00
Matthias Clasen
d1bd1270c9 testsuite: Make tests run without a11y bus
Not having an a11y bus around causes warnings from
at-spi, which make tests fail. Explicitly ignore those
warnings.
2020-02-05 22:24:39 -05:00
Matthias Clasen
34cc68003c testsuite: Fix bloomfilter style tests
The results were expecting solid-csd, which is not what
we usually have.
2020-02-05 22:23:52 -05:00
Benjamin Otte
0ad791277a Merge branch 'wip/otte/css' into 'master'
Some CSS cleanup

See merge request GNOME/gtk!1389
2020-02-05 14:04:12 +00:00
Matthias Clasen
b7b251019e testperf: More flexible mark selection
Allow selecting marks not just by their name, but
also by the message detail.
2020-02-05 00:46:47 -05:00
Matthias Clasen
ed742f1d6c testperf: Allow measuring start time
This can be used e.g. to measure how long it takes us
to get the first frame on screen.
2020-02-05 00:46:39 -05:00
Benjamin Otte
b9c880f58d testsuite: Remove the stylecontext test
Stylecontexts are on their way out and I'm removing API that the
testsuite was relying on, so remove the tests.

Put the useful parts of the tests elsewhere.
2020-02-05 04:03:43 +01:00
Alexander Larsson
410541f82b Rename GtkIcon to GtkIconPaintable 2020-02-04 17:19:22 +01:00
Benjamin Otte
138de60ab2 icontheme: Remove GENERIC_FALLBACKS
Instead, rely on people passing fallbacks explicitly.

Alternatively, GThemedIcon provides the functionality to create
fallbacks, which is what GtkImage and the testsuite now use.
That method is slightly better, too, so the expected test results
have been updated accordingly.
2020-02-04 16:51:54 +01:00
Benjamin Otte
571021cbc1 icontheme: Pass fallbacks as optional argument to lookup_icon()
This way, we can remove gtk_icon_theme_choose_icon() completely.
2020-02-04 16:51:54 +01:00
Benjamin Otte
f7a5dd7b8b icontheme: Remove contexts
There is no way to query contexts or do anything useful with them.

So don't keep track of them and don't make them an argument in public
APIs with the docs saying "I don't know what to use here, maybe read
some spec somewhere".
2020-02-04 16:51:54 +01:00
Benjamin Otte
3bba52ed67 icontheme: Remove crayon APIs
We expose no API to get at any colors for drawing symbolics, so we
shouldn't have APIs to draw with them.

Apart from that, those APIs look like a box of crayons, not like an
icontheme.
2020-02-04 16:43:59 +01:00
Benjamin Otte
bbbe39fb44 icontheme: Make text direction a lookup argument
Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.
2020-02-04 16:41:36 +01:00