Commit Graph

279 Commits

Author SHA1 Message Date
Matthias Clasen
59aeae3c8e testsuite: Remove menu tests
Menus are going away.
2019-12-29 20:31:57 -05:00
Benjamin Otte
f8a7f30a0d builder: Add GtkBuilderScope
GtkBuilderScope is an interface that provides the scope that a builder
instance operates in.
It creates closures and resolves types. Language bindings are meant to
use this interface to customize the behavior of builder files, in
particular when instantiating templates.

A default implementation for C is provided via GtkBuilderCScope (to keep
with the awkward naming that glib uses for closures). It is derivable on
purpose so that languages or extensions that extend C can use it.

The reftest code in fact does derive GtkBuilderCScope for its own scope
implementation that implements looking up symbols in modules.

gtk-widget-factory was updated to use the new GtkBuilderCScope to add
its custom callback symbols.
So it does it different from gtk-demo, which uses the normal way of
exporting symbols for dlsym() and thereby makes the 2 demos test the 2
ways GtkBuilder uses for looking up symbols.
2019-12-12 19:39:23 +01:00
Timm Bäder
5bdd25627f reftests: Fix css-multi-state test
Properly unset theme CSS and use the right selector for the toggle
buttons.
2019-11-29 20:26:45 +09:00
Benjamin Otte
b025ee428c builder: Connect signals automatically
gtk_builder_connect_signals() is no longer necessary, because all the
setup that made it necessary to have this extra step is now done
automatically via the closure functions.
2019-11-22 17:42:31 +01:00
Benjamin Otte
82395a93b0 reftests: Switch to gtk_builder_set_closure_func() 2019-11-22 17:42:31 +01:00
Niklas Hambüchen
bb9c07d8fe build: Don't hardcode shared_library() in meson.
Instead, use the standard library().
This is a meson best practice.

Fixes -Ddefault_library=static not having any effect.
2019-11-11 16:37:46 +01:00
Emmanuele Bassi
b5ed2d310e tests: Add label-sizing.ui to the XFAIL list
Changes in Pango may make this test fail.
2019-11-04 23:46:22 +00:00
Matthias Clasen
34d002121d reftests: Print out a helpful error
When module loading fails, print out the error.
2019-11-01 13:37:52 -04:00
Matthias Clasen
22bb1bd568 reftests: Drop libtool hack
We are not using libtool anymore.
2019-11-01 13:37:43 -04:00
Christian Hergert
fea2a82ef6 textview: use GtkTextViewChild for border and overlay children
This creates a new GtkTextViewChild that can manage overlay children at
given x,y offsets in buffer coordinates. This simplifies GtkTextView by
extracting this from GtkTextWindow as well as providing a real widget for
the borders.

With this change, we also rename gtk_text_view_add_child_in_window() to
gtk_text_view_add_overlay(). For those that were using
GTK_TEXT_WINDOW_WIDGET, they can use a GtkOverlay. It does not appear
that anyone was using GTK_TEXT_WINDOW_(LEFT|RIGHT|TOP|BOTTOM) for widgets
in this fashion, but that can be done by setting a gutter widget with
gtk_text_view_set_gutter(). We can make GtkTextViewChild public if
necessary to simplify this should it become necessary.

GtkTextViewChild will setup a CSS node of either "text" or "border"
depending on the GtkTextWindowType.

The old GtkTextViewChild has been renamed to AnchoredChild as it is only
used for widgets with anchors in the GtkTextBuffer. This also removes the
use of allocated GSList and instead embeds a GQueue and GList to save a
few extraneous allocations.
2019-10-04 14:45:43 -07:00
Timm Bäder
1db59d1c89 fixedlayout: Don't call the child transform position
It's a full transform and not just a translation these days.
2019-09-09 17:36:25 +02:00
Matthias Clasen
6118dfba74 Add missing includes 2019-07-31 08:04:03 -04:00
Matthias Clasen
e3ee1df456 Add an image comparison utility
This comes in handy sometimes, and we
already have the image diff code.
2019-07-30 14:02:43 -04:00
Matthias Clasen
032473fef8 reftest: Exclude flaky tests
These depend on details of text rendering,
and started failing with newer pango.
2019-07-28 16:42:52 -04:00
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02:00
Benjamin Otte
8be95ca348 css: Add data URL parsing to images 2019-05-12 17:27:01 +02:00
Matthias Clasen
a0c6d88858 Mark a failing reftest as xfail
I don't know why we expect different window types
to render identically in the first place.
2019-05-07 03:27:04 +00:00
Matthias Clasen
6f25168db3 Make the newly added test a bit more robust
Follow the style of the other tests and provide
style for both the test and ref.
2019-05-03 02:15:07 +00:00
Matthias Clasen
7037ff8f3d 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 01:44:29 +00:00
Matthias Clasen
51b2759eb1 surface: Drop group api
This was only ever implemented on X11, and
GTK is not using it at all. Relegate it to
x11-specific api.
2019-04-20 02:28:46 +00:00
Benjamin Otte
70fb29e81a reftests: Add a reftest for rendering failure
c18d2872f2 introduced a misrendering in
the Cairo fallback rendering code while fixing another one.

This test exposes that problem.

Related: !756
2019-04-19 03:39:57 +02:00
Benjamin Otte
84351ba9e5 reftests: Be more graceful about errors
The nice thing about that is that we can then log messages about the
errors to the log.

And then we can read the logs of the CI machinery and actually know
what's going on.
2019-04-13 01:48:28 +02:00
Benjamin Otte
e0730bc118 testsuite: Fix label-shadows test
Use a GtkFixed to position and rotate the labels. This is necessary
because the GtkLabel::angle property was removed.
2019-04-13 01:31:49 +02:00
Benjamin Otte
07e0411b98 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-13 00:11:24 +02:00
Benjamin Otte
254feda16b Revert "reftests: Fix textview-margins test"
This reverts commit c6471ee874.

Doesn't work on CI.
2019-04-12 22:38:11 +02:00
Benjamin Otte
c6471ee874 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-12 22:15:00 +02:00
Emmanuele Bassi
f58f0732c2 ci: Cache the reftest artifacts
Keeping the reftest output images as artifacts of a job allows us to
browse them and download them straight from GitLab.
2019-04-12 20:58:29 +01:00
Emmanuele Bassi
c5a4a26f06 Merge branch 'ci-update' into 'master'
ci: Install Monospace fonts

See merge request GNOME/gtk!742
2019-04-12 19:30:31 +00:00
Emmanuele Bassi
3046358d38 ci: Update list of xfail tests
The label tests do not fail any more, because the CI image has Monospace
fonts; the textview-margins test started to fail on the CI image,
though.
2019-04-12 20:21:29 +01:00
James Westman
c20360dd98 reftests: Use shared_library, not shared_module
This allows Meson to run on macOS, where shared modules cannot be linked
against.
2019-04-12 14:04:01 -05:00
Benjamin Otte
198207f1ff reftests: Mark the currently unfixed failures as XFAIL
They should be fixeed before 4.0 but the fixes are more involved. And we
want to start running the existing tests on CI, because they break
regularly and we want to catch that.
2019-04-12 19:34:29 +02:00
Benjamin Otte
6120f11ed3 reftests: Fix GtkFixed layout properties
GtkFixed was still using "x" and "y", when it should have been using
"position".
2019-04-12 19:34:29 +02:00
Benjamin Otte
0a440a804f reftests: Fix CSS for various tests
* :nth-child(first) => :first-child
* :nth-child(last) => :last-child
* Add semicolons at end of declarations
* Remove spaces between color functions (shade, alpha, ...) and args
2019-04-12 19:34:29 +02:00
Benjamin Otte
3988847a05 reftests: Add a cross-fade syntax-checking reftest
Making sure all this newfangled code does what it says.
2019-04-12 19:34:28 +02:00
Emmanuele Bassi
5d778175ee testsuite/reftests: Update UI files
Run the UI files through `gtk-builder-tool simplify --3to4` to update
the layout properties.
2019-04-05 00:33:12 +01:00
Chun-wei Fan
68af572ba4 test/reftests: Fix build on Visual Studio
As we are building the gtkreftestprivate and reftest test libraries as
DLLs, we need to export the symbols in there so that things will link.

Decorate the symbols with G_MODULE_EXPORT for this purpose.
2019-04-01 12:14:45 +08:00
Timm Bäder
fb4ffa468c build: Don't use 'continue'
It does not exist in meson 0.48 apparently.
2019-03-31 06:37:10 +02:00
Benjamin Otte
a8dccef507 build: The private reftest library needs to be shared
Otherwise the module and gtk-reftest will each have their own copy and
that'll mean all symbols - and inhibiting the shutdown - will exist
twice. Not good.
2019-03-29 09:56:52 +01:00
Benjamin Otte
90f460c236 reftests: Remove notebook-childproperties test
Notebooks have no child properties anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
e5e516468a reftests: Fix textview-tags test
The test was timeouting on X11.

I'm still not sure it does what it should do, but at least that
problem's gone.
2019-03-29 09:56:52 +01:00
Benjamin Otte
b88c9439aa reftests: Fix label-sizing test
Set border, padding and margin to 0, not just padding.
2019-03-29 09:56:52 +01:00
Benjamin Otte
95f9c8a5eb reftests: Remove box-packing test
Boxes have no packing flags anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
fbc8bb979d reftests: Fix grid-empty-with-spacing test
Widgets are visible by default now, so make sure the ones that should be
invisible are marked as such.
2019-03-29 09:56:52 +01:00
Benjamin Otte
e861b0d6c1 reftests: Fix grid-spacing2 test
The expand flag needs to be set on widgets when previously it was a
packing property.
2019-03-29 09:56:52 +01:00
Benjamin Otte
7918eaf677 picture: Don't cause warnings on load failures
When a file set via gtk_picture_set_file() can't be loaded, just
silently don't load it.

Reftest picture-load-invalid-file added for that case.
2019-03-29 09:56:52 +01:00
Benjamin Otte
bf2a93ca0e reftests: Fix image-load-from-file test
- Images are always correctly sized
- Use a GtkPicture for the large file
2019-03-29 09:56:52 +01:00
Benjamin Otte
606aea2302 reftests: Fix iconview-empty test
Images have a static size now, use a GtkPicture instead.
2019-03-29 09:56:52 +01:00
Benjamin Otte
fee8f6b9be reftests: Fix shorthand-entry-border test
We weren't setting CSS back to defaults, so the border highlight
transition would be at different stages when the 2 snapshots happened.
2019-03-29 09:56:52 +01:00
Benjamin Otte
3a8a9fc2bd reftests: Remove style-properties-nth-child test
Style properties don't exist anymore.
2019-03-29 09:56:52 +01:00
Benjamin Otte
866bc13557 reftests: Fix statusbar-remove-all test 2019-03-29 09:56:52 +01:00