diff --git a/lib/Drawing/Canvas.vala b/lib/Drawing/Canvas.vala new file mode 100644 index 000000000..974e779dc --- /dev/null +++ b/lib/Drawing/Canvas.vala @@ -0,0 +1,164 @@ +/* + * Copyright 2024 elementary, Inc. (https://elementary.io) + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +#if HAS_MUTTER46 +public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content { + private int width = -1; + private int height = -1; + private float scale_factor = 1.0f; + + private Cogl.Texture? texture = null; + private Cogl.Bitmap? bitmap = null; + + private bool dirty = false; + + private void emit_draw () requires (width > 0 && height > 0) { + dirty = true; + int real_width = (int) Math.ceilf (width * scale_factor); + int real_height = (int) Math.ceilf (height * scale_factor); + if (bitmap == null) { + unowned Cogl.Context ctx = Clutter.get_default_backend ().get_cogl_context (); + bitmap = new Cogl.Bitmap.with_size (ctx, real_width, real_height, Cogl.PixelFormat.CAIRO_ARGB32_COMPAT); + } + + unowned Cogl.Buffer? buffer = bitmap.get_buffer (); + if (buffer == null) { + return; + } + + buffer.set_update_hint (Cogl.BufferUpdateHint.DYNAMIC); + void* data = buffer.map (Cogl.BufferAccess.READ_WRITE, Cogl.BufferMapHint.DISCARD); + Cairo.ImageSurface surface; + bool mapped_buffer; + if (data != null) { + var bitmap_stride = bitmap.get_rowstride (); + surface = new Cairo.ImageSurface.for_data ((uchar[]) data, Cairo.Format.ARGB32, real_width, real_height, bitmap_stride); + mapped_buffer = true; + } else { + surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, real_width, real_height); + mapped_buffer = false; + } + + surface.set_device_scale (scale_factor, scale_factor); + var cr = new Cairo.Context (surface); + draw ((owned) cr, width, height, scale_factor); + + if (mapped_buffer) { + buffer.unmap (); + } else { + int size = surface.get_stride () * height; + buffer.set_data (0, surface.get_data (), size); + } + } + + public bool get_preferred_size (out float out_width, out float out_height) { + if (width < 0 || width < 0) { + out_width = 0; + out_height = 0; + return false; + } + + out_width = Math.ceilf (width * scale_factor); + out_height = Math.ceilf (height * scale_factor); + + return true; + } + + public void invalidate () { + if (width < 0 || height < 0) { + return; + } + + emit_draw (); + } + + public void invalidate_size () { } + + public void paint_content (Clutter.Actor actor, Clutter.PaintNode root, Clutter.PaintContext paint_context) { + if (bitmap == null) { + return; + } + + if (dirty) { + texture = null; + } + + if (texture == null) { + texture = new Cogl.Texture2D.from_bitmap (bitmap); + } + + if (texture == null) { + return; + } + + var node = actor.create_texture_paint_node (texture); + root.add_child (node); + + dirty = false; + } + + public void set_size (int new_width, int new_height) requires (new_width >= -1 && new_height >= -1) { + if (new_width == width && new_height == height) { + return; + } + + width = new_width; + height = new_height; + + invalidate (); + } + + public void set_scale_factor (float new_scale_factor) requires (new_scale_factor > 0.0f) { + if (new_scale_factor != scale_factor) { + scale_factor = new_scale_factor; + + invalidate (); + } + } + + + public virtual signal void draw (Cairo.Context cr, int width, int height, float scale_factor); +} +#else +public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content { + public Clutter.Canvas canvas; + + construct { + canvas = new Clutter.Canvas (); + canvas.draw.connect (on_draw); + } + + public bool get_preferred_size (out float out_width, out float out_height) { + return canvas.get_preferred_size (out out_width, out out_height); + } + + public void invalidate () { + canvas.invalidate (); + } + + public void invalidate_size () { + canvas.invalidate_size (); + } + + public void paint_content (Clutter.Actor actor, Clutter.PaintNode root, Clutter.PaintContext paint_context) { + canvas.paint_content (actor, root, paint_context); + } + + public void set_size (int new_width, int new_height) requires (new_width >= -1 && new_height >= -1) { + canvas.set_size (new_width, new_height); + } + + public void set_scale_factor (float new_scale_factor) requires (new_scale_factor > 0.0f) { + canvas.set_scale_factor (new_scale_factor); + } + + private bool on_draw (Cairo.Context cr, int width, int height) { + draw (cr, width, height, canvas.get_scale_factor ()); + return true; + } + + public virtual signal void draw (Cairo.Context cr, int width, int height, float scale_factor); +} +#endif diff --git a/lib/Utils.vala b/lib/Utils.vala index 7c22b7465..9a6570627 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -117,7 +117,11 @@ namespace Gala { } } +#if HAS_MUTTER46 + unowned Meta.Group group = window.x11_get_group (); +#else unowned Meta.Group group = window.get_group (); +#endif if (group != null) { var group_windows = group.list_windows (); group_windows.foreach ((window) => { diff --git a/lib/meson.build b/lib/meson.build index 8e4f5608a..8fe75c1e1 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -7,6 +7,7 @@ gala_lib_sources = files( 'Constants.vala', 'DragDropAction.vala', 'Drawing/BufferSurface.vala', + 'Drawing/Canvas.vala', 'Drawing/Color.vala', 'Drawing/Utilities.vala', 'Plugin.vala', diff --git a/plugins/pip/SelectionArea.vala b/plugins/pip/SelectionArea.vala index ba666f39a..4c1d2623c 100644 --- a/plugins/pip/SelectionArea.vala +++ b/plugins/pip/SelectionArea.vala @@ -43,12 +43,10 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor { width = screen_width; height = screen_height; - var canvas = new Clutter.Canvas (); + var canvas = new Gala.Drawing.Canvas (); canvas.set_size (screen_width, screen_height); canvas.draw.connect (draw_area); set_content (canvas); - - canvas.invalidate (); } #if HAS_MUTTER45 @@ -159,7 +157,7 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor { height = (start_point.y - end_point.y).abs (); } - private bool draw_area (Cairo.Context ctx) { + private void draw_area (Cairo.Context ctx, int width, int height, float scale_factor) { ctx.save (); ctx.set_operator (Cairo.Operator.CLEAR); @@ -168,7 +166,7 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor { ctx.restore (); if (!dragging) { - return true; + return; } int x, y, w, h; @@ -182,7 +180,5 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor { ctx.set_source_rgb (0.7, 0.7, 0.7); ctx.set_line_width (1.0); ctx.stroke (); - - return true; } } diff --git a/src/Dialogs.vala b/src/Dialogs.vala index 4df78b6af..2f3826744 100644 --- a/src/Dialogs.vala +++ b/src/Dialogs.vala @@ -73,8 +73,14 @@ namespace Gala { if (parent != null) { if (parent.get_client_type () == Meta.WindowClientType.X11) { - //TODO: wayland support +#if HAS_MUTTER46 + unowned Meta.Display display = parent.get_display (); + unowned Meta.X11Display x11display = display.get_x11_display (); + parent_handler = "x11:%x".printf ((uint) x11display.lookup_xwindow (parent)); +#else parent_handler = "x11:%x".printf ((uint) parent.get_xwindow ()); +#endif + //TODO: wayland support } app_id = parent.get_sandboxed_app_id () ?? ""; diff --git a/src/KeyboardManager.vala b/src/KeyboardManager.vala index f1ddae91f..3eea27b3a 100644 --- a/src/KeyboardManager.vala +++ b/src/KeyboardManager.vala @@ -51,7 +51,11 @@ public class Gala.KeyboardManager : Object { [CCode (instance_pos = -1)] public static bool handle_modifiers_accelerator_activated (Meta.Display display, bool backward) { +#if HAS_MUTTER46 + display.get_compositor ().backend.ungrab_keyboard (display.get_current_time ()); +#else display.ungrab_keyboard (display.get_current_time ()); +#endif var sources = settings.get_value ("sources"); if (!sources.is_of_type (sources_variant_type)) { @@ -116,7 +120,12 @@ public class Gala.KeyboardManager : Object { var variant = string.joinv (",", variants); var options = string.joinv (",", xkb_options); +#if HAS_MUTTER46 + //TODO: add model support + display.get_context ().get_backend ().set_keymap (layout, variant, options, ""); +#else display.get_context ().get_backend ().set_keymap (layout, variant, options); +#endif } else if (key == "current") { display.get_context ().get_backend ().lock_layout_group (settings.get_uint ("current")); } diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala index 072899244..fd85cbabd 100644 --- a/src/ScreenshotManager.vala +++ b/src/ScreenshotManager.vala @@ -65,7 +65,11 @@ namespace Gala { var flash_actor = new Clutter.Actor (); flash_actor.set_size (width, height); flash_actor.set_position (x, y); +#if HAS_MUTTER46 + flash_actor.set_background_color (Clutter.Color.from_pixel (0xffffffffu)); +#else flash_actor.set_background_color (Clutter.Color.get_static (Clutter.StaticColor.WHITE)); +#endif flash_actor.set_opacity (0); flash_actor.transitions_completed.connect ((actor) => { wm.ui_group.remove_child (actor); diff --git a/src/Widgets/IconGroup.vala b/src/Widgets/IconGroup.vala index 51d6ba93e..1741d5e58 100644 --- a/src/Widgets/IconGroup.vala +++ b/src/Widgets/IconGroup.vala @@ -47,7 +47,7 @@ namespace Gala { set { if (value != _scale_factor) { _scale_factor = value; - resize_canvas (); + update_scale_factor (value); } } } @@ -62,8 +62,10 @@ namespace Gala { construct { reactive = true; - var canvas = new Clutter.Canvas (); + var canvas = new Gala.Drawing.Canvas (); canvas.draw.connect (draw); + canvas.set_size (SIZE, SIZE); + canvas.set_scale_factor (scale_factor); content = canvas; drag_action = new DragDropAction (DragDropActionType.SOURCE | DragDropActionType.DESTINATION, "multitaskingview-window"); @@ -80,8 +82,6 @@ namespace Gala { add_child (icon_container); - resize_canvas (); - #if HAS_MUTTER46 icon_container.child_removed.connect_after (redraw); #else @@ -97,13 +97,15 @@ namespace Gala { #endif } - private bool resize_canvas () { - var size = InternalUtils.scale_to_int (SIZE, scale_factor); + private void update_scale_factor (float new_scale) { + var size = InternalUtils.scale_to_int (SIZE, new_scale); width = size; height = size; - return ((Clutter.Canvas) content).set_size (size, size); + if (content != null) { + ((Gala.Drawing.Canvas) content).set_scale_factor (new_scale); + } } /** @@ -206,16 +208,14 @@ namespace Gala { * Trigger a redraw */ public void redraw () { - if (!resize_canvas ()) { - content.invalidate (); - } + content.invalidate (); } /** * Draw the background or plus sign and do layouting. We won't lose performance here * by relayouting in the same function, as it's only ever called when we invalidate it. */ - private bool draw (Cairo.Context cr) { + private void draw (Cairo.Context cr, int width, int height, float scale_factor) { clear_effects (); cr.set_operator (Cairo.Operator.CLEAR); cr.paint (); @@ -228,7 +228,7 @@ namespace Gala { var icon = (WindowIconActor) icon_container.get_child_at_index (0); icon.place (0, 0, 64, scale_factor); - return false; + return; } // more than one => we need a folder @@ -236,8 +236,8 @@ namespace Gala { cr, 0, 0, - (int) width, - (int) height, + width, + height, InternalUtils.scale_to_int (5, scale_factor) ); @@ -289,7 +289,7 @@ namespace Gala { if (n_windows < 1) { if (!Meta.Prefs.get_dynamic_workspaces () || workspace_index != manager.get_n_workspaces () - 1) - return false; + return; var buffer = new Drawing.BufferSurface (scaled_size, scaled_size); var offset = scaled_size / 2 - InternalUtils.scale_to_int (PLUS_WIDTH, scale_factor) / 2; @@ -330,7 +330,7 @@ namespace Gala { cr.set_source_surface (buffer.surface, 0, 0); cr.paint (); - return false; + return; } int size; @@ -345,10 +345,10 @@ namespace Gala { int spacing = InternalUtils.scale_to_int (6, scale_factor); - var width = columns * InternalUtils.scale_to_int (size, scale_factor) + (columns - 1) * spacing; - var height = rows * InternalUtils.scale_to_int (size, scale_factor) + (rows - 1) * spacing; - var x_offset = scaled_size / 2 - width / 2; - var y_offset = scaled_size / 2 - height / 2; + var f_width = columns * InternalUtils.scale_to_int (size, scale_factor) + (columns - 1) * spacing; + var f_height = rows * InternalUtils.scale_to_int (size, scale_factor) + (rows - 1) * spacing; + var x_offset = scaled_size / 2 - f_width / 2; + var y_offset = scaled_size / 2 - f_height / 2; var show_ellipsis = false; var n_shown_windows = n_windows; @@ -390,8 +390,6 @@ namespace Gala { y += InternalUtils.scale_to_int (size, scale_factor) + spacing; } } - - return false; } private Clutter.Actor? drag_begin (float click_x, float click_y) { diff --git a/src/Widgets/SelectionArea.vala b/src/Widgets/SelectionArea.vala index 7e3f3ca1f..a8244fc15 100644 --- a/src/Widgets/SelectionArea.vala +++ b/src/Widgets/SelectionArea.vala @@ -44,12 +44,10 @@ namespace Gala { width = screen_width; height = screen_height; - var canvas = new Clutter.Canvas (); + var canvas = new Gala.Drawing.Canvas (); canvas.set_size (screen_width, screen_height); canvas.draw.connect (draw_area); set_content (canvas); - - canvas.invalidate (); } #if HAS_MUTTER45 @@ -155,7 +153,7 @@ namespace Gala { }.expand (end_point); } - private bool draw_area (Cairo.Context ctx) { + private void draw_area (Cairo.Context ctx, int width, int height, float scale_factor) { ctx.save (); ctx.set_operator (Cairo.Operator.CLEAR); @@ -164,7 +162,7 @@ namespace Gala { ctx.restore (); if (!dragging) { - return true; + return; } ctx.translate (0.5, 0.5); @@ -178,8 +176,6 @@ namespace Gala { ctx.set_source_rgb (0.7, 0.7, 0.7); ctx.set_line_width (1.0); ctx.stroke (); - - return true; } } } diff --git a/src/Widgets/Tooltip.vala b/src/Widgets/Tooltip.vala index 9eb6ecfb0..e32811f71 100644 --- a/src/Widgets/Tooltip.vala +++ b/src/Widgets/Tooltip.vala @@ -15,7 +15,7 @@ public class Gala.Tooltip : Clutter.Actor { /** * Canvas to draw the Tooltip background. */ - private Clutter.Canvas background_canvas; + private Gala.Drawing.Canvas background_canvas; /** * Actor to display the Tooltip text. @@ -38,7 +38,7 @@ public class Gala.Tooltip : Clutter.Actor { text = ""; max_width = 200; - background_canvas = new Clutter.Canvas (); + background_canvas = new Gala.Drawing.Canvas (); background_canvas.draw.connect (draw_background); content = background_canvas; @@ -121,12 +121,9 @@ public class Gala.Tooltip : Clutter.Actor { width = text_actor.width + padding.left + padding.right; height = text_actor.height + padding.top + padding.bottom; background_canvas.set_size ((int) width, (int) height); - - // And paint the background - background_canvas.invalidate (); } - private static bool draw_background (Cairo.Context ctx, int width, int height) { + private void draw_background (Cairo.Context ctx, int width, int height, float scale_factor) { if (style_context == null) { create_gtk_objects (); } @@ -141,7 +138,5 @@ public class Gala.Tooltip : Clutter.Actor { style_context.render_background (ctx, 0, 0, width, height); ctx.restore (); - - return false; } } diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala index 01b0e3c52..6b97b28d3 100644 --- a/src/Widgets/WindowClone.vala +++ b/src/Widgets/WindowClone.vala @@ -870,10 +870,10 @@ public class Gala.WindowClone : Clutter.Actor { private static int border_radius = -1; private const double COLOR_OPACITY = 0.8; - private Clutter.Canvas background_canvas; + private Gala.Drawing.Canvas background_canvas; construct { - background_canvas = new Clutter.Canvas (); + background_canvas = new Gala.Drawing.Canvas (); background_canvas.draw.connect (draw_background); content = background_canvas; @@ -899,13 +899,13 @@ public class Gala.WindowClone : Clutter.Actor { background_canvas.invalidate (); } - private bool draw_background (Cairo.Context cr, int width, int height) { + private void draw_background (Cairo.Context cr, int width, int height, float scale_factor) { if (border_radius == -1) { create_gtk_objects (); } if (!visible || opacity == 0) { - return Clutter.EVENT_PROPAGATE; + return; } var color = InternalUtils.get_theme_accent_color (); @@ -918,8 +918,6 @@ public class Gala.WindowClone : Clutter.Actor { Drawing.Utilities.cairo_rounded_rectangle (cr, 0, 0, width, height, border_radius); cr.set_source_rgba (color.red, color.green, color.blue, COLOR_OPACITY); cr.fill (); - - return Clutter.EVENT_PROPAGATE; } public override void allocate (Clutter.ActorBox box) { diff --git a/src/Widgets/WindowSwitcher/WindowSwitcher.vala b/src/Widgets/WindowSwitcher/WindowSwitcher.vala index 102ddc202..c80fccf18 100644 --- a/src/Widgets/WindowSwitcher/WindowSwitcher.vala +++ b/src/Widgets/WindowSwitcher/WindowSwitcher.vala @@ -25,7 +25,7 @@ public class Gala.WindowSwitcher : Clutter.Actor { private int modifier_mask; private Gala.ModalProxy modal_proxy = null; private Granite.Settings granite_settings; - private Clutter.Canvas canvas; + private Gala.Drawing.Canvas canvas; private Clutter.Actor container; private Clutter.Text caption; @@ -68,8 +68,8 @@ public class Gala.WindowSwitcher : Clutter.Actor { unowned var display = wm.get_display (); scaling_factor = display.get_monitor_scale (display.get_current_monitor ()); - canvas = new Clutter.Canvas (); - canvas.scale_factor = scaling_factor; + canvas = new Gala.Drawing.Canvas (); + canvas.set_scale_factor (scaling_factor); set_content (canvas); opacity = 0; @@ -100,7 +100,7 @@ public class Gala.WindowSwitcher : Clutter.Actor { var cur_scale = display.get_monitor_scale (display.get_current_monitor ()); if (cur_scale != scaling_factor) { scaling_factor = cur_scale; - canvas.scale_factor = scaling_factor; + canvas.set_scale_factor (scaling_factor); effect.scale_factor = scaling_factor; create_components (); } @@ -109,7 +109,7 @@ public class Gala.WindowSwitcher : Clutter.Actor { canvas.draw.connect (draw); } - private bool draw (Cairo.Context ctx, int width, int height) { + private void draw (Cairo.Context ctx, int width, int height, float scale_factor) { if (style_context == null) { // gtk is not initialized yet create_gtk_objects (); } @@ -133,8 +133,6 @@ public class Gala.WindowSwitcher : Clutter.Actor { style_context.render_background (ctx, 0, 0, width, height); style_context.render_frame (ctx, 0, 0, width, height); ctx.restore (); - - return true; } private void create_components () { @@ -144,7 +142,11 @@ public class Gala.WindowSwitcher : Clutter.Actor { } var margin = InternalUtils.scale_to_int (WRAPPER_PADDING, scaling_factor); +#if HAS_MUTTER46 + var layout = new Clutter.FlowLayout (Clutter.Orientation.HORIZONTAL); +#else var layout = new Clutter.FlowLayout (Clutter.FlowOrientation.HORIZONTAL); +#endif container = new Clutter.Actor () { reactive = true, layout_manager = layout, @@ -372,7 +374,6 @@ public class Gala.WindowSwitcher : Clutter.Actor { var switcher_height = (int) (nat_height + caption.height / 2 - container.margin_bottom + WRAPPER_PADDING * 3 * scaling_factor); set_size ((int) nat_width, switcher_height); canvas.set_size ((int) nat_width, switcher_height); - canvas.invalidate (); // container width might have changed, so we must update caption width too update_caption_text (); diff --git a/src/Widgets/WindowSwitcher/WindowSwitcherIcon.vala b/src/Widgets/WindowSwitcher/WindowSwitcherIcon.vala index 7191ceeaa..99ddbe3d6 100644 --- a/src/Widgets/WindowSwitcher/WindowSwitcherIcon.vala +++ b/src/Widgets/WindowSwitcher/WindowSwitcherIcon.vala @@ -9,7 +9,7 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor { public Meta.Window window { get; construct; } private WindowIcon icon; - private Clutter.Canvas canvas; + private Gala.Drawing.Canvas canvas; private bool _selected = false; public bool selected { @@ -29,10 +29,9 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor { } set { _scale_factor = value; - canvas.scale_factor = _scale_factor; + canvas.set_scale_factor (_scale_factor); update_size (); - canvas.invalidate (); } } @@ -43,8 +42,12 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor { icon.add_constraint (new Clutter.AlignConstraint (this, Clutter.AlignAxis.BOTH, 0.5f)); add_child (icon); - canvas = new Clutter.Canvas (); + canvas = new Gala.Drawing.Canvas (); canvas.draw.connect (draw_background); + canvas.set_size ( + WindowSwitcher.ICON_SIZE + WindowSwitcher.WRAPPER_PADDING * 2, + WindowSwitcher.ICON_SIZE + WindowSwitcher.WRAPPER_PADDING * 2 + ); set_content (canvas); reactive = true; @@ -58,10 +61,9 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor { scale_factor ); set_size (indicator_size, indicator_size); - canvas.set_size (indicator_size, indicator_size); } - private bool draw_background (Cairo.Context ctx, int width, int height) { + private void draw_background (Cairo.Context ctx, int width, int height, float scale_factor) { ctx.save (); ctx.set_operator (Cairo.Operator.CLEAR); ctx.paint (); @@ -84,7 +86,5 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor { ctx.restore (); } - - return true; } } diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 497201676..a11b78d6f 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -691,9 +691,21 @@ namespace Gala { uint fade_out_duration = 900U; double[] op_keyframes = { 0.1, 0.9 }; GLib.Value[] opacity = { 20U, 20U }; +#if HAS_MUTTER46 + unowned Meta.Display display = get_display (); + unowned Meta.X11Display x11display = display.get_x11_display (); + var bottom_xwin = x11display.lookup_xwindow (bottom_window); +#else + var bottom_xwin = bottom_window.get_xwindow (); +#endif workspace.list_windows ().@foreach ((window) => { - if (window.get_xwindow () == bottom_window.get_xwindow () +#if HAS_MUTTER46 + var xwin = x11display.lookup_xwindow (window); +#else + var xwin = window.get_xwindow (); +#endif + if (xwin == bottom_xwin || !InternalUtils.get_window_is_normal (window) || window.minimized) { return; diff --git a/src/WindowTracker.vala b/src/WindowTracker.vala index 787a136fc..7e51cebaf 100644 --- a/src/WindowTracker.vala +++ b/src/WindowTracker.vala @@ -170,7 +170,11 @@ public class Gala.WindowTracker : GLib.Object { } private unowned Gala.App? get_app_from_window_group (Meta.Window window) { +#if HAS_MUTTER46 + unowned Meta.Group? group = window.x11_get_group (); +#else unowned Meta.Group? group = window.get_group (); +#endif if (group == null) { return null; } diff --git a/vapi/Clutter-14.metadata b/vapi/Clutter-14.metadata index 2555ce73a..21cb052e1 100644 --- a/vapi/Clutter-14.metadata +++ b/vapi/Clutter-14.metadata @@ -10,8 +10,6 @@ Perspective struct Actor .apply_transform.matrix ref .get_abs_allocation_vertices.verts out=false -Canvas - .new symbol_type="constructor" Event.type#method name="get_type" Image .new symbol_type="constructor" @@ -77,9 +75,6 @@ ActorBox Margin .new skip -// Struct return values -color_get_static nullable - // Upstream Event .get_position.position out diff --git a/vapi/Cogl-14-custom.vala b/vapi/Cogl-14-custom.vala index cff30cc3e..236d4045a 100644 --- a/vapi/Cogl-14-custom.vala +++ b/vapi/Cogl-14-custom.vala @@ -131,4 +131,8 @@ namespace Cogl { public uint8 b; public uint8 a; } + [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-14.metadata b/vapi/Cogl-14.metadata index 1987d1f19..2425ef030 100644 --- a/vapi/Cogl-14.metadata +++ b/vapi/Cogl-14.metadata @@ -8,6 +8,10 @@ color_equal skip Context.free_timestamp_query.query owned +Bitmap.* skip=false +Bitmap.new_for_data.data type="owned uint8[]" +Bitmap.get_buffer type="unowned Cogl.Buffer?" + Texture .get_data.data type="uint8[]" .set_data.data type="uint8[]" @@ -47,6 +51,3 @@ blit_framebuffer parent="Cogl.Framebuffer" symbol_type="method" instance_idx=0 n Onscreen .add_dirty_callback unowned .add_frame_callback unowned - .queue_damage_region.rectangles array array_length_idx=1 - .swap_buffers_with_damage.rectangles array array_length_idx=1 - .swap_region.rectangles array array_length_idx=1 diff --git a/vapi/Meta-14.metadata b/vapi/Meta-14.metadata index dd4338262..5a09a2748 100644 --- a/vapi/Meta-14.metadata +++ b/vapi/Meta-14.metadata @@ -19,7 +19,6 @@ BarrierFlags cheader_filename="meta/barrier.h" ButtonFunction cheader_filename="meta/common.h" ButtonLayout cheader_filename="meta/common.h" Compositor cheader_filename="meta/compositor.h" -get_feedback_group_for_display parent="Meta.Display" symbol_type="method" name="get_feedback_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h" get_stage_for_display parent="Meta.Display" symbol_type="method" name="get_stage" instance_idx=0 cheader_filename="meta/compositor-mutter.h" get_top_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_top_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h" get_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h" @@ -41,6 +40,7 @@ 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" @@ -107,7 +107,6 @@ 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" -VirtualModifier cheader_filename="meta/common.h" WaylandClient cheader_filename="meta/meta-wayland-client.h" WaylandCompositor cheader_filename="meta/meta-wayland-compositor.h" Workspace cheader_filename="meta/workspace.h" @@ -175,10 +174,6 @@ unsigned_long_hash.v type="ulong?" warning parent="Meta.Util" cheader_filename="meta/util.h" create_context parent="Meta.Context" name="new" symbol_type="constructor" cheader_filename="meta/meta-context.h" -x11_error_trap_pop parent="Meta.X11Display" symbol_type="method" name="error_trap_pop" instance_idx=0 cheader_filename="meta/meta-x11-errors.h" -x11_error_trap_pop_with_return parent="Meta.X11Display" symbol_type="method" name="error_trap_pop_with_return" instance_idx=0 cheader_filename="meta/meta-x11-errors.h" -x11_error_trap_push parent="Meta.X11Display" symbol_type="method" name="error_trap_push" instance_idx=0 cheader_filename="meta/meta-x11-errors.h" - BackgroundActor sealed BackgroundContent sealed BackgroundImage sealed diff --git a/vapi/Mtk-14.metadata b/vapi/Mtk-14.metadata index a8b51c6c0..95a62dde6 100644 --- a/vapi/Mtk-14.metadata +++ b/vapi/Mtk-14.metadata @@ -1 +1,3 @@ Rectangle struct +RECTANGLE_MAX_STACK_RECTS parent="Mtk.Rectangle" name="MAX_STACK_RECTS" +REGION_BUILDER_MAX_LEVELS parent="Mtk.RegionBuilder" name="MAX_LEVELS" diff --git a/vapi/libmutter.vapi b/vapi/libmutter.vapi index 21da1b919..1c7262650 100644 --- a/vapi/libmutter.vapi +++ b/vapi/libmutter.vapi @@ -146,6 +146,9 @@ namespace Meta { public abstract class Backend : GLib.Object, GLib.Initable { [CCode (has_construct_function = false)] protected Backend (); +#if HAS_MUTTER46 + public void freeze_keyboard (uint32 timestamp); +#endif #if !HAS_MUTTER44 [CCode (cheader_filename = "meta/meta-backend.h", cname = "meta_get_backend")] public static unowned Meta.Backend get_backend (); @@ -163,7 +166,13 @@ namespace Meta { public bool is_headless (); public bool is_rendering_hardware_accelerated (); public void lock_layout_group (uint idx); +#if HAS_MUTTER46 + public void set_keymap (string layouts, string variants, string options, string model); + public void unfreeze_keyboard (uint32 timestamp); + public void ungrab_keyboard (uint32 timestamp); +#else public void set_keymap (string layouts, string variants, string options); +#endif #if HAS_MUTTER43 public Meta.BackendCapabilities capabilities { get; } #endif @@ -422,8 +431,8 @@ namespace Meta { #if !HAS_MUTTER46 [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_focus_stage_window")] public void focus_stage_window (uint32 timestamp); -#endif public void freeze_keyboard (uint32 timestamp); +#endif public unowned Meta.Compositor get_compositor (); public Clutter.ModifierType get_compositor_modifiers (); public unowned Meta.Context get_context (); @@ -498,9 +507,13 @@ namespace Meta { public bool stage_is_focused (); #endif public bool supports_extended_barriers (); +#if !HAS_MUTTER46 public void unfreeze_keyboard (uint32 timestamp); +#endif public bool ungrab_accelerator (uint action_id); +#if !HAS_MUTTER46 public void ungrab_keyboard (uint32 timestamp); +#endif public void unset_input_focus (uint32 timestamp); public bool xserver_time_is_before (uint32 time1, uint32 time2); public Clutter.ModifierType compositor_modifiers { get; } @@ -966,7 +979,9 @@ namespace Meta { #else public Meta.Rectangle client_rect_to_frame_rect (Meta.Rectangle client_rect); #endif +#if !HAS_MUTTER46 public void compute_group (); +#endif public void @delete (uint32 timestamp); public unowned Meta.Window find_root_ancestor (); public void focus (uint32 timestamp); @@ -979,7 +994,9 @@ namespace Meta { public Meta.Rectangle frame_rect_to_client_rect (Meta.Rectangle frame_rect); public Meta.Rectangle get_buffer_rect (); #endif +#if !HAS_MUTTER46 public unowned string? get_client_machine (); +#endif public Meta.WindowClientType get_client_type (); public unowned GLib.Object get_compositor_private (); public unowned string get_description (); @@ -996,7 +1013,9 @@ namespace Meta { public Meta.Rectangle get_frame_rect (); #endif public Meta.FrameType get_frame_type (); +#if !HAS_MUTTER46 public unowned Meta.Group? get_group (); +#endif public unowned string? get_gtk_app_menu_object_path (); public unowned string? get_gtk_application_id (); public unowned string? get_gtk_application_object_path (); @@ -1036,8 +1055,10 @@ namespace Meta { public Meta.Rectangle get_work_area_for_monitor (int which_monitor); #endif public unowned Meta.Workspace get_workspace (); +#if !HAS_MUTTER46 public X.Window get_xwindow (); public void group_leader_changed (); +#endif public bool has_attached_dialogs (); public bool has_focus (); #if HAS_MUTTER45 @@ -1087,7 +1108,9 @@ namespace Meta { #endif public void shove_titlebar_onscreen (); public bool showing_on_its_workspace (); +#if !HAS_MUTTER46 public void shutdown_group (); +#endif public void stick (); public bool titlebar_is_onscreen (); public void unmake_above (); @@ -1099,6 +1122,9 @@ namespace Meta { public void unshade (uint32 timestamp); #endif public void unstick (); +#if HAS_MUTTER46 + public unowned Meta.Group? x11_get_group (); +#endif [NoAccessorMethod] public bool above { get; } [NoAccessorMethod] @@ -1259,14 +1285,22 @@ namespace Meta { public unowned Meta.Workspace get_active_workspace (); public int get_active_workspace_index (); public int get_n_workspaces (); +#if HAS_MUTTER46 + public int get_layout_columns (); + public int get_layout_rows (); +#endif public unowned Meta.Workspace? get_workspace_by_index (int index); public unowned GLib.List get_workspaces (); public void override_workspace_layout (Meta.DisplayCorner starting_corner, bool vertical_layout, int n_rows, int n_columns); public void remove_workspace (Meta.Workspace workspace, uint32 timestamp); public void reorder_workspace (Meta.Workspace workspace, int new_index); +#if !HAS_MUTTER46 [NoAccessorMethod] +#endif public int layout_columns { get; } +#if !HAS_MUTTER46 [NoAccessorMethod] +#endif public int layout_rows { get; } public int n_workspaces { get; } public signal void active_workspace_changed (); @@ -1303,6 +1337,9 @@ namespace Meta { public bool has_shape (); #endif public unowned Meta.Group lookup_group (X.Window group_leader); +#if HAS_MUTTER46 + public X.Window lookup_xwindow (Meta.Window window); +#endif #if HAS_MUTTER45 public void redirect_windows (Meta.Display display); public void remove_event_func (uint id); @@ -1973,6 +2010,7 @@ namespace Meta { ICON, INSTANTLY } +#if !HAS_MUTTER46 [CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_", type_id = "meta_virtual_modifier_get_type ()")] [Flags] public enum VirtualModifier { @@ -1987,6 +2025,7 @@ namespace Meta { MOD4_MASK, MOD5_MASK } +#endif [CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_CLIENT_TYPE_", type_id = "meta_window_client_type_get_type ()")] public enum WindowClientType { WAYLAND, @@ -2056,8 +2095,10 @@ namespace Meta { public static void add_clutter_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags); [CCode (cheader_filename = "meta/main.h")] public static void add_debug_paint_flag (Meta.DebugPaintFlag flag); +#if !HAS_MUTTER46 [CCode (cheader_filename = "meta/main.h")] public static void clutter_init (); +#endif [CCode (cheader_filename = "meta/main.h")] public static void exit (Meta.ExitCode code); #if HAS_MUTTER44 @@ -2085,3 +2126,4 @@ namespace Meta { public static void restart (string? message); #endif } + diff --git a/vapi/mutter-clutter.vapi b/vapi/mutter-clutter.vapi index 507156fb0..33d5c1d97 100644 --- a/vapi/mutter-clutter.vapi +++ b/vapi/mutter-clutter.vapi @@ -4706,6 +4706,9 @@ namespace Clutter { public Pango.Context create_pango_context (); [Version (since = "1.0")] public Pango.Layout create_pango_layout (string? text); +#if HAS_MUTTER46 + public Clutter.PaintNode create_texture_paint_node (Cogl.Texture texture); +#endif [Version (since = "1.10")] public void destroy_all_children (); [CCode (cname = "clutter_actor_event")] @@ -5348,7 +5351,7 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_align_constraint_get_type ()")] [Version (since = "1.4")] - public class AlignConstraint : Clutter.Constraint { + public sealed class AlignConstraint : Clutter.Constraint { [CCode (has_construct_function = false, type = "ClutterConstraint*")] public AlignConstraint (Clutter.Actor? source, Clutter.AlignAxis axis, float factor); public Clutter.AlignAxis get_align_axis (); @@ -5418,7 +5421,7 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_bind_constraint_get_type ()")] [Version (since = "1.4")] - public class BindConstraint : Clutter.Constraint { + public sealed class BindConstraint : Clutter.Constraint { [CCode (has_construct_function = false, type = "ClutterConstraint*")] public BindConstraint (Clutter.Actor? source, Clutter.BindCoordinate coordinate, float offset); public Clutter.BindCoordinate get_coordinate (); @@ -5433,7 +5436,7 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_binding_pool_get_type ()")] [Version (since = "1.0")] - public class BindingPool : GLib.Object { + public sealed class BindingPool : GLib.Object { [CCode (has_construct_function = false)] public BindingPool (string name); public bool activate (uint key_val, Clutter.ModifierType modifiers, GLib.Object gobject); @@ -5441,7 +5444,11 @@ namespace Clutter { public static unowned Clutter.BindingPool find (string name); public unowned string find_action (uint key_val, Clutter.ModifierType modifiers); public static unowned Clutter.BindingPool get_for_class (void* klass); +#if HAS_MUTTER46 + public void install_action (string action_name, uint key_val, Clutter.ModifierType modifiers, owned GLib.Callback callback); +#else public void install_action (string action_name, uint key_val, Clutter.ModifierType modifiers, owned Clutter.BindingActionFunc callback); +#endif public void install_closure (string action_name, uint key_val, Clutter.ModifierType modifiers, GLib.Closure closure); public void override_action (uint key_val, Clutter.ModifierType modifiers, owned GLib.Callback callback); public void override_closure (uint key_val, Clutter.ModifierType modifiers, GLib.Closure closure); @@ -5537,6 +5544,7 @@ namespace Clutter { public float y; #endif } +#if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_canvas_get_type ()")] [Version (since = "1.10")] public class Canvas : GLib.Object, Clutter.Content { @@ -5552,7 +5560,6 @@ namespace Clutter { public int width { get; set; } public virtual signal bool draw (Cairo.Context cr, int width, int height); } -#if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_child_meta_get_type ()")] [Version (since = "0.8")] public abstract class ChildMeta : GLib.Object { @@ -5753,8 +5760,10 @@ namespace Clutter { #if !HAS_MUTTER45 public Clutter.EventType type; #endif +#if !HAS_MUTTER46 [CCode (has_construct_function = false)] public Event (Clutter.EventType type); +#endif [Version (since = "1.18")] public static uint add_filter (Clutter.Stage? stage, [CCode (delegate_target_pos = 2.2, destroy_notify_pos = 2.1)] owned Clutter.EventFilterFunc func); public Clutter.Event copy (); @@ -5907,13 +5916,21 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_flow_layout_get_type ()")] [Version (since = "1.2")] - public class FlowLayout : Clutter.LayoutManager { + public sealed class FlowLayout : Clutter.LayoutManager { [CCode (has_construct_function = false, type = "ClutterLayoutManager*")] +#if HAS_MUTTER46 + public FlowLayout (Clutter.Orientation orientation); +#else public FlowLayout (Clutter.FlowOrientation orientation); +#endif public float get_column_spacing (); public void get_column_width (out float min_width, out float max_width); public bool get_homogeneous (); +#if HAS_MUTTER46 + public Clutter.Orientation get_orientation (); +#else public Clutter.FlowOrientation get_orientation (); +#endif public void get_row_height (out float min_height, out float max_height); public float get_row_spacing (); [Version (since = "1.16")] @@ -5921,7 +5938,11 @@ namespace Clutter { public void set_column_spacing (float spacing); public void set_column_width (float min_width, float max_width); public void set_homogeneous (bool homogeneous); +#if HAS_MUTTER46 + public void set_orientation (Clutter.Orientation orientation); +#else public void set_orientation (Clutter.FlowOrientation orientation); +#endif public void set_row_height (float min_height, float max_height); public void set_row_spacing (float spacing); [Version (since = "1.16")] @@ -5936,7 +5957,11 @@ namespace Clutter { public float min_column_width { get; set; } [NoAccessorMethod] public float min_row_height { get; set; } +#if HAS_MUTTER46 + public Clutter.Orientation orientation { get; set construct; } +#else public Clutter.FlowOrientation orientation { get; set construct; } +#endif public float row_spacing { get; set; } [Version (since = "1.16")] public bool snap_to_grid { get; set; } @@ -5950,7 +5975,9 @@ namespace Clutter { public class Frame { #if HAS_MUTTER44 public int64 get_count (); -#if HAS_MUTTER45 +#if HAS_MUTTER46 + public bool get_frame_deadline (int64 frame_deadline_us); +#elif HAS_MUTTER45 public bool get_min_render_time_allowed (int64 min_render_time_allowed_us); #endif public bool get_target_presentation_time (int64 target_presentation_time_us); @@ -6036,17 +6063,30 @@ namespace Clutter { public virtual signal void gesture_end (Clutter.Actor actor); public virtual signal bool gesture_progress (Clutter.Actor actor); } +#if HAS_MUTTER46 + [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_grab_get_type ()")] + public sealed class Grab : GLib.Object { + [CCode (has_construct_function = false)] + protected Grab (); +#else [CCode (cheader_filename = "clutter/clutter.h", ref_function = "clutter_grab_ref", type_id = "clutter_grab_get_type ()", unref_function = "clutter_grab_unref")] [Compact] public class Grab { +#endif public void dismiss (); public Clutter.GrabState get_seat_state (); +#if HAS_MUTTER46 + public bool is_revoked (); + [NoAccessorMethod] + public bool revoked { get; } +#else public unowned Clutter.Grab @ref (); public void unref (); +#endif } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_grid_layout_get_type ()")] [Version (since = "1.12")] - public class GridLayout : Clutter.LayoutManager { + public sealed class GridLayout : Clutter.LayoutManager { [CCode (has_construct_function = false, type = "ClutterLayoutManager*")] public GridLayout (); public void attach (Clutter.Actor child, int left, int top, int width, int height); @@ -6343,7 +6383,11 @@ namespace Clutter { [CCode (has_construct_function = false)] protected Keymap (); public bool get_caps_lock_state (); +#if HAS_MUTTER46 + public virtual Clutter.TextDirection get_direction (); +#else public virtual Pango.Direction get_direction (); +#endif public bool get_num_lock_state (); public bool caps_lock_state { get; } public bool num_lock_state { get; } @@ -6843,7 +6887,7 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_settings_get_type ()")] [Version (since = "1.4")] - public class Settings : GLib.Object { + public sealed class Settings : GLib.Object { [CCode (has_construct_function = false)] protected Settings (); public static unowned Clutter.Settings get_default (); @@ -6924,7 +6968,7 @@ namespace Clutter { } [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_snap_constraint_get_type ()")] [Version (since = "1.6")] - public class SnapConstraint : Clutter.Constraint { + public sealed class SnapConstraint : Clutter.Constraint { [CCode (has_construct_function = false, type = "ClutterConstraint*")] public SnapConstraint (Clutter.Actor? source, Clutter.SnapEdge from_edge, Clutter.SnapEdge to_edge, float offset); public void get_edges (out Clutter.SnapEdge from_edge, out Clutter.SnapEdge to_edge); @@ -7143,8 +7187,10 @@ namespace Clutter { public class SwipeAction : Clutter.GestureAction { [CCode (has_construct_function = false, type = "ClutterAction*")] public SwipeAction (); +#if !HAS_MUTTER46 [Version (deprecated = true, deprecated_since = "1.14", since = "1.8")] public virtual signal void swept (Clutter.Actor actor, Clutter.SwipeDirection direction); +#endif [Version (since = "1.14")] #if HAS_MUTTER46 public virtual signal bool swipe (Clutter.Actor actor, Clutter.SwipeDirection direction); @@ -7590,7 +7636,7 @@ namespace Clutter { [CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_transition_group_get_type ()")] [Version (since = "1.12")] #if HAS_MUTTER46 - public class TransitionGroup : Clutter.Transition { + public sealed class TransitionGroup : Clutter.Transition { #else public class TransitionGroup : Clutter.Transition, Clutter.Scriptable { #endif @@ -7784,7 +7830,9 @@ namespace Clutter { public uint8 green; public uint8 blue; public uint8 alpha; +#if !HAS_MUTTER46 public Clutter.Color add (Clutter.Color b); +#endif [Version (since = "1.12")] public static Clutter.Color? alloc (); [Version (since = "0.2")] @@ -7815,8 +7863,10 @@ namespace Clutter { color.init_from_string (str); return color; } +#if !HAS_MUTTER46 [Version (since = "1.6")] public static unowned Clutter.Color? get_static (Clutter.StaticColor color); +#endif [Version (since = "1.0")] public uint hash (); [Version (since = "1.12")] @@ -7830,11 +7880,15 @@ namespace Clutter { public bool init_from_string (string str); [Version (since = "1.6")] public Clutter.Color interpolate (Clutter.Color final, double progress); +#if !HAS_MUTTER46 public Clutter.Color lighten (); +#endif [CCode (cname = "clutter_color_from_string")] public bool parse_string (string str); +#if !HAS_MUTTER46 public Clutter.Color shade (double factor); public Clutter.Color subtract (Clutter.Color b); +#endif public void to_hls (out float hue, out float luminance, out float saturation); public uint32 to_pixel (); [Version (since = "0.2")] @@ -8221,12 +8275,14 @@ namespace Clutter { SHADERS_GLSL } #endif +#if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FLOW_", type_id = "clutter_flow_orientation_get_type ()")] [Version (since = "1.2")] public enum FlowOrientation { HORIZONTAL, VERTICAL } +#endif [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FRAME_INFO_FLAG_", type_id = "clutter_frame_info_flag_get_type ()")] [Flags] public enum FrameInfoFlag { @@ -8642,6 +8698,7 @@ namespace Clutter { BOTTOM, LEFT } +#if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_COLOR_", type_id = "clutter_static_color_get_type ()")] [Version (since = "1.6")] public enum StaticColor { @@ -8691,6 +8748,7 @@ namespace Clutter { ALUMINIUM_6, TRANSPARENT } +#endif [CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_STEP_MODE_", type_id = "clutter_step_mode_get_type ()")] [Version (since = "1.12")] public enum StepMode { @@ -8785,11 +8843,13 @@ namespace Clutter { [CCode (cheader_filename = "clutter/clutter.h", instance_pos = 1.9)] [Version (since = "1.24")] public delegate Clutter.Actor ActorCreateChildFunc (GLib.Object item); +#if !HAS_MUTTER46 [CCode (cheader_filename = "clutter/clutter.h", instance_pos = 4.9)] [Version (since = "1.0")] public delegate bool BindingActionFunc (GLib.Object gobject, string action_name, uint key_val, Clutter.ModifierType modifiers); [CCode (cheader_filename = "clutter/clutter.h", instance_pos = 1.9)] public delegate void Callback (Clutter.Actor actor); +#endif #if HAS_MUTTER43 [CCode (cheader_filename = "clutter/clutter.h", instance_pos = 2.9)] [Version (since = "1.18")] diff --git a/vapi/mutter-cogl-14.vapi b/vapi/mutter-cogl-14.vapi index 4c3bbce6d..18e3b79c4 100644 --- a/vapi/mutter-cogl-14.vapi +++ b/vapi/mutter-cogl-14.vapi @@ -6,10 +6,17 @@ namespace Cogl { public class Bitmap : GLib.Object { [CCode (has_construct_function = false)] protected Bitmap (); + [CCode (has_construct_function = false)] + public Bitmap.for_data (Cogl.Context context, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false, type = "uint8_t*")] owned uint8[] data); + [CCode (has_construct_function = false)] + public Bitmap.from_buffer (Cogl.Buffer buffer, Cogl.PixelFormat format, int width, int height, int rowstride, int offset); + public unowned Cogl.Buffer? get_buffer (); public Cogl.PixelFormat get_format (); public int get_height (); public int get_rowstride (); public int get_width (); + [CCode (has_construct_function = false)] + public Bitmap.with_size (Cogl.Context context, uint width, uint height, Cogl.PixelFormat format); } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_buffer_get_type ()")] public abstract class Buffer : GLib.Object { @@ -162,13 +169,13 @@ namespace Cogl { public virtual int get_buffer_age (); public int64 get_frame_counter (); public void hide (); - public virtual void queue_damage_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.1, type = "const int*")] int[] rectangles); + public virtual void queue_damage_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.1)] int[] rectangles); public void remove_dirty_callback (Cogl.OnscreenDirtyClosure closure); public void remove_frame_callback (Cogl.FrameClosure closure); public void show (); public void swap_buffers (Cogl.FrameInfo frame_info, void* user_data); - public virtual void swap_buffers_with_damage ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5, type = "const int*")] int[] rectangles, Cogl.FrameInfo info); - public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5, type = "const int*")] int[] rectangles, Cogl.FrameInfo info); + public virtual void swap_buffers_with_damage ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info); + public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info); } [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] @@ -202,8 +209,6 @@ namespace Cogl { public bool set_blend (string blend_string) throws GLib.Error; public void set_blend_constant (Cogl.Color constant_color); public void set_color (Cogl.Color color); - public void set_color4f (float red, float green, float blue, float alpha); - public void set_color4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha); public void set_cull_face_mode (Cogl.PipelineCullFaceMode cull_face_mode); public void set_front_face_winding (Cogl.Winding front_winding); public bool set_layer_combine (int layer_index, string blend_string) throws GLib.Error; @@ -299,6 +304,10 @@ namespace Cogl { [Compact] public class Scanout { } + [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] + [Compact] + public class ScanoutBuffer { + } [CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_shader_get_type ()")] public class Shader : GLib.Object { [CCode (has_construct_function = false)] @@ -358,8 +367,6 @@ namespace Cogl { public sealed class Texture2D : Cogl.Texture { [CCode (has_construct_function = false)] protected Texture2D (); - public void egl_image_external_alloc_finish (void* user_data, GLib.DestroyNotify destroy); - public void egl_image_external_bind (); [CCode (has_construct_function = false, type = "CoglTexture*")] public Texture2D.from_bitmap (Cogl.Bitmap bitmap); [CCode (has_construct_function = false, type = "CoglTexture*")] @@ -376,10 +383,6 @@ namespace Cogl { [Compact] public class TimestampQuery { } - [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] - [Compact] - public class TraceContext { - } [CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_color_get_type ()")] public struct Color { [CCode (has_construct_function = false, type = "CoglColor*")] @@ -448,12 +451,6 @@ namespace Cogl { public Cogl.Color color; } [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] - public struct TraceHead { - public uint64 begin_time; - public weak string name; - public weak string description; - } - [CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)] [Version (since = "1.6")] public struct VertexP2 { public float x; @@ -685,6 +682,7 @@ namespace Cogl { } [CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_PIXEL_FORMAT_", type_id = "cogl_pixel_format_get_type ()")] public enum PixelFormat { + CAIRO_ARGB32_COMPAT, ANY, A_8, RGB_565, @@ -861,8 +859,6 @@ namespace Cogl { public delegate void OnscreenDirtyCallback (Cogl.Onscreen onscreen, Cogl.OnscreenDirtyInfo info); [CCode (cheader_filename = "cogl/cogl.h", instance_pos = 2.9)] public delegate bool PipelineLayerCallback (Cogl.Pipeline pipeline, int layer_index); - [CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)] - public delegate bool Texture2DEGLImageExternalAlloc (Cogl.Texture2D tex_2d) throws GLib.Error; [CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_AFIRST_BIT")] public const int AFIRST_BIT; [CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_A_BIT")] @@ -896,19 +892,13 @@ namespace Cogl { [Version (replacement = "PixelFormat.to_string")] public static unowned string pixel_format_to_string (Cogl.PixelFormat format); [CCode (cheader_filename = "cogl/cogl.h")] - public static void set_tracing_disabled_on_thread (GLib.MainContext main_context); + public static void set_tracing_disabled_on_thread (void* data); [CCode (cheader_filename = "cogl/cogl.h")] - public static void set_tracing_enabled_on_thread (GLib.MainContext main_context, string group); + public static void set_tracing_enabled_on_thread (void* data, string group); [CCode (cheader_filename = "cogl/cogl.h")] public static bool start_tracing_with_fd (int fd) throws GLib.Error; [CCode (cheader_filename = "cogl/cogl.h")] public static bool start_tracing_with_path (string filename) throws GLib.Error; [CCode (cheader_filename = "cogl/cogl.h")] public static void stop_tracing (); - [CCode (cheader_filename = "cogl/cogl.h")] - public static void trace_describe (Cogl.TraceHead head, string description); - [CCode (cheader_filename = "cogl/cogl.h")] - public static void trace_end (Cogl.TraceHead head); - [CCode (cheader_filename = "cogl/cogl.h")] - public static void trace_mark (string name, string description); } diff --git a/vapi/mutter-cogl.vapi b/vapi/mutter-cogl.vapi index 723eeef7e..5858cde7a 100644 --- a/vapi/mutter-cogl.vapi +++ b/vapi/mutter-cogl.vapi @@ -1168,3 +1168,4 @@ namespace Cogl { [CCode (cheader_filename = "cogl/cogl.h")] public static void trace_end (Cogl.TraceHead head); } + diff --git a/vapi/mutter-mtk-13.vapi b/vapi/mutter-mtk-13.vapi index c92d3cd23..e9f393e57 100644 --- a/vapi/mutter-mtk-13.vapi +++ b/vapi/mutter-mtk-13.vapi @@ -6,12 +6,14 @@ namespace Mtk { [CCode (cheader_filename = "mtk/mtk.h", ref_function = "mtk_region_ref", type_id = "mtk_region_get_type ()", unref_function = "mtk_region_unref")] [Compact] public class Region { + public Mtk.Region apply_matrix_transform_expand (Graphene.Matrix transform); public bool contains_point (int x, int y); public Mtk.RegionOverlap contains_rectangle (Mtk.Rectangle rect); public Mtk.Region copy (); public static Mtk.Region create (); 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); public bool equal (Mtk.Region other); public Mtk.Rectangle? get_extents (); public Mtk.Rectangle? get_rectangle (int nth); @@ -20,6 +22,7 @@ namespace Mtk { public bool is_empty (); public int num_rectangles (); public unowned Mtk.Region @ref (); + public Mtk.Region scale (int scale); public void subtract (Mtk.Region other); public void subtract_rectangle (Mtk.Rectangle rect); public void translate (int dx, int dy); @@ -34,23 +37,58 @@ namespace Mtk { public int y; public int width; public int height; +#if HAS_MUTTER46 + [CCode (cname = "MTK_RECTANGLE_MAX_STACK_RECTS")] + public const int MAX_STACK_RECTS; +#endif [CCode (has_construct_function = false, type = "MtkRectangle*")] public Rectangle (int x, int y, int width, int height); public int area (); public bool contains_rect (Mtk.Rectangle inner_rect); public Mtk.Rectangle? copy (); public bool could_fit_rect (Mtk.Rectangle inner_rect); +#if HAS_MUTTER46 + public void crop_and_scale (Graphene.Rect src_rect, int dst_width, int dst_height, Mtk.Rectangle dest); +#endif public bool equal (Mtk.Rectangle src2); public void free (); public static Mtk.Rectangle from_graphene_rect (Graphene.Rect rect, Mtk.RoundingStrategy rounding_strategy); public bool horiz_overlap (Mtk.Rectangle rect2); public bool intersect (Mtk.Rectangle src2, out Mtk.Rectangle dest); +#if HAS_MUTTER46 + public bool is_adjacent_to (Mtk.Rectangle other); +#endif public bool overlap (Mtk.Rectangle rect2); +#if HAS_MUTTER46 + public void scale_double (double scale, Mtk.RoundingStrategy rounding_strategy, Mtk.Rectangle dest); +#endif public Graphene.Rect? to_graphene_rect (); public Mtk.Rectangle union (Mtk.Rectangle rect2); public bool vert_overlap (Mtk.Rectangle rect2); } #if HAS_MUTTER46 + [CCode (cheader_filename = "mtk/mtk.h", has_type_id = false)] + public struct RegionBuilder { + [CCode (array_length_cname = "n_levels")] + public weak Mtk.Region levels[16]; + public int n_levels; + [CCode (cname = "MTK_REGION_BUILDER_MAX_LEVELS")] + public const int MAX_LEVELS; + public void add_rectangle (int x, int y, int width, int height); + public Mtk.Region finish (); + public void init (); + } + [CCode (cheader_filename = "mtk/mtk.h", has_type_id = false)] + public struct RegionIterator { + public weak Mtk.Region region; + public Mtk.Rectangle rectangle; + public bool line_start; + public bool line_end; + public int i; + public bool at_end (); + public void init (Mtk.Region region); + public void next (); + } [CCode (cheader_filename = "mtk/mtk.h", cprefix = "MTK_REGION_OVERLAP_", has_type_id = false)] public enum RegionOverlap { OUT,