Commit Graph

24 Commits

Author SHA1 Message Date
Bilal Elmoussaoui
6e7d314e75 region: Move Region.scale to Mtk
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Bilal Elmoussaoui
4513abd584 region: Move rectangle helper macro to Mtk
Rename it to Rectangle prefix to avoid confusion with MtkRegion

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Bilal Elmoussaoui
6f9e75b6f2 boxes: Move Rectangle.is_adjacent_to to Mtk
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Bilal Elmoussaoui
fcc8cfff11 boxes: Move Rectangle.scale_double to Mtk
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Bilal Elmoussaoui
59457dff81 boxes: Move Rectangle.crop_and_scale to Mtk
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Robert Mader
a4181a6730 mtk: Mark mtk_rectangle_to_graphene_rect in-variable as const
To silence occasional compiler warnings.

Fixes: a93471eb90 ("mtk: Move Rectangle.to_graphene_rect from Meta")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3474>
2023-12-29 12:45:19 +01:00
Bilal Elmoussaoui
371d28a766 cleanup: Stop allowing deprecated Cogl API usage
Allow only specific files to use those deprecated APIs making
it easier to find where deprecated APIs are still in use
and avoid introducing new usages without being noticed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3400>
2023-11-15 13:13:00 +01:00
Zander Brown
9610665ab8 mtk: Use an arc box for region
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3363>
2023-11-09 10:09:23 +00:00
Bilal Elmoussaoui
156fe0fdd8 mtk: Make Rectangle no longer a typedef
Now that we provide our own Region type which uses
MtkRectangle directly, there is no longer a need to go through cairo

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3292>
2023-11-03 11:27:52 +00:00
Bilal Elmoussaoui
7c98910488 mtk: Add a Region type
Currently, we use cairo_region_t despite it being a thing wrapper around pixman_region_32
In order to push for a cairo-less and wayland only build in the future, replace
cairo_region_t with a thin wrapper that is almost a copy of the upstream cairo implementation

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3292>
2023-11-03 11:27:52 +00:00
Carlos Garnacho
fac0d05762 mtk: Include config.h in C files
Make these pull the general config, might be handy in the
future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3230>
2023-09-02 09:52:54 +00:00
Carlos Garnacho
ef366c5fcb mtk: Make error traps multi-display
Keep a per-display list of error traps, so we don't mix them
together, and possibly deem unintended error traps outdated.

This means init/deinit calls are now stackable, and need to
happen evenly. In order to honor this, move the MetaX11Display
error trap destrution to finalize.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3230>
2023-09-02 09:52:54 +00:00
Carlos Garnacho
6bda46095a mtk: Add API for X11 errors
We currently have a bit of a disaster area wrt X11 error handling,
with all of Cogl/Clutter/Mutter offering implementations with different
expectations and different degrees of integration with other error
handlers.

It makes more sense to have a single X11 error handling implementation
that is used in all those places. Mtk seems like the reasonable place
to have this kind of general API, so adopt the more advanced code
at src/x11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3230>
2023-09-02 09:52:54 +00:00
Bilal Elmoussaoui
1abef24154 mtk: Move Rectangle.from_graphene_rect from Meta
And drop the clutter helper

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
a93471eb90 mtk: Move Rectangle.to_graphene_rect from Meta
Also drops the clutter equivalent

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
aec8e50df8 mtk: Move Rectangle.[contains|could_fit]_rect from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
eafe07de31 mtk: Move Rectangle.overlap_* from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
db77759938 mtk: Move Rectangle.area from Meta
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
af7c7befd8 mtk: Move Rectangle constructors from Meta
Also rename the rect constructor from mtk_rect to mtk_rectangle_new so
it is detected as a proper constructor instead of a random function by
g-ir-scanner

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
565acaed9c mtk: Move Rectangle.intersect from Meta
Also replaces it usage everywhere & remove the Clutter helper. Note the
tests were not moved yet to mtk.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:14 +02:00
Bilal Elmoussaoui
6f66dd9944 mtk: Move Rectangle.union from Meta
Similar to Rectangle.equal. The clutter helper was not used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Bilal Elmoussaoui
9b2cba4e86 mtk: Move Rectangle.equal from Meta
Moves equal the equal function and removes the clutter equivalent. The
tests were not moved until all the remaining helper functions are moved.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Bilal Elmoussaoui
c035e0e238 mtk: Add a copy of MetaRectangle
Just to get the basics for porting Cogl to using it instead of
cairo_rectangle_int_t.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Bilal Elmoussaoui
765a918a62 build: Add a Meta Toolkit private library
Currently, Meta/Cogl/Clutter makes use of cairo_rectangle_int_t despite
the existance of MetaRectangle.

In order to make MetaRectangle usable in Cogl/Clutter as well, Mtk would
provide such base types that are shared across the various private
libraries

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00