From 452430a8877fcfbccc5c8a941c7d20f8779e9f12 Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Wed, 27 Jul 2011 16:10:05 -0700 Subject: [PATCH] Add rest-0.7 bindings Fixes bug 655411. --- vapi/Makefile.am | 4 + vapi/metadata/Rest-0.7.metadata | 46 +++++++ vapi/rest-0.7.vapi | 225 ++++++++++++++++++++++++++++++++ 3 files changed, 275 insertions(+) create mode 100644 vapi/metadata/Rest-0.7.metadata create mode 100644 vapi/rest-0.7.vapi diff --git a/vapi/Makefile.am b/vapi/Makefile.am index 0e8488c8c..53ff55117 100644 --- a/vapi/Makefile.am +++ b/vapi/Makefile.am @@ -199,6 +199,7 @@ dist_vapi_DATA = \ rest-0.6.vapi \ rest-extras-0.6.deps \ rest-extras-0.6.vapi \ + rest-0.7.vapi \ sdl.vapi \ sdl-gfx.vapi \ sdl-gfx.deps \ @@ -260,5 +261,8 @@ libsoup-2.4: libpeas-1.0: $(VAPIGEN) --library $(srcdir)/libpeas-1.0 --metadatadir $(METADATADIR) $(GIRDIR)/Peas-1.0.gir +rest-0.7: + $(VAPIGEN) --library $(srcdir)/rest-0.7 --metadatadir $(METADATADIR) $(GIRDIR)/Rest-0.7.gir + vte-2.90: $(VAPIGEN) --library $(srcdir)/vte-2.90 --metadatadir $(METADATADIR) --pkg atk --pkg gdk-3.0 --pkg gtk+-3.0 --pkg gio-2.0 --pkg pango $(GIRDIR)/Vte-2.90.gir $(METADATADIR)/Vte-2.90-custom.vala diff --git a/vapi/metadata/Rest-0.7.metadata b/vapi/metadata/Rest-0.7.metadata new file mode 100644 index 000000000..8d8ce9893 --- /dev/null +++ b/vapi/metadata/Rest-0.7.metadata @@ -0,0 +1,46 @@ +OAuthProxy cheader_filename="rest/oauth-proxy.h" cprefix="oauth_proxy_" +OAuthProxyCall cheader_filename="rest/oauth-proxy-call.h" cprefix="oauth_proxy_call_" +OAuthSignatureMethod cheader_filename="rest/oauth-proxy.h" +OAuth2Proxy cheader_filename="rest/oauth2-proxy.h" cprefix="oauth2_proxy_" +OAuth2ProxyCall cheader_filename="rest/oauth2-proxy-call.h" cprefix="oauth2_proxy_call_" +Proxy cheader_filename="rest/rest-proxy.h" + .new_call skip=false owned=true + .bind skip=false +ProxyCall cheader_filename="rest/rest-proxy-call.h" + .run.loop out=true default=null + .get_params skip=false + .get_response_headers skip=false + .add_headers skip=false + .add_params skip=false + .continuous skip=false + .upload skip=false + .async skip=false name="run_async" + .async.weak_object nullable default=null +MemoryUse cheader_filename="rest/rest-param.h" +ProxyError cheader_filename="rest/rest-proxy.h" +ProxyCallError cheader_filename="rest/rest-proxy-call.h" +Param cheader_filename="rest/rest-param.h" +Params cheader_filename="rest/rest-params.h" + .as_string_hash_table skip=false owned=true type_arguments="string,string" +ParamsIter cheader_filename="rest/rest-params.h" +XmlNode cheader_filename="rest/rest-xml-node.h" +XmlParser cheader_filename="rest/rest-xml-parser.h" + +OAuthProxyAuthCallback cheader_filename="rest/oauth-proxy.h" + .error nullable=true + .weak_object nullable=true + .userdata closure=3 +ProxyCallAsyncCallback cheader_filename="rest/rest-proxy-call.h" + .error nullable=true + .weak_object nullable=true + .userdata closure=3 +ProxyCallContinuousCallback cheader_filename="rest/rest-proxy-call.h" + .error nullable=true + .weak_object nullable=true + .userdata closure=5 +ProxyCallUploadCallback cheader_filename="rest/rest-proxy-call.h" + .error nullable=true + .weak_object nullable=true + .userdata closure=5 + +hmac_sha1 skip=true diff --git a/vapi/rest-0.7.vapi b/vapi/rest-0.7.vapi new file mode 100644 index 000000000..7c140a31a --- /dev/null +++ b/vapi/rest-0.7.vapi @@ -0,0 +1,225 @@ +/* rest-0.7.vapi generated by lt-vapigen, do not modify. */ + +[CCode (cprefix = "Rest", lower_case_cprefix = "rest_", gir_namespace = "Rest", gir_version = "0.7")] +namespace Rest { + [CCode (cname = "OAuth2Proxy", cprefix = "oauth2_proxy_", type_id = "oauth2_proxy_get_type ()", cheader_filename = "rest/oauth2-proxy.h")] + public class OAuth2Proxy : Rest.Proxy { + [CCode (type = "RestProxy*", has_construct_function = false)] + public OAuth2Proxy (string client_id, string auth_endpoint, string url_format, bool binding_required); + public string build_login_url (string redirect_uri); + public string build_login_url_full (string redirect_uri, GLib.HashTable extra_params); + public static string extract_access_token (string url); + public unowned string get_access_token (); + public void set_access_token (string access_token); + [CCode (type = "RestProxy*", has_construct_function = false)] + public OAuth2Proxy.with_token (string client_id, string access_token, string auth_endpoint, string url_format, bool binding_required); + public string access_token { get; set; } + [NoAccessorMethod] + public string auth_endpoint { owned get; construct; } + [NoAccessorMethod] + public string client_id { owned get; construct; } + } + [CCode (cname = "OAuth2ProxyCall", cprefix = "oauth2_proxy_call_", type_id = "oauth2_proxy_call_get_type ()", cheader_filename = "rest/oauth2-proxy-call.h")] + public class OAuth2ProxyCall : Rest.ProxyCall { + [CCode (has_construct_function = false)] + protected OAuth2ProxyCall (); + } + [CCode (cname = "OAuthProxy", cprefix = "oauth_proxy_", type_id = "oauth_proxy_get_type ()", cheader_filename = "rest/oauth-proxy.h")] + public class OAuthProxy : Rest.Proxy { + [CCode (type = "RestProxy*", has_construct_function = false)] + public OAuthProxy (string consumer_key, string consumer_secret, string url_format, bool binding_required); + public bool access_token (string function, string verifier) throws GLib.Error; + public bool auth_step (string function) throws GLib.Error; + public unowned string get_signature_host (); + public unowned string get_token (); + public unowned string get_token_secret (); + public bool is_oauth10a (); + public bool request_token (string function, string callback_uri) throws GLib.Error; + public void set_signature_host (string signature_host); + public void set_token (string token); + public void set_token_secret (string token_secret); + [CCode (type = "RestProxy*", has_construct_function = false)] + public OAuthProxy.with_token (string consumer_key, string consumer_secret, string token, string token_secret, string url_format, bool binding_required); + [NoAccessorMethod] + public string consumer_key { owned get; construct; } + [NoAccessorMethod] + public string consumer_secret { owned get; construct; } + public string signature_host { get; set; } + [NoAccessorMethod] + public Rest.OAuthSignatureMethod signature_method { get; set; } + public string token { get; set; } + public string token_secret { get; set; } + } + [CCode (cname = "OAuthProxyCall", cprefix = "oauth_proxy_call_", type_id = "oauth_proxy_call_get_type ()", cheader_filename = "rest/oauth-proxy-call.h")] + public class OAuthProxyCall : Rest.ProxyCall { + [CCode (has_construct_function = false)] + protected OAuthProxyCall (); + public void parse_token_reponse (); + } + [Compact] + [CCode (cheader_filename = "rest/rest-param.h")] + public class Param { + public size_t get_content_length (); + public unowned string get_content_type (); + public unowned string get_file_name (); + public unowned string get_name (); + public bool is_string (); + public void unref (); + } + [Compact] + [CCode (cheader_filename = "rest/rest-params.h")] + public class Params { + public void add (Rest.Param param); + public bool are_strings (); + public unowned GLib.HashTable as_string_hash_table (); + public void free (); + public void remove (string name); + } + [Compact] + [CCode (cheader_filename = "rest/rest-params.h")] + public class ParamsIter { + public void init (Rest.Params @params); + public bool next (string name, Rest.Param param); + } + [CCode (type_id = "rest_proxy_get_type ()", cheader_filename = "rest/rest-proxy.h")] + public class Proxy : GLib.Object { + [CCode (has_construct_function = false)] + public Proxy (string url_format, bool binding_required); + public bool bind (...); + public unowned string get_user_agent (); + public virtual unowned Rest.ProxyCall new_call (); + public void set_user_agent (string user_agent); + [NoAccessorMethod] + public bool binding_required { get; set; } + [NoAccessorMethod] + public bool disable_cookies { get; construct; } + [NoAccessorMethod] + public string url_format { owned get; set; } + public string user_agent { get; set; } + } + [CCode (type_id = "rest_proxy_call_get_type ()", cheader_filename = "rest/rest-proxy-call.h")] + public class ProxyCall : GLib.Object { + [CCode (has_construct_function = false)] + protected ProxyCall (); + public void add_header (string header, string value); + public void add_headers (...); + public void add_param (string name, string value); + public void add_param_full (Rest.Param param); + public void add_params (...); + public bool cancel (); + public bool continuous ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallContinuousCallback cb, GLib.Object weak_object) throws GLib.Error; + public unowned string get_method (); + public unowned Rest.Params get_params (); + public unowned string get_payload (); + public int64 get_payload_length (); + public unowned GLib.HashTable get_response_headers (); + public uint get_status_code (); + public unowned string get_status_message (); + public unowned string lookup_header (string header); + public unowned string lookup_response_header (string header); + [NoWrapper] + public virtual bool prepare () throws GLib.Error; + public void remove_header (string header); + public void remove_param (string name); + public bool run (out unowned GLib.MainLoop loop = null) throws GLib.Error; + [CCode (cname = "rest_proxy_call_async")] + public bool run_async ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallAsyncCallback callback, GLib.Object? weak_object = null) throws GLib.Error; + public virtual bool serialize_params (out string content_type, out string content, out size_t content_len) throws GLib.Error; + public void set_function (string function); + public void set_method (string method); + public bool sync () throws GLib.Error; + public bool upload ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallUploadCallback cb, GLib.Object weak_object) throws GLib.Error; + [NoAccessorMethod] + public Rest.Proxy proxy { owned get; construct; } + } + [Compact] + [CCode (copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "rest_xml_node_get_type ()", cheader_filename = "rest/rest-xml-node.h")] + public class XmlNode { + public weak GLib.HashTable attrs; + public weak GLib.HashTable children; + public weak string content; + public weak string name; + public weak Rest.XmlNode next; + public void add_attr (string attribute, string value); + public unowned Rest.XmlNode add_child (string tag); + public Rest.XmlNode find (string tag); + public void free (); + public unowned string get_attr (string attr_name); + public string print (); + public Rest.XmlNode @ref (); + public void set_content (string value); + public void unref (); + } + [CCode (type_id = "rest_xml_parser_get_type ()", cheader_filename = "rest/rest-xml-parser.h")] + public class XmlParser : GLib.Object { + [CCode (has_construct_function = false)] + public XmlParser (); + public Rest.XmlNode parse_from_data (string data, int64 len); + } + [CCode (cprefix = "REST_MEMORY_", cheader_filename = "rest/rest-param.h")] + public enum MemoryUse { + STATIC, + TAKE, + COPY + } + [CCode (cprefix = "", cname = "OAuthSignatureMethod", cheader_filename = "rest/oauth-proxy.h")] + public enum OAuthSignatureMethod { + PLAINTEXT, + HMAC_SHA1 + } + [CCode (cprefix = "REST_PROXY_CALL_", cheader_filename = "rest/rest-proxy-call.h")] + public errordomain ProxyCallError { + FAILED; + public static GLib.Quark quark (); + } + [CCode (cprefix = "REST_PROXY_ERROR_", cheader_filename = "rest/rest-proxy.h")] + public errordomain ProxyError { + CANCELLED, + RESOLUTION, + CONNECTION, + SSL, + IO, + FAILED, + HTTP_MULTIPLE_CHOICES, + HTTP_MOVED_PERMANENTLY, + HTTP_FOUND, + HTTP_SEE_OTHER, + HTTP_NOT_MODIFIED, + HTTP_USE_PROXY, + HTTP_THREEOHSIX, + HTTP_TEMPORARY_REDIRECT, + HTTP_BAD_REQUEST, + HTTP_UNAUTHORIZED, + HTTP_FOUROHTWO, + HTTP_FORBIDDEN, + HTTP_NOT_FOUND, + HTTP_METHOD_NOT_ALLOWED, + HTTP_NOT_ACCEPTABLE, + HTTP_PROXY_AUTHENTICATION_REQUIRED, + HTTP_REQUEST_TIMEOUT, + HTTP_CONFLICT, + HTTP_GONE, + HTTP_LENGTH_REQUIRED, + HTTP_PRECONDITION_FAILED, + HTTP_REQUEST_ENTITY_TOO_LARGE, + HTTP_REQUEST_URI_TOO_LONG, + HTTP_UNSUPPORTED_MEDIA_TYPE, + HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, + HTTP_EXPECTATION_FAILED, + HTTP_INTERNAL_SERVER_ERROR, + HTTP_NOT_IMPLEMENTED, + HTTP_BAD_GATEWAY, + HTTP_SERVICE_UNAVAILABLE, + HTTP_GATEWAY_TIMEOUT, + HTTP_HTTP_VERSION_NOT_SUPPORTED; + public static GLib.Quark quark (); + } + [CCode (cheader_filename = "rest/oauth-proxy.h", instance_pos = 3.9)] + public delegate void OAuthProxyAuthCallback (Rest.OAuthProxy proxy, GLib.Error? error, GLib.Object? weak_object); + [CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 3.9)] + public delegate void ProxyCallAsyncCallback (Rest.ProxyCall call, GLib.Error? error, GLib.Object? weak_object); + [CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 5.9)] + public delegate void ProxyCallContinuousCallback (Rest.ProxyCall call, string buf, size_t len, GLib.Error? error, GLib.Object? weak_object); + [CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 5.9)] + public delegate void ProxyCallUploadCallback (Rest.ProxyCall call, size_t total, size_t uploaded, GLib.Error? error, GLib.Object? weak_object); +} -- 2.47.2