Update Mutter 46 support

Update to the latest version on time.
This commit is contained in:
Corentin Noël 2024-02-17 00:47:04 +01:00
parent 331e05907c
commit 5644c66724
24 changed files with 767 additions and 202 deletions

View File

@ -4,14 +4,13 @@
*/
public class Gala.CanvasActor : Clutter.Actor {
private Clutter.Canvas canvas;
private Gala.Drawing.Canvas canvas;
construct {
canvas = new Clutter.Canvas ();
canvas = new Gala.Drawing.Canvas ();
content = canvas;
canvas.draw.connect ((ctx, width, height) => {
draw (ctx, width, height);
return true;
});
}

163
lib/Drawing/Canvas.vala Normal file
View File

@ -0,0 +1,163 @@
/*
* 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;
public signal void draw (Cairo.Context cr, int width, int height);
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);
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 ();
}
}
}
#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 signal void draw (Cairo.Context cr, int width, int height);
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);
return true;
}
}
#endif

View File

@ -133,8 +133,8 @@ public class Gala.ShadowEffect : Clutter.Effect {
pipeline.set_layer_texture (0, shadow);
}
var opacity = actor.get_paint_opacity () * shadow_opacity / 255;
var alpha = Cogl.Color.from_4ub (255, 255, 255, opacity);
var opacity = actor.get_paint_opacity () * shadow_opacity / 255.0f;
var alpha = Cogl.Color.from_4f (1.0f, 1.0f, 1.0f, opacity / 255.0f);
alpha.premultiply ();
pipeline.set_color (alpha);

View File

@ -117,24 +117,30 @@ namespace Gala {
}
}
unowned Meta.Group group = window.get_group ();
if (group != null) {
var group_windows = group.list_windows ();
group_windows.foreach ((window) => {
if (window.get_window_type () != Meta.WindowType.NORMAL) {
return;
}
if (window.get_client_type () == Meta.WindowClientType.X11) {
#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) => {
if (window.get_window_type () != Meta.WindowType.NORMAL) {
return;
}
if (window_to_desktop_cache[window] != null) {
desktop_app = window_to_desktop_cache[window];
}
});
if (window_to_desktop_cache[window] != null) {
desktop_app = window_to_desktop_cache[window];
}
});
if (desktop_app != null) {
var icon = get_icon_for_desktop_app_info (desktop_app, icon_size, scale);
if (icon != null) {
window_to_desktop_cache[window] = desktop_app;
return icon;
if (desktop_app != null) {
var icon = get_icon_for_desktop_app_info (desktop_app, icon_size, scale);
if (icon != null) {
window_to_desktop_cache[window] = desktop_app;
return icon;
}
}
}
}

View File

@ -9,6 +9,7 @@ gala_lib_sources = files(
'Constants.vala',
'DragDropAction.vala',
'Drawing/BufferSurface.vala',
'Drawing/Canvas.vala',
'Drawing/Color.vala',
'Drawing/Utilities.vala',
'Plugin.vala',

View File

@ -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 () ?? "";

View File

@ -24,7 +24,11 @@ private class Gala.Barrier : Meta.Barrier {
public double pressure_y { get; set; default = 0; }
public Barrier (Meta.Display display, int x1, int y1, int x2, int y2, Meta.BarrierDirection directions) {
#if HAS_MUTTER46
Object (x1: x1, y1: y1, x2: x2, y2: y2, directions: directions);
#else
Object (display: display, x1: x1, y1: y1, x2: x2, y2: y2, directions: directions);
#endif
}
}

View File

@ -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"));
}

View File

@ -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);

View File

@ -77,7 +77,6 @@ namespace Gala {
add_child (icon_container);
resize ();
#if HAS_MUTTER46
icon_container.child_removed.connect_after (redraw);
#else
@ -228,8 +227,8 @@ namespace Gala {
cr,
0,
0,
(int) width,
(int) height,
width,
height,
InternalUtils.scale_to_int (5, scale_factor)
);
@ -382,8 +381,6 @@ namespace Gala {
y += InternalUtils.scale_to_int (size, scale_factor) + spacing;
}
}
return;
}
private Clutter.Actor? drag_begin (float click_x, float click_y) {

View File

@ -63,7 +63,11 @@ public class Gala.WindowSwitcher : CanvasActor {
container = new Clutter.Actor () {
reactive = true,
#if HAS_MUTTER46
layout_manager = new Clutter.FlowLayout (Clutter.Orientation.HORIZONTAL)
#else
layout_manager = new Clutter.FlowLayout (Clutter.FlowOrientation.HORIZONTAL)
#endif
};
caption = new Clutter.Text () {

View File

@ -86,7 +86,7 @@ namespace Gala {
debug (e.message);
}
var color = Cogl.Color.from_4ub (255, 255, 255, 25);
var color = Cogl.Color.from_4f (1.0f, 1.0f, 1.0f, 25.0f / 255.0f);
color.premultiply ();
pipeline.set_color (color);

View File

@ -694,9 +694,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;
@ -899,7 +911,9 @@ namespace Gala {
break;
case ActionType.START_MOVE_CURRENT:
if (current != null && current.allows_move ())
#if HAS_MUTTER44
#if HAS_MUTTER46
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, null, null, Gtk.get_current_event_time (), null);
#elif HAS_MUTTER44
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, null, null, Gtk.get_current_event_time ());
#else
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, true, Gtk.get_current_event_time ());
@ -907,7 +921,9 @@ namespace Gala {
break;
case ActionType.START_RESIZE_CURRENT:
if (current != null && current.allows_resize ())
#if HAS_MUTTER44
#if HAS_MUTTER46
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, null, null, Gtk.get_current_event_time (), null);
#elif HAS_MUTTER44
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, null, null, Gtk.get_current_event_time ());
#else
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, true, Gtk.get_current_event_time ());

View File

@ -170,7 +170,16 @@ public class Gala.WindowTracker : GLib.Object {
}
private unowned Gala.App? get_app_from_window_group (Meta.Window window) {
if (window.get_client_type () != Meta.WindowClientType.X11) {
//TODO: Implement it for wayland
return null;
}
#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;
}

View File

@ -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

View File

@ -6,55 +6,10 @@ namespace Cogl {
[Version (since = "1.4")]
[CCode (cname="cogl_color_init_from_4fv")]
public Color.from_4fv (float color_array);
[Version (since = "1.4")]
[CCode (cname="cogl_color_init_from_4ub")]
public Color.from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
[Version (since = "1.16")]
[CCode (cname="cogl_color_init_from_hsl")]
public Color.from_hsl (float hue, float saturation, float luminance);
}
[CCode (cheader_filename = "cogl/cogl.h")]
public sealed class Primitive : GLib.Object {
[CCode (has_construct_function = false)]
public Primitive (Cogl.VerticesMode mode, int n_vertices, ...);
[Version (since = "1.10")]
public Cogl.Primitive copy ();
[Version (since = "1.16")]
public void draw (Cogl.Framebuffer framebuffer, Cogl.Pipeline pipeline);
public int get_first_vertex ();
public Cogl.VerticesMode get_mode ();
[Version (since = "1.8")]
public int get_n_vertices ();
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2C4[] data);
public void set_first_vertex (int first_vertex);
public void set_mode (Cogl.VerticesMode mode);
[Version (since = "1.8")]
public void set_n_vertices (int n_vertices);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2 {
@ -131,4 +86,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;
}
}

View File

@ -8,6 +8,12 @@ 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?"
Primitive.new skip=false
Texture
.get_data.data type="uint8[]"
.set_data.data type="uint8[]"
@ -15,11 +21,6 @@ Texture
Texture2D
.new_from_data skip=false
.new_from_data.data array=true
Pipeline.get_layer_filters
.min_filter out
.mag_filter out
create_program type="Cogl.Program" name="create" parent="Cogl.Program"
create_shader type="Cogl.Shader" name="create" parent="Cogl.Shader"
@ -31,7 +32,6 @@ has_feature parent="Cogl.Context" symbol_type="method" instance_idx=0
Bitmap.error_quark parent="Cogl.BitmapError" name="quark"
Texture.error_quark parent="Cogl.TextureError" name="quark"
Scanout.error_quark parent="Cogl.ScanoutError" name="quark"
scanout_error_quark skip
BitmapError errordomain
BlendStringError errordomain
@ -47,6 +47,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

View File

@ -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"
@ -78,7 +78,6 @@ MotionDirection cheader_filename="meta/common.h"
PadDirection cheader_filename="meta/display.h"
PadFeatureType cheader_filename="meta/display.h"
Plugin cheader_filename="meta/meta-plugin.h"
Plugin.xevent_filter.event type="X.Event" ref
PluginInfo cheader_filename="meta/meta-plugin.h"
PowerSaveChangeReason cheader_filename="meta/meta-monitor-manager.h"
Preference cheader_filename="meta/prefs.h"
@ -107,7 +106,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"
@ -140,11 +138,6 @@ 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"
ICON_WIDTH cheader_filename="meta/common.h"
ICON_HEIGHT cheader_filename="meta/common.h"
MINI_ICON_WIDTH cheader_filename="meta/common.h"
MINI_ICON_HEIGHT cheader_filename="meta/common.h"
DEFAULT_ICON_NAME 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"
@ -175,10 +168,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

View File

@ -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"

View File

@ -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
@ -279,8 +288,10 @@ namespace Meta {
#endif
[NoAccessorMethod]
public Meta.BarrierDirection directions { get; construct; }
#if !HAS_MUTTER46
[NoAccessorMethod]
public Meta.Display display { owned get; construct; }
#endif
#if HAS_MUTTER45
[NoAccessorMethod]
public Meta.BarrierFlags flags { get; construct; }
@ -422,8 +433,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 ();
@ -432,8 +443,10 @@ namespace Meta {
public uint32 get_current_time_roundtrip ();
[CCode (cname = "meta_cursor_tracker_get_for_display")]
public unowned Meta.CursorTracker get_cursor_tracker ();
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_feedback_group_for_display")]
public unowned Clutter.Actor get_feedback_group ();
#endif
public unowned Meta.Window get_focus_window ();
#if !HAS_MUTTER44
public Meta.GrabOp get_grab_op ();
@ -496,11 +509,13 @@ namespace Meta {
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_stage_is_focused")]
public bool stage_is_focused ();
#endif
public bool supports_extended_barriers ();
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; }
@ -508,6 +523,8 @@ namespace Meta {
public signal void accelerator_activated (uint object, Clutter.InputDevice p0, uint p1);
public signal void closing ();
public signal void cursor_updated ();
[CCode (cname = "focus-window")]
public signal void do_focus_window (Meta.Window object, int64 p0);
public signal void gl_video_memory_purged ();
public signal void grab_op_begin (Meta.Window object, Meta.GrabOp p0);
public signal void grab_op_end (Meta.Window object, Meta.GrabOp p0);
@ -729,8 +746,10 @@ namespace Meta {
[NoWrapper]
public virtual void unminimize (Meta.WindowActor actor);
public void unminimize_completed (Meta.WindowActor actor);
#if !HAS_MUTTER46
[NoWrapper]
public virtual bool xevent_filter ([CCode (type = "XEvent*")] ref X.Event event);
#endif
}
[CCode (cheader_filename = "meta/meta-remote-access-controller.h", type_id = "meta_remote_access_controller_get_type ()")]
public sealed class RemoteAccessController : GLib.Object {
@ -900,6 +919,7 @@ namespace Meta {
public void hide_from_window_list (Meta.Window window);
#if HAS_MUTTER46
public void make_desktop (Meta.Window window);
public void make_dock (Meta.Window window);
#endif
public bool owns_window (Meta.Window window);
public void show_in_window_list (Meta.Window window);
@ -947,7 +967,9 @@ namespace Meta {
public void activate_with_workspace (uint32 current_time, Meta.Workspace workspace);
public bool allows_move ();
public bool allows_resize ();
#if HAS_MUTTER44
#if HAS_MUTTER46
public bool begin_grab_op (Meta.GrabOp op, Clutter.InputDevice? device, Clutter.EventSequence? sequence, uint32 timestamp, Graphene.Point? pos_hint);
#elif HAS_MUTTER44
public bool begin_grab_op (Meta.GrabOp op, Clutter.InputDevice? device, Clutter.EventSequence? sequence, uint32 timestamp);
#else
public void begin_grab_op (Meta.GrabOp op, bool frame_action, uint32 timestamp);
@ -966,7 +988,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 +1003,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 +1022,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 +1064,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 +1117,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 +1131,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]
@ -1258,15 +1293,23 @@ namespace Meta {
public unowned Meta.Workspace append_new_workspace (bool activate, uint32 timestamp);
public unowned Meta.Workspace get_active_workspace ();
public int get_active_workspace_index ();
#if HAS_MUTTER46
public int get_layout_columns ();
public int get_layout_rows ();
#endif
public int get_n_workspaces ();
public unowned Meta.Workspace? get_workspace_by_index (int index);
public unowned GLib.List<Meta.Workspace> 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 +1346,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 +2019,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 +2034,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,
@ -2026,16 +2074,6 @@ namespace Meta {
public delegate bool WindowForeachFunc (Meta.Window window);
[CCode (cheader_filename = "meta/common.h", cname = "META_CURRENT_TIME")]
public const int CURRENT_TIME;
[CCode (cheader_filename = "meta/common.h", cname = "META_DEFAULT_ICON_NAME")]
public const string DEFAULT_ICON_NAME;
[CCode (cheader_filename = "meta/common.h", cname = "META_ICON_HEIGHT")]
public const int ICON_HEIGHT;
[CCode (cheader_filename = "meta/common.h", cname = "META_ICON_WIDTH")]
public const int ICON_WIDTH;
[CCode (cheader_filename = "meta/common.h", cname = "META_MINI_ICON_HEIGHT")]
public const int MINI_ICON_HEIGHT;
[CCode (cheader_filename = "meta/common.h", cname = "META_MINI_ICON_WIDTH")]
public const int MINI_ICON_WIDTH;
[CCode (cheader_filename = "meta/common.h", cname = "META_PRIORITY_BEFORE_REDRAW")]
public const int PRIORITY_BEFORE_REDRAW;
[CCode (cheader_filename = "meta/common.h", cname = "META_PRIORITY_PREFS_NOTIFY")]
@ -2056,8 +2094,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 +2125,4 @@ namespace Meta {
public static void restart (string? message);
#endif
}

View File

@ -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 ();
@ -5827,8 +5836,10 @@ namespace Clutter {
public Clutter.ScrollFinishFlags get_scroll_finish_flags ();
[Version (since = "1.26")]
public Clutter.ScrollSource get_scroll_source ();
#if !HAS_MUTTER46
[Version (since = "0.6")]
public unowned Clutter.Actor get_source ();
#endif
[Version (since = "1.6")]
public unowned Clutter.InputDevice get_source_device ();
#if !HAS_MUTTER45
@ -5907,13 +5918,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 +5940,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 +5959,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 +5977,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 +6065,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 +6385,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 +6889,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 +6970,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 +7189,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 +7638,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,12 +7832,16 @@ 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")]
public Clutter.Color? copy ();
#if !HAS_MUTTER46
public Clutter.Color darken ();
#endif
[Version (since = "0.2")]
public bool equal (Clutter.Color v2);
[Version (since = "0.2")]
@ -7815,8 +7867,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 +7884,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 +8279,21 @@ 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
#if HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FRAME_CLOCK_MODE_", type_id = "clutter_frame_clock_mode_get_type ()")]
public enum FrameClockMode {
FIXED,
VARIABLE
}
#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 +8709,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 +8759,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 +8854,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")]

View File

@ -2,14 +2,68 @@
[CCode (cprefix = "Cogl", gir_namespace = "Cogl", gir_version = "14", lower_case_cprefix = "cogl_")]
namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_atlas_texture_get_type ()")]
public sealed class AtlasTexture : Cogl.Texture {
[CCode (has_construct_function = false)]
protected AtlasTexture ();
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.from_bitmap (Cogl.Bitmap bmp);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, uint8 data) throws GLib.Error;
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.with_size (Cogl.Context ctx, int width, int height);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_attribute_get_type ()")]
public class Attribute : GLib.Object {
[CCode (has_construct_function = false)]
public Attribute (Cogl.AttributeBuffer attribute_buffer, string name, size_t stride, size_t offset, int components, Cogl.AttributeType type);
[CCode (has_construct_function = false)]
public Attribute.const_1f (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_2f (Cogl.Context context, string name, float component0, float component1);
[CCode (has_construct_function = false)]
public Attribute.const_2fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_2x2fv (Cogl.Context context, string name, float matrix2x2, bool transpose);
[CCode (has_construct_function = false)]
public Attribute.const_3f (Cogl.Context context, string name, float component0, float component1, float component2);
[CCode (has_construct_function = false)]
public Attribute.const_3fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_3x3fv (Cogl.Context context, string name, float matrix3x3, bool transpose);
[CCode (has_construct_function = false)]
public Attribute.const_4f (Cogl.Context context, string name, float component0, float component1, float component2, float component3);
[CCode (has_construct_function = false)]
public Attribute.const_4fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_4x4fv (Cogl.Context context, string name, float matrix4x4, bool transpose);
public unowned Cogl.AttributeBuffer get_buffer ();
public bool get_normalized ();
public void set_buffer (Cogl.AttributeBuffer attribute_buffer);
public void set_normalized (bool normalized);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_attribute_buffer_get_type ()")]
public sealed class AttributeBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public AttributeBuffer (Cogl.Context context, [CCode (array_length_cname = "bytes", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] data);
[CCode (has_construct_function = false)]
public AttributeBuffer.with_size (Cogl.Context context, size_t bytes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_bitmap_get_type ()")]
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)] 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 {
@ -19,7 +73,7 @@ namespace Cogl {
public Cogl.BufferUpdateHint get_update_hint ();
public void* map (Cogl.BufferAccess access, Cogl.BufferMapHint hints);
public void* map_range (size_t offset, size_t size, Cogl.BufferAccess access, Cogl.BufferMapHint hints) throws GLib.Error;
public bool set_data (size_t offset, void* data, size_t size);
public bool set_data (size_t offset, [CCode (array_length = false)] uint8[] data, size_t size);
public void set_update_hint (Cogl.BufferUpdateHint hint);
public void unmap ();
[NoAccessorMethod]
@ -33,20 +87,56 @@ namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_context_get_type ()")]
public class Context : GLib.Object {
[CCode (has_construct_function = false)]
protected Context ();
public Context (Cogl.Display? display) throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_foreach_feature")]
public void foreach_feature (Cogl.FeatureCallback callback);
public void free_timestamp_query (owned Cogl.TimestampQuery query);
public unowned Cogl.Display get_display ();
public int64 get_gpu_time_ns ();
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_get_graphics_reset_status")]
public Cogl.GraphicsResetStatus get_graphics_reset_status ();
public unowned Cogl.Pipeline get_named_pipeline (Cogl.PipelineKey key);
public unowned Cogl.Renderer get_renderer ();
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_has_feature")]
public bool has_feature (Cogl.FeatureID feature);
public bool is_hardware_accelerated ();
public void set_named_pipeline (Cogl.PipelineKey key, Cogl.Pipeline? pipeline);
public int64 timestamp_query_get_time_ns (Cogl.TimestampQuery query);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_display_get_type ()")]
public class Display : GLib.Object {
[CCode (has_construct_function = false)]
public Display (Cogl.Renderer renderer, Cogl.OnscreenTemplate onscreen_template);
public unowned Cogl.Renderer get_renderer ();
public void set_onscreen_template (Cogl.OnscreenTemplate onscreen_template);
public bool setup () throws GLib.Error;
}
[CCode (cheader_filename = "cogl/cogl.h", free_function = "cogl_dma_buf_handle_free", has_type_id = false)]
[Compact]
public class DmaBufHandle {
[DestroysInstance]
public void free ();
public int get_bpp ();
public int get_fd ();
public unowned Cogl.Framebuffer get_framebuffer ();
public int get_height ();
public int get_offset ();
public int get_stride ();
public int get_width ();
public void* mmap () throws GLib.Error;
public bool munmap (void* data) throws GLib.Error;
public bool sync_read_end () throws GLib.Error;
public bool sync_read_start () throws GLib.Error;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class Fence {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class FenceClosure {
public void* get_user_data ();
}
[CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_frame_closure_get_type ()")]
[Compact]
public class FrameClosure {
@ -56,6 +146,7 @@ namespace Cogl {
[CCode (has_construct_function = false)]
protected FrameInfo ();
public int64 get_frame_counter ();
public int64 get_global_frame_counter ();
public bool get_is_symbolic ();
public int64 get_presentation_time_us ();
public float get_refresh_rate ();
@ -70,9 +161,11 @@ namespace Cogl {
public abstract class Framebuffer : GLib.Object {
[CCode (has_construct_function = false)]
protected Framebuffer ();
public unowned Cogl.FenceClosure? add_fence_callback ([CCode (scope = "async")] Cogl.FenceCallback callback);
public virtual bool allocate () throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_blit_framebuffer")]
public bool blit (Cogl.Framebuffer dst, int src_x, int src_y, int dst_x, int dst_y, int width, int height) throws GLib.Error;
public void cancel_fence_callback (Cogl.FenceClosure closure);
public void clear (ulong buffers, Cogl.Color color);
public void clear4f (ulong buffers, float red, float green, float blue, float alpha);
public void discard_buffers (ulong buffers);
@ -113,6 +206,7 @@ namespace Cogl {
public void pop_clip ();
public void pop_matrix ();
public void push_matrix ();
public void push_primitive_clip (Cogl.Primitive primitive, float bounds_x1, float bounds_y1, float bounds_x2, float bounds_y2);
public void push_rectangle_clip (float x_1, float y_1, float x_2, float y_2);
public void push_region_clip (Mtk.Region region);
public bool read_pixels (int x, int y, int width, int height, Cogl.PixelFormat format, uint8 pixels);
@ -144,10 +238,57 @@ namespace Cogl {
[Compact]
public class FramebufferDriverConfig {
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_index_buffer_get_type ()")]
public sealed class IndexBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public IndexBuffer (Cogl.Context context, size_t bytes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_indices_get_type ()")]
public class Indices : GLib.Object {
[CCode (has_construct_function = false)]
public Indices (Cogl.Context context, Cogl.IndicesType type, void* indices_data, int n_indices);
[CCode (has_construct_function = false)]
public Indices.for_buffer (Cogl.IndicesType type, Cogl.IndexBuffer buffer, size_t offset);
public unowned Cogl.IndexBuffer get_buffer ();
public Cogl.IndicesType get_indices_type ();
public size_t get_offset ();
public void set_offset (size_t offset);
}
[CCode (cheader_filename = "cogl/cogl.h", ref_function = "cogl_matrix_entry_ref", type_id = "cogl_matrix_entry_get_type ()", unref_function = "cogl_matrix_entry_unref")]
[Compact]
public class MatrixEntry {
public bool calculate_translation (Cogl.MatrixEntry entry1, out float x, out float y, out float z);
public bool equal (Cogl.MatrixEntry entry1);
public Graphene.Matrix? @get (out Graphene.Matrix matrix);
public bool is_identity ();
public Cogl.MatrixEntry @ref ();
public void unref ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_matrix_stack_get_type ()")]
public class MatrixStack : GLib.Object {
[CCode (has_construct_function = false)]
public MatrixStack (Cogl.Context ctx);
public void frustum (float left, float right, float bottom, float top, float z_near, float z_far);
public Graphene.Matrix? @get (out Graphene.Matrix matrix);
public unowned Cogl.MatrixEntry get_entry ();
public bool get_inverse (out Graphene.Matrix inverse);
public void load_identity ();
public void multiply (Graphene.Matrix matrix);
public void orthographic (float x_1, float y_1, float x_2, float y_2, float near, float far);
public void perspective (float fov_y, float aspect, float z_near, float z_far);
public void pop ();
public void push ();
public void rotate (float angle, float x, float y, float z);
public void rotate_euler (Graphene.Euler euler);
public void scale (float x, float y, float z);
public void @set (Graphene.Matrix matrix);
public void translate (float x, float y, float z);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_offscreen_get_type ()")]
public class Offscreen : Cogl.Framebuffer {
[CCode (has_construct_function = false)]
protected Offscreen ();
public unowned Cogl.Texture get_texture ();
[CCode (has_construct_function = false)]
public Offscreen.with_texture (Cogl.Texture texture);
}
@ -157,23 +298,45 @@ namespace Cogl {
protected Onscreen ();
public unowned Cogl.OnscreenDirtyClosure add_dirty_callback (owned Cogl.OnscreenDirtyCallback callback);
public unowned Cogl.FrameClosure add_frame_callback (owned Cogl.FrameCallback callback);
public void add_frame_info (owned Cogl.FrameInfo info);
[NoWrapper]
public virtual void bind ();
public virtual bool direct_scanout (Cogl.Scanout scanout, Cogl.FrameInfo info) throws GLib.Error;
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]
public class OnscreenDirtyClosure {
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_onscreen_template_get_type ()")]
public class OnscreenTemplate : GLib.Object {
[CCode (has_construct_function = false)]
public OnscreenTemplate (Cogl.SwapChain swap_chain);
public void set_samples_per_pixel (int n);
public void set_stereo_enabled (bool enabled);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_output_get_type ()")]
public class Output : GLib.Object {
[CCode (has_construct_function = false)]
protected Output ();
public int get_height ();
public int get_mm_height ();
public int get_mm_width ();
public float get_refresh_rate ();
public Cogl.SubpixelOrder get_subpixel_order ();
public int get_width ();
public int get_x ();
public int get_y ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pipeline_get_type ()")]
public sealed class Pipeline : GLib.Object {
[CCode (has_construct_function = false)]
@ -186,6 +349,7 @@ namespace Cogl {
public float get_alpha_test_reference ();
public Cogl.Color get_color ();
public Cogl.PipelineCullFaceMode get_cull_face_mode ();
public Cogl.DepthState get_depth_state ();
public Cogl.Winding get_front_face_winding ();
public void get_layer_filters (int layer_index, out Cogl.PipelineFilter min_filter, out Cogl.PipelineFilter mag_filter);
public bool get_layer_point_sprite_coords_enabled (int layer_index);
@ -202,9 +366,8 @@ 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 bool set_depth_state (Cogl.DepthState state) throws GLib.Error;
public void set_front_face_winding (Cogl.Winding front_winding);
public bool set_layer_combine (int layer_index, string blend_string) throws GLib.Error;
public void set_layer_combine_constant (int layer_index, Cogl.Color constant);
@ -226,50 +389,46 @@ namespace Cogl {
public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, float value);
public void set_user_program (Cogl.Program program);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "G_TYPE_STRING")]
[Compact]
public class PipelineKey : string {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pixel_buffer_get_type ()")]
public sealed class PixelBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public PixelBuffer (Cogl.Context context, [CCode (array_length_cname = "size", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] data);
}
[CCode (cheader_filename = "cogl/cogl.h")]
public sealed class Primitive : GLib.Object {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_primitive_get_type ()")]
public class Primitive : GLib.Object {
[CCode (has_construct_function = false)]
public Primitive (Cogl.VerticesMode mode, int n_vertices, ...);
[Version (since = "1.10")]
public Cogl.Primitive copy ();
[Version (since = "1.16")]
public void draw (Cogl.Framebuffer framebuffer, Cogl.Pipeline pipeline);
public void foreach_attribute (Cogl.PrimitiveAttributeCallback callback);
public int get_first_vertex ();
[CCode (array_length = false)]
public unowned Cogl.Indices[]? get_indices ();
public Cogl.VerticesMode get_mode ();
[Version (since = "1.8")]
public int get_n_vertices ();
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2C4[] data);
public void set_first_vertex (int first_vertex);
public void set_indices ([CCode (array_length_cname = "n_indices", array_length_pos = 1.1)] Cogl.Indices[] indices);
public void set_mode (Cogl.VerticesMode mode);
[Version (since = "1.8")]
public void set_n_vertices (int n_vertices);
public static void texture_set_auto_mipmap (Cogl.Texture primitive_texture, bool value);
[CCode (has_construct_function = false)]
public Primitive.with_attributes (Cogl.VerticesMode mode, int n_vertices, [CCode (array_length_cname = "n_attributes", array_length_pos = 3.1)] Cogl.Attribute[] attributes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_program_get_type ()")]
public class Program : GLib.Object {
@ -295,9 +454,35 @@ namespace Cogl {
[Version (deprecated = true, deprecated_since = "1.16")]
public void set_uniform_matrix (int uniform_location, int dimensions, bool transpose, [CCode (array_length_cname = "count", array_length_pos = 2.5)] float[] value);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class Scanout {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_renderer_get_type ()")]
public class Renderer : GLib.Object {
[CCode (has_construct_function = false)]
public Renderer ();
public void add_constraint (Cogl.RendererConstraint constraint);
public void bind_api ();
public bool check_onscreen_template (Cogl.OnscreenTemplate onscreen_template) throws GLib.Error;
public bool connect () throws GLib.Error;
public static uint32 error_quark ();
public void foreach_output (Cogl.OutputCallback callback);
public Cogl.Driver get_driver ();
public Cogl.WinsysID get_winsys_id ();
public bool is_dma_buf_supported ();
public void remove_constraint (Cogl.RendererConstraint constraint);
public void set_driver (Cogl.Driver driver);
public void set_winsys_id (Cogl.WinsysID winsys_id);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_scanout_get_type ()")]
public sealed class Scanout : GLib.Object {
[CCode (has_construct_function = false)]
public Scanout (Cogl.ScanoutBuffer scanout_buffer);
public bool blit_to_framebuffer (Cogl.Framebuffer framebuffer, int x, int y) throws GLib.Error;
public unowned Cogl.ScanoutBuffer get_buffer ();
public void get_dst_rect (Mtk.Rectangle rect);
public void get_src_rect (Graphene.Rect rect);
public void notify_failed (Cogl.Onscreen onscreen);
public void set_dst_rect (Mtk.Rectangle rect);
public void set_src_rect (Graphene.Rect rect);
public signal void scanout_failed (Cogl.Onscreen object);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_shader_get_type ()")]
public class Shader : GLib.Object {
@ -325,6 +510,19 @@ namespace Cogl {
public void set_pre (string pre);
public void set_replace (string replace);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_sub_texture_get_type ()")]
public sealed class SubTexture : Cogl.Texture {
[CCode (has_construct_function = false, type = "CoglTexture*")]
public SubTexture (Cogl.Context ctx, Cogl.Texture parent_texture, int sub_x, int sub_y, int sub_width, int sub_height);
public unowned Cogl.Texture get_parent ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_swap_chain_get_type ()")]
public class SwapChain : GLib.Object {
[CCode (has_construct_function = false)]
public SwapChain ();
public void set_has_alpha (bool has_alpha);
public void set_length (int length);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_texture_get_type ()")]
public abstract class Texture : GLib.Object {
[CCode (has_construct_function = false)]
@ -337,6 +535,7 @@ namespace Cogl {
public int get_max_waste ();
public bool get_premultiplied ();
public uint get_width ();
public bool is_get_data_supported ();
public bool is_sliced ();
public void set_components (Cogl.TextureComponents components);
public bool set_data (Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data, int level) throws GLib.Error;
@ -358,12 +557,15 @@ 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*")]
public Texture2D.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false, type = "const uint8_t*")] uint8[] data) throws GLib.Error;
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;
[CCode (has_construct_function = false, type = "CoglTexture*")]
[Version (since = "2.0")]
public Texture2D.with_format (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2D.with_size (Cogl.Context ctx, int width, int height);
}
[CCode (cheader_filename = "cogl/cogl.h", lower_case_csuffix = "texture_2d_sliced", type_id = "cogl_texture_2d_sliced_get_type ()")]
public sealed class Texture2DSliced : Cogl.Texture {
@ -371,19 +573,22 @@ namespace Cogl {
protected Texture2DSliced ();
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.from_bitmap (Cogl.Bitmap bmp, int max_waste);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.from_data (Cogl.Context ctx, int width, int height, int max_waste, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data) throws GLib.Error;
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.with_size (Cogl.Context ctx, int width, int height, int max_waste);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class TimestampQuery {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class TraceContext {
[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 ();
public abstract int get_width ();
}
[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*")]
public Color ();
public Cogl.Color? copy ();
public bool equal ([CCode (type = "void*")] Cogl.Color v2);
public void free ();
@ -393,43 +598,29 @@ namespace Cogl {
[CCode (cname = "cogl_color_init_from_4fv")]
[Version (since = "1.4")]
public Color.from_4fv (float color_array);
[CCode (cname = "cogl_color_init_from_4ub")]
[Version (since = "1.4")]
public Color.from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
[CCode (cname = "cogl_color_init_from_hsl")]
[Version (since = "1.16")]
public Color.from_hsl (float hue, float saturation, float luminance);
public float get_alpha ();
public uint8 get_alpha_byte ();
public float get_alpha_float ();
public float get_blue ();
public uint8 get_blue_byte ();
public float get_blue_float ();
public float get_green ();
public uint8 get_green_byte ();
public float get_green_float ();
public float get_red ();
public uint8 get_red_byte ();
public float get_red_float ();
public void init_from_4f (float red, float green, float blue, float alpha);
public void init_from_4fv (float color_array);
public void init_from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
public void init_from_hsl (float hue, float saturation, float luminance);
public void premultiply ();
public void set_alpha (float alpha);
public void set_alpha_byte (uint8 alpha);
public void set_alpha_float (float alpha);
public void set_blue (float blue);
public void set_blue_byte (uint8 blue);
public void set_blue_float (float blue);
public void set_green (float green);
public void set_green_byte (uint8 green);
public void set_green_float (float green);
public void set_red (float red);
public void set_red_byte (uint8 red);
public void set_red_float (float red);
public void to_hsl (out float hue, out float saturation, out float luminance);
public void unpremultiply ();
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct DepthState {
public void get_range (float near_val, float far_val);
public bool get_test_enabled ();
public Cogl.DepthTestFunction get_test_function ();
public bool get_write_enabled ();
public void init ();
public void set_range (float near_val, float far_val);
public void set_test_enabled (bool enable);
public void set_test_function (Cogl.DepthTestFunction function);
public void set_write_enabled (bool enable);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct OnscreenDirtyInfo {
@ -438,6 +629,14 @@ namespace Cogl {
public int width;
public int height;
}
[CCode (cheader_filename = "cogl/cogl.h")]
[SimpleType]
public struct PipelineKey : char {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct PollFD {
public int fd;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct TextureVertex {
public float x;
@ -448,12 +647,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;
@ -592,6 +785,13 @@ namespace Cogl {
GEQUAL,
ALWAYS
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_DRIVER_", has_type_id = false)]
public enum Driver {
ANY,
NOP,
GL3,
GLES2
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_IMAGE_FLAG_", has_type_id = false)]
[Flags]
public enum EglImageFlags {
@ -685,6 +885,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,
@ -743,12 +944,28 @@ namespace Cogl {
public int get_n_planes ();
public unowned string to_string ();
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_POLL_FD_EVENT_", has_type_id = false)]
public enum PollFDEvent {
IN,
PRI,
OUT,
ERR,
HUP,
NVAL
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_READ_PIXELS_COLOR_", has_type_id = false)]
[Flags]
public enum ReadPixelsFlags {
[CCode (cname = "COGL_READ_PIXELS_COLOR_BUFFER")]
READ_PIXELS_COLOR_BUFFER
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_RENDERER_CONSTRAINT_USES_", has_type_id = false)]
[Flags]
public enum RendererConstraint {
X11,
XLIB,
EGL
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_SHADER_TYPE_", has_type_id = false)]
public enum ShaderType {
VERTEX,
@ -772,6 +989,15 @@ namespace Cogl {
LEFT,
RIGHT
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_SUBPIXEL_ORDER_", has_type_id = false)]
public enum SubpixelOrder {
UNKNOWN,
NONE,
HORIZONTAL_RGB,
HORIZONTAL_BGR,
VERTICAL_RGB,
VERTICAL_BGR
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_TEXTURE_COMPONENTS_", has_type_id = false)]
public enum TextureComponents {
A,
@ -808,6 +1034,14 @@ namespace Cogl {
SYNC_AND_COMPLETE_EVENT,
N_FEATURES
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ID_", has_type_id = false)]
public enum WinsysID {
ANY,
STUB,
GLX,
EGL_XLIB,
CUSTOM
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_BITMAP_ERROR_", has_type_id = false)]
public errordomain BitmapError {
FAILED,
@ -855,14 +1089,20 @@ namespace Cogl {
}
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void FeatureCallback (Cogl.FeatureID feature);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void FenceCallback (Cogl.Fence fence);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)]
public delegate void FrameCallback (Cogl.Onscreen onscreen, Cogl.FrameEvent event, Cogl.FrameInfo info);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)]
public delegate void MetaTextureCallback (Cogl.Texture sub_texture, float sub_texture_coords, float meta_coords);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 2.9)]
public delegate void OnscreenDirtyCallback (Cogl.Onscreen onscreen, Cogl.OnscreenDirtyInfo info);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void OutputCallback (Cogl.Output output);
[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", instance_pos = 2.9)]
public delegate bool PrimitiveAttributeCallback (Cogl.Primitive primitive, Cogl.Attribute attribute);
[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")]
@ -885,8 +1125,24 @@ namespace Cogl {
[Version (replacement = "Color.init_from_hsl")]
public static void color_init_from_hsl (out Cogl.Color color, float hue, float saturation, float luminance);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void debug_matrix_entry_print (Cogl.MatrixEntry entry);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void flush ();
[CCode (cheader_filename = "cogl/cogl.h")]
public static unowned Cogl.Indices get_rectangle_indices (Cogl.Context context, int n_rectangles);
[CCode (cheader_filename = "cogl/cogl.h")]
public static GLib.Source glib_renderer_source_new (Cogl.Renderer renderer, int priority);
[CCode (cheader_filename = "cogl/cogl.h")]
public static GLib.Source glib_source_new (Cogl.Context context, int priority);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void graphene_matrix_project_point (Graphene.Matrix matrix, ref float x, ref float y, ref float z, ref float w);
[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);
[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")]
public static void meta_texture_foreach_in_region (Cogl.Texture texture, float tx_1, float ty_1, float tx_2, float ty_2, Cogl.PipelineWrapMode wrap_s, Cogl.PipelineWrapMode wrap_t, Cogl.MetaTextureCallback callback);
[CCode (cheader_filename = "cogl/cogl.h")]
[Version (replacement = "PixelFormat.get_bytes_per_pixel")]
public static int pixel_format_get_bytes_per_pixel (Cogl.PixelFormat format, int plane);
[CCode (cheader_filename = "cogl/cogl.h")]
@ -896,19 +1152,17 @@ 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 poll_renderer_dispatch (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_enabled_on_thread (GLib.MainContext main_context, string group);
public static int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds, int64 timeout);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_disabled_on_thread (void* data);
[CCode (cheader_filename = "cogl/cogl.h")]
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);
}

View File

@ -1168,3 +1168,4 @@ namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h")]
public static void trace_end (Cogl.TraceHead head);
}

View File

@ -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,