diff options
author | Murray Cumming <murrayc@murrayc.com> | 2010-09-02 23:43:04 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2010-09-02 23:43:04 +0200 |
commit | dd1b61233d7b46071e319aad57a883dd4db608a6 (patch) | |
tree | 40010255a5c805f1d59bc979be91cd87af07c230 | |
parent | faf9cb3c4f983a37b14f86ae41d5d1144d78d48e (diff) | |
download | glibmm-dd1b61233d7b46071e319aad57a883dd4db608a6.tar.gz |
giomm: Added Proxy, ProxyAddress and ProxyResolver.
* gio/src/proxy.[hg|ccg]:
* gio/src/proxyaddress.[hg|ccg]:
* gio/src/proxyresolver.[hg|ccg]: New files, not complete.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gio/giomm.h | 2 | ||||
-rw-r--r-- | gio/src/filelist.am | 3 | ||||
-rw-r--r-- | gio/src/gio_methods.defs | 716 | ||||
-rw-r--r-- | gio/src/gio_signals.defs | 125 | ||||
-rw-r--r-- | gio/src/proxy.ccg | 29 | ||||
-rw-r--r-- | gio/src/proxy.hg | 71 | ||||
-rw-r--r-- | gio/src/proxyaddress.ccg | 25 | ||||
-rw-r--r-- | gio/src/proxyaddress.hg | 69 | ||||
-rw-r--r-- | gio/src/proxyresolver.ccg | 39 | ||||
-rw-r--r-- | gio/src/proxyresolver.hg | 67 | ||||
-rw-r--r-- | tools/extra_defs_gen/generate_defs_gio.cc | 4 | ||||
-rw-r--r-- | tools/m4/convert_gio.m4 | 6 |
13 files changed, 1147 insertions, 17 deletions
@@ -1,3 +1,11 @@ +2010-09-02 Murray Cumming <murrayc@murrayc.com> + + giomm: Added Proxy, ProxyAddress and ProxyResolver. + + * gio/src/proxy.[hg|ccg]: + * gio/src/proxyaddress.[hg|ccg]: + * gio/src/proxyresolver.[hg|ccg]: New files, not complete. + 2.25.4: 2010-08-31 José Alburquerque <jaalburqu@svn.gnome.org> diff --git a/gio/giomm.h b/gio/giomm.h index da6a78f5..54cedc5a 100644 --- a/gio/giomm.h +++ b/gio/giomm.h @@ -71,6 +71,8 @@ #include <giomm/networkaddress.h> #include <giomm/networkservice.h> #include <giomm/outputstream.h> +#include <giomm/proxy.h> +#include <giomm/proxyresolver.h> #include <giomm/resolver.h> #include <giomm/seekable.h> #include <giomm/settings.h> diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 74819ef4..efbf97a8 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -60,6 +60,9 @@ giomm_files_any_hg = \ networkaddress.hg \ networkservice.hg \ outputstream.hg \ + proxy.hg \ + proxyaddress.hg \ + proxyresolver.hg \ resolver.hg \ seekable.hg \ settings.hg \ diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index e800c615..8b0cf0b0 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -276,6 +276,20 @@ (gtype-id "G_TYPE_SETTINGS_BACKEND") ) +(define-object Action + (in-module "GSimple") + (parent "GObject") + (c-name "GSimpleAction") + (gtype-id "G_TYPE_SIMPLE_ACTION") +) + +(define-object ActionGroup + (in-module "GSimple") + (parent "GObject") + (c-name "GSimpleActionGroup") + (gtype-id "G_TYPE_SIMPLE_ACTION_GROUP") +) + (define-object t (in-module "GSocke") (parent "GObject") @@ -297,6 +311,13 @@ (gtype-id "G_TYPE_INET_SOCKET_ADDRESS") ) +(define-object Address + (in-module "GProxy") + (parent "GInetSocketAddress") + (c-name "GProxyAddress") + (gtype-id "G_TYPE_PROXY_ADDRESS") +) + (define-object AddressEnumerator (in-module "GSocket") (parent "GObject") @@ -304,6 +325,13 @@ (gtype-id "G_TYPE_SOCKET_ADDRESS_ENUMERATOR") ) +(define-object AddressEnumerator + (in-module "GProxy") + (parent "GSocketAddressEnumerator") + (c-name "GProxyAddressEnumerator") + (gtype-id "G_TYPE_PROXY_ADDRESS_ENUMERATOR") +) + (define-object Client (in-module "GSocket") (parent "GObject") @@ -658,6 +686,13 @@ '("partial-input" "G_IO_ERROR_PARTIAL_INPUT") '("invalid-data" "G_IO_ERROR_INVALID_DATA") '("dbus-error" "G_IO_ERROR_DBUS_ERROR") + '("host-unreachable" "G_IO_ERROR_HOST_UNREACHABLE") + '("network-unreachable" "G_IO_ERROR_NETWORK_UNREACHABLE") + '("connection-refused" "G_IO_ERROR_CONNECTION_REFUSED") + '("proxy-failed" "G_IO_ERROR_PROXY_FAILED") + '("proxy-auth-failed" "G_IO_ERROR_PROXY_AUTH_FAILED") + '("proxy-need-auth" "G_IO_ERROR_PROXY_NEED_AUTH") + '("proxy-not-allowed" "G_IO_ERROR_PROXY_NOT_ALLOWED") ) ) @@ -1034,6 +1069,27 @@ ) ) +(define-enum MessageByteOrder + (in-module "GDBus") + (c-name "GDBusMessageByteOrder") + (gtype-id "G_TYPE_D_BUS_MESSAGE_BYTE_ORDER") + (values + '("big-endian" "G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN") + '("little-endian" "G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN") + ) +) + +(define-enum MessageFilterResult + (in-module "GDBus") + (c-name "GDBusMessageFilterResult") + (gtype-id "G_TYPE_D_BUS_MESSAGE_FILTER_RESULT") + (values + '("no-effect" "G_DBUS_MESSAGE_FILTER_RESULT_NO_EFFECT") + '("message-consumed" "G_DBUS_MESSAGE_FILTER_RESULT_MESSAGE_CONSUMED") + '("message-altered" "G_DBUS_MESSAGE_FILTER_RESULT_MESSAGE_ALTERED") + ) +) + (define-flags BindFlags (in-module "GSettings") (c-name "GSettingsBindFlags") @@ -1044,9 +1100,200 @@ '("set" "G_SETTINGS_BIND_SET") '("no-sensitivity" "G_SETTINGS_BIND_NO_SENSITIVITY") '("get-no-changes" "G_SETTINGS_BIND_GET_NO_CHANGES") + '("invert-boolean" "G_SETTINGS_BIND_INVERT_BOOLEAN") + ) +) + + +;; From gactiongroup.h + +(define-function g_action_group_get_type + (c-name "g_action_group_get_type") + (return-type "GType") +) + +(define-method has_action + (of-object "GActionGroup") + (c-name "g_action_group_has_action") + (return-type "gboolean") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method list_actions + (of-object "GActionGroup") + (c-name "g_action_group_list_actions") + (return-type "gchar**") +) + +(define-method get_parameter_type + (of-object "GActionGroup") + (c-name "g_action_group_get_parameter_type") + (return-type "const-GVariantType*") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method get_state_type + (of-object "GActionGroup") + (c-name "g_action_group_get_state_type") + (return-type "const-GVariantType*") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method get_state_hint + (of-object "GActionGroup") + (c-name "g_action_group_get_state_hint") + (return-type "GVariant*") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method get_enabled + (of-object "GActionGroup") + (c-name "g_action_group_get_enabled") + (return-type "gboolean") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method get_state + (of-object "GActionGroup") + (c-name "g_action_group_get_state") + (return-type "GVariant*") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method set_state + (of-object "GActionGroup") + (c-name "g_action_group_set_state") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + '("GVariant*" "value") + ) +) + +(define-method activate + (of-object "GActionGroup") + (c-name "g_action_group_activate") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + '("GVariant*" "parameter") + ) +) + +(define-method action_added + (of-object "GActionGroup") + (c-name "g_action_group_action_added") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method action_removed + (of-object "GActionGroup") + (c-name "g_action_group_action_removed") + (return-type "none") + (parameters + '("const-gchar*" "action_name") ) ) +(define-method action_enabled_changed + (of-object "GActionGroup") + (c-name "g_action_group_action_enabled_changed") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + '("gboolean" "enabled") + ) +) + +(define-method action_state_changed + (of-object "GActionGroup") + (c-name "g_action_group_action_state_changed") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + '("GVariant*" "state") + ) +) + + + +;; From gaction.h + +(define-function g_action_get_type + (c-name "g_action_get_type") + (return-type "GType") +) + +(define-method get_name + (of-object "GAction") + (c-name "g_action_get_name") + (return-type "const-gchar*") +) + +(define-method get_parameter_type + (of-object "GAction") + (c-name "g_action_get_parameter_type") + (return-type "const-GVariantType*") +) + +(define-method get_state_type + (of-object "GAction") + (c-name "g_action_get_state_type") + (return-type "const-GVariantType*") +) + +(define-method get_state_hint + (of-object "GAction") + (c-name "g_action_get_state_hint") + (return-type "GVariant*") +) + +(define-method get_enabled + (of-object "GAction") + (c-name "g_action_get_enabled") + (return-type "gboolean") +) + +(define-method get_state + (of-object "GAction") + (c-name "g_action_get_state") + (return-type "GVariant*") +) + +(define-method set_state + (of-object "GAction") + (c-name "g_action_set_state") + (return-type "none") + (parameters + '("GVariant*" "value") + ) +) + +(define-method activate + (of-object "GAction") + (c-name "g_action_activate") + (return-type "none") + (parameters + '("GVariant*" "parameter") + ) +) + + ;; From gappinfo.h @@ -3325,6 +3572,21 @@ ) ) +(define-method get_byte_order + (of-object "GDBusMessage") + (c-name "g_dbus_message_get_byte_order") + (return-type "GDBusMessageByteOrder") +) + +(define-method set_byte_order + (of-object "GDBusMessage") + (c-name "g_dbus_message_set_byte_order") + (return-type "none") + (parameters + '("GDBusMessageByteOrder" "byte_order") + ) +) + (define-method get_message_type (of-object "GDBusMessage") (c-name "g_dbus_message_get_message_type") @@ -3616,23 +3878,6 @@ (return-type "GType") ) -(define-function g_dbus_method_invocation_new - (c-name "g_dbus_method_invocation_new") - (is-constructor-of "GDbusMethodInvocation") - (return-type "GDBusMethodInvocation*") - (parameters - '("const-gchar*" "sender") - '("const-gchar*" "object_path") - '("const-gchar*" "interface_name") - '("const-gchar*" "method_name") - '("const-GDBusMethodInfo*" "method_info") - '("GDBusConnection*" "connection") - '("GDBusMessage*" "message") - '("GVariant*" "parameters") - '("gpointer" "user_data") - ) -) - (define-method get_sender (of-object "GDBusMethodInvocation") (c-name "g_dbus_method_invocation_get_sender") @@ -7461,6 +7706,16 @@ (return-type "GType") ) +(define-function g_dbus_message_byte_order_get_type + (c-name "g_dbus_message_byte_order_get_type") + (return-type "GType") +) + +(define-function g_dbus_message_filter_result_get_type + (c-name "g_dbus_message_filter_result_get_type") + (return-type "GType") +) + (define-function g_settings_bind_flags_get_type (c-name "g_settings_bind_flags_get_type") (return-type "GType") @@ -7873,6 +8128,12 @@ (return-type "gsize") ) +(define-method steal_data + (of-object "GMemoryOutputStream") + (c-name "g_memory_output_stream_steal_data") + (return-type "gpointer") +) + ;; From gmount.h @@ -8252,6 +8513,16 @@ ) ) +(define-function g_network_address_parse_uri + (c-name "g_network_address_parse_uri") + (return-type "GSocketConnectable*") + (parameters + '("const-gchar*" "uri") + '("guint16" "default_port") + '("GError**" "error") + ) +) + (define-method get_hostname (of-object "GNetworkAddress") (c-name "g_network_address_get_hostname") @@ -8264,6 +8535,12 @@ (return-type "guint16") ) +(define-method get_scheme + (of-object "GNetworkAddress") + (c-name "g_network_address_get_scheme") + (return-type "const-gchar*") +) + ;; From gnetworkservice.h @@ -8302,6 +8579,21 @@ (return-type "const-gchar*") ) +(define-method get_scheme + (of-object "GNetworkService") + (c-name "g_network_service_get_scheme") + (return-type "const-gchar*") +) + +(define-method set_scheme + (of-object "GNetworkService") + (c-name "g_network_service_set_scheme") + (return-type "none") + (parameters + '("const-gchar*" "scheme") + ) +) + ;; From goutputstream.h @@ -8595,6 +8887,180 @@ +;; From gproxyaddressenumerator.h + +(define-function g_proxy_address_enumerator_get_type + (c-name "g_proxy_address_enumerator_get_type") + (return-type "GType") +) + + + +;; From gproxyaddress.h + +(define-function g_proxy_address_get_type + (c-name "g_proxy_address_get_type") + (return-type "GType") +) + +(define-function g_proxy_address_new + (c-name "g_proxy_address_new") + (is-constructor-of "GProxyAddress") + (return-type "GSocketAddress*") + (parameters + '("GInetAddress*" "inetaddr") + '("guint16" "port") + '("const-gchar*" "protocol") + '("const-gchar*" "dest_hostname") + '("guint16" "dest_port") + '("const-gchar*" "username") + '("const-gchar*" "password") + ) +) + +(define-method get_protocol + (of-object "GProxyAddress") + (c-name "g_proxy_address_get_protocol") + (return-type "const-gchar*") +) + +(define-method get_destination_hostname + (of-object "GProxyAddress") + (c-name "g_proxy_address_get_destination_hostname") + (return-type "const-gchar*") +) + +(define-method get_destination_port + (of-object "GProxyAddress") + (c-name "g_proxy_address_get_destination_port") + (return-type "guint16") +) + +(define-method get_username + (of-object "GProxyAddress") + (c-name "g_proxy_address_get_username") + (return-type "const-gchar*") +) + +(define-method get_password + (of-object "GProxyAddress") + (c-name "g_proxy_address_get_password") + (return-type "const-gchar*") +) + + + +;; From gproxy.h + +(define-function g_proxy_get_type + (c-name "g_proxy_get_type") + (return-type "GType") +) + +(define-function g_proxy_get_default_for_protocol + (c-name "g_proxy_get_default_for_protocol") + (return-type "GProxy*") + (parameters + '("const-gchar*" "protocol") + ) +) + +(define-method connect + (of-object "GProxy") + (c-name "g_proxy_connect") + (return-type "GIOStream*") + (parameters + '("GIOStream*" "connection") + '("GProxyAddress*" "proxy_address") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + +(define-method connect_async + (of-object "GProxy") + (c-name "g_proxy_connect_async") + (return-type "none") + (parameters + '("GIOStream*" "connection") + '("GProxyAddress*" "proxy_address") + '("GCancellable*" "cancellable") + '("GAsyncReadyCallback" "callback") + '("gpointer" "user_data") + ) +) + +(define-method connect_finish + (of-object "GProxy") + (c-name "g_proxy_connect_finish") + (return-type "GIOStream*") + (parameters + '("GAsyncResult*" "result") + '("GError**" "error") + ) +) + +(define-method supports_hostname + (of-object "GProxy") + (c-name "g_proxy_supports_hostname") + (return-type "gboolean") +) + + + +;; From gproxyresolver.h + +(define-function g_proxy_resolver_get_type + (c-name "g_proxy_resolver_get_type") + (return-type "GType") +) + +(define-function g_proxy_resolver_get_default + (c-name "g_proxy_resolver_get_default") + (return-type "GProxyResolver*") +) + +(define-method is_supported + (of-object "GProxyResolver") + (c-name "g_proxy_resolver_is_supported") + (return-type "gboolean") +) + +(define-method lookup + (of-object "GProxyResolver") + (c-name "g_proxy_resolver_lookup") + (return-type "gchar**") + (parameters + '("const-gchar*" "uri") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + +(define-method lookup_async + (of-object "GProxyResolver") + (c-name "g_proxy_resolver_lookup_async") + (return-type "none") + (parameters + '("const-gchar*" "uri") + '("GCancellable*" "cancellable") + '("GAsyncReadyCallback" "callback") + '("gpointer" "user_data") + ) +) + +(define-method lookup_finish + (of-object "GProxyResolver") + (c-name "g_proxy_resolver_lookup_finish") + (return-type "gchar**") + (parameters + '("GAsyncResult*" "result") + '("GError**" "error") + ) +) + + + ;; From gresolver.h (define-function g_resolver_get_type @@ -8970,6 +9436,15 @@ (varargs #t) ) +(define-method reset + (of-object "GSettings") + (c-name "g_settings_reset") + (return-type "none") + (parameters + '("const-gchar*" "key") + ) +) + (define-method get_int (of-object "GSettings") (c-name "g_settings_get_int") @@ -9212,6 +9687,86 @@ +;; From gsimpleactiongroup.h + +(define-function g_simple_action_group_get_type + (c-name "g_simple_action_group_get_type") + (return-type "GType") +) + +(define-function g_simple_action_group_new + (c-name "g_simple_action_group_new") + (is-constructor-of "GSimpleActionGroup") + (return-type "GSimpleActionGroup*") +) + +(define-method lookup + (of-object "GSimpleActionGroup") + (c-name "g_simple_action_group_lookup") + (return-type "GAction*") + (parameters + '("const-gchar*" "action_name") + ) +) + +(define-method insert + (of-object "GSimpleActionGroup") + (c-name "g_simple_action_group_insert") + (return-type "none") + (parameters + '("GAction*" "action") + ) +) + +(define-method remove + (of-object "GSimpleActionGroup") + (c-name "g_simple_action_group_remove") + (return-type "none") + (parameters + '("const-gchar*" "action_name") + ) +) + + + +;; From gsimpleaction.h + +(define-function g_simple_action_get_type + (c-name "g_simple_action_get_type") + (return-type "GType") +) + +(define-function g_simple_action_new + (c-name "g_simple_action_new") + (is-constructor-of "GSimpleAction") + (return-type "GSimpleAction*") + (parameters + '("const-gchar*" "name") + '("const-GVariantType*" "parameter_type") + ) +) + +(define-function g_simple_action_new_stateful + (c-name "g_simple_action_new_stateful") + (return-type "GSimpleAction*") + (parameters + '("const-gchar*" "name") + '("const-GVariantType*" "parameter_type") + '("GVariant*" "state") + ) +) + +(define-method set_enabled + (of-object "GSimpleAction") + (c-name "g_simple_action_set_enabled") + (return-type "none") + (parameters + '("gboolean" "enabled") + ) +) + + + ;; From gsimpleasyncresult.h (define-function g_simple_async_result_get_type @@ -9591,6 +10146,36 @@ ) ) +(define-method get_timeout + (of-object "GSocketClient") + (c-name "g_socket_client_get_timeout") + (return-type "guint") +) + +(define-method set_timeout + (of-object "GSocketClient") + (c-name "g_socket_client_set_timeout") + (return-type "none") + (parameters + '("guint" "timeout") + ) +) + +(define-method get_enable_proxy + (of-object "GSocketClient") + (c-name "g_socket_client_get_enable_proxy") + (return-type "gboolean") +) + +(define-method set_enable_proxy + (of-object "GSocketClient") + (c-name "g_socket_client_set_enable_proxy") + (return-type "none") + (parameters + '("gboolean" "enable") + ) +) + (define-method connect (of-object "GSocketClient") (c-name "g_socket_client_connect") @@ -9626,6 +10211,18 @@ ) ) +(define-method connect_to_uri + (of-object "GSocketClient") + (c-name "g_socket_client_connect_to_uri") + (return-type "GSocketConnection*") + (parameters + '("const-gchar*" "uri") + '("guint16" "default_port") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + (define-method connect_async (of-object "GSocketClient") (c-name "g_socket_client_connect_async") @@ -9694,6 +10291,38 @@ ) ) +(define-method connect_to_uri_async + (of-object "GSocketClient") + (c-name "g_socket_client_connect_to_uri_async") + (return-type "none") + (parameters + '("const-gchar*" "uri") + '("guint16" "default_port") + '("GCancellable*" "cancellable") + '("GAsyncReadyCallback" "callback") + '("gpointer" "user_data") + ) +) + +(define-method connect_to_uri_finish + (of-object "GSocketClient") + (c-name "g_socket_client_connect_to_uri_finish") + (return-type "GSocketConnection*") + (parameters + '("GAsyncResult*" "result") + '("GError**" "error") + ) +) + +(define-method add_application_proxy + (of-object "GSocketClient") + (c-name "g_socket_client_add_application_proxy") + (return-type "none") + (parameters + '("const-gchar*" "protocol") + ) +) + ;; From gsocketconnectable.h @@ -9709,6 +10338,12 @@ (return-type "GSocketAddressEnumerator*") ) +(define-method proxy_enumerate + (of-object "GSocketConnectable") + (c-name "g_socket_connectable_proxy_enumerate") + (return-type "GSocketAddressEnumerator*") +) + ;; From gsocketconnection.h @@ -10157,6 +10792,32 @@ ) ) +(define-method receive_with_blocking + (of-object "GSocket") + (c-name "g_socket_receive_with_blocking") + (return-type "gssize") + (parameters + '("gchar*" "buffer") + '("gsize" "size") + '("gboolean" "blocking") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + +(define-method send_with_blocking + (of-object "GSocket") + (c-name "g_socket_send_with_blocking") + (return-type "gssize") + (parameters + '("const-gchar*" "buffer") + '("gsize" "size") + '("gboolean" "blocking") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + ;; From gsocketlistener.h @@ -10767,6 +11428,21 @@ ) ) +(define-method get_file_info + (of-object "GZlibCompressor") + (c-name "g_zlib_compressor_get_file_info") + (return-type "GFileInfo*") +) + +(define-method set_file_info + (of-object "GZlibCompressor") + (c-name "g_zlib_compressor_set_file_info") + (return-type "none") + (parameters + '("GFileInfo*" "file_info") + ) +) + ;; From gzlibdecompressor.h @@ -10785,4 +11461,10 @@ ) ) +(define-method get_file_info + (of-object "GZlibDecompressor") + (c-name "g_zlib_decompressor_get_file_info") + (return-type "GFileInfo*") +) + diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 53a0f2c8..c1f52dba 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -614,6 +614,104 @@ (construct-only #f) ) +;; From GProxy + +;; From GProxyAddress + +(define-property family + (of-object "GProxyAddress") + (prop-type "GParamEnum") + (docs "The family of the socket address") + (readable #t) + (writable #f) + (construct-only #f) +) + +(define-property address + (of-object "GProxyAddress") + (prop-type "GParamObject") + (docs "The address") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property port + (of-object "GProxyAddress") + (prop-type "GParamUInt") + (docs "The port") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property protocol + (of-object "GProxyAddress") + (prop-type "GParamString") + (docs "The proxy protocol") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property destination-hostname + (of-object "GProxyAddress") + (prop-type "GParamString") + (docs "The proxy destination hostname") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property destination-port + (of-object "GProxyAddress") + (prop-type "GParamUInt") + (docs "The proxy destination port") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property username + (of-object "GProxyAddress") + (prop-type "GParamString") + (docs "The proxy username") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property password + (of-object "GProxyAddress") + (prop-type "GParamString") + (docs "The proxy password") + (readable #t) + (writable #t) + (construct-only #t) +) + +;; From GProxyAddressEnumerator + +(define-property uri + (of-object "GProxyAddressEnumerator") + (prop-type "GParamString") + (docs "The destination URI, use none:// for generic socket") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property connectable + (of-object "GProxyAddressEnumerator") + (prop-type "GParamObject") + (docs "The connectable being enumerated.") + (readable #t) + (writable #t) + (construct-only #t) +) + +;; From GProxyResolver + ;; From GSeekable ;; From GSettings @@ -1109,6 +1207,15 @@ (construct-only #t) ) +(define-property scheme + (of-object "GNetworkAddress") + (prop-type "GParamString") + (docs "URI Scheme") + (readable #t) + (writable #t) + (construct-only #t) +) + ;; From GNetworkService (define-property service @@ -1129,6 +1236,15 @@ (construct-only #t) ) +(define-property scheme + (of-object "GNetworkService") + (prop-type "GParamString") + (docs "Network scheme (default is to use service)") + (readable #t) + (writable #t) + (construct-only #f) +) + (define-property domain (of-object "GNetworkService") (prop-type "GParamString") @@ -1352,6 +1468,15 @@ (construct-only #f) ) +(define-property enable-proxy + (of-object "GSocketClient") + (prop-type "GParamBoolean") + (docs "Enable proxy support") + (readable #t) + (writable #t) + (construct-only #f) +) + ;; From GSocketConnection (define-property input-stream diff --git a/gio/src/proxy.ccg b/gio/src/proxy.ccg new file mode 100644 index 00000000..16320294 --- /dev/null +++ b/gio/src/proxy.ccg @@ -0,0 +1,29 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2010 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <gio/gio.h> +#include <utility> +#include <glibmm/error.h> +#include <glibmm/exceptionhandler.h> +#include "slot_async.h" + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/proxy.hg b/gio/src/proxy.hg new file mode 100644 index 00000000..b14c2a26 --- /dev/null +++ b/gio/src/proxy.hg @@ -0,0 +1,71 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2010 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <glibmm/error.h> +#include <glibmm/interface.h> +#include <giomm/asyncresult.h> +#include <giomm/cancellable.h> +#include <giomm/proxyaddress.h> +#include <giomm/iostream.h> +//#include <giomm/error.h> //Because this is thrown by some of these methods. + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GProxyInterface GProxyInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + + +/** TODO: Documentation + * + * @newin{2,26} + */ +class Proxy : public Glib::Interface +{ + _CLASS_INTERFACE(Proxy, GProxy, G_PROXY, GProxyInterface) + +public: + + _WRAP_METHOD(static Glib::RefPtr<Proxy> get_default_for_protocol(const Glib::ustring& protocol), g_proxy_get_default_for_protocol) + + _WRAP_METHOD(Glib::RefPtr<IOStream> connect(const Glib::RefPtr<IOStream>& connection, + const Glib::RefPtr<const ProxyAddress>& proxy_adress, const Glib::RefPtr<Cancellable>& cancellable), g_proxy_connect, errthrow) + +/* TODO: +void g_proxy_connect_async (GProxy *proxy, + GIOStream *connection, + GProxyAddress *proxy_address, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +*/ + + _WRAP_METHOD(Glib::RefPtr<IOStream> connect_finish(const Glib::RefPtr<AsyncResult>& result), g_proxy_resolver_connect_finish, errthrow) + + _WRAP_METHOD(bool supports_hostname() const, g_proxy_supports_hostname) + +}; + + +} // namespace Gio + diff --git a/gio/src/proxyaddress.ccg b/gio/src/proxyaddress.ccg new file mode 100644 index 00000000..96aed62c --- /dev/null +++ b/gio/src/proxyaddress.ccg @@ -0,0 +1,25 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2010 glibmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <gio/gio.h> + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/proxyaddress.hg b/gio/src/proxyaddress.hg new file mode 100644 index 00000000..853f4bb3 --- /dev/null +++ b/gio/src/proxyaddress.hg @@ -0,0 +1,69 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2009 The glibmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <giomm/inetsocketaddress.h> + +_DEFS(giomm,gio) +_PINCLUDE(giomm/private/inetsocketaddress_p.h) + +namespace Gio +{ + +/** TODO: Documentation + * + * @newin{2,26} + */ +class ProxyAddress +: public InetSocketAddress +{ + _CLASS_GOBJECT(ProxyAddress, GProxyAddress, G_PROXY_ADDRESS, InetSocketAddress, GInetSocketAddress) + +protected: + _WRAP_CTOR(ProxyAddress(const Glib::RefPtr<InetAddress>& address, + guint16 port, + const Glib::ustring& protocol, + const Glib::ustring& destination_hostname, + guint16 destination_port, + const Glib::ustring& username = Glib::ustring(), + const Glib::ustring& password = Glib::ustring()), g_proxy_address_new) + +public: + _WRAP_CREATE(const Glib::RefPtr<InetAddress>& address, + guint16 port, + const Glib::ustring& protocol, + const Glib::ustring& destination_hostname, + guint16 destination_port, + const Glib::ustring& username = Glib::ustring(), + const Glib::ustring& password = Glib::ustring()) + + _WRAP_METHOD(Glib::ustring get_protocol() const, g_proxy_address_get_protocol) + _WRAP_METHOD(Glib::ustring get_destination_hostname() const, g_proxy_address_get_destination_hostname) + _WRAP_METHOD(guint16 get_destination_port() const, g_proxy_address_get_destination_port) + + _WRAP_METHOD(Glib::ustring get_username() const, g_proxy_address_get_username) + _WRAP_METHOD(Glib::ustring get_password() const, g_proxy_address_get_password) + + _WRAP_PROPERTY("protocol", Glib::ustring) + _WRAP_PROPERTY("destination_hostname", Glib::ustring) + _WRAP_PROPERTY("destination_port", Glib::ustring) + _WRAP_PROPERTY("username", Glib::ustring) + _WRAP_PROPERTY("password", Glib::ustring) +}; + +} // namespace Gio diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg new file mode 100644 index 00000000..037ad179 --- /dev/null +++ b/gio/src/proxyresolver.ccg @@ -0,0 +1,39 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2010 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <gio/gio.h> +#include <utility> +#include <glibmm/error.h> +#include <glibmm/exceptionhandler.h> +#include "slot_async.h" + +namespace Gio +{ + +Glib::StringArrayHandle ProxyResolver::lookup(const Glib::ustring& uri) +{ + GError* gerror = 0; + Glib::StringArrayHandle retvalue = Glib::StringArrayHandle(g_proxy_resolver_lookup(gobj(), uri.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); + if(gerror) + ::Glib::Error::throw_exception(gerror); + + return retvalue; +} + +} //namespace Gio diff --git a/gio/src/proxyresolver.hg b/gio/src/proxyresolver.hg new file mode 100644 index 00000000..75336b65 --- /dev/null +++ b/gio/src/proxyresolver.hg @@ -0,0 +1,67 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2010 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <glibmm/error.h> +#include <glibmm/interface.h> +#include <giomm/asyncresult.h> +#include <giomm/cancellable.h> +//#include <giomm/error.h> //Because this is thrown by some of these methods. + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GProxyResolverInterface GProxyResolverInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + + +/** TODO: Documentation + * + * @newin{2,26} + */ +class ProxyResolver : public Glib::Interface +{ + _CLASS_INTERFACE(ProxyResolver, GProxyResolver, G_PROXY_RESOLVER, GProxyResolverInterface) + +public: + + _WRAP_METHOD(static Glib::RefPtr<ProxyResolver> get_default(), g_proxy_resolver_get_default) + + _WRAP_METHOD(bool is_supported() const, g_proxy_resolver_is_supported) + + //TODO: Use std::string instead of ustring (StringArrayHandle uses ustring)?: +#m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(Glib::StringArrayHandle lookup(const Glib::ustring& uri, + const Glib::RefPtr<Cancellable>& cancellable), g_proxy_resolver_lookup, errthrow) + + //TODO: Documentation + Glib::StringArrayHandle lookup(const Glib::ustring& uri); + + //TODO: _WRAP_METHOD(void lookup_async(const std::string& uri, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot), g_proxy_resolver_lookup_async) + + _WRAP_METHOD(Glib::StringArrayHandle lookup_finish(const Glib::RefPtr<AsyncResult>& result), g_proxy_resolver_lookup_finish, errthrow) + +}; + + +} // namespace Gio + diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index ac740d02..6926aff0 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -70,6 +70,10 @@ int main(int, char**) << get_defs(G_TYPE_MEMORY_OUTPUT_STREAM) << get_defs(G_TYPE_MOUNT) << get_defs(G_TYPE_MOUNT_OPERATION) + << get_defs(G_TYPE_PROXY) + << get_defs(G_TYPE_PROXY_ADDRESS) + << get_defs(G_TYPE_PROXY_ADDRESS_ENUMERATOR) + << get_defs(G_TYPE_PROXY_RESOLVER) << get_defs(G_TYPE_SEEKABLE) << get_defs(G_TYPE_SETTINGS) << get_defs(G_TYPE_SETTINGS_BACKEND) diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index e1197ce1..69ac6acd 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -129,6 +129,7 @@ _CONVERSION(`GIOStream*',`Glib::RefPtr<Gio::IOStream>',`Glib::wrap($3)') _CONVERSION(`GIOStream*',`Glib::RefPtr<IOStream>',`Glib::wrap($3)') _CONVERSION(`GIOStream*',`Glib::RefPtr<const Gio::IOStream>',`Glib::wrap($3)') _CONVERSION(`GIOStream*',`Glib::RefPtr<const IOStream>',`Glib::wrap($3)') +_CONVERSION(`const Glib::RefPtr<IOStream>&',`GIOStream*',`Glib::unwrap($3)') _CONVERSION(`const Glib::RefPtr<const IOStream>&',`GIOStream*',`const_cast<GIOStream*>(Glib::unwrap($3))') # InetAddress @@ -155,6 +156,11 @@ _CONVERSION(`PasswordSave',`GPasswordSave',`($2)$3') _CONVERSION(`GOutputStream*',`Glib::RefPtr<OutputStream>',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr<OutputStream>&',`GOutputStream*',__CONVERT_CONST_REFPTR_TO_P) +_CONVERSION(`GProxyResolver*',`Glib::RefPtr<ProxyResolver>',`Glib::wrap($3)') +_CONVERSION(`GProxy*',`Glib::RefPtr<Proxy>',`Glib::wrap($3)') + +_CONVERSION(`const Glib::RefPtr<const ProxyAddress>&',`GProxyAddress*',__CONVERT_CONST_REFPTR_TO_P) + #Settings _CONVERSION(`GSettings*',`Glib::RefPtr<Settings>',`Glib::wrap($3)') _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*-const*',`($3).data()') |