diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f7a86f2..0ed1e19a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,8 @@ jobs: - version: unstable mutter_pkg: libmutter-14-dev - version: development-target - mutter_pkg: libmutter-14-dev + mutter_pkg: libmutter-18-dev + lightdm_vala: lightdm-vala container: image: ghcr.io/elementary/docker:${{ matrix.version }} @@ -31,7 +32,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y desktop-file-utils libgdk-pixbuf2.0-dev libgnome-desktop-3-dev libgranite-dev libgtk-3-dev libhandy-1-dev liblightdm-gobject-1-dev ${{ matrix.mutter_pkg }} libx11-dev meson valac + apt install -y desktop-file-utils libgdk-pixbuf-2.0-dev libgnome-desktop-3-dev libgranite-dev libgtk-3-dev libhandy-1-dev libjson-glib-dev liblightdm-gobject-1-dev ${{ matrix.mutter_pkg }} libsoup-3.0-dev libx11-dev ${{ matrix.lightdm_vala }} meson valac - name: Build env: DESTDIR: out @@ -75,8 +76,8 @@ jobs: DESTDIR: out run: | meson build - ninja -C build install - + ninja -C build install + lint: runs-on: ubuntu-latest @@ -89,4 +90,3 @@ jobs: run: | io.elementary.vala-lint -d compositor io.elementary.vala-lint -d src - diff --git a/compositor/BackgroundBlurEffect.vala b/compositor/BackgroundBlurEffect.vala index 7cda051e..ede2fe9c 100644 --- a/compositor/BackgroundBlurEffect.vala +++ b/compositor/BackgroundBlurEffect.vala @@ -39,11 +39,7 @@ public class GreeterCompositor.BackgroundBlurEffect : Clutter.Effect { } construct { -#if HAS_MUTTER47 - unowned var ctx = actor.context.get_backend ().get_cogl_context (); -#else unowned var ctx = Clutter.get_default_backend ().get_cogl_context (); -#endif actor_pipeline = new Cogl.Pipeline (ctx); actor_pipeline.set_layer_null_texture (0); diff --git a/compositor/KeyboardManager.vala b/compositor/KeyboardManager.vala index cd51e126..c2eb254e 100644 --- a/compositor/KeyboardManager.vala +++ b/compositor/KeyboardManager.vala @@ -48,10 +48,12 @@ public class GreeterCompositor.KeyboardManager : Object { [CCode (instance_pos = -1)] public static bool handle_modifiers_accelerator_activated (Meta.Display display, bool backward) { +#if !HAS_MUTTER50 #if HAS_MUTTER46 display.get_compositor ().backend.ungrab_keyboard (display.get_current_time ()); #else display.ungrab_keyboard (display.get_current_time ()); +#endif #endif var sources = settings.get_value ("sources"); @@ -79,7 +81,11 @@ public class GreeterCompositor.KeyboardManager : Object { private void set_keyboard_layout (GLib.Settings settings, string key) { unowned var backend = display.get_context ().get_backend (); +#if HAS_MUTTER50 + if (key == "sources" || key == "xkb-options" || key == "current") { +#else if (key == "sources" || key == "xkb-options") { +#endif string[] layouts = {}, variants = {}; var sources = settings.get_value ("sources"); @@ -111,7 +117,12 @@ public class GreeterCompositor.KeyboardManager : Object { cancellable = new GLib.Cancellable (); } +#if HAS_MUTTER50 + var description = new Meta.KeymapDescription.from_rules (settings.get_string ("xkb-model"), layout, variant, options, layouts, layouts); + backend.set_keymap_async.begin (description, settings.get_uint ("current"), cancellable, (obj, res) => { +#else backend.set_keymap_async.begin (layout, variant, options, settings.get_string ("xkb-model"), cancellable, (obj, res) => { +#endif try { ((Meta.Backend) obj).set_keymap_async.end (res); } catch (Error e) { @@ -128,6 +139,7 @@ public class GreeterCompositor.KeyboardManager : Object { #else backend.set_keymap (layout, variant, options); #endif +#if !HAS_MUTTER50 } else if (key == "current") { #if HAS_MUTTER49 if (cancellable != null) { @@ -148,6 +160,7 @@ public class GreeterCompositor.KeyboardManager : Object { }); #else backend.lock_layout_group (settings.get_uint ("current")); +#endif #endif } } diff --git a/compositor/meson.build b/compositor/meson.build index 1cfe5539..e8453310 100644 --- a/compositor/meson.build +++ b/compositor/meson.build @@ -68,6 +68,17 @@ if mutter49_dep.found() vala_flags = ['--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48', '--define', 'HAS_MUTTER49'] endif +mutter50_dep = dependency('libmutter-18', version: ['>= 50', '< 51'], required: false) +if mutter50_dep.found() + libmutter_dep = dependency('libmutter-18', version: '>= 50') + mutter_dep = [ + libmutter_dep, + dependency('mutter-mtk-18'), dependency('mutter-cogl-18'), + dependency('mutter-clutter-18') + ] + vala_flags = ['--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48', '--define', 'HAS_MUTTER49', '--define', 'HAS_MUTTER50'] +endif + if mutter_dep.length() == 0 error ('No supported mutter library found!') endif diff --git a/vapi/Clutter-18.metadata b/vapi/Clutter-18.metadata new file mode 100644 index 00000000..8c22eeeb --- /dev/null +++ b/vapi/Clutter-18.metadata @@ -0,0 +1,146 @@ +// Non mini-object +ActorBox struct +Margin struct +PaintVolume struct +Perspective struct + +*.ref unowned +* cheader_filename="clutter/clutter.h" + +// Fix the few clutter-pango headers +Text cheader_filename="clutter/clutter-pango.h" +TextBuffer cheader_filename="clutter/clutter-pango.h" +TextNode cheader_filename="clutter/clutter-pango.h" +Actor + .get_pango_context cheader_filename="clutter/clutter-pango.h" + .create_pango_context cheader_filename="clutter/clutter-pango.h" + .create_pango_layout cheader_filename="clutter/clutter-pango.h" + + +Actor + .apply_transform.matrix ref + .get_abs_allocation_vertices.verts out=false +Event.type#method name="get_type" + +// ??? +Actor.has_pointer#method name="get_has_pointer" + +// Not all backing symbols are deprecated +Actor.pick deprecated=false + +// Nullable return values +Actor + .get_parent nullable + +// The original CType has been overridden by the annotations +Actor + .allocate.box ctype="const ClutterActorBox *" + .get_stage ctype="ClutterActor *" +Action.handle_event.event ctype="const ClutterEvent *" + +// method/virtual-method/signal don't match +Actor + .event#method name="emit_event" + .get_paint_volume#virtual_method name="get_paint_volume_vfunc" + .get_paint_volume#virtual_method.volume out +Text + .activate#method name="try_activate" + .insert_text#signal skip +TextBuffer.get_text#virtual_method name="get_text_with_length" + +// Default values +Stage.read_pixels + .width default=-1 + .height default=-1 +Stage.paint_to_buffer + .data type="uint8[]" +Text + .position_to_coords.line_height default=null + +// Skipped by g-i for unknown reasons +LayoutManager + .create_child_meta skip=false + +// We can use static strings +PaintNode + .set_static_name skip=false + +// Variadic arguments +Backend + .get_cogl_context skip=false +Interval + .new skip=false + .get_interval skip=false + .set_final skip=false + .set_initial skip=false + .set_interval skip=false +LayoutManager + .child_get skip=false + .child_set skip=false + +// Skipped upstream for unknown reasons +Interval.register_progress_func skip=false + +// struct/class confusion +ActorBox + .new skip + .from_vertices skip +Margin + .new skip + +// Upstream +Event + .get_position.position out + +FrameListenerIface skip +FrameClock.new skip + +// Remove for clutter-2.0 +///////////////////////// + +StageView.layout skip + +Stage + .paint_view.redraw_clip type="Cairo.Region" + +// *Event should be compact classes derived from Clutter.Event +Event.type skip=false +AnyEvent struct=false base_type="Clutter.Event" +ButtonEvent struct=false base_type="Clutter.Event" +CrossingEvent struct=false base_type="Clutter.Event" +DeviceEvent struct=false base_type="Clutter.Event" +IMEvent struct=false base_type="Clutter.Event" +KeyEvent struct=false base_type="Clutter.Event" +MotionEvent struct=false base_type="Clutter.Event" +PadButtonEvent struct=false base_type="Clutter.Event" +PadDialEvent struct=false base_type="Clutter.Event" +PadRingEvent struct=false base_type="Clutter.Event" +PadStripEvent struct=false base_type="Clutter.Event" +ProximityEvent struct=false base_type="Clutter.Event" +ScrollEvent struct=false base_type="Clutter.Event" +TouchEvent struct=false base_type="Clutter.Event" +TouchpadHoldEvent struct=false base_type="Clutter.Event" +TouchpadPinchEvent struct=false base_type="Clutter.Event" +TouchpadSwipeEvent struct=false base_type="Clutter.Event" + +// Keysyms used to be CLUTTER_X instead of CLUTTER_KEY_X +*#constant skip +CURRENT_TIME skip=false +PRIORITY_REDRAW skip=false + +// Clutter devs don't like us creating nested namespaces +value_* name="value_(.+)" parent="Clutter.Value" +threads_* name="threads_(.+)" parent="Clutter.Threads" + +// There is no way to know sealed classes before GLib 2.70 +ColorState sealed +FrameClock sealed +TextureContent sealed + +TextureContent.new_from_texture symbol_type="constructor" + +// Possibly keep +KEY_* skip=false name="KEY_(.+)" type="uint" parent="Clutter.Key" +BUTTON_* skip=false name="BUTTON_(.+)" type="uint32" parent="Clutter.Button" +EVENT_STOP skip=false type="bool" +EVENT_PROPAGATE skip=false type="bool" diff --git a/vapi/Cogl-18-custom.vala b/vapi/Cogl-18-custom.vala new file mode 100644 index 00000000..90d46b33 --- /dev/null +++ b/vapi/Cogl-18-custom.vala @@ -0,0 +1,66 @@ +namespace Cogl { + public struct Color { + [CCode (cname="cogl_color_init_from_4f")] + public Color.from_4f (float red, float green, float blue, float alpha); + [CCode (cname="cogl_color_init_from_hsl")] + public Color.from_hsl (float hue, float saturation, float luminance); + [CCode (cname = "_vala_cogl_color_from_string")] + public static Cogl.Color? from_string (string str) { + Cogl.Color color = {}; + if (color.init_from_string (str)) + return color; + + return null; + } + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP2 { + public float x; + public float y; + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP2C4 { + public float x; + public float y; + public uint8 r; + public uint8 g; + public uint8 b; + public uint8 a; + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP2T2 { + public float x; + public float y; + public float s; + public float t; + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP2T2C4 { + public float x; + public float y; + public float s; + public float t; + public uint8 r; + public uint8 g; + public uint8 b; + public uint8 a; + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP3 { + public float x; + public float y; + public float z; + } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct VertexP3T2 { + public float x; + public float y; + public float z; + public float s; + public float t; + } + [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_PIXEL_FORMAT_", type_id = "cogl_pixel_format_get_type ()")] + public enum PixelFormat { + CAIRO_ARGB32_COMPAT; + } +} diff --git a/vapi/Cogl-18.metadata b/vapi/Cogl-18.metadata new file mode 100644 index 00000000..f66d6f40 --- /dev/null +++ b/vapi/Cogl-18.metadata @@ -0,0 +1,40 @@ +* cheader_filename="cogl/cogl.h" + +Color struct + +Color.equal.v1 type="Cogl.Color" +Color.equal.v2 type="Cogl.Color" +Color.from_string name="init_from_string" + +Bitmap.* skip=false +Bitmap.new_for_data.data type="owned uint8[]" +Bitmap.get_buffer type="unowned Cogl.Buffer?" + +Primitive.new skip=false + +Texture + .get_data.data type="uint8[]" + .set_data.data type="uint8[]" + .set_region.data type="uint8[]" + +Texture2D + .new_from_data skip=false + +Texture.error_quark parent="Cogl.TextureError" name="quark" + +RendererError errordomain +SystemError errordomain +TextureError errordomain +FramebufferError errordomain +ScanoutError errordomain + +Onscreen + .add_frame_callback unowned + +A_BIT parent="Cogl.Bits" name="A" +BGR_BIT parent="Cogl.Bits" name="BGR" +AFIRST_BIT parent="Cogl.Bits" name="AFIRST" +PREMULT_BIT parent="Cogl.Bits" name="PREMULT" +DEPTH_BIT parent="Cogl.Bits" name="DEPTH" +STENCIL_BIT parent="Cogl.Bits" name="STENCIL" +PIXEL_FORMAT_MAX_PLANES parent = "Cogl.PixelFormat" name="MAX_PLANES" diff --git a/vapi/Meta-18-custom.vala b/vapi/Meta-18-custom.vala new file mode 100644 index 00000000..6c2ad893 --- /dev/null +++ b/vapi/Meta-18-custom.vala @@ -0,0 +1,5 @@ +namespace Meta.Util { + public static inline bool is_wayland_compositor () { + return true; + } +} diff --git a/vapi/Meta-18.metadata b/vapi/Meta-18.metadata new file mode 100644 index 00000000..a1abf9e6 --- /dev/null +++ b/vapi/Meta-18.metadata @@ -0,0 +1,184 @@ +* skip=false +*.* skip=false +* cheader_filename="meta/main.h" + +Backend cheader_filename="meta/meta-backend.h" +Backend.gpu_added skip +Background cheader_filename="meta/meta-background.h" +Background.set_file.file nullable +BackgroundContent.new symbol_type="constructor" +BackgroundActor cheader_filename="meta/meta-background-actor.h" +BackgroundContent cheader_filename="meta/meta-background-content.h" +BackgroundGroup cheader_filename="meta/meta-background-group.h" +BackgroundImage cheader_filename="meta/meta-background-image.h" +BackgroundImageCache cheader_filename="meta/meta-background-image.h" +Barrier cheader_filename="meta/barrier.h" +BarrierDirection cheader_filename="meta/barrier.h" +BarrierEvent cheader_filename="meta/barrier.h" +BarrierFlags cheader_filename="meta/barrier.h" +ButtonFunction cheader_filename="meta/common.h" +ButtonLayout cheader_filename="meta/common.h" +Compositor cheader_filename="meta/compositor.h" +CompEffect cheader_filename="meta/compositor.h" +CloseDialog cheader_filename="meta/meta-close-dialog.h" +CloseDialogResponse cheader_filename="meta/meta-close-dialog.h" +Context cheader_filename="meta/meta-context.h" +CursorTracker cheader_filename="meta/meta-cursor-tracker.h" +CursorTracker.get_pointer.mods out +DebugControl cheader_filename="meta/meta-debug-control.h" +DebugTopic cheader_filename="meta/util.h" +DebugPaintFlag cheader_filename="meta/util.h" +Direction cheader_filename="meta/common.h" +Display cheader_filename="meta/display.h" +Display.focus_window#signal name="do_focus_window" +DisplayCorner cheader_filename="meta/display.h" +DisplayDirection cheader_filename="meta/display.h" +Dnd cheader_filename="meta/meta-dnd.h" +EdgeType cheader_filename="meta/boxes.h" +Edge cheader_filename="meta/boxes.h" +FrameBorders cheader_filename="meta/common.h" +FrameType cheader_filename="meta/common.h" +GrabOp cheader_filename="meta/common.h" +Gravity cheader_filename="meta/common.h" +Group cheader_filename="meta/meta-x11-types.h" +IdleMonitor cheader_filename="meta/meta-idle-monitor.h" +IdleMonitorWatchFunc cheader_filename="meta/meta-idle-monitor.h" +InhibitShortcutsDialog cheader_filename="meta/meta-inhibit-shortcuts-dialog.h" +InhibitShortcutsDialogResponse cheader_filename="meta/meta-inhibit-shortcuts-dialog.h" +KeyboardA11yFlags cheader_filename="meta/meta-enums.h" +KeyBinding cheader_filename="meta/keybindings.h" +keybindings_set_custom_handler parent="Meta.KeyBinding" name="set_custom_handler" cheader_filename="meta/keybindings.h" +KeyBindingAction cheader_filename="meta/prefs.h" +KeyBindingFlags cheader_filename="meta/prefs.h" +KeyHandlerFunc cheader_filename="meta/prefs.h" +KeyHandlerFunc.event type="Clutter.KeyEvent?" +KeyHandlerFunc.window nullable +LaunchContext cheader_filename="meta/meta-launch-context.h" +Laters cheader_filename="meta/types.h" +LaterType cheader_filename="meta/util.h" +MaximizeFlags cheader_filename="meta/window.h" +MultiTexture cheader_filename="meta/meta-multi-texture.h" +MultiTextureAlphaMode.n_meta_multi_texture_alpha_modes name="N_MODES" +MultiTextureAlphaMode.meta_multi_texture_alpha_mode_* name="meta_multi_texture_alpha_mode_(.+)" +MultiTextureAlphaMode cheader_filename="meta/meta-multi-texture-format.h" cprefix="META_MULTI_TEXTURE_ALPHA_MODE_" +MultiTextureCoefficients.n_meta_multi_texture_coefficients name="N_COEFFICIENTS" +MultiTextureCoefficients.meta_multi_texture_coefficients_* name="meta_multi_texture_coefficients_(.+)" +MultiTextureCoefficients cheader_filename="meta/meta-multi-texture-format.h" cprefix="META_MULTI_TEXTURE_COEFFICIENTS_" +MultiTextureFormat.n_meta_multi_texture_formats name="N_FORMATS" +MultiTextureFormat.meta_multi_texture_format_* name="meta_multi_texture_format_(.+)" +MultiTextureFormat cheader_filename="meta/meta-multi-texture-format.h" cprefix="META_MULTI_TEXTURE_FORMAT_" +MonitorManager cheader_filename="meta/meta-monitor-manager.h" +MonitorSwitchConfigType cheader_filename="meta/meta-monitor-manager.h" +MotionDirection cheader_filename="meta/common.h" +Orientation cheader_filename="meta/meta-orientation-manager.h" +OrientationManager cheader_filename="meta/meta-orientation-manager.h" +PadDirection cheader_filename="meta/display.h" +PadFeatureType cheader_filename="meta/display.h" +Plugin cheader_filename="meta/meta-plugin.h" +PowerSaveChangeReason cheader_filename="meta/meta-monitor-manager.h" +Preference cheader_filename="meta/prefs.h" +PrefsChangedFunc cheader_filename="meta/prefs.h" +RemoteAccessController cheader_filename="meta/meta-remote-access-controller.h" +RemoteAccessHandle cheader_filename="meta/meta-remote-access-controller.h" +Selection cheader_filename="meta/meta-selection.h" +SelectionSource cheader_filename="meta/meta-selection-source.h" +SelectionSourceMemory cheader_filename="meta/meta-selection-source-memory.h" +SelectionType cheader_filename="meta/meta-selection-source.h" +Settings cheader_filename="meta/meta-settings.h" +ShapedTexture cheader_filename="meta/meta-shaped-texture.h" +Side cheader_filename="meta/common.h" +SizeChange cheader_filename="meta/compositor.h" +SoundPlayer cheader_filename="meta/meta-sound-player.h" +StartupNotification cheader_filename="meta/meta-startup-notification.h" +StartupNotification.changed.object type="Meta.StartupSequence" +StartupNotification.get_sequences type_arguments="Meta.StartupSequence" +StartupSequence cheader_filename="meta/meta-startup-notification.h" +StackLayer cheader_filename="meta/common.h" +Stage cheader_filename="meta/meta-stage.h" +Strut cheader_filename="meta/boxes.h" +TabList cheader_filename="meta/display.h" +TabShowType cheader_filename="meta/display.h" +WaylandClient cheader_filename="meta/meta-wayland-client.h" +WaylandCompositor cheader_filename="meta/meta-wayland-compositor.h" +Workspace cheader_filename="meta/workspace.h" +WorkspaceManager cheader_filename="meta/meta-workspace-manager.h" +Window cheader_filename="meta/window.h" +Window.focus#signal name="focused" +Window.suspend_state skip +Window.main_monitor skip +WindowActor cheader_filename="meta/meta-window-actor.h" +WindowClientType cheader_filename="meta/window.h" +WindowForeachFunc cheader_filename="meta/window.h" +WindowGroup cheader_filename="meta/meta-window-group.h" +WindowMenuType cheader_filename="meta/compositor.h" +WindowType cheader_filename="meta/window.h" +X11Display cheader_filename="meta/meta-x11-display.h" +X11Display.add_event_func skip +X11DisplayEventFunc skip + +WaylandSurface.scanout_candidate skip +WaylandSurface.main_monitor skip + +// As per https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2287 +MonitorManager.monitor_privacy_screen_changed skip + +prefs_* parent="Meta.Prefs" name="prefs_(.+)" cheader_filename="meta/prefs.h" + +g_utf8_strndup skip + +preference_to_string cheader_filename="meta/prefs.h" +frame_type_to_string cheader_filename="meta/util.h" +topic_to_string parent="Meta.DebugTopic" name="to_string" cheader_filename="meta/util.h" + +CURRENT_TIME cheader_filename="meta/common.h" +PRIORITY_RESIZE cheader_filename="meta/common.h" +PRIORITY_BEFORE_REDRAW cheader_filename="meta/common.h" +PRIORITY_REDRAW cheader_filename="meta/common.h" +PRIORITY_PREFS_NOTIFY cheader_filename="meta/common.h" +VIRTUAL_CORE_POINTER_ID cheader_filename="meta/common.h" +VIRTUAL_CORE_KEYBOARD_ID cheader_filename="meta/common.h" + +Display.window_visibility_updated + .object name="unplaced" type="GLib.List" + .p0 name="should_show" type="GLib.List" + .p1 name="should_hide" type="GLib.List" + +Compositor.get_window_actors type_arguments="Meta.WindowActor" + +add_verbose_topic parent="Meta.Util" cheader_filename="meta/util.h" +bug parent="Meta.Util" cheader_filename="meta/util.h" +external_binding_name_for_action parent="Meta.Util" cheader_filename="meta/util.h" +fatal parent="Meta.Util" cheader_filename="meta/util.h" +is_verbose parent="Meta.Util" cheader_filename="meta/util.h" +pop_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h" +push_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h" +remove_verbose_topic parent="Meta.Util" cheader_filename="meta/util.h" +unsigned_long_equal parent="Meta.Util" name="ulong_equal" cheader_filename="meta/util.h" +unsigned_long_equal.v1 type="ulong?" +unsigned_long_equal.v2 type="ulong?" +unsigned_long_hash parent="Meta.Util" name="ulong_hash" cheader_filename="meta/util.h" +unsigned_long_hash.v type="ulong?" +create_context parent="Meta.Context" name="new" symbol_type="constructor" cheader_filename="meta/meta-context.h" + +Plugin.create_close_dialog unowned=false nullable +Plugin.create_inhibit_shortcuts_dialog unowned=false + +BackgroundActor sealed +BackgroundContent sealed +BackgroundImage sealed +BackgroundImageCache sealed +Background sealed +Dnd sealed +IdleMonitor sealed +LaunchContext sealed +RemoteAccessController sealed +SelectionSourceMemory sealed +Selection sealed +ShapedTexture sealed +SoundPlayer sealed +Stage sealed +StartupNotification sealed +WaylandClient sealed +WindowGroup sealed +WorkspaceManager sealed +X11Display sealed diff --git a/vapi/Mtk-18.metadata b/vapi/Mtk-18.metadata new file mode 100644 index 00000000..f804d1bc --- /dev/null +++ b/vapi/Mtk-18.metadata @@ -0,0 +1,6 @@ +Rectangle struct +RECTANGLE_MAX_STACK_RECTS parent="Mtk.Rectangle" name="MAX_STACK_RECTS" +REGION_BUILDER_MAX_LEVELS parent="Mtk.RegionBuilder" name="MAX_LEVELS" + +MONITOR_ALL_TRANSFORMS parent="Mtk.MonitorTransform" name="ALL" +MONITOR_N_TRANSFORMS skip diff --git a/vapi/libmutter-18.deps b/vapi/libmutter-18.deps new file mode 120000 index 00000000..18c721de --- /dev/null +++ b/vapi/libmutter-18.deps @@ -0,0 +1 @@ +libmutter-17.deps \ No newline at end of file diff --git a/vapi/libmutter-18.vapi b/vapi/libmutter-18.vapi new file mode 120000 index 00000000..ff0e578a --- /dev/null +++ b/vapi/libmutter-18.vapi @@ -0,0 +1 @@ +libmutter-17.vapi \ No newline at end of file diff --git a/vapi/libmutter.vapi b/vapi/libmutter.vapi index e21902e7..ade24867 100644 --- a/vapi/libmutter.vapi +++ b/vapi/libmutter.vapi @@ -105,8 +105,15 @@ namespace Meta { #endif [CCode (cheader_filename = "meta/util.h", cname = "meta_is_verbose")] public static bool is_verbose (); +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h")] + public static bool is_wayland_compositor () { + return true; + } +#else [CCode (cheader_filename = "meta/util.h", cname = "meta_is_wayland_compositor")] public static bool is_wayland_compositor (); +#endif [CCode (cheader_filename = "meta/util.h", cname = "meta_pop_no_msg_prefix")] public static void pop_no_msg_prefix (); [CCode (cheader_filename = "meta/util.h", cname = "meta_push_no_msg_prefix")] @@ -139,6 +146,9 @@ namespace Meta { public unowned Meta.CursorTracker get_cursor_tracker (); #endif public unowned Meta.Dnd get_dnd (); +#if HAS_MUTTER50 + public unowned Meta.KeymapDescription get_keymap_description (); +#endif public unowned Meta.MonitorManager get_monitor_manager (); #if HAS_MUTTER47 public unowned Meta.OrientationManager get_orientation_manager (); @@ -156,13 +166,21 @@ namespace Meta { #endif #if HAS_MUTTER46 #if HAS_MUTTER49 +#if HAS_MUTTER50 + public async bool set_keymap_async (Meta.KeymapDescription description, uint32 layout_index, GLib.Cancellable? cancellable) throws GLib.Error; +#else public async bool set_keymap_async (string layouts, string variants, string options, string model, GLib.Cancellable? cancellable) throws GLib.Error; +#endif +#if !HAS_MUTTER50 public async bool set_keymap_layout_group_async (uint32 idx, GLib.Cancellable? cancellable) throws GLib.Error; +#endif #else public void set_keymap (string layouts, string variants, string options, string model); #endif +#if !HAS_MUTTER50 public void unfreeze_keyboard (uint32 timestamp); public void ungrab_keyboard (uint32 timestamp); +#endif #else public void set_keymap (string layouts, string variants, string options); #endif @@ -172,11 +190,16 @@ namespace Meta { public signal void keymap_layout_group_changed (uint object); public signal void last_device_changed (Clutter.InputDevice object); public signal void lid_is_closed_changed (bool object); -#if HAS_MUTTER48 +#if HAS_MUTTER50 + public signal Clutter.CursorType override_cursor (); +#elif HAS_MUTTER48 public signal void pause (); #endif public signal void prepare_shutdown (); -#if HAS_MUTTER48 +#if HAS_MUTTER50 + public signal Meta.KeymapDescription reset_keymap_description (); + public signal uint reset_keymap_layout_index (); +#elif HAS_MUTTER48 public signal void resume (); #endif } @@ -364,13 +387,17 @@ namespace Meta { public bool configure ([CCode (array_length_cname = "argc", array_length_pos = 0.5)] ref unowned string[]? argv) throws GLib.Error; public void destroy (); public unowned Meta.Backend get_backend (); +#if !HAS_MUTTER50 public Meta.CompositorType get_compositor_type (); +#endif #if HAS_MUTTER47 public unowned Meta.DebugControl get_debug_control (); #endif public unowned Meta.Display get_display (); public unowned Meta.WaylandCompositor? get_wayland_compositor (); +#if !HAS_MUTTER50 public bool is_replacing (); +#endif public void notify_ready (); public bool raise_rlimit_nofile () throws GLib.Error; public bool restore_rlimit_nofile () throws GLib.Error; @@ -497,11 +524,15 @@ namespace Meta { public unowned Meta.X11Display get_x11_display (); public uint grab_accelerator (string accelerator, Meta.KeyBindingFlags flags); public bool is_grabbed (); +#if !HAS_MUTTER50 public bool is_pointer_emulating_sequence (Clutter.EventSequence? sequence); +#endif public GLib.List list_all_windows (); public bool remove_keybinding (string name); public void request_pad_osd (Clutter.InputDevice pad, bool edition_mode); +#if !HAS_MUTTER50 public void set_cursor (Meta.Cursor cursor); +#endif #if HAS_MUTTER46 public void set_input_focus (Meta.Window window, uint32 timestamp); #else @@ -527,7 +558,9 @@ namespace Meta { public signal void accelerator_deactivated (uint object, Clutter.InputDevice p0, uint p1); #endif public signal void closing (); +#if !HAS_MUTTER50 public signal void cursor_updated (); +#endif [CCode (cname = "focus-window")] public signal void do_focus_window (Meta.Window object, int64 p0); public signal void gl_video_memory_purged (); @@ -535,15 +568,23 @@ namespace Meta { public signal void grab_op_end (Meta.Window object, Meta.GrabOp p0); public signal void in_fullscreen_changed (); public signal bool init_xserver (GLib.Task object); +#if HAS_MUTTER50 + public signal void modifiers_accelerator_activated (); +#else public signal bool modifiers_accelerator_activated (); +#endif public signal void overlay_key (); public signal void pad_mode_switch (Clutter.InputDevice object, uint p0, uint p1); public signal void restacked (); +#if !HAS_MUTTER50 public signal bool restart (); +#endif public signal void show_osd (int object, string p0, string p1); public signal unowned Clutter.Actor? show_pad_osd (Clutter.InputDevice pad, GLib.Settings settings, string layout_path, bool edition_mode, int monitor_idx); public signal bool show_resize_popup (bool object, Mtk.Rectangle p0, int p1, int p2); +#if !HAS_MUTTER50 public signal bool show_restart_message (string? message); +#endif public signal void showing_desktop_changed (); public signal void window_created (Meta.Window object); public signal void window_demands_attention (Meta.Window object); @@ -595,11 +636,16 @@ namespace Meta { [CCode (has_construct_function = false)] protected IdleMonitor (); public uint add_idle_watch (uint64 interval_msec, owned Meta.IdleMonitorWatchFunc? callback); +#if HAS_MUTTER50 + public uint add_idle_watch_full (uint64 interval_msec, [CCode (delegate_target_pos = 2.33333, destroy_notify_pos = 2.66667)] owned Meta.IdleMonitorWatchFunc? callback, Meta.IdleMonitorWatchFlags flags); +#endif public uint add_user_active_watch (owned Meta.IdleMonitorWatchFunc? callback); public int64 get_idletime (); public void remove_watch (uint id); +#if !HAS_MUTTER50 [NoAccessorMethod] public Clutter.InputDevice device { owned get; construct; } +#endif } [CCode (cheader_filename = "meta/keybindings.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "meta_key_binding_get_type ()")] [Compact] @@ -612,6 +658,18 @@ namespace Meta { [CCode (cheader_filename = "meta/keybindings.h", cname = "meta_keybindings_set_custom_handler")] public static bool set_custom_handler (string name, owned Meta.KeyHandlerFunc? handler); } +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h", ref_function = "meta_keymap_description_ref", type_id = "meta_keymap_description_get_type ()", unref_function = "meta_keymap_description_unref")] + [Compact] + public class KeymapDescription { + public bool direct_equal (Meta.KeymapDescription other); + [CCode (has_construct_function = false)] + public KeymapDescription.from_rules (string model, string layout, string variant, string options, [CCode (array_length = false, array_null_terminated = true)] string[] display_names, [CCode (array_length = false, array_null_terminated = true)] string[] short_names); + public bool is_locked (); + public Meta.KeymapDescription @ref (); + public void unref (); + } +#endif [CCode (cheader_filename = "meta/types.h", type_id = "meta_laters_get_type ()")] public class Laters : GLib.Object { [CCode (has_construct_function = false)] @@ -661,6 +719,9 @@ namespace Meta { [CCode (has_construct_function = false)] protected MonitorManager (); public bool can_switch_config (); +#if HAS_MUTTER50 + public unowned Meta.Backend get_backend (); +#endif public int get_display_configuration_timeout (); public bool get_is_builtin_display_on (); #if HAS_MUTTER49 @@ -673,8 +734,12 @@ namespace Meta { public bool get_panel_orientation_managed (); public Meta.MonitorSwitchConfigType get_switch_config (); public void switch_config (Meta.MonitorSwitchConfigType config_type); +#if HAS_MUTTER50 + public Meta.Backend backend { get; construct; } +#else [NoAccessorMethod] public Meta.Backend backend { owned get; construct; } +#endif #if !HAS_MUTTER48 [NoAccessorMethod] public string experimental_hdr { owned get; set; } @@ -785,6 +850,7 @@ namespace Meta { [NoWrapper] public virtual void unminimize (Meta.WindowActor actor); public void unminimize_completed (Meta.WindowActor actor); +#if !HAS_MUTTER50 #if !HAS_MUTTER46 [NoWrapper] public virtual bool xevent_filter ([CCode (type = "XEvent*")] ref X.Event event); @@ -795,6 +861,7 @@ namespace Meta { #elif HAS_MUTTER48 [NoWrapper] public virtual bool xevent_filter (X.Event event); +#endif #endif } [CCode (cheader_filename = "meta/meta-remote-access-controller.h", type_id = "meta_remote_access_controller_get_type ()")] @@ -1001,6 +1068,9 @@ namespace Meta { protected Window (); public void activate (uint32 current_time); public void activate_with_workspace (uint32 current_time, Meta.Workspace workspace); +#if HAS_MUTTER50 + public void add_external_constraint (Meta.ExternalConstraint constraint); +#endif public bool allows_move (); public bool allows_resize (); #if HAS_MUTTER49 @@ -1101,6 +1171,9 @@ namespace Meta { public bool has_pointer (); #if HAS_MUTTER49 public void hide_from_window_list (); +#endif +#if HAS_MUTTER50 + public void inhibit_mapped (); #endif public bool is_above (); public bool is_always_on_all_workspaces (); @@ -1111,6 +1184,9 @@ namespace Meta { #endif public bool is_fullscreen (); public bool is_hidden (); +#if HAS_MUTTER50 + public bool is_mapped_inhibited (); +#endif #if HAS_MUTTER49 public bool is_maximized (); #endif @@ -1144,6 +1220,9 @@ namespace Meta { public void raise_and_make_recent_on_workspace (Meta.Workspace workspace); #else public void raise_and_make_recent (); +#endif +#if HAS_MUTTER50 + public void remove_external_constraint (Meta.ExternalConstraint constraint); #endif public void set_compositor_private (GLib.Object priv); public void set_demands_attention (); @@ -1165,6 +1244,9 @@ namespace Meta { public Mtk.Rectangle stage_to_protocol_rect (Mtk.Rectangle stage_rect); #endif public void stick (); +#if HAS_MUTTER50 + public void uninhibit_mapped (); +#endif #if !HAS_MUTTER48 public bool titlebar_is_onscreen (); #endif @@ -1183,6 +1265,12 @@ namespace Meta { [CCode (cheader_filename = "meta/meta-x11-group.h")] #endif public unowned Meta.Group? x11_get_group (); +#endif +#if HAS_MUTTER50 + [NoAccessorMethod] + public string a11y_dbus_name { owned get; } + [NoAccessorMethod] + public string a11y_object_path { owned get; } #endif [NoAccessorMethod] public bool above { get; } @@ -1383,7 +1471,11 @@ namespace Meta { public signal void workspaces_reordered (); } [CCode (cheader_filename = "meta/meta-x11-display.h", type_id = "meta_x11_display_get_type ()")] +#if HAS_MUTTER50 + public class X11Display : GLib.Object { +#else public sealed class X11Display : GLib.Object { +#endif [CCode (has_construct_function = false)] protected X11Display (); #if !HAS_MUTTER47 @@ -1404,10 +1496,12 @@ namespace Meta { #endif public void redirect_windows (Meta.Display display); public void remove_event_func (uint id); +#if !HAS_MUTTER50 #if HAS_MUTTER47 public void set_stage_input_region ([CCode (array_length_cname = "n_rects", array_length_pos = 1.1, type = "XRectangle*")] X.Xrectangle[] rects); #else public void set_stage_input_region (X.XserverRegion region); +#endif #endif } [CCode (cheader_filename = "meta/meta-close-dialog.h", type_cname = "MetaCloseDialogInterface", type_id = "meta_close_dialog_get_type ()")] @@ -1421,6 +1515,12 @@ namespace Meta { [HasEmitter] public signal void response (Meta.CloseDialogResponse response); } +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h", type_cname = "MetaExternalConstraintInterface", type_id = "meta_external_constraint_get_type ()")] + public interface ExternalConstraint : GLib.Object { + public abstract bool constrain (Meta.Window window, Meta.ExternalConstraintInfo info); + } +#endif [CCode (cheader_filename = "meta/meta-inhibit-shortcuts-dialog.h", type_cname = "MetaInhibitShortcutsDialogInterface", type_id = "meta_inhibit_shortcuts_dialog_get_type ()")] public interface InhibitShortcutsDialog : GLib.Object { public abstract void hide (); @@ -1447,6 +1547,14 @@ namespace Meta { public Meta.Side side_type; public Meta.EdgeType edge_type; } +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h", has_type_id = false)] + public struct ExternalConstraintInfo { + public Mtk.Rectangle new_rect; + public Meta.ExternalConstraintFlags flags; + public Meta.Gravity resize_gravity; + } +#endif [CCode (cheader_filename = "meta/main.h", has_type_id = false)] public struct FrameBorder { public int16 left; @@ -1527,6 +1635,7 @@ namespace Meta { MINIMIZE, NONE } +#if !HAS_MUTTER50 [CCode (cheader_filename = "meta/meta-enums.h", cprefix = "META_COMPOSITOR_TYPE_", type_id = "meta_compositor_type_get_type ()")] public enum CompositorType { WAYLAND, @@ -1598,6 +1707,7 @@ namespace Meta { LAST #endif } +#endif [CCode (cheader_filename = "meta/util.h", cprefix = "META_DEBUG_PAINT_", type_id = "meta_debug_paint_flag_get_type ()")] [Flags] public enum DebugPaintFlag { @@ -1698,6 +1808,15 @@ namespace Meta { SUCCESS, ERROR } +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h", cprefix = "META_EXTERNAL_CONSTRAINT_FLAGS_", type_id = "meta_external_constraint_flags_get_type ()")] + [Flags] + public enum ExternalConstraintFlags { + NONE, + MOVE, + RESIZE + } +#endif [CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_TYPE_", type_id = "meta_frame_type_get_type ()")] public enum FrameType { NORMAL, @@ -1708,7 +1827,9 @@ namespace Meta { BORDER, ATTACHED, LAST; +#if !HAS_MUTTER50 [CCode (cheader_filename = "meta/util.h")] +#endif public unowned string to_string (); } [CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_", type_id = "meta_grab_op_get_type ()")] @@ -1749,9 +1870,20 @@ namespace Meta { SOUTH, SOUTH_EAST, STATIC; +#if !HAS_MUTTER50 [CCode (cheader_filename = "meta/util.h")] +#endif public unowned string to_string (); } +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h", cprefix = "META_IDLE_MONITOR_WATCH_FLAGS_", type_id = "meta_idle_monitor_watch_flags_get_type ()")] + [Flags] + public enum IdleMonitorWatchFlags { + NONE, + UNINHIBITABLE, + START_NOW + } +#endif [CCode (cheader_filename = "meta/meta-inhibit-shortcuts-dialog.h", cprefix = "META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_", type_id = "meta_inhibit_shortcuts_dialog_response_get_type ()")] public enum InhibitShortcutsDialogResponse { ALLOW, @@ -2066,7 +2198,9 @@ namespace Meta { DRAG_THRESHOLD, LOCATE_POINTER, CHECK_ALIVE_TIMEOUT; +#if !HAS_MUTTER50 [CCode (cheader_filename = "meta/prefs.h")] +#endif public unowned string to_string (); } [CCode (cheader_filename = "meta/meta-selection-source.h", cprefix = "META_", type_id = "meta_selection_type_get_type ()")] @@ -2216,22 +2350,46 @@ namespace Meta { #if !HAS_MUTTER48 [CCode (cheader_filename = "meta/main.h")] public static void get_clutter_debug_flags (out Clutter.DebugFlag debug_flags, out Clutter.DrawDebugFlag draw_flags, out Clutter.PickDebugFlag pick_flags); +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/util.h")] + [Version (replacement = "FrameType.to_string")] + public static unowned string frame_type_to_string (Meta.FrameType type); #endif [CCode (cheader_filename = "meta/main.h")] public static Meta.DebugPaintFlag get_debug_paint_flags (); +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h")] + [Version (replacement = "Gravity.to_string")] + public static unowned string gravity_to_string (Meta.Gravity gravity); +#else [CCode (cheader_filename = "meta/main.h")] public static bool is_restart (); +#endif [CCode (cheader_filename = "meta/main.h")] public static bool is_topic_enabled (Meta.DebugTopic topic); [CCode (cheader_filename = "meta/main.h")] public static void log (string format, ...); +#if HAS_MUTTER50 + [CCode (cheader_filename = "meta/main.h")] + [Version (replacement = "Orientation.to_transform")] + public static Mtk.MonitorTransform orientation_to_transform (Meta.Orientation orientation); + [CCode (cheader_filename = "meta/prefs.h")] + [Version (replacement = "Preference.to_string")] + public static unowned string preference_to_string (Meta.Preference pref); + [CCode (cheader_filename = "meta/main.h")] + public static async bool read_bytes (int fd, uint32 offset, uint32 length) throws GLib.Error; + [CCode (cheader_filename = "meta/main.h")] + public static void remove_debug_paint_flag (Meta.DebugPaintFlag flag); +#endif #if !HAS_MUTTER48 [CCode (cheader_filename = "meta/main.h")] public static void remove_clutter_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags); #endif +#if !HAS_MUTTER50 [CCode (cheader_filename = "meta/main.h")] public static void remove_debug_paint_flag (Meta.DebugPaintFlag flag); [CCode (cheader_filename = "meta/main.h")] public static void restart (string? message, Meta.Context context); +#endif } - diff --git a/vapi/meson.build b/vapi/meson.build index 408feaec..9d11aef0 100644 --- a/vapi/meson.build +++ b/vapi/meson.build @@ -414,3 +414,75 @@ if mutter49_dep.found() output: 'libmutter-17.vapi' ) endif +if mutter50_dep.found() + mtk_target = custom_target('mutter-mtk-18', + command: [ + vapigen, + mutter_typelib_dir / 'Mtk-18.gir', + '--library=mutter-mtk-18', + '--pkg=gobject-2.0', + '--pkg=gio-2.0', + '--pkg=cairo', + '--pkg=graphene-gobject-1.0', + vapigen_args + ], + output: 'mutter-mtk-18.vapi' + ) + cogl_target = custom_target('mutter-cogl-18', + command: [ + vapigen, + mutter_typelib_dir / 'Cogl-18.gir', + '--library=mutter-cogl-18', + '--pkg=mutter-mtk-18', + '--pkg=gobject-2.0', + '--pkg=gio-2.0', + '--pkg=cairo', + '--pkg=graphene-gobject-1.0', + '--pkg=x11', + vapigen_args, + files('Cogl-18-custom.vala') + ], + depends: mtk_target, + output: 'mutter-cogl-18.vapi' + ) + + clutter_target = custom_target('mutter-clutter-18', + command: [ + vapigen, + mutter_typelib_dir / 'Clutter-18.gir', + '--library=mutter-clutter-18', + '--pkg=graphene-gobject-1.0', + '--pkg=mutter-mtk-18', + '--pkg=mutter-cogl-18', + '--pkg=atk', + '--pkg=gio-2.0', + '--pkg=json-glib-1.0', + '--pkg=pango', + '--pkg=x11', + vapigen_args, + ], + depends: [ cogl_target, mtk_target ], + output: 'mutter-clutter-18.vapi' + ) + + libmutter_target = custom_target('libmutter-18', + command: [ + vapigen, + mutter_typelib_dir / 'Meta-18.gir', + '--library=libmutter-18', + '--pkg=graphene-gobject-1.0', + '--pkg=mutter-cogl-18', + '--pkg=mutter-clutter-18', + '--pkg=atk', + '--pkg=gio-2.0', + '--pkg=json-glib-1.0', + '--pkg=pango', + '--pkg=x11', + '--pkg=xfixes-4.0', + vapigen_args, + files('Meta-18-custom.vala') + ], + depends: [ cogl_target, clutter_target ], + output: 'libmutter-18.vapi' + ) +endif diff --git a/vapi/mutter-clutter-18.deps b/vapi/mutter-clutter-18.deps new file mode 100644 index 00000000..b3056877 --- /dev/null +++ b/vapi/mutter-clutter-18.deps @@ -0,0 +1,6 @@ +atk +cairo +pango +json-glib-1.0 +mutter-cogl-18 +graphene-gobject-1.0 diff --git a/vapi/mutter-clutter-18.vapi b/vapi/mutter-clutter-18.vapi new file mode 120000 index 00000000..ee388ea5 --- /dev/null +++ b/vapi/mutter-clutter-18.vapi @@ -0,0 +1 @@ +mutter-clutter-17.vapi \ No newline at end of file diff --git a/vapi/mutter-clutter.vapi b/vapi/mutter-clutter.vapi index 97dfb632..87fd485e 100644 --- a/vapi/mutter-clutter.vapi +++ b/vapi/mutter-clutter.vapi @@ -5142,10 +5142,18 @@ namespace Clutter { public virtual bool register_sequence (Clutter.Event event); #endif [NoWrapper] +#if HAS_MUTTER50 + public virtual void sequence_cancelled (Clutter.Sprite sprite); +#else public virtual void sequence_cancelled (Clutter.InputDevice device, Clutter.EventSequence sequence); +#endif #if HAS_MUTTER47 [NoWrapper] +#if HAS_MUTTER50 + public virtual int setup_sequence_relationship (Clutter.Action action_2, Clutter.Sprite sprite); +#else public virtual int setup_sequence_relationship (Clutter.Action action_2, Clutter.InputDevice device, Clutter.EventSequence sequence); +#endif #endif } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_actor_get_type ()")] @@ -5157,6 +5165,9 @@ namespace Clutter { public uint32 flags; [CCode (has_construct_function = false)] public Actor (); +#if HAS_MUTTER50 + public void add_accessible_state (Atk.StateType state); +#endif public void add_action (Clutter.Action action); public void add_action_full (string name, Clutter.EventPhase phase, Clutter.Action action); public void add_action_with_name (string name, Clutter.Action action); @@ -5226,6 +5237,9 @@ namespace Clutter { public void get_content_scaling_filters (out Clutter.ScalingFilter min_filter, out Clutter.ScalingFilter mag_filter); #if HAS_MUTTER47 public unowned Clutter.Context get_context (); +#endif +#if HAS_MUTTER50 + public Clutter.CursorType get_cursor_type (); #endif public uint get_easing_delay (); public uint get_easing_duration (); @@ -5395,6 +5409,9 @@ namespace Clutter { public void set_content_gravity (Clutter.ContentGravity gravity); public void set_content_repeat (Clutter.ContentRepeat repeat); public void set_content_scaling_filters (Clutter.ScalingFilter min_filter, Clutter.ScalingFilter mag_filter); +#if HAS_MUTTER50 + public void set_cursor_type (Clutter.CursorType cursor_type); +#endif public void set_easing_delay (uint msecs); public void set_easing_duration (uint msecs); public void set_easing_mode (Clutter.AnimationMode mode); @@ -5477,6 +5494,9 @@ namespace Clutter { public Clutter.ContentRepeat content_repeat { get; set; } #if HAS_MUTTER47 public Clutter.Context context { get; construct; } +#endif +#if HAS_MUTTER50 + public Clutter.CursorType cursor_type { get; set; } #endif [NoAccessorMethod] public Clutter.Effect effect { set; } @@ -5931,12 +5951,14 @@ namespace Clutter { public uint get_id (); #if HAS_MUTTER48 #if HAS_MUTTER49 +#if HAS_MUTTER50 [NoWrapper] public virtual void init_color_transform_key (Clutter.ColorState target_color_state, Clutter.ColorStateTransformFlags flags, Clutter.ColorTransformKey key); public virtual bool needs_mapping (Clutter.ColorState target_color_state); #else [NoWrapper] public virtual void init_color_transform_key (Clutter.ColorState target_color_state, Clutter.ColorTransformKey key); +#endif public void params_do_tone_mapping (Clutter.ColorState other_color_state, [CCode (array_length = false)] float[] data, int n_samples); #endif public virtual Clutter.EncodingRequiredFormat required_format (); @@ -6047,6 +6069,28 @@ namespace Clutter { [Compact] public class CrossingEvent : Clutter.Event { } +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_cursor_get_type ()")] + public abstract class Cursor : GLib.Object { + [CCode (has_construct_function = false)] + protected Cursor (); + [NoWrapper] + public virtual uint get_current_frame_time (); + [NoWrapper] + public virtual void invalidate (); + [NoWrapper] + public virtual bool is_animated (); + [NoWrapper] + public virtual void prepare_at (float best_scale, int x, int y); + [NoWrapper] + public virtual bool realize_texture (); + [NoWrapper] + public virtual void tick_frame (); + [NoAccessorMethod] + public Clutter.ColorState color_state { construct; } + public signal void texture_changed (); + } +#endif [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_deform_effect_get_type ()")] public abstract class DeformEffect : Clutter.OffscreenEffect { [CCode (has_construct_function = false)] @@ -6133,7 +6177,9 @@ namespace Clutter { public unowned Clutter.InputDevice get_device (); #endif public unowned Clutter.InputDeviceTool get_device_tool (); +#if !HAS_MUTTER50 public Clutter.InputDeviceType get_device_type (); +#endif public float get_distance (Clutter.Event target); public uint32 get_event_code (); public unowned Clutter.EventSequence get_event_sequence (); @@ -6260,6 +6306,9 @@ namespace Clutter { [Compact] public class Frame { public int64 get_count (); +#if HAS_MUTTER50 + public bool get_expected_presentation_time (int64 expected_presentation_time_us); +#endif #if HAS_MUTTER46 public bool get_frame_deadline (int64 frame_deadline_us); #else @@ -6295,6 +6344,9 @@ namespace Clutter { public void schedule_update_now (); #if HAS_MUTTER47 public void set_deadline_evasion (int64 deadline_evasion_us); +#if HAS_MUTTER50 + public void set_frame_sync_update_time (int64 update_time_us); +#endif public void set_mode (Clutter.FrameClockMode mode); #endif #if HAS_MUTTER49 @@ -6389,7 +6441,9 @@ namespace Clutter { public void activate (); #endif public void dismiss (); +#if !HAS_MUTTER50 public Clutter.GrabState get_seat_state (); +#endif #if HAS_MUTTER46 public bool is_revoked (); [NoAccessorMethod] @@ -6448,13 +6502,17 @@ namespace Clutter { public uint get_bus_type (); #endif public Clutter.InputCapabilities get_capabilities (); +#if !HAS_MUTTER50 public Clutter.InputMode get_device_mode (); +#endif public unowned string get_device_name (); public unowned string get_device_node (); public Clutter.InputDeviceType get_device_type (); public virtual bool get_dimensions (out uint width, out uint height); public virtual int get_group_n_modes (int group); +#if !HAS_MUTTER50 public bool get_has_cursor (); +#endif public int get_mode_switch_button_group (uint button); public int get_n_buttons (); #if HAS_MUTTER49 @@ -6481,10 +6539,14 @@ namespace Clutter { public uint bus_type { get; construct; } #endif public Clutter.InputCapabilities capabilities { get; construct; } +#if !HAS_MUTTER50 public Clutter.InputMode device_mode { get; construct; } +#endif public string device_node { get; construct; } public Clutter.InputDeviceType device_type { get; construct; } +#if !HAS_MUTTER50 public bool has_cursor { get; construct; } +#endif public int n_buttons { get; construct; } #if HAS_MUTTER49 public int n_dials { get; construct; } @@ -6649,6 +6711,10 @@ namespace Clutter { [CCode (has_construct_function = false)] protected Keymap (); public bool get_caps_lock_state (); +#if HAS_MUTTER50 + public unowned string? get_current_display_name (); + public unowned string? get_current_short_name (); +#endif #if HAS_MUTTER46 public virtual Clutter.TextDirection get_direction (); #else @@ -6849,6 +6915,9 @@ namespace Clutter { public Graphene.Point get_begin_centroid (); public Graphene.Point get_begin_centroid_abs (); public uint get_begin_threshold (); +#if HAS_MUTTER50 + public uint get_button (); +#endif public Graphene.Point get_centroid (); public Graphene.Point get_centroid_abs (); public Graphene.Vec2 get_delta (); @@ -6856,16 +6925,26 @@ namespace Clutter { public uint get_max_n_points (); public uint get_min_n_points (); public Clutter.PanAxis get_pan_axis (); +#if HAS_MUTTER50 + public uint get_required_button (); + public Clutter.ModifierType get_state (); +#endif public Graphene.Vec2 get_velocity (); public Graphene.Vec2 get_velocity_abs (); public void set_begin_threshold (uint begin_threshold); public void set_max_n_points (uint max_n_points); public void set_min_n_points (uint min_n_points); public void set_pan_axis (Clutter.PanAxis axis); +#if HAS_MUTTER50 + public void set_required_button (uint required_button); +#endif public uint begin_threshold { get; set; } public uint max_n_points { get; set; } public uint min_n_points { get; set; } public Clutter.PanAxis pan_axis { get; set; } +#if HAS_MUTTER50 + public uint required_button { get; set; } +#endif public signal void pan_update (); } #else @@ -7111,8 +7190,10 @@ namespace Clutter { #endif public void get_pointer_a11y_settings (Clutter.PointerA11ySettings settings); public bool get_touch_mode (); +#if !HAS_MUTTER50 [NoWrapper] public virtual Clutter.GrabState grab (uint32 time); +#endif #if HAS_MUTTER48 [NoWrapper] #endif @@ -7130,8 +7211,10 @@ namespace Clutter { #endif public void set_pointer_a11y_dwell_click_type (Clutter.PointerA11yDwellClickType click_type); public void set_pointer_a11y_settings (Clutter.PointerA11ySettings settings); +#if !HAS_MUTTER50 [NoWrapper] public virtual void ungrab (uint32 time); +#endif public void uninhibit_unfocus (); public virtual void warp_pointer (int x, int y); #if HAS_MUTTER47 @@ -7141,7 +7224,11 @@ namespace Clutter { public bool touch_mode { get; } public signal void device_added (Clutter.InputDevice object); public signal void device_removed (Clutter.InputDevice object); +#if HAS_MUTTER50 + public virtual signal void is_unfocus_inhibited_changed (); +#else public signal void is_unfocus_inhibited_changed (); +#endif public signal void kbd_a11y_flags_changed (uint settings_flags, uint changed_mask); public signal void kbd_a11y_mods_state_changed (uint latched_mask, uint locked_mask); public signal void ptr_a11y_dwell_click_type_changed (Clutter.PointerA11yDwellClickType click_type); @@ -7266,8 +7353,17 @@ namespace Clutter { [CCode (has_construct_function = false)] protected Sprite (); public Graphene.Point get_coords (); +#if HAS_MUTTER50 + public Clutter.SpriteRole get_role (); + [NoWrapper] + public virtual void update_cursor (Clutter.Cursor cursor); + public Clutter.SpriteRole role { get; construct; } + [NoAccessorMethod] + public Clutter.InputDevice sprite_device { owned get; construct; } +#else [NoAccessorMethod] public Clutter.InputDevice device { owned get; construct; } +#endif [NoAccessorMethod] public Clutter.EventSequence sequence { owned get; construct; } } @@ -8013,6 +8109,9 @@ namespace Clutter { public float min; public float max; public float @ref; +#if HAS_MUTTER50 + public float mastering_max; +#endif } #endif #if !HAS_MUTTER47 @@ -8391,6 +8490,49 @@ namespace Clutter { Y_AXIS, BOTH } +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_CURSOR_", type_id = "clutter_cursor_type_get_type ()")] + public enum CursorType { + INHERIT, + NONE, + DEFAULT, + CONTEXT_MENU, + HELP, + POINTER, + PROGRESS, + WAIT, + CELL, + CROSSHAIR, + TEXT, + VERTICAL_TEXT, + ALIAS, + COPY, + MOVE, + NO_DROP, + NOT_ALLOWED, + GRAB, + GRABBING, + E_RESIZE, + N_RESIZE, + NE_RESIZE, + NW_RESIZE, + S_RESIZE, + SE_RESIZE, + SW_RESIZE, + W_RESIZE, + EW_RESIZE, + NS_RESIZE, + NESW_RESIZE, + NWSE_RESIZE, + COL_RESIZE, + ROW_RESIZE, + ALL_SCROLL, + ZOOM_IN, + ZOOM_OUT, + DND_ASK, + ALL_RESIZE + } +#endif #if !HAS_MUTTER48 #if HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_CONTEXT_FLAG_", type_id = "clutter_context_flags_get_type ()")] @@ -8590,6 +8732,7 @@ namespace Clutter { BEFORE } #endif +#if !HAS_MUTTER50 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_GRAB_STATE_", type_id = "clutter_grab_state_get_type ()")] [Flags] public enum GrabState { @@ -8598,6 +8741,7 @@ namespace Clutter { KEYBOARD, ALL } +#endif [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_GRID_POSITION_", type_id = "clutter_grid_position_get_type ()")] public enum GridPosition { LEFT, @@ -8967,6 +9111,14 @@ namespace Clutter { BOTTOM, LEFT } +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_SPRITE_ROLE_", type_id = "clutter_sprite_role_get_type ()")] + public enum SpriteRole { + POINTER, + TABLET, + TOUCHPOINT + } +#endif #if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_COLOR_", type_id = "clutter_static_color_get_type ()")] public enum StaticColor { @@ -9022,6 +9174,7 @@ namespace Clutter { START, END } +#if !HAS_MUTTER50 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_SWIPE_DIRECTION_", type_id = "clutter_swipe_direction_get_type ()")] [Flags] public enum SwipeDirection { @@ -9030,6 +9183,7 @@ namespace Clutter { LEFT, RIGHT } +#endif [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_TEXT_DIRECTION_", type_id = "clutter_text_direction_get_type ()")] public enum TextDirection { DEFAULT, @@ -9051,11 +9205,17 @@ namespace Clutter { #if HAS_MUTTER47 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_TRANSFER_FUNCTION_", type_id = "clutter_transfer_function_get_type ()")] public enum TransferFunction { +#if !HAS_MUTTER50 DEFAULT, +#endif SRGB, PQ, #if HAS_MUTTER48 +#if HAS_MUTTER50 + BT1886, +#else BT709, +#endif LINEAR #else LINEAR; @@ -9131,6 +9291,14 @@ namespace Clutter { #endif [CCode (cheader_filename = "clutter/clutter.h", cname = "CLUTTER_PRIORITY_REDRAW")] public const int PRIORITY_REDRAW; +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "ActorBox.alloc")] + public static Clutter.ActorBox? actor_box_alloc (); + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "ActorBox.clamp_to_pixel")] + public static void actor_box_clamp_to_pixel (ref Clutter.ActorBox box); +#endif #if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h")] public static void cairo_clear (Cairo.Context cr); @@ -9140,12 +9308,27 @@ namespace Clutter { #if HAS_MUTTER48 [CCode (cheader_filename = "clutter/clutter.h")] public static void add_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags); +#endif +#if HAS_MUTTER50 + [Version (replacement = "Colorspace.to_primaries")] + public static unowned Clutter.Primaries? colorspace_to_primaries (Clutter.Colorspace colorspace); #endif [CCode (cheader_filename = "clutter/clutter.h")] public static void debug_set_max_render_time_constant (int max_render_time_constant_us); #if !HAS_MUTTER47 [CCode (cheader_filename = "clutter/clutter.h")] public static void disable_accessibility (); +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "Event.add_filter")] + public static uint event_add_filter (Clutter.Stage? stage, [CCode (delegate_target_pos = 2.2, destroy_notify_pos = 2.1)] owned Clutter.EventFilterFunc func); + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "Event.get")] + public static Clutter.Event event_get (); + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "Event.remove_filter")] + public static void event_remove_filter (uint id); #endif [CCode (cheader_filename = "clutter/clutter.h")] public static bool events_pending (); @@ -9177,6 +9360,11 @@ namespace Clutter { public static void keyval_convert_case (uint symbol, out uint lower, out uint upper); [CCode (cheader_filename = "clutter/clutter.h")] public static unowned string? keyval_name (uint keyval); +#if HAS_MUTTER50 + [CCode (cheader_filename = "clutter/clutter.h")] + [Version (replacement = "PipelineCapability.quark")] + public static GLib.Quark pipeline_capability_quark (); +#endif #if HAS_MUTTER48 [CCode (cheader_filename = "clutter/clutter.h")] public static void remove_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags); diff --git a/vapi/mutter-cogl-14.vapi b/vapi/mutter-cogl-14.vapi index fb26e857..fd78df6b 100644 --- a/vapi/mutter-cogl-14.vapi +++ b/vapi/mutter-cogl-14.vapi @@ -122,16 +122,24 @@ namespace Cogl { [CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_foreach_feature")] public void foreach_feature (Cogl.FeatureCallback callback); #endif +#if !HAS_MUTTER50 #if HAS_MUTTER49 public bool format_supports_upload (Cogl.PixelFormat format); #endif public void free_timestamp_query (owned Cogl.TimestampQuery query); +#endif public unowned Cogl.Display get_display (); +#if HAS_MUTTER50 + public unowned Cogl.Driver get_driver (); +#else public int64 get_gpu_time_ns (); +#endif #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_get_graphics_reset_status")] #endif +#if !HAS_MUTTER50 public Cogl.GraphicsResetStatus get_graphics_reset_status (); +#endif #if HAS_MUTTER48 public int get_latest_sync_fd (); #endif @@ -147,9 +155,13 @@ namespace Cogl { #if HAS_MUTTER47 public bool has_winsys_feature (Cogl.WinsysFeature feature); #endif +#if !HAS_MUTTER50 public bool is_hardware_accelerated (); +#endif public void set_named_pipeline (Cogl.PipelineKey key, Cogl.Pipeline? pipeline); +#if !HAS_MUTTER50 public int64 timestamp_query_get_time_ns (Cogl.TimestampQuery query); +#endif } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_display_get_type ()")] public sealed class Display : GLib.Object { @@ -193,6 +205,19 @@ namespace Cogl { public bool sync_read_end () throws GLib.Error; public bool sync_read_start () throws GLib.Error; } +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_driver_get_type ()")] + public abstract class Driver : GLib.Object { + [CCode (has_construct_function = false)] + protected Driver (); + public bool format_supports_upload (Cogl.PixelFormat format); + public Cogl.GraphicsResetStatus get_graphics_reset_status (); + public unowned string get_vendor (); + public bool has_feature (Cogl.FeatureID feature); + public bool is_hardware_accelerated (); + public void set_feature (Cogl.FeatureID feature, bool value); + } +#endif #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] [Compact] @@ -217,19 +242,28 @@ namespace Cogl { public int64 get_global_frame_counter (); #endif public bool get_is_symbolic (); +#if HAS_MUTTER50 + public int64 get_kms_ready_time_us (); +#endif public int64 get_presentation_time_us (); public float get_refresh_rate (); +#if !HAS_MUTTER50 public int64 get_rendering_duration_ns (); +#endif public uint get_sequence (); +#if !HAS_MUTTER50 #if HAS_MUTTER49 public int64 get_target_presentation_time_us (); #endif public int64 get_time_before_buffer_swap_us (); +#endif #if HAS_MUTTER49 public int64 get_view_frame_counter (); #endif +#if !HAS_MUTTER50 #if HAS_MUTTER47 public bool has_valid_gpu_rendering_duration (); +#endif #endif public bool is_hw_clock (); public bool is_vsync (); @@ -346,7 +380,11 @@ namespace Cogl { public IndexBuffer (Cogl.Context context, size_t bytes); } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_indices_get_type ()")] +#if HAS_MUTTER50 + public sealed class Indices : GLib.Object { +#else public class Indices : GLib.Object { +#endif [CCode (has_construct_function = false)] public Indices (Cogl.Context context, Cogl.IndicesType type, void* indices_data, int n_indices); #if !HAS_MUTTER48 @@ -400,6 +438,10 @@ namespace Cogl { public sealed class Offscreen : Cogl.Framebuffer { [CCode (has_construct_function = false)] protected Offscreen (); +#if HAS_MUTTER50 + [CCode (has_construct_function = false)] + public Offscreen.from_formats (Cogl.Context context, Cogl.PixelFormat formats, size_t n_formats, int width, int height) throws GLib.Error; +#endif public unowned Cogl.Texture get_texture (); [CCode (has_construct_function = false)] public Offscreen.with_texture (Cogl.Texture texture); @@ -443,6 +485,13 @@ namespace Cogl { public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info); #endif } +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_onscreen_egl_get_type ()")] + public class OnscreenEgl : Cogl.Onscreen { + [CCode (has_construct_function = false)] + protected OnscreenEgl (); + } +#endif #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_onscreen_dirty_closure_get_type ()")] [Compact] @@ -525,9 +574,15 @@ namespace Cogl { #endif public void set_uniform_1f (int uniform_location, float value); public void set_uniform_1i (int uniform_location, int value); +#if HAS_MUTTER50 + public void set_uniform_float (int uniform_location, int n_components, int count, [CCode (array_length = false)] float[] value); + public void set_uniform_int (int uniform_location, int n_components, int count, [CCode (array_length = false)] int[] value); + public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, [CCode (array_length = false)] float[] value); +#else public void set_uniform_float (int uniform_location, int n_components, int count, [CCode (array_length = false, array_null_terminated = false)] float[] value); public void set_uniform_int (int uniform_location, int n_components, int count, int value); public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, float value); +#endif public void set_user_program (Cogl.Program program); } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pixel_buffer_get_type ()")] @@ -624,9 +679,11 @@ namespace Cogl { public bool check_onscreen_template (Cogl.OnscreenTemplate onscreen_template) throws GLib.Error; #endif public bool connect () throws GLib.Error; +#if !HAS_MUTTER50 #if HAS_MUTTER49 public void* get_custom_winsys_data (); #endif +#endif #if !HAS_MUTTER47 public void foreach_output (Cogl.OutputCallback callback); #endif @@ -639,10 +696,16 @@ namespace Cogl { #if HAS_MUTTER47 public void* get_proc_address (string name); #endif -#if HAS_MUTTER49 +#if HAS_MUTTER50 + public unowned Cogl.Winsys get_winsys (); +#elif HAS_MUTTER49 public void* get_winsys (); #endif +#if HAS_MUTTER50 + public void* get_winsys_data (); +#else public Cogl.WinsysID get_winsys_id (); +#endif public bool is_dma_buf_supported (); #if HAS_MUTTER48 public bool is_implicit_drm_modifier (uint64 modifier); @@ -656,9 +719,16 @@ namespace Cogl { #if !HAS_MUTTER47 public void set_winsys_id (Cogl.WinsysID winsys_id); #endif +#if HAS_MUTTER50 + public void set_custom_winsys (Cogl.Winsys winsys); +#endif #if HAS_MUTTER49 public void set_driver (Cogl.DriverId driver); +#if HAS_MUTTER50 + public void set_winsys_data (void* winsys, GLib.DestroyNotify destroy); +#else public void set_winsys (void* winsys); +#endif #endif } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_scanout_get_type ()")] @@ -669,7 +739,11 @@ namespace Cogl { #else public Scanout (Cogl.ScanoutBuffer scanout_buffer); #endif +#if HAS_MUTTER50 + public bool copy_to_framebuffer (Cogl.Framebuffer framebuffer) throws GLib.Error; +#else public bool blit_to_framebuffer (Cogl.Framebuffer framebuffer, int x, int y) throws GLib.Error; +#endif public unowned Cogl.ScanoutBuffer get_buffer (); public void get_dst_rect (Mtk.Rectangle dst_rect); public void get_src_rect (Graphene.Rect rect); @@ -786,6 +860,9 @@ namespace Cogl { public Texture2D.from_bitmap (Cogl.Bitmap bitmap); [CCode (has_construct_function = false, type = "CoglTexture*")] public Texture2D.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data) throws GLib.Error; +#if HAS_MUTTER50 + public void set_auto_mipmap (bool value); +#endif [CCode (has_construct_function = false, type = "CoglTexture*")] public Texture2D.with_format (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format); [CCode (has_construct_function = false, type = "CoglTexture*")] @@ -804,10 +881,47 @@ namespace Cogl { [CCode (has_construct_function = false, type = "CoglTexture*")] public Texture2DSliced.with_size (Cogl.Context ctx, int width, int height, int max_waste); } +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_winsys_get_type ()")] + public abstract class Winsys : GLib.Object { + [CCode (has_construct_function = false)] + protected Winsys (); + [NoWrapper] + public virtual bool context_init (Cogl.Context context) throws GLib.Error; + [NoWrapper] + public virtual void display_destroy (Cogl.Display display); + [NoWrapper] + public virtual bool display_setup (Cogl.Display display) throws GLib.Error; + [NoWrapper] + public virtual int get_sync_fd (Cogl.Context ctx); + [NoWrapper] + public virtual void renderer_bind_api (Cogl.Renderer renderer); + [NoWrapper] + public virtual bool renderer_connect (Cogl.Renderer renderer) throws GLib.Error; + [NoWrapper] + public virtual uint64 renderer_get_implicit_drm_modifier (Cogl.Renderer renderer); + [NoWrapper] + public virtual bool renderer_is_dma_buf_supported (Cogl.Renderer renderer); + [NoWrapper] + public virtual void update_sync (Cogl.Context ctx); + [NoAccessorMethod] + public string name { owned get; construct; } + } + [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_winsys_egl_get_type ()")] + public abstract class WinsysEGL : Cogl.Winsys { + [CCode (has_construct_function = false)] + protected WinsysEGL (); + [NoWrapper] + public virtual void cleanup_context (Cogl.Display display); + [NoWrapper] + public virtual bool context_created (Cogl.Display display) throws GLib.Error; + } +#else [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] [Compact] public class TimestampQuery { } +#endif [CCode (cheader_filename = "cogl/cogl.h", type_cname = "CoglScanoutBufferInterface", type_id = "cogl_scanout_buffer_get_type ()")] public interface ScanoutBuffer : GLib.Object { public abstract int get_height (); @@ -877,6 +991,12 @@ namespace Cogl { public void set_test_function (Cogl.DepthTestFunction function); public void set_write_enabled (bool enable); } +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct DisplayEGL { + public void* platform; + } +#endif #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] public struct OnscreenDirtyInfo { @@ -904,6 +1024,14 @@ namespace Cogl { public float ty; public Cogl.Color color; } +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + public struct RendererEGL { + public Cogl.EGLWinsysFeature private_features; + public void* platform; + public bool needs_config; + } #endif [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] public struct VertexP2 { @@ -965,7 +1093,7 @@ namespace Cogl { public float s; public float t; } -#if !HAS_MUTTER47 +#if !HAS_MUTTER47 || HAS_MUTTER50 [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] public struct VertexP3T2C4 { public float x; @@ -1084,6 +1212,21 @@ namespace Cogl { SINGLE_PLANE, NOT_EXTERNAL_ONLY } +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_WINSYS_FEATURE_", has_type_id = false)] + [Flags] + public enum EGLWinsysFeature { + SWAP_REGION, + EGL_IMAGE_FROM_WAYLAND_BUFFER, + CREATE_CONTEXT, + BUFFER_AGE, + FENCE_SYNC, + SURFACELESS_CONTEXT, + CONTEXT_PRIORITY, + NO_CONFIG_CONTEXT, + NATIVE_FENCE_SYNC + } #endif [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_IMAGE_FLAG_", has_type_id = false)] [Flags] @@ -1109,19 +1252,60 @@ namespace Cogl { OGL_FEATURE_ID_TEXTURE_HALF_FLOAT, [CCode (cname = "COGL_FEATURE_ID_TEXTURE_NORM16")] OGL_FEATURE_ID_TEXTURE_NORM16, +#if !HAS_MUTTER50 [CCode (cname = "COGL_FEATURE_ID_BUFFER_AGE")] OGL_FEATURE_ID_BUFFER_AGE, +#endif [CCode (cname = "COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL")] OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL, [CCode (cname = "COGL_FEATURE_ID_BLIT_FRAMEBUFFER")] OGL_FEATURE_ID_BLIT_FRAMEBUFFER, -#if HAS_MUTTER47 +#if HAS_MUTTER47 && !HAS_MUTTER50 [CCode (cname = "COGL_FEATURE_ID_SYNC_FD")] OGL_FEATURE_ID_SYNC_FD, +#endif +#if HAS_MUTTER50 + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_2D_FROM_EGL_IMAGE")] + OGL_FEATURE_ID_TEXTURE_2D_FROM_EGL_IMAGE, + [CCode (cname = "COGL_FEATURE_ID_MESA_PACK_INVERT")] + OGL_FEATURE_ID_MESA_PACK_INVERT, + [CCode (cname = "COGL_FEATURE_ID_PBOS")] + OGL_FEATURE_ID_PBOS, + [CCode (cname = "COGL_FEATURE_ID_EXT_PACKED_DEPTH_STENCIL")] + OGL_FEATURE_ID_EXT_PACKED_DEPTH_STENCIL, + [CCode (cname = "COGL_FEATURE_ID_OES_PACKED_DEPTH_STENCIL")] + OGL_FEATURE_ID_OES_PACKED_DEPTH_STENCIL, + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_FORMAT_BGRA8888")] + OGL_FEATURE_ID_TEXTURE_FORMAT_BGRA8888, + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_FORMAT_SIZED_RGBA")] + OGL_FEATURE_ID_TEXTURE_FORMAT_SIZED_RGBA, + [CCode (cname = "COGL_FEATURE_ID_UNPACK_SUBIMAGE")] + OGL_FEATURE_ID_UNPACK_SUBIMAGE, + [CCode (cname = "COGL_FEATURE_ID_SAMPLER_OBJECTS")] + OGL_FEATURE_ID_SAMPLER_OBJECTS, + [CCode (cname = "COGL_FEATURE_ID_READ_PIXELS_ANY_STRIDE")] + OGL_FEATURE_ID_READ_PIXELS_ANY_STRIDE, + [CCode (cname = "COGL_FEATURE_ID_FORMAT_CONVERSION")] + OGL_FEATURE_ID_FORMAT_CONVERSION, + [CCode (cname = "COGL_FEATURE_ID_QUERY_FRAMEBUFFER_BITS")] + OGL_FEATURE_ID_QUERY_FRAMEBUFFER_BITS, + [CCode (cname = "COGL_FEATURE_ID_ALPHA_TEXTURES")] + OGL_FEATURE_ID_ALPHA_TEXTURES, + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_SWIZZLE")] + OGL_FEATURE_ID_TEXTURE_SWIZZLE, + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_MAX_LEVEL")] + OGL_FEATURE_ID_TEXTURE_MAX_LEVEL, + [CCode (cname = "COGL_FEATURE_ID_TEXTURE_LOD_BIAS")] + OGL_FEATURE_ID_TEXTURE_LOD_BIAS, + [CCode (cname = "COGL_FEATURE_ID_OES_EGL_SYNC")] + OGL_FEATURE_ID_OES_EGL_SYNC, + [CCode (cname = "COGL_FEATURE_ID_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH")] + OGL_FEATURE_ID_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH, #endif [CCode (cname = "COGL_FEATURE_ID_TIMESTAMP_QUERY")] OGL_FEATURE_ID_TIMESTAMP_QUERY } +#if !HAS_MUTTER50 #if HAS_MUTTER48 [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_FILTER_", type_id = "cogl_filter_return_get_type ()")] #else @@ -1131,6 +1315,7 @@ namespace Cogl { CONTINUE, REMOVE } +#endif [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_FRAME_EVENT_", has_type_id = false)] public enum FrameEvent { SYNC, @@ -1241,6 +1426,9 @@ namespace Cogl { RGBA_FP_32323232_PRE, R_16, RG_1616, +#if HAS_MUTTER50 + RGBX_16161616, +#endif RGBA_16161616, RGBA_16161616_PRE, DEPTH_16, @@ -1350,23 +1538,37 @@ namespace Cogl { CLOCKWISE, COUNTER_CLOCKWISE } +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ERROR_", has_type_id = false)] + public enum WinsysError { + INIT, + CREATE_CONTEXT, + CREATE_ONSCREEN, + MAKE_CURRENT + } +#endif #if HAS_MUTTER48 [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_FEATURE_", type_id = "cogl_winsys_feature_get_type ()")] #else [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_FEATURE_", has_type_id = false)] #endif public enum WinsysFeature { +#if !HAS_MUTTER50 VBLANK_COUNTER, VBLANK_WAIT, TEXTURE_FROM_PIXMAP, SWAP_BUFFERS_EVENT, +#endif SWAP_REGION, +#if !HAS_MUTTER50 SWAP_REGION_THROTTLE, SWAP_REGION_SYNCHRONIZED, +#endif BUFFER_AGE, SYNC_AND_COMPLETE_EVENT, N_FEATURES } +#if !HAS_MUTTER50 [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ID_", has_type_id = false)] public enum WinsysID { ANY, @@ -1375,6 +1577,7 @@ namespace Cogl { EGL_XLIB, CUSTOM } +#endif #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_BITMAP_ERROR_", has_type_id = false)] public errordomain BitmapError { @@ -1467,12 +1670,23 @@ namespace Cogl { #if HAS_MUTTER48 [CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)] public delegate void TextureForeachCallback (Cogl.Texture sub_texture, float sub_texture_coords, float meta_coords); +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_MAX_EGL_CONFIG_ATTRIBS")] + public const int MAX_EGL_CONFIG_ATTRIBS; #endif [CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_TEXTURE_MAX_WASTE")] public const int TEXTURE_MAX_WASTE; #if !HAS_MUTTER47 [CCode (cheader_filename = "cogl/cogl.h")] public static bool clutter_winsys_has_feature (Cogl.WinsysFeature feature); +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h")] + public static bool can_blit_between_formats (Cogl.PixelFormat src_format, Cogl.PixelFormat dst_format); + [CCode (cheader_filename = "cogl/cogl.h")] + [Version (replacement = "Color.from_string")] + public static bool color_from_string (out Cogl.Color color, string str); #endif [CCode (cheader_filename = "cogl/cogl.h")] [Version (replacement = "Color.init_from_hsl")] @@ -1500,8 +1714,10 @@ namespace Cogl { #else public static void graphene_matrix_project_point (Graphene.Matrix matrix, ref float x, ref float y, ref float z, ref float w); #endif +#if !HAS_MUTTER50 [CCode (cheader_filename = "cogl/cogl.h")] public static void graphene_matrix_project_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points); +#endif [CCode (cheader_filename = "cogl/cogl.h")] public static void graphene_matrix_transform_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points); [CCode (cheader_filename = "cogl/cogl.h")] @@ -1518,6 +1734,14 @@ namespace Cogl { public static void poll_renderer_dispatch (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds); [CCode (cheader_filename = "cogl/cogl.h")] public static int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds, int64 timeout); +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "cogl/cogl.h")] + [Version (replacement = "RendererError.quark")] + public static uint32 renderer_error_quark (); + [CCode (cheader_filename = "cogl/cogl.h")] + [Version (replacement = "ScanoutError.quark")] + public static GLib.Quark scanout_error_quark (); #endif [CCode (cheader_filename = "cogl/cogl.h")] public static void set_tracing_disabled_on_thread (void* data); diff --git a/vapi/mutter-cogl-18.deps b/vapi/mutter-cogl-18.deps new file mode 100644 index 00000000..8f69f28a --- /dev/null +++ b/vapi/mutter-cogl-18.deps @@ -0,0 +1,5 @@ +pango +glib-2.0 +gio-2.0 +mutter-mtk-18 +x11 diff --git a/vapi/mutter-cogl-18.vapi b/vapi/mutter-cogl-18.vapi new file mode 120000 index 00000000..dca44a1c --- /dev/null +++ b/vapi/mutter-cogl-18.vapi @@ -0,0 +1 @@ +mutter-cogl-17.vapi \ No newline at end of file diff --git a/vapi/mutter-mtk-13.vapi b/vapi/mutter-mtk-13.vapi index dc6416e2..97e13096 100644 --- a/vapi/mutter-mtk-13.vapi +++ b/vapi/mutter-mtk-13.vapi @@ -8,6 +8,15 @@ namespace Mtk { public class AnonymousFile { } #endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "mtk/mtk.h", has_type_id = false)] + [Compact] + public class DbusPidfd { + public void free (); + public pid_t get_pid (); + public int get_pidfd (); + } +#endif #if HAS_MUTTER46 [CCode (cheader_filename = "mtk/mtk.h", ref_function = "mtk_region_ref", type_id = "mtk_region_get_type ()", unref_function = "mtk_region_unref")] [Compact] @@ -20,6 +29,9 @@ namespace Mtk { public static Mtk.Region create_rectangle (Mtk.Rectangle rect); public static Mtk.Region create_rectangles (Mtk.Rectangle rects, int n_rects); public Mtk.Region crop_and_scale (Graphene.Rect src_rect, int dst_width, int dst_height); +#if HAS_MUTTER50 + public Mtk.Region downscale (int scale); +#endif public bool equal (Mtk.Region other); #if HAS_MUTTER48 public void get_box (int nth, int x1, int y1, int x2, int y2); @@ -163,7 +175,15 @@ namespace Mtk { #endif #if HAS_MUTTER49 [CCode (cheader_filename = "mtk/mtk.h")] +#if HAS_MUTTER50 + public static int64 extrapolate_next_interval_boundary (int64 boundary_us, int64 base_us, int64 interval_us); +#else public static int64 extrapolate_next_interval_boundary (int64 base_us, int64 interval_us); +#endif +#endif +#if HAS_MUTTER50 + [CCode (cheader_filename = "mtk/mtk.h")] + public static int64 find_nearest_interval_boundary (int64 boundary_us, int64 base_us, int64 interval_us); #endif [CCode (cheader_filename = "mtk/mtk.h")] [Version (replacement = "Rectangle.from_graphene_rect")] diff --git a/vapi/mutter-mtk-18.vapi b/vapi/mutter-mtk-18.vapi new file mode 120000 index 00000000..efd075ab --- /dev/null +++ b/vapi/mutter-mtk-18.vapi @@ -0,0 +1 @@ +mutter-mtk-17.vapi \ No newline at end of file