From 5fb1676e99c4f4bd13e9392bd346c87595dd13b4 Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Mon, 13 Jun 2011 14:59:54 +0200 Subject: [PATCH 1/1] Add non-generated Vala binding --- libchimara/Makefile.am | 11 +++- libchimara/chimara.vapi | 138 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 libchimara/chimara.vapi diff --git a/libchimara/Makefile.am b/libchimara/Makefile.am index 7724b74..f1ef3f4 100644 --- a/libchimara/Makefile.am +++ b/libchimara/Makefile.am @@ -88,7 +88,11 @@ Chimara_1_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gtk-2.0 Chimara_1_0_gir_CFLAGS = @CHIMARA_CFLAGS@ -I$(top_srcdir) Chimara_1_0_gir_LIBS = libchimara.la Chimara_1_0_gir_FILES = $(introspection_sources) -Chimara_1_0_gir_SCANNERFLAGS = --warn-all +Chimara_1_0_gir_SCANNERFLAGS = \ + --warn-all \ + --c-include='libchimara/chimara-glk.h' \ + --c-include='libchimara/chimara-if.h' +Chimara_1_0_gir_EXPORT_PACKAGES = chimara INTROSPECTION_GIRS += Chimara-1.0.gir girdir = $(datadir)/gir-1.0 @@ -100,4 +104,9 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) CLEANFILES += $(gir_DATA) $(typelib_DATA) endif +# Currently, install the Vala VAPI file statically - generation is broken? + +vapidir = $(datadir)/vala/vapi +dist_vapi_DATA = chimara.vapi + -include $(top_srcdir)/git.mk diff --git a/libchimara/chimara.vapi b/libchimara/chimara.vapi new file mode 100644 index 0000000..7b014d8 --- /dev/null +++ b/libchimara/chimara.vapi @@ -0,0 +1,138 @@ +/* chimara.vapi generated by vapigen, do not modify. */ + +[CCode (cprefix = "Chimara", lower_case_cprefix = "chimara_", gir_namespace = "Chimara", gir_version = "1.0")] +namespace Chimara { + [CCode (cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public class Glk : Gtk.Container, Atk.Implementor, Gtk.Buildable { + [CCode (type = "GtkWidget*", has_construct_function = false)] + public Glk (); + public void feed_char_input (uint32 keyval); + public void feed_line_input (string text); + public bool get_interactive (); + public bool get_protect (); + public bool get_running (); + public uint get_spacing (); + public unowned Gtk.TextTag get_tag (Chimara.GlkWindowType window, string name); + public unowned string[] get_tag_names (out uint num_tags); + public bool is_char_input_pending (); + public bool is_line_input_pending (); + public bool run (string plugin, int argc, string argv) throws GLib.Error; + public bool set_css_from_file (string filename) throws GLib.Error; + public void set_css_from_string (string css); + public void set_css_to_default (); + public void set_interactive (bool interactive); + public void set_protect (bool protect); + public void set_resource_load_callback (owned Chimara.ResourceLoadFunc func); + public void set_spacing (uint spacing); + public void stop (); + public void update_style (); + public void wait (); + public bool interactive { get; set construct; } + [NoAccessorMethod] + public string program_info { get; } + [NoAccessorMethod] + public string program_name { get; } + public bool protect { get; set construct; } + public uint spacing { get; set construct; } + [NoAccessorMethod] + public string story_name { get; } + public signal void char_input (uint object, uint p0); + public signal void iliad_screen_update (bool object); + public signal void line_input (uint object, string p0); + public signal void started (); + public signal void stopped (); + public signal void text_buffer_output (uint object, string p0); + public signal void waiting (); + } + [CCode (cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public class IF : Chimara.Glk, Atk.Implementor, Gtk.Buildable { + [CCode (type = "GtkWidget*", has_construct_function = false)] + public IF (); + public Chimara.IFFormat get_format (); + public Chimara.IFInterpreter get_interpreter (); + public Chimara.IFInterpreter get_preferred_interpreter (Chimara.IFFormat format); + public bool run_game (string gamefile) throws GLib.Error; + public void set_preferred_interpreter (Chimara.IFFormat format, Chimara.IFInterpreter interpreter); + [NoAccessorMethod] + public bool expand_abbreviations { get; set construct; } + [NoAccessorMethod] + public string graphics_file { get; set construct; } + [NoAccessorMethod] + public bool ignore_errors { get; set construct; } + [NoAccessorMethod] + public uint interpreter_number { get; set construct; } + [NoAccessorMethod] + public bool piracy_mode { get; set construct; } + [NoAccessorMethod] + public int random_seed { get; set; } + [NoAccessorMethod] + public bool random_seed_set { get; set construct; } + [NoAccessorMethod] + public bool tandy_bit { get; set construct; } + [NoAccessorMethod] + public bool typo_correction { get; set construct; } + public signal void command (string object, string p0); + } + [CCode (cprefix = "CHIMARA_GLK_TEXT_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public enum GlkWindowType { + BUFFER, + GRID + } + [CCode (cprefix = "CHIMARA_IF_FORMAT_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public enum IFFormat { + [CCode (cname = "CHIMARA_IF_FORMAT_Z5")] + FORMAT_Z5, + [CCode (cname = "CHIMARA_IF_FORMAT_Z6")] + FORMAT_Z6, + [CCode (cname = "CHIMARA_IF_FORMAT_Z8")] + FORMAT_Z8, + [CCode (cname = "CHIMARA_IF_FORMAT_Z_BLORB")] + FORMAT_Z_BLORB, + [CCode (cname = "CHIMARA_IF_FORMAT_GLULX")] + FORMAT_GLULX, + [CCode (cname = "CHIMARA_IF_FORMAT_GLULX_BLORB")] + FORMAT_GLULX_BLORB + } + [CCode (cprefix = "CHIMARA_IF_INTERPRETER_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public enum IFInterpreter { + [CCode (cname = "CHIMARA_IF_INTERPRETER_FROTZ")] + INTERPRETER_FROTZ, + [CCode (cname = "CHIMARA_IF_INTERPRETER_NITFOL")] + INTERPRETER_NITFOL, + [CCode (cname = "CHIMARA_IF_INTERPRETER_GLULXE")] + INTERPRETER_GLULXE, + [CCode (cname = "CHIMARA_IF_INTERPRETER_GIT")] + INTERPRETER_GIT + } + [CCode (cprefix = "CHIMARA_IF_ZMACHINE_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public enum IFZmachineVersion { + DEFAULT, + DECSYSTEM_20, + APPLE_IIE, + MACINTOSH, + AMIGA, + ATARI_ST, + IBM_PC, + COMMODORE_128, + COMMODORE_64, + APPLE_IIC, + APPLE_IIGS, + TANDY_COLOR + } + [CCode (cprefix = "CHIMARA_RESOURCE_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public enum ResourceType { + SOUND, + IMAGE + } + [CCode (cprefix = "ERROR_", cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public errordomain Error { + LOAD_MODULE_ERROR, + NO_GLK_MAIN, + PLUGIN_NOT_FOUND, + PLUGIN_ALREADY_RUNNING, + } + [CCode (cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h", instance_pos = 2.9)] + public delegate string ResourceLoadFunc (Chimara.ResourceType usage, uint32 resnum); + [CCode (cheader_filename = "libchimara/chimara-glk.h,libchimara/chimara-if.h")] + public static GLib.Quark error_quark (); +} -- 2.30.2