]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libxklavier: Add new bindings
authorDaiki Ueno <ueno@unixuser.org>
Thu, 15 Nov 2012 01:22:15 +0000 (10:22 +0900)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 25 Nov 2012 20:32:45 +0000 (21:32 +0100)
Fixes bug 688358.

vapi/Makefile.am
vapi/libxklavier.deps [new file with mode: 0644]
vapi/libxklavier.vapi [new file with mode: 0644]
vapi/metadata/Xkl-1.0-custom.vala [new file with mode: 0644]
vapi/metadata/Xkl-1.0.metadata [new file with mode: 0644]

index 6a716a693b1da502e30d77119e1f9c9e1121be23..98bb317af56f98b8c3b6662d5725faa7fdf12930 100644 (file)
@@ -215,6 +215,8 @@ dist_vapi_DATA = \
        libwnck-1.0.vapi \
        libwnck-3.0.deps \
        libwnck-3.0.vapi \
+       libxklavier.vapi \
+       libxklavier.deps \
        libxml-2.0.vapi \
        linux.deps \
        linux.vapi \
@@ -393,6 +395,7 @@ GIR_BINDINGS = \
        udisks2 \
        vte-2.90 \
        $(GSTREAMER_1_0_BINDINGS) \
+       libxklavier \
        $(NULL)
 
 BINDINGS = $(GIR_BINDINGS) $(GIDL_BINDINGS)
@@ -673,6 +676,9 @@ libwnck-1.0:
 libwnck-3.0:
        $(GENVAPI) --library $(srcdir)/libwnck-3.0 --metadatadir $(METADATADIR) --pkg gio-2.0 --pkg gtk+-3.0 $(GIRDIR)/Wnck-3.0.gir
 
+libxklavier:
+       $(GENVAPI) --library $(srcdir)/libxklavier --metadatadir $(METADATADIR) --pkg x11 $(GIRDIR)/Xkl-1.0.gir $(METADATADIR)/Xkl-1.0-custom.vala
+
 loudmouth-1.0:
        $(GENVAPI) --library $(srcdir)/loudmouth-1.0 $(PACKAGESDIR)/loudmouth-1.0/loudmouth-1.0-custom.vala $(PACKAGESDIR)/loudmouth-1.0/loudmouth-1.0.gi
 
diff --git a/vapi/libxklavier.deps b/vapi/libxklavier.deps
new file mode 100644 (file)
index 0000000..e181da0
--- /dev/null
@@ -0,0 +1 @@
+x11
diff --git a/vapi/libxklavier.vapi b/vapi/libxklavier.vapi
new file mode 100644 (file)
index 0000000..ae08e60
--- /dev/null
@@ -0,0 +1,185 @@
+/* libxklavier.vapi generated by vapigen, do not modify. */
+
+[CCode (cprefix = "Xkl", gir_namespace = "Xkl", gir_version = "1.0", lower_case_cprefix = "xkl_")]
+namespace Xkl {
+       [CCode (cheader_filename = "libxklavier/xklavier.h", type_id = "xkl_config_item_get_type ()")]
+       public class ConfigItem : GLib.Object {
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak char[] description;
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak char[] name;
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak char[] short_description;
+               [CCode (has_construct_function = false)]
+               public ConfigItem ();
+               public void set_description (string? description);
+               public void set_name (string? name);
+               public void set_short_description (string? short_description);
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", type_id = "xkl_config_rec_get_type ()")]
+       public class ConfigRec : GLib.Object {
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak string[] layouts;
+               public weak string model;
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak string[] options;
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak string[] variants;
+               [CCode (has_construct_function = false)]
+               public ConfigRec ();
+               public bool activate (Xkl.Engine engine);
+               public bool equals (Xkl.ConfigRec data2);
+               public bool get_from_backup (Xkl.Engine engine);
+               public bool get_from_root_window_property (X.Atom rules_atom_name, string rules_file_out, Xkl.Engine engine);
+               public bool get_from_server (Xkl.Engine engine);
+               public void reset ();
+               public void set_layouts ([CCode (array_length = false, array_null_terminated = true)] string[] new_layouts);
+               public void set_options ([CCode (array_length = false, array_null_terminated = true)] string[] new_options);
+               public bool set_to_root_window_property (X.Atom rules_atom_name, string rules_file, Xkl.Engine engine);
+               public void set_variants ([CCode (array_length = false, array_null_terminated = true)] string[] new_variants);
+               public static bool write_to_file (Xkl.Engine engine, string file_name, Xkl.ConfigRec data, bool binary);
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", type_id = "xkl_config_registry_get_type ()")]
+       public class ConfigRegistry : GLib.Object {
+               [CCode (has_construct_function = false)]
+               protected ConfigRegistry ();
+               public bool find_layout (Xkl.ConfigItem item);
+               public bool find_model (Xkl.ConfigItem item);
+               public bool find_option (string option_group_name, Xkl.ConfigItem item);
+               public bool find_option_group (Xkl.ConfigItem item);
+               public bool find_variant (string layout_name, Xkl.ConfigItem item);
+               public void foreach_country (Xkl.ConfigItemProcessFunc func);
+               public void foreach_country_variant (string country_code, Xkl.TwoConfigItemsProcessFunc func);
+               public void foreach_language (Xkl.ConfigItemProcessFunc func);
+               public void foreach_language_variant (string language_code, Xkl.TwoConfigItemsProcessFunc func);
+               public void foreach_layout (Xkl.ConfigItemProcessFunc func);
+               public void foreach_layout_variant (string layout_name, Xkl.ConfigItemProcessFunc func);
+               public void foreach_model (Xkl.ConfigItemProcessFunc func);
+               public void foreach_option (string option_group_name, Xkl.ConfigItemProcessFunc func);
+               public void foreach_option_group (Xkl.ConfigItemProcessFunc func);
+               public static unowned Xkl.ConfigRegistry get_instance (Xkl.Engine engine);
+               public bool load (bool if_extras_needed);
+               public void search_by_pattern (string pattern, Xkl.TwoConfigItemsProcessFunc func);
+               [NoAccessorMethod]
+               public Xkl.Engine engine { owned get; construct; }
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public class Engine : GLib.Object {
+               [CCode (has_construct_function = false)]
+               protected Engine ();
+               public static void INT__LONG_LONG (GLib.Closure closure, GLib.Value return_value, uint n_param_values, GLib.Value param_values, void* invocation_hint, void* marshal_data);
+               public static void VOID__FLAGS_INT_BOOLEAN (GLib.Closure closure, GLib.Value return_value, uint n_param_values, GLib.Value param_values, void* invocation_hint, void* marshal_data);
+               public void allow_one_switch_to_secondary_group ();
+               public bool backup_names_prop ();
+               [NoWrapper]
+               public virtual void config_notify ();
+               public void delete_state (X.Window win);
+               public int filter_events ([CCode (type = "XEvent*")] X.Event* evt);
+               public unowned string get_backend_name ();
+               public unowned Xkl.State get_current_state ();
+               public X.Window get_current_window ();
+               public int get_current_window_group ();
+               public int get_default_group ();
+               public uint get_features ();
+               [CCode (array_length = false, array_null_terminated = true)]
+               public unowned string[] get_groups_names ();
+               public bool get_indicators_handling ();
+               [CCode (array_length = false, array_null_terminated = true)]
+               public unowned string[] get_indicators_names ();
+               public static unowned Xkl.Engine get_instance (X.Display display);
+               public uint get_max_num_groups ();
+               public int get_next_group ();
+               public uint get_num_groups ();
+               public int get_prev_group ();
+               public uint get_secondary_groups_mask ();
+               public bool get_state (X.Window win, Xkl.State state_out);
+               public string get_window_title (X.Window win);
+               public bool grab_key (int keycode, uint modifiers);
+               public bool is_group_per_toplevel_window ();
+               public bool is_window_from_same_toplevel_window (X.Window win1, X.Window win2);
+               public bool is_window_transparent (X.Window win);
+               public void lock_group (int group);
+               [NoWrapper]
+               public virtual void new_device_notify ();
+               [NoWrapper]
+               public virtual int new_window_notify (X.Window win, X.Window parent);
+               public int pause_listen ();
+               public int resume_listen ();
+               public void save_state (X.Window win, Xkl.State state);
+               public void set_default_group (int group);
+               public void set_group_per_toplevel_window (bool is_global);
+               public void set_indicators_handling (bool whether_handle);
+               public void set_secondary_groups_mask (uint mask);
+               public void set_window_transparent (X.Window win, bool transparent);
+               public int start_listen (uint flags);
+               [NoWrapper]
+               public virtual void state_notify (Xkl.EngineStateChange change_type, int group, bool restore);
+               public int stop_listen (uint flags);
+               public bool ungrab_key (int keycode, uint modifiers);
+               [NoAccessorMethod]
+               public string backendName { owned get; }
+               public uint default_group { get; }
+               [NoAccessorMethod]
+               public void* display { get; construct; }
+               public bool indicators_handling { get; }
+               public uint max_num_groups { get; }
+               public uint num_groups { get; }
+               public uint secondary_groups_mask { get; }
+               [CCode (cname = "X_config_changed")]
+               public signal void X_config_changed ();
+               [CCode (cname = "X_new_device")]
+               public signal void X_new_device ();
+               [CCode (cname = "X_state_changed")]
+               public signal void X_state_changed (int type, int group, bool restore);
+               public signal int new_toplevel_window (long object, long p0);
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "xkl_state_get_type ()")]
+       [Compact]
+       public class State {
+               public int32 group;
+               public uint32 indicators;
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cprefix = "XKLF_", has_type_id = false)]
+       [Flags]
+       public enum EngineFeatures {
+               CAN_TOGGLE_INDICATORS,
+               CAN_OUTPUT_CONFIG_AS_ASCII,
+               CAN_OUTPUT_CONFIG_AS_BINARY,
+               MULTIPLE_LAYOUTS_SUPPORTED,
+               REQUIRES_MANUAL_LAYOUT_MANAGEMENT,
+               DEVICE_DISCOVERY
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cprefix = "XKLL_", has_type_id = false)]
+       public enum EngineListenModes {
+               MANAGE_WINDOW_STATES,
+               TRACK_KEYBOARD_STATE,
+               MANAGE_LAYOUTS
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cprefix = "", has_type_id = false)]
+       public enum EngineStateChange {
+               [CCode (cname = "GROUP_CHANGED")]
+               ROUP_CHANGED,
+               [CCode (cname = "INDICATORS_CHANGED")]
+               NDICATORS_CHANGED
+       }
+       [CCode (cheader_filename = "libxklavier/xklavier.h", has_target = false)]
+       public delegate void ConfigItemProcessFunc (Xkl.ConfigRegistry config, Xkl.ConfigItem item, void* data);
+       [CCode (cheader_filename = "libxklavier/xklavier.h", has_target = false)]
+       public delegate void TwoConfigItemsProcessFunc (Xkl.ConfigRegistry config, Xkl.ConfigItem item, Xkl.ConfigItem subitem, void* data);
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cname = "XKL_MAX_CI_DESC_LENGTH")]
+       public const int MAX_CI_DESC_LENGTH;
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cname = "XKL_MAX_CI_NAME_LENGTH")]
+       public const int MAX_CI_NAME_LENGTH;
+       [CCode (cheader_filename = "libxklavier/xklavier.h", cname = "XKL_MAX_CI_SHORT_DESC_LENGTH")]
+       public const int MAX_CI_SHORT_DESC_LENGTH;
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public static unowned string get_country_name (string code);
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public static unowned string get_language_name (string code);
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public static unowned string get_last_error ();
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public static bool restore_names_prop (Xkl.Engine engine);
+       [CCode (cheader_filename = "libxklavier/xklavier.h")]
+       public static void set_debug_level (int level);
+}
diff --git a/vapi/metadata/Xkl-1.0-custom.vala b/vapi/metadata/Xkl-1.0-custom.vala
new file mode 100644 (file)
index 0000000..e7a65f2
--- /dev/null
@@ -0,0 +1,11 @@
+namespace Xkl {
+       public class Engine : GLib.Object {
+               // Prevent signal names from being converted to lower case.
+               [CCode (cname = "X_config_changed")]
+               public signal void X_config_changed ();
+               [CCode (cname = "X_new_device")]
+               public signal void X_new_device ();
+               [CCode (cname = "X_state_changed")]
+               public signal void X_state_changed (int type, int group, bool restore);
+       }
+}
diff --git a/vapi/metadata/Xkl-1.0.metadata b/vapi/metadata/Xkl-1.0.metadata
new file mode 100644 (file)
index 0000000..f1647d4
--- /dev/null
@@ -0,0 +1,6 @@
+Xkl cheader_filename="libxklavier/xklavier.h"
+Engine
+        .filter_events.evt type="X.Event*"
+        .X_state_changed skip
+        .X_config_changed skip
+        .X_new_device skip