vapi: Be more specific with Clutter and Cogl

Add the right dependencies and fill the custom.vala with more metadata
This commit is contained in:
David Hewitt 2020-03-12 23:08:59 +01:00 committed by Corentin Noël
parent 1c829e1a29
commit 423f104201
7 changed files with 304 additions and 1 deletions

View File

@ -134,6 +134,10 @@ color_get_static nullable
Event
.get_position.position out
Texture2D
.new_from_data skip=false
.new_from_data.data array=true
// Remove for clutter-2.0
/////////////////////////
@ -156,6 +160,10 @@ StageStateEvent struct=false base_type="Clutter.Event"
TouchEvent struct=false base_type="Clutter.Event"
TouchpadPinchEvent struct=false base_type="Clutter.Event"
TouchpadSwipeEvent struct=false base_type="Clutter.Event"
ProximityEvent struct=false base_type="Clutter.Event"
PadButtonEvent struct=false base_type="Clutter.Event"
PadRingEvent struct=false base_type="Clutter.Event"
PadStripEvent struct=false base_type="Clutter.Event"
// Keysyms used to be CLUTTER_X instead of CLUTTER_KEY_X
*#constant skip

View File

@ -19,6 +19,53 @@ namespace Cogl {
public class Shader : Cogl.Handle {
}
public interface Framebuffer {
[CCode (cheader_filename = "cogl-path/cogl-path.h")]
public void stroke_path (Cogl.Pipeline pipeline, Cogl.Path path);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_primitive_get_gtype ()")]
public class Primitive : Cogl.Object {
[CCode (has_construct_function = false)]
protected Primitive ();
[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);
}
[Compact]
[CCode (cname = "CoglHandle", cheader_filename = "cogl/cogl.h", type_id = "cogl_handle_get_gtype ()", ref_function = "cogl_program_ref", unref_function = "cogl_program_unref")]
public class Program : Cogl.Handle {
@ -40,4 +87,80 @@ namespace Cogl {
public bool is_texture ();
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2 {
public float x;
public float y;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2C4 {
public float x;
public float y;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2T2 {
public float x;
public float y;
public float s;
public float t;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2T2C4 {
public float x;
public float y;
public float s;
public float t;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3 {
public float x;
public float y;
public float z;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3C4 {
public float x;
public float y;
public float z;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3T2 {
public float x;
public float y;
public float z;
public float s;
public float t;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3T2C4 {
public float x;
public float y;
public float z;
public float s;
public float t;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
}

View File

@ -1,6 +1,7 @@
* cheader_filename="cogl/cogl.h"
Color struct
Matrix struct
Material base_type="Cogl.Handle"
MaterialLayer base_type="Cogl.Handle"

View File

@ -3,6 +3,7 @@ vapigen_args = [
'--metadatadir=@0@'.format(meson.current_source_dir()),
'--girdir=@0@'.format(mutter_typelib_dir),
'--vapidir=@0@'.format(meson.current_build_dir()),
'--vapidir=@0@'.format(meson.current_source_dir()),
]
if mutter328_dep.found()
@ -267,6 +268,7 @@ if mutter336_dep.found()
vapigen,
mutter_typelib_dir / 'Cogl-6.gir',
'--library=mutter-cogl-6',
'--pkg=mutter-cogl-path-6',
'--pkg=gobject-2.0',
'--pkg=cairo',
'--pkg=graphene-gobject-1.0',
@ -281,6 +283,7 @@ if mutter336_dep.found()
vapigen,
mutter_typelib_dir / 'CoglPango-6.gir',
'--library=mutter-cogl-pango-6',
'--pkg=mutter-cogl-path-6',
'--pkg=mutter-cogl-6',
'--pkg=pangocairo',
vapigen_args
@ -294,8 +297,10 @@ if mutter336_dep.found()
vapigen,
mutter_typelib_dir / 'Clutter-6.gir',
'--library=mutter-clutter-6',
'--pkg=graphene-gobject-1.0',
'--pkg=mutter-cogl-6',
'--pkg=mutter-cogl-pango-6',
'--pkg=mutter-cogl-path-6',
'--pkg=atk',
'--pkg=gio-2.0',
'--pkg=json-glib-1.0',
@ -312,8 +317,10 @@ if mutter336_dep.found()
vapigen,
mutter_typelib_dir / 'Meta-6.gir',
'--library=libmutter-6',
'--pkg=graphene-gobject-1.0',
'--pkg=mutter-cogl-6',
'--pkg=mutter-cogl-pango-6',
'--pkg=mutter-cogl-path-6',
'--pkg=mutter-clutter-6',
'--pkg=atk',
'--pkg=gio-2.0',
@ -321,6 +328,7 @@ if mutter336_dep.found()
'--pkg=pangocairo',
'--pkg=gtk+-3.0',
'--pkg=x11',
'--pkg=xfixes-4.0',
vapigen_args
],
depends: [ cogl_target, cogl_pango_target, clutter_target ],

View File

@ -4564,6 +4564,7 @@ namespace Clutter {
public const uint zstroke;
}
namespace Threads {
#if !HAS_MUTTER336
namespace FrameSource {
[CCode (cheader_filename = "clutter/clutter.h", cname = "clutter_threads_add_frame_source")]
[Version (deprecated = true, deprecated_since = "1.6", since = "0.8")]
@ -4572,6 +4573,7 @@ namespace Clutter {
[Version (deprecated = true, deprecated_since = "1.6", since = "0.8")]
public static uint add_full (int priority, uint fps, owned GLib.SourceFunc func);
}
#endif
namespace Idle {
[CCode (cheader_filename = "clutter/clutter.h", cname = "clutter_threads_add_idle")]
[Version (since = "0.4")]
@ -4594,6 +4596,7 @@ namespace Clutter {
[CCode (cheader_filename = "clutter/clutter.h")]
[Version (since = "1.10")]
public static uint add_repaint_func_full (Clutter.RepaintFlags flags, owned GLib.SourceFunc func);
#if !HAS_MUTTER336
[CCode (cheader_filename = "clutter/clutter.h")]
[Version (deprecated = true, deprecated_since = "1.12", since = "0.4")]
public static void enter ();
@ -4603,6 +4606,7 @@ namespace Clutter {
[CCode (cheader_filename = "clutter/clutter.h")]
[Version (deprecated = true, deprecated_since = "1.12", since = "0.4")]
public static void leave ();
#endif
[CCode (cheader_filename = "clutter/clutter.h")]
[Version (since = "1.0")]
public static void remove_repaint_func (uint handle_id);
@ -4612,11 +4616,13 @@ namespace Clutter {
public static void set_lock_functions (GLib.Callback enter_fn, GLib.Callback leave_fn);
#endif
}
#if !HAS_MUTTER336
namespace Util {
[CCode (cheader_filename = "clutter/clutter.h", cname = "clutter_util_next_p2")]
[Version (deprecated = true, deprecated_since = "1.2")]
public static int next_power_of_2 (int a);
}
#endif
namespace Value {
[CCode (cheader_filename = "clutter/clutter.h")]
[Version (since = "1.10")]
@ -4739,15 +4745,22 @@ namespace Clutter {
[Version (since = "1.4")]
public bool contains (Clutter.Actor descendant);
[Version (since = "1.8")]
#if HAS_MUTTER336
public void continue_paint (Clutter.PaintContext paint_context);
public void continue_pick (Clutter.PickContext pick_context);
#else
public void continue_paint ();
#endif
[Version (since = "1.0")]
public Pango.Context create_pango_context ();
[Version (since = "1.0")]
public Pango.Layout create_pango_layout (string? text);
[Version (since = "1.10")]
public void destroy_all_children ();
#if !HAS_MUTTER336
[Version (deprecated = true, deprecated_since = "1.12", since = "1.4")]
public void detach_animation ();
#endif
[CCode (cname = "clutter_actor_event")]
[Version (since = "0.6")]
public bool emit_event (Clutter.Event event, bool capture);
@ -6738,7 +6751,7 @@ namespace Clutter {
public void update_from_event (Clutter.Event event, bool update_stage);
#if HAS_MUTTER336
[NoWrapper]
public virtual void update_from_tool (Clutter.InputDeviceTool tool);
public virtual void update_from_tool (Clutter.InputDeviceTool tool);
#endif
[NoAccessorMethod]
[Version (since = "1.6")]

View File

@ -270,6 +270,47 @@ namespace Cogl {
[Version (since = "2.0")]
public void set_user_program (Cogl.Handle program);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_primitive_get_gtype ()")]
public class Primitive : Cogl.Object {
[CCode (has_construct_function = false)]
protected Primitive ();
[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", cname = "CoglHandle", ref_function = "cogl_program_ref", type_id = "cogl_handle_get_gtype ()", unref_function = "cogl_program_unref")]
[Compact]
public class Program : Cogl.Handle {
@ -441,6 +482,8 @@ namespace Cogl {
public void set_stereo_mode (Cogl.StereoMode stereo_mode);
[Version (since = "1.8")]
public void set_viewport (float x, float y, float width, float height);
[CCode (cheader_filename = "cogl-path/cogl-path.h")]
public void stroke_path (Cogl.Pipeline pipeline, Cogl.Path path);
[Version (since = "1.10")]
public void transform (Cogl.Matrix matrix);
[Version (since = "1.10")]
@ -642,6 +685,82 @@ namespace Cogl {
public struct UserDataKey {
public int unused;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2 {
public float x;
public float y;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2C4 {
public float x;
public float y;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2T2 {
public float x;
public float y;
public float s;
public float t;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2T2C4 {
public float x;
public float y;
public float s;
public float t;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3 {
public float x;
public float y;
public float z;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3C4 {
public float x;
public float y;
public float z;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3T2 {
public float x;
public float y;
public float z;
public float s;
public float t;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP3T2C4 {
public float x;
public float y;
public float z;
public float s;
public float t;
public uint8 r;
public uint8 g;
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_ATTRIBUTE_TYPE_", has_type_id = false)]
[Version (since = "1.0")]
public enum AttributeType {

View File

@ -0,0 +1,31 @@
/* mutter-cogl-pango-6.vapi generated by vapigen, do not modify. */
[CCode (cprefix = "CoglPango", gir_namespace = "CoglPango", gir_version = "6", lower_case_cprefix = "cogl_pango_")]
namespace CoglPango {
[CCode (cheader_filename = "cogl-pango.h", type_id = "cogl_pango_renderer_get_type ()")]
public class Renderer : Pango.Renderer {
[CCode (has_construct_function = false)]
protected Renderer ();
[NoAccessorMethod]
public void* context { construct; }
}
[CCode (cheader_filename = "cogl-pango.h")]
public interface FontMap : Pango.CairoFontMap, GLib.Object {
[Version (since = "1.0")]
public void clear_glyph_cache ();
public Pango.Context create_context ();
[Version (since = "1.0")]
public unowned Pango.Renderer get_renderer ();
[Version (since = "1.0")]
public bool get_use_mipmapping ();
[Version (since = "1.14")]
public static Pango.FontMap @new ();
[Version (since = "1.14")]
public void set_resolution (double dpi);
[Version (since = "1.0")]
public void set_use_mipmapping (bool value);
}
[CCode (cheader_filename = "cogl-pango.h")]
[Version (since = "1.0")]
public static void ensure_glyph_cache_for_layout (Pango.Layout layout);
}