[pygobject] Wrap new API added in GIO-UNIX 2.22



commit d3d5cb3a4a2c2cb2bd0c2571304d59e19bc08452
Author: Gian Mario Tagliaretti <gianmt gnome org>
Date:   Thu Dec 17 21:54:36 2009 +0100

    Wrap new API added in GIO-UNIX 2.22

 gio/unix-types.defs |   22 ++++++++++
 gio/unix.defs       |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 gio/unix.override   |    8 ++++
 3 files changed, 144 insertions(+), 1 deletions(-)
---
diff --git a/gio/unix-types.defs b/gio/unix-types.defs
index fea11e9..ed1ed9f 100644
--- a/gio/unix-types.defs
+++ b/gio/unix-types.defs
@@ -1,5 +1,12 @@
 ;; -*- scheme -*-
 
+(define-object Connection
+  (in-module "giounix")
+  (parent "GSocketConnection")
+  (c-name "GUnixConnection")
+  (gtype-id "G_TYPE_UNIX_CONNECTION")
+)
+
 (define-object DesktopAppInfo
   (docstring
   "DesktopAppInfo(desktop_id) -> gio.unix.DesktopAppInfo\n\n"
@@ -12,6 +19,13 @@
   (gtype-id "G_TYPE_DESKTOP_APP_INFO")
 )
 
+(define-object FDMessage
+  (in-module "giounix")
+  (parent "GSocketControlMessage")
+  (c-name "GUnixFDMessage")
+  (gtype-id "G_TYPE_UNIX_FD_MESSAGE")
+)
+
 (define-object InputStream
   (in-module "giounix")
   (parent "GInputStream")
@@ -31,3 +45,11 @@
   (c-name "GUnixMountEntry")
   (gtype-id "GIO_UNIX_MOUNT_ENTRY_TYPE")
 )
+
+(define-object SocketAddress
+  (in-module "giounix")
+  (parent "GSocketAddress")
+  (c-name "GUnixSocketAddress")
+  (gtype-id "G_TYPE_UNIX_SOCKET_ADDRESS")
+)
+
diff --git a/gio/unix.defs b/gio/unix.defs
index 018a351..ff43ed6 100644
--- a/gio/unix.defs
+++ b/gio/unix.defs
@@ -2,6 +2,36 @@
 
 (include "unix-types.defs")
 
+;; From gunixconnection.h
+
+(define-function g_unix_connection_get_type
+  (c-name "g_unix_connection_get_type")
+  (return-type "GType")
+)
+
+(define-method send_fd
+  (of-object "GUnixConnection")
+  (c-name "g_unix_connection_send_fd")
+  (return-type "gboolean")
+  (parameters
+    '("gint" "fd")
+    '("GCancellable*" "cancellable")
+    '("GError**" "error")
+  )
+)
+
+(define-method receive_fd
+  (of-object "GUnixConnection")
+  (c-name "g_unix_connection_receive_fd")
+  (return-type "gint")
+  (parameters
+    '("GCancellable*" "cancellable")
+    '("GError**" "error")
+  )
+)
+
+
+
 ;; From gdesktopappinfo.h
 
 (define-function desktop_app_info_get_type
@@ -48,7 +78,39 @@
   )
 )
 
-;; From gunixmount.h
+
+
+;; From gunixfdmessage.h
+
+(define-function g_unix_fd_message_get_type
+  (c-name "g_unix_fd_message_get_type")
+  (return-type "GType")
+)
+
+(define-function g_unix_fd_message_new
+  (c-name "g_unix_fd_message_new")
+  (is-constructor-of "GUnixFdMessage")
+  (return-type "GSocketControlMessage*")
+)
+
+(define-method steal_fds
+  (of-object "GUnixFDMessage")
+  (c-name "g_unix_fd_message_steal_fds")
+  (return-type "gint*")
+  (parameters
+    '("gint*" "length")
+  )
+)
+
+(define-method append_fd
+  (of-object "GUnixFDMessage")
+  (c-name "g_unix_fd_message_append_fd")
+  (return-type "gboolean")
+  (parameters
+    '("gint" "fd")
+    '("GError**" "error")
+  )
+)
 
 
 
@@ -360,3 +422,54 @@
   (c-name "g_unix_output_stream_get_fd")
   (return-type "gint")
 )
+
+
+
+;; From gunixsocketaddress.h
+
+(define-function g_unix_socket_address_get_type
+  (c-name "g_unix_socket_address_get_type")
+  (return-type "GType")
+)
+
+(define-function g_unix_socket_address_new
+  (c-name "g_unix_socket_address_new")
+  (is-constructor-of "GUnixSocketAddress")
+  (return-type "GSocketAddress*")
+  (parameters
+    '("const-gchar*" "path")
+  )
+)
+
+(define-function g_unix_socket_address_new_abstract
+  (c-name "g_unix_socket_address_new_abstract")
+  (return-type "GSocketAddress*")
+  (parameters
+    '("const-gchar*" "path")
+    '("int" "path_len")
+  )
+)
+
+(define-method get_path
+  (of-object "GUnixSocketAddress")
+  (c-name "g_unix_socket_address_get_path")
+  (return-type "const-char*")
+)
+
+(define-method get_path_len
+  (of-object "GUnixSocketAddress")
+  (c-name "g_unix_socket_address_get_path_len")
+  (return-type "gsize")
+)
+
+(define-method get_is_abstract
+  (of-object "GUnixSocketAddress")
+  (c-name "g_unix_socket_address_get_is_abstract")
+  (return-type "gboolean")
+)
+
+(define-function g_unix_socket_address_abstract_names_supported
+  (c-name "g_unix_socket_address_abstract_names_supported")
+  (return-type "gboolean")
+)
+
diff --git a/gio/unix.override b/gio/unix.override
index bdf710e..fd691e8 100644
--- a/gio/unix.override
+++ b/gio/unix.override
@@ -23,10 +23,14 @@
 headers
 #define NO_IMPORT_PYGOBJECT
 #include <pygobject.h>
+#include <gio/gio.h>
 #include <gio/gdesktopappinfo.h>
 #include <gio/gunixinputstream.h>
 #include <gio/gunixmounts.h>
 #include <gio/gunixoutputstream.h>
+#include <gio/gunixconnection.h>
+#include <gio/gunixfdmessage.h>
+#include <gio/gunixsocketaddress.h>
 
 #define GIO_UNIX_MOUNT_ENTRY_TYPE (_gio_unix_mount_entry_get_type ())
 
@@ -46,6 +50,10 @@ modulename gio.unix
 import gobject.GObject as PyGObject_Type
 import gio.InputStream as PyGInputStream_Type
 import gio.OutputStream as PyGOutputStream_Type
+import gio.SocketAddress as PyGSocketAddress_Type
+import gio.Cancellable as PyGCancellable_Type
+import gio.SocketConnection as PyGSocketConnection_Type
+import gio.SocketControlMessage as PyGSocketControlMessage_Type
 %%
 ignore-glob
   *_get_type



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]