glibmm r784 - in trunk: . gio/src



Author: murrayc
Date: Fri Feb  6 11:29:20 2009
New Revision: 784
URL: http://svn.gnome.org/viewvc/glibmm?rev=784&view=rev

Log:
2009-02-06  Murray Cumming  <murrayc murrayc com>

* gio/src/gio_methods.defs: Regenerated.

* gio/src/filterinputstream.hg: Added get/set_close_base_stream().
* gio/src/filteroutputstream.hg: Added get/set_close_base_stream().
* gio/src/unixinputstream.hg: Added get_fd() and get/set_close_fd().
* gio/src/unixoutputstream.hg: Added get_fd() and get/set_close_fd().

* gio/src/datainputstream.[hg|ccg]: Added read_until_async(), 
read_until_finish(), read_line_async() and read_line_finish().
Added documentation for read_until() and read_line().

Modified:
   trunk/ChangeLog
   trunk/gio/src/cancellable.hg
   trunk/gio/src/datainputstream.ccg
   trunk/gio/src/datainputstream.hg
   trunk/gio/src/filterinputstream.hg
   trunk/gio/src/filteroutputstream.hg
   trunk/gio/src/gio_methods.defs
   trunk/gio/src/unixinputstream.hg
   trunk/gio/src/unixoutputstream.hg

Modified: trunk/gio/src/cancellable.hg
==============================================================================
--- trunk/gio/src/cancellable.hg	(original)
+++ trunk/gio/src/cancellable.hg	Fri Feb  6 11:29:20 2009
@@ -59,7 +59,7 @@
                g_cancellable_pop_current)
   _WRAP_METHOD(void reset(), g_cancellable_reset)
 
-  // FIXME: is this useful in the C++ API?
+  // TODO: is this useful in the C++ API?
   //_WRAP_METHOD(void make_pollfd(PollFD* pollfd), g_cancellable_make_pollfd)
 
   _WRAP_SIGNAL(void cancelled(), cancelled)

Modified: trunk/gio/src/datainputstream.ccg
==============================================================================
--- trunk/gio/src/datainputstream.ccg	(original)
+++ trunk/gio/src/datainputstream.ccg	Fri Feb  6 11:29:20 2009
@@ -210,6 +210,47 @@
     return false;
 }
 
+void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_data_input_stream_read_line_async(gobj(),
+                            io_priority,
+                            cancellable->gobj(),
+                            &SignalProxy_async_callback,
+                            slot_copy);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
+#else
+bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  gsize size = 0;
+  gchar* buffer = g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  bool retval = false;
+  if(buffer && size)
+  {
+    retval = (buffer != 0);
+    data = std::string(buffer, size);
+    g_free (buffer);
+  }
+  
+  return retval;
+}
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool DataInputStream::read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable)
@@ -269,4 +310,47 @@
     return false;
 }
 
+void DataInputStream::read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), 
+                            io_priority,
+                            cancellable->gobj(),
+                            &SignalProxy_async_callback,
+                            slot_copy);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
+#else
+bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  gsize size = 0;
+  gchar* buffer = g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  bool retval = false;
+  if(buffer && size)
+  {
+    retval = (buffer != 0);
+    data = std::string(buffer, size);
+    g_free (buffer);
+  }
+  
+  return retval;
+}
+
+  
 } // namespace Gio

Modified: trunk/gio/src/datainputstream.hg
==============================================================================
--- trunk/gio/src/datainputstream.hg	(original)
+++ trunk/gio/src/datainputstream.hg	Fri Feb  6 11:29:20 2009
@@ -100,6 +100,7 @@
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
   _WRAP_METHOD(gint64 read_int64(const Glib::RefPtr<Cancellable>& cancellable), g_data_input_stream_read_int64, errthrow)
+
   /** non-cancellable version of read_int64()
    */
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -118,19 +119,30 @@
   guint64 read_uint64(std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
-  _IGNORE(g_data_input_stream_read_line)
 
-  // FIXME: In C, these functions return NULL if there is an error (i.e. end of
-  // stream reached), but if we use std::string, we don't have a way to tell an
-  // empty string from NULL.  Perhaps we should use raw pointers as in C, but
-  // that would mean we need to worry about freeing the C string...
+  //Note that we return a bool because we can't use std::string to distinguish between an empty string and a NULL.
+
+  /** Reads a line from the data input stream.
+   * 
+   * The operation can be cancelled by triggering the cancellable object from 
+   * another thread. If the operation
+   * was cancelled, a Gio::Error with CANCELLED will be thrown. 
+   *
+   * @param data A string to fill with the read data (without the newlines).
+   * @param cancellable A cancellable object.
+   * @result true if the read succeeded without error.
+   */
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   bool read_line(std::string& line, const Glib::RefPtr<Cancellable>& cancellable);
 #else
   bool read_line(std::string& line, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
+  _IGNORE(g_data_input_stream_read_line)
 
-  /** non-cancellable version of read_line()
+  /** A non-cancellable version of read_line().
+   *
+   * @param data A string to fill with the read data (without the newlines).
+   * @result true if the read succeeded without error.
    */
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   bool read_line(std::string& line);
@@ -138,15 +150,49 @@
   bool read_line(std::string& line, std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
-  _IGNORE(g_data_input_stream_read_until)
+  /** The asynchronous version of read_until(). It is 
+   * an error to have two outstanding calls to this function.
+   *
+   * @param slot The slot to call when the request is satisfied. 
+   * @param cancellable A cancellable object.
+   * @param io_priority The I/O priority of the request. 
+   * @result true if the read succeeded without error.
+   */
+  void read_line_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = Glib::PRIORITY_DEFAULT);
+  _IGNORE(g_data_input_stream_read_line_async)
 
+  /** Finish an asynchronous call started by read_line_async().
+   *
+   * @param result The AsyncResult that was provided to the callback slot.
+   * @param data A string to fill with the read data.
+   * @result true if the read succeeded without error.
+   */
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data);
+  #else
+  bool read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data, std::auto_ptr<Glib::Error>& error);
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+  _IGNORE(g_data_input_stream_read_line_finish)
+
+  /** Reads a string from the data input stream, up to the first 
+   * occurrence of any of the stop characters.
+   *
+   * @param data A string to fill with the read data.
+   * @param stop_chars Characters to terminate the read.
+   * @param cancellable A cancellable object.
+   * @result true if the read succeeded without error.
+   */
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   bool read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable);
 #else
   bool read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
+  _IGNORE(g_data_input_stream_read_until)
 
-  /** non-cancellable version of read_until()
+  /** A non-cancellable version of read_until().
+   * @param stop_chars Characters to terminate the read.
+   * @param data A string to fill with the read data.
+   * @result true if the read succeeded without error.
    */
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   bool read_until(std::string& data, const std::string& stop_chars);
@@ -154,6 +200,31 @@
   bool read_until(std::string& data, const std::string& stop_chars, std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
+  /** The asynchronous version of read_until(). It is 
+   * an error to have two outstanding calls to this function.
+   *
+   * @param stop_chars Characters to terminate the read.
+   * @param slot The slot to call when the request is satisfied. 
+   * @param cancellable A cancellable object.
+   * @param io_priority The I/O priority of the request. 
+   * @result true if the read succeeded without error.
+   */
+  void read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = Glib::PRIORITY_DEFAULT);
+  _IGNORE(g_data_input_stream_read_until_async)
+
+  /** Finish an asynchronous call started by read_until_async().
+   *
+   * @param result The AsyncResult that was provided to the callback slot.
+   * @param data A string to fill with the read data.
+   * @result true if the read succeeded without error.
+   */
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data);
+  #else
+  bool read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data, std::auto_ptr<Glib::Error>& error);
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+  _IGNORE(g_data_input_stream_read_until_finish)
+
   _WRAP_PROPERTY("byte-order", DataStreamByteOrder)
   _WRAP_PROPERTY("newline-type", DataStreamNewlineType)
 };

Modified: trunk/gio/src/filterinputstream.hg
==============================================================================
--- trunk/gio/src/filterinputstream.hg	(original)
+++ trunk/gio/src/filterinputstream.hg	Fri Feb  6 11:29:20 2009
@@ -46,6 +46,9 @@
                g_filter_input_stream_get_base_stream,
                refreturn, constversion)
 
+  _WRAP_METHOD(bool get_close_base_stream() const, g_filter_input_stream_get_close_base_stream)
+  _WRAP_METHOD(void set_close_base_stream(bool close_base = true), g_filter_input_stream_set_close_base_stream)
+
   _WRAP_PROPERTY("base-stream", Glib::RefPtr<InputStream>)
   _WRAP_PROPERTY("close-base-stream", bool)
 };

Modified: trunk/gio/src/filteroutputstream.hg
==============================================================================
--- trunk/gio/src/filteroutputstream.hg	(original)
+++ trunk/gio/src/filteroutputstream.hg	Fri Feb  6 11:29:20 2009
@@ -46,6 +46,9 @@
                g_filter_output_stream_get_base_stream,
                refreturn, constversion)
 
+  _WRAP_METHOD(bool get_close_base_stream() const, g_filter_output_stream_get_close_base_stream)
+  _WRAP_METHOD(void set_close_base_stream(bool close_base = true), g_filter_output_stream_set_close_base_stream)
+
   _WRAP_PROPERTY("base-stream", Glib::RefPtr<InputStream>)
   _WRAP_PROPERTY("close-base-stream", bool)
 };

Modified: trunk/gio/src/gio_methods.defs
==============================================================================
--- trunk/gio/src/gio_methods.defs	(original)
+++ trunk/gio/src/gio_methods.defs	Fri Feb  6 11:29:20 2009
@@ -98,6 +98,27 @@
   (gtype-id "G_TYPE_LOADABLE_ICON")
 )
 
+(define-object DirectoryMonitor
+  (in-module "GLocal")
+  (parent "GFileMonitor")
+  (c-name "GLocalDirectoryMonitor")
+  (gtype-id "G_TYPE_LOCAL_DIRECTORY_MONITOR")
+)
+
+(define-object FileInputStream
+  (in-module "GLocal")
+  (parent "GFileInputStream")
+  (c-name "GLocalFileInputStream")
+  (gtype-id "G_TYPE_LOCAL_FILE_INPUT_STREAM")
+)
+
+(define-object FileMonitor
+  (in-module "GLocal")
+  (parent "GFileMonitor")
+  (c-name "GLocalFileMonitor")
+  (gtype-id "G_TYPE_LOCAL_FILE_MONITOR")
+)
+
 (define-object InputStream
   (in-module "GMemory")
   (parent "GInputStream")
@@ -160,6 +181,13 @@
   (gtype-id "G_TYPE_FILE_OUTPUT_STREAM")
 )
 
+(define-object FileOutputStream
+  (in-module "GLocal")
+  (parent "GFileOutputStream")
+  (c-name "GLocalFileOutputStream")
+  (gtype-id "G_TYPE_LOCAL_FILE_OUTPUT_STREAM")
+)
+
 (define-object e
   (in-module "GSeekabl")
   (c-name "GSeekable")
@@ -423,6 +451,7 @@
     '("host-not-found" "G_IO_ERROR_HOST_NOT_FOUND")
     '("would-merge" "G_IO_ERROR_WOULD_MERGE")
     '("failed-handled" "G_IO_ERROR_FAILED_HANDLED")
+    '("too-many-open-files" "G_IO_ERROR_TOO_MANY_OPEN_FILES")
   )
 )
 
@@ -742,6 +771,10 @@
 
 
 
+;; From gasynchelper.h
+
+
+
 ;; From gasyncresult.h
 
 (define-function g_async_result_get_type
@@ -1100,6 +1133,10 @@
 
 
 
+;; From gcontenttypeprivate.h
+
+
+
 ;; From gdatainputstream.h
 
 (define-function g_data_input_stream_get_type
@@ -1227,6 +1264,29 @@
   )
 )
 
+(define-method read_line_async
+  (of-object "GDataInputStream")
+  (c-name "g_data_input_stream_read_line_async")
+  (return-type "none")
+  (parameters
+    '("gint" "io_priority")
+    '("GCancellable*" "cancellable")
+    '("GAsyncReadyCallback" "callback")
+    '("gpointer" "user_data")
+  )
+)
+
+(define-method read_line_finish
+  (of-object "GDataInputStream")
+  (c-name "g_data_input_stream_read_line_finish")
+  (return-type "char*")
+  (parameters
+    '("GAsyncResult*" "result")
+    '("gsize*" "length")
+    '("GError**" "error")
+  )
+)
+
 (define-method read_until
   (of-object "GDataInputStream")
   (c-name "g_data_input_stream_read_until")
@@ -1239,6 +1299,30 @@
   )
 )
 
+(define-method read_until_async
+  (of-object "GDataInputStream")
+  (c-name "g_data_input_stream_read_until_async")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "stop_chars")
+    '("gint" "io_priority")
+    '("GCancellable*" "cancellable")
+    '("GAsyncReadyCallback" "callback")
+    '("gpointer" "user_data")
+  )
+)
+
+(define-method read_until_finish
+  (of-object "GDataInputStream")
+  (c-name "g_data_input_stream_read_until_finish")
+  (return-type "char*")
+  (parameters
+    '("GAsyncResult*" "result")
+    '("gsize*" "length")
+    '("GError**" "error")
+  )
+)
+
 
 
 ;; From gdataoutputstream.h
@@ -1362,6 +1446,68 @@
 
 
 
+;; From gdesktopappinfo.h
+
+(define-function g_desktop_app_info_get_type
+  (c-name "g_desktop_app_info_get_type")
+  (return-type "GType")
+)
+
+(define-function g_desktop_app_info_new_from_filename
+  (c-name "g_desktop_app_info_new_from_filename")
+  (return-type "GDesktopAppInfo*")
+  (parameters
+    '("const-char*" "filename")
+  )
+)
+
+(define-function g_desktop_app_info_new_from_keyfile
+  (c-name "g_desktop_app_info_new_from_keyfile")
+  (return-type "GDesktopAppInfo*")
+  (parameters
+    '("GKeyFile*" "key_file")
+  )
+)
+
+(define-function g_desktop_app_info_new
+  (c-name "g_desktop_app_info_new")
+  (is-constructor-of "GDesktopAppInfo")
+  (return-type "GDesktopAppInfo*")
+  (parameters
+    '("const-char*" "desktop_id")
+  )
+)
+
+(define-method get_is_hidden
+  (of-object "GDesktopAppInfo")
+  (c-name "g_desktop_app_info_get_is_hidden")
+  (return-type "gboolean")
+)
+
+(define-function g_desktop_app_info_set_desktop_env
+  (c-name "g_desktop_app_info_set_desktop_env")
+  (return-type "none")
+  (parameters
+    '("const-char*" "desktop_env")
+  )
+)
+
+(define-function g_desktop_app_info_lookup_get_type
+  (c-name "g_desktop_app_info_lookup_get_type")
+  (return-type "GType")
+)
+
+(define-method get_default_for_uri_scheme
+  (of-object "GDesktopAppInfoLookup")
+  (c-name "g_desktop_app_info_lookup_get_default_for_uri_scheme")
+  (return-type "GAppInfo*")
+  (parameters
+    '("const-char*" "uri_scheme")
+  )
+)
+
+
+
 ;; From gdrive.h
 
 (define-function g_drive_get_type
@@ -1483,6 +1629,10 @@
 
 
 
+;; From gdummyfile.h
+
+
+
 ;; From gemblemedicon.h
 
 (define-function g_emblemed_icon_get_type
@@ -1615,6 +1765,10 @@
 
 
 
+;; From gfileattribute-priv.h
+
+
+
 ;; From gfileenumerator.h
 
 (define-function g_file_enumerator_get_type
@@ -3448,6 +3602,21 @@
   (return-type "GInputStream*")
 )
 
+(define-method get_close_base_stream
+  (of-object "GFilterInputStream")
+  (c-name "g_filter_input_stream_get_close_base_stream")
+  (return-type "gboolean")
+)
+
+(define-method set_close_base_stream
+  (of-object "GFilterInputStream")
+  (c-name "g_filter_input_stream_set_close_base_stream")
+  (return-type "none")
+  (parameters
+    '("gboolean" "close_base")
+  )
+)
+
 
 
 ;; From gfilteroutputstream.h
@@ -3463,6 +3632,21 @@
   (return-type "GOutputStream*")
 )
 
+(define-method get_close_base_stream
+  (of-object "GFilterOutputStream")
+  (c-name "g_filter_output_stream_get_close_base_stream")
+  (return-type "gboolean")
+)
+
+(define-method set_close_base_stream
+  (of-object "GFilterOutputStream")
+  (c-name "g_filter_output_stream_set_close_base_stream")
+  (return-type "none")
+  (parameters
+    '("gboolean" "close_base")
+  )
+)
+
 
 
 ;; From gicon.h
@@ -3657,6 +3841,10 @@
 
 
 
+;; From gioalias.h
+
+
+
 ;; From gioenums.h
 
 
@@ -3791,6 +3979,10 @@
 
 
 
+;; From gio-marshal.h
+
+
+
 ;; From giomodule.h
 
 (define-function g_io_module_get_type
@@ -3910,6 +4102,10 @@
 
 
 
+;; From giomodule-priv.h
+
+
+
 ;; From gioscheduler.h
 
 (define-function g_io_scheduler_push_job
@@ -4001,6 +4197,48 @@
 
 
 
+;; From glocaldirectorymonitor.h
+
+(define-function g_local_directory_monitor_get_type
+  (c-name "g_local_directory_monitor_get_type")
+  (return-type "GType")
+)
+
+
+
+;; From glocalfileenumerator.h
+
+
+
+;; From glocalfile.h
+
+
+
+;; From glocalfileinfo.h
+
+
+
+;; From glocalfileinputstream.h
+
+
+
+;; From glocalfilemonitor.h
+
+(define-function g_local_file_monitor_get_type
+  (c-name "g_local_file_monitor_get_type")
+  (return-type "GType")
+)
+
+
+
+;; From glocalfileoutputstream.h
+
+
+
+;; From glocalvfs.h
+
+
+
 ;; From gmemoryinputstream.h
 
 (define-function g_memory_input_stream_get_type
@@ -4365,6 +4603,10 @@
 
 
 
+;; From gmountprivate.h
+
+
+
 ;; From gnativevolumemonitor.h
 
 (define-function g_native_volume_monitor_get_type
@@ -4559,6 +4801,10 @@
 
 
 
+;; From gpollfilemonitor.h
+
+
+
 ;; From gseekable.h
 
 (define-function g_seekable_get_type
@@ -4779,6 +5025,16 @@
   )
 )
 
+(define-function g_simple_async_result_is_valid
+  (c-name "g_simple_async_result_is_valid")
+  (return-type "gboolean")
+  (parameters
+    '("GAsyncResult*" "result")
+    '("GObject*" "source")
+    '("gpointer" "source_tag")
+  )
+)
+
 (define-function g_simple_async_report_error_in_idle
   (c-name "g_simple_async_report_error_in_idle")
   (return-type "none")
@@ -4859,321 +5115,55 @@
 
 
 
-;; From gvfs.h
+;; From gunionvolumemonitor.h
 
-(define-function g_vfs_get_type
-  (c-name "g_vfs_get_type")
-  (return-type "GType")
-)
 
-(define-method is_active
-  (of-object "GVfs")
-  (c-name "g_vfs_is_active")
-  (return-type "gboolean")
-)
 
-(define-method get_file_for_path
-  (of-object "GVfs")
-  (c-name "g_vfs_get_file_for_path")
-  (return-type "GFile*")
-  (parameters
-    '("const-char*" "path")
-  )
+;; From gunixinputstream.h
+
+(define-function g_unix_input_stream_get_type
+  (c-name "g_unix_input_stream_get_type")
+  (return-type "GType")
 )
 
-(define-method get_file_for_uri
-  (of-object "GVfs")
-  (c-name "g_vfs_get_file_for_uri")
-  (return-type "GFile*")
+(define-function g_unix_input_stream_new
+  (c-name "g_unix_input_stream_new")
+  (is-constructor-of "GUnixInputStream")
+  (return-type "GInputStream*")
   (parameters
-    '("const-char*" "uri")
+    '("gint" "fd")
+    '("gboolean" "close_fd")
   )
 )
 
-(define-method parse_name
-  (of-object "GVfs")
-  (c-name "g_vfs_parse_name")
-  (return-type "GFile*")
+(define-method set_close_fd
+  (of-object "GUnixInputStream")
+  (c-name "g_unix_input_stream_set_close_fd")
+  (return-type "none")
   (parameters
-    '("const-char*" "parse_name")
+    '("gboolean" "close_fd")
   )
 )
 
-(define-function g_vfs_get_default
-  (c-name "g_vfs_get_default")
-  (return-type "GVfs*")
+(define-method get_close_fd
+  (of-object "GUnixInputStream")
+  (c-name "g_unix_input_stream_get_close_fd")
+  (return-type "gboolean")
 )
 
-(define-function g_vfs_get_local
-  (c-name "g_vfs_get_local")
-  (return-type "GVfs*")
+(define-method get_fd
+  (of-object "GUnixInputStream")
+  (c-name "g_unix_input_stream_get_fd")
+  (return-type "gint")
 )
 
 
 
-;; From gvolume.h
+;; From gunixmount.h
 
-(define-function g_volume_get_type
-  (c-name "g_volume_get_type")
-  (return-type "GType")
-)
 
-(define-method get_name
-  (of-object "GVolume")
-  (c-name "g_volume_get_name")
-  (return-type "char*")
-)
 
-(define-method get_icon
-  (of-object "GVolume")
-  (c-name "g_volume_get_icon")
-  (return-type "GIcon*")
-)
-
-(define-method get_uuid
-  (of-object "GVolume")
-  (c-name "g_volume_get_uuid")
-  (return-type "char*")
-)
-
-(define-method get_drive
-  (of-object "GVolume")
-  (c-name "g_volume_get_drive")
-  (return-type "GDrive*")
-)
-
-(define-method get_mount
-  (of-object "GVolume")
-  (c-name "g_volume_get_mount")
-  (return-type "GMount*")
-)
-
-(define-method can_mount
-  (of-object "GVolume")
-  (c-name "g_volume_can_mount")
-  (return-type "gboolean")
-)
-
-(define-method can_eject
-  (of-object "GVolume")
-  (c-name "g_volume_can_eject")
-  (return-type "gboolean")
-)
-
-(define-method should_automount
-  (of-object "GVolume")
-  (c-name "g_volume_should_automount")
-  (return-type "gboolean")
-)
-
-(define-method mount
-  (of-object "GVolume")
-  (c-name "g_volume_mount")
-  (return-type "none")
-  (parameters
-    '("GMountMountFlags" "flags")
-    '("GMountOperation*" "mount_operation")
-    '("GCancellable*" "cancellable")
-    '("GAsyncReadyCallback" "callback")
-    '("gpointer" "user_data")
-  )
-)
-
-(define-method mount_finish
-  (of-object "GVolume")
-  (c-name "g_volume_mount_finish")
-  (return-type "gboolean")
-  (parameters
-    '("GAsyncResult*" "result")
-    '("GError**" "error")
-  )
-)
-
-(define-method eject
-  (of-object "GVolume")
-  (c-name "g_volume_eject")
-  (return-type "none")
-  (parameters
-    '("GMountUnmountFlags" "flags")
-    '("GCancellable*" "cancellable")
-    '("GAsyncReadyCallback" "callback")
-    '("gpointer" "user_data")
-  )
-)
-
-(define-method eject_finish
-  (of-object "GVolume")
-  (c-name "g_volume_eject_finish")
-  (return-type "gboolean")
-  (parameters
-    '("GAsyncResult*" "result")
-    '("GError**" "error")
-  )
-)
-
-(define-method get_identifier
-  (of-object "GVolume")
-  (c-name "g_volume_get_identifier")
-  (return-type "char*")
-  (parameters
-    '("const-char*" "kind")
-  )
-)
-
-(define-method enumerate_identifiers
-  (of-object "GVolume")
-  (c-name "g_volume_enumerate_identifiers")
-  (return-type "char**")
-)
-
-(define-method get_activation_root
-  (of-object "GVolume")
-  (c-name "g_volume_get_activation_root")
-  (return-type "GFile*")
-)
-
-
-
-;; From gvolumemonitor.h
-
-(define-function g_volume_monitor_get_type
-  (c-name "g_volume_monitor_get_type")
-  (return-type "GType")
-)
-
-(define-function g_volume_monitor_get
-  (c-name "g_volume_monitor_get")
-  (return-type "GVolumeMonitor*")
-)
-
-(define-method get_connected_drives
-  (of-object "GVolumeMonitor")
-  (c-name "g_volume_monitor_get_connected_drives")
-  (return-type "GList*")
-)
-
-(define-method get_volumes
-  (of-object "GVolumeMonitor")
-  (c-name "g_volume_monitor_get_volumes")
-  (return-type "GList*")
-)
-
-(define-method get_mounts
-  (of-object "GVolumeMonitor")
-  (c-name "g_volume_monitor_get_mounts")
-  (return-type "GList*")
-)
-
-(define-method get_volume_for_uuid
-  (of-object "GVolumeMonitor")
-  (c-name "g_volume_monitor_get_volume_for_uuid")
-  (return-type "GVolume*")
-  (parameters
-    '("const-char*" "uuid")
-  )
-)
-
-(define-method get_mount_for_uuid
-  (of-object "GVolumeMonitor")
-  (c-name "g_volume_monitor_get_mount_for_uuid")
-  (return-type "GMount*")
-  (parameters
-    '("const-char*" "uuid")
-  )
-)
-
-(define-function g_volume_monitor_adopt_orphan_mount
-  (c-name "g_volume_monitor_adopt_orphan_mount")
-  (return-type "GVolume*")
-  (parameters
-    '("GMount*" "mount")
-  )
-)
-
-
-
-;; From gdesktopappinfo.h
-
-(define-function g_desktop_app_info_get_type
-  (c-name "g_desktop_app_info_get_type")
-  (return-type "GType")
-)
-
-(define-function g_desktop_app_info_new_from_filename
-  (c-name "g_desktop_app_info_new_from_filename")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("const-char*" "filename")
-  )
-)
-
-(define-function g_desktop_app_info_new_from_keyfile
-  (c-name "g_desktop_app_info_new_from_keyfile")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("GKeyFile*" "key_file")
-  )
-)
-
-(define-function g_desktop_app_info_new
-  (c-name "g_desktop_app_info_new")
-  (is-constructor-of "GDesktopAppInfo")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("const-char*" "desktop_id")
-  )
-)
-
-(define-method get_is_hidden
-  (of-object "GDesktopAppInfo")
-  (c-name "g_desktop_app_info_get_is_hidden")
-  (return-type "gboolean")
-)
-
-(define-function g_desktop_app_info_set_desktop_env
-  (c-name "g_desktop_app_info_set_desktop_env")
-  (return-type "none")
-  (parameters
-    '("const-char*" "desktop_env")
-  )
-)
-
-(define-function g_desktop_app_info_lookup_get_type
-  (c-name "g_desktop_app_info_lookup_get_type")
-  (return-type "GType")
-)
-
-(define-method get_default_for_uri_scheme
-  (of-object "GDesktopAppInfoLookup")
-  (c-name "g_desktop_app_info_lookup_get_default_for_uri_scheme")
-  (return-type "GAppInfo*")
-  (parameters
-    '("const-char*" "uri_scheme")
-  )
-)
-
-
-
-;; From gunixinputstream.h
-
-(define-function g_unix_input_stream_get_type
-  (c-name "g_unix_input_stream_get_type")
-  (return-type "GType")
-)
-
-(define-function g_unix_input_stream_new
-  (c-name "g_unix_input_stream_new")
-  (is-constructor-of "GUnixInputStream")
-  (return-type "GInputStream*")
-  (parameters
-    '("int" "fd")
-    '("gboolean" "close_fd_at_close")
-  )
-)
-
-
-
-;; From gunixmounts.h
+;; From gunixmounts.h
 
 (define-function g_unix_mount_free
   (c-name "g_unix_mount_free")
@@ -5416,9 +5406,288 @@
   (is-constructor-of "GUnixOutputStream")
   (return-type "GOutputStream*")
   (parameters
-    '("int" "fd")
-    '("gboolean" "close_fd_at_close")
+    '("gint" "fd")
+    '("gboolean" "close_fd")
+  )
+)
+
+(define-method set_close_fd
+  (of-object "GUnixOutputStream")
+  (c-name "g_unix_output_stream_set_close_fd")
+  (return-type "none")
+  (parameters
+    '("gboolean" "close_fd")
   )
 )
 
+(define-method get_close_fd
+  (of-object "GUnixOutputStream")
+  (c-name "g_unix_output_stream_get_close_fd")
+  (return-type "gboolean")
+)
+
+(define-method get_fd
+  (of-object "GUnixOutputStream")
+  (c-name "g_unix_output_stream_get_fd")
+  (return-type "gint")
+)
+
+
+
+;; From gunixvolume.h
+
+
+
+;; From gunixvolumemonitor.h
+
+
+
+;; From gvfs.h
+
+(define-function g_vfs_get_type
+  (c-name "g_vfs_get_type")
+  (return-type "GType")
+)
+
+(define-method is_active
+  (of-object "GVfs")
+  (c-name "g_vfs_is_active")
+  (return-type "gboolean")
+)
+
+(define-method get_file_for_path
+  (of-object "GVfs")
+  (c-name "g_vfs_get_file_for_path")
+  (return-type "GFile*")
+  (parameters
+    '("const-char*" "path")
+  )
+)
+
+(define-method get_file_for_uri
+  (of-object "GVfs")
+  (c-name "g_vfs_get_file_for_uri")
+  (return-type "GFile*")
+  (parameters
+    '("const-char*" "uri")
+  )
+)
+
+(define-method parse_name
+  (of-object "GVfs")
+  (c-name "g_vfs_parse_name")
+  (return-type "GFile*")
+  (parameters
+    '("const-char*" "parse_name")
+  )
+)
+
+(define-function g_vfs_get_default
+  (c-name "g_vfs_get_default")
+  (return-type "GVfs*")
+)
+
+(define-function g_vfs_get_local
+  (c-name "g_vfs_get_local")
+  (return-type "GVfs*")
+)
+
+
+
+;; From gvolume.h
+
+(define-function g_volume_get_type
+  (c-name "g_volume_get_type")
+  (return-type "GType")
+)
+
+(define-method get_name
+  (of-object "GVolume")
+  (c-name "g_volume_get_name")
+  (return-type "char*")
+)
+
+(define-method get_icon
+  (of-object "GVolume")
+  (c-name "g_volume_get_icon")
+  (return-type "GIcon*")
+)
+
+(define-method get_uuid
+  (of-object "GVolume")
+  (c-name "g_volume_get_uuid")
+  (return-type "char*")
+)
+
+(define-method get_drive
+  (of-object "GVolume")
+  (c-name "g_volume_get_drive")
+  (return-type "GDrive*")
+)
+
+(define-method get_mount
+  (of-object "GVolume")
+  (c-name "g_volume_get_mount")
+  (return-type "GMount*")
+)
+
+(define-method can_mount
+  (of-object "GVolume")
+  (c-name "g_volume_can_mount")
+  (return-type "gboolean")
+)
+
+(define-method can_eject
+  (of-object "GVolume")
+  (c-name "g_volume_can_eject")
+  (return-type "gboolean")
+)
+
+(define-method should_automount
+  (of-object "GVolume")
+  (c-name "g_volume_should_automount")
+  (return-type "gboolean")
+)
+
+(define-method mount
+  (of-object "GVolume")
+  (c-name "g_volume_mount")
+  (return-type "none")
+  (parameters
+    '("GMountMountFlags" "flags")
+    '("GMountOperation*" "mount_operation")
+    '("GCancellable*" "cancellable")
+    '("GAsyncReadyCallback" "callback")
+    '("gpointer" "user_data")
+  )
+)
+
+(define-method mount_finish
+  (of-object "GVolume")
+  (c-name "g_volume_mount_finish")
+  (return-type "gboolean")
+  (parameters
+    '("GAsyncResult*" "result")
+    '("GError**" "error")
+  )
+)
+
+(define-method eject
+  (of-object "GVolume")
+  (c-name "g_volume_eject")
+  (return-type "none")
+  (parameters
+    '("GMountUnmountFlags" "flags")
+    '("GCancellable*" "cancellable")
+    '("GAsyncReadyCallback" "callback")
+    '("gpointer" "user_data")
+  )
+)
+
+(define-method eject_finish
+  (of-object "GVolume")
+  (c-name "g_volume_eject_finish")
+  (return-type "gboolean")
+  (parameters
+    '("GAsyncResult*" "result")
+    '("GError**" "error")
+  )
+)
+
+(define-method get_identifier
+  (of-object "GVolume")
+  (c-name "g_volume_get_identifier")
+  (return-type "char*")
+  (parameters
+    '("const-char*" "kind")
+  )
+)
+
+(define-method enumerate_identifiers
+  (of-object "GVolume")
+  (c-name "g_volume_enumerate_identifiers")
+  (return-type "char**")
+)
+
+(define-method get_activation_root
+  (of-object "GVolume")
+  (c-name "g_volume_get_activation_root")
+  (return-type "GFile*")
+)
+
+
+
+;; From gvolumemonitor.h
+
+(define-function g_volume_monitor_get_type
+  (c-name "g_volume_monitor_get_type")
+  (return-type "GType")
+)
+
+(define-function g_volume_monitor_get
+  (c-name "g_volume_monitor_get")
+  (return-type "GVolumeMonitor*")
+)
+
+(define-method get_connected_drives
+  (of-object "GVolumeMonitor")
+  (c-name "g_volume_monitor_get_connected_drives")
+  (return-type "GList*")
+)
+
+(define-method get_volumes
+  (of-object "GVolumeMonitor")
+  (c-name "g_volume_monitor_get_volumes")
+  (return-type "GList*")
+)
+
+(define-method get_mounts
+  (of-object "GVolumeMonitor")
+  (c-name "g_volume_monitor_get_mounts")
+  (return-type "GList*")
+)
+
+(define-method get_volume_for_uuid
+  (of-object "GVolumeMonitor")
+  (c-name "g_volume_monitor_get_volume_for_uuid")
+  (return-type "GVolume*")
+  (parameters
+    '("const-char*" "uuid")
+  )
+)
+
+(define-method get_mount_for_uuid
+  (of-object "GVolumeMonitor")
+  (c-name "g_volume_monitor_get_mount_for_uuid")
+  (return-type "GMount*")
+  (parameters
+    '("const-char*" "uuid")
+  )
+)
+
+(define-function g_volume_monitor_adopt_orphan_mount
+  (c-name "g_volume_monitor_adopt_orphan_mount")
+  (return-type "GVolume*")
+  (parameters
+    '("GMount*" "mount")
+  )
+)
+
+
+
+;; From gwin32appinfo.h
+
+(define-function g_win32_app_info_get_type
+  (c-name "g_win32_app_info_get_type")
+  (return-type "GType")
+)
+
+
+
+;; From gwin32mount.h
+
+
+
+;; From gwin32volumemonitor.h
+
 

Modified: trunk/gio/src/unixinputstream.hg
==============================================================================
--- trunk/gio/src/unixinputstream.hg	(original)
+++ trunk/gio/src/unixinputstream.hg	Fri Feb  6 11:29:20 2009
@@ -45,6 +45,10 @@
 public:
   _WRAP_CREATE(int fd, bool close_fd_at_close)
 
+  _WRAP_METHOD(void set_close_fd(bool close_fd = true), g_unix_input_stream_set_close_fd)
+  _WRAP_METHOD(bool get_close_fd() const, g_unix_input_stream_get_close_fd)
+  _WRAP_METHOD(int get_fd() const, g_unix_input_stream_get_fd)
+
   _WRAP_PROPERTY("fd", int)
   _WRAP_PROPERTY("close-fd", bool)
 };

Modified: trunk/gio/src/unixoutputstream.hg
==============================================================================
--- trunk/gio/src/unixoutputstream.hg	(original)
+++ trunk/gio/src/unixoutputstream.hg	Fri Feb  6 11:29:20 2009
@@ -44,6 +44,10 @@
 public:
   _WRAP_CREATE(int fd, bool close_fd_at_close)
 
+  _WRAP_METHOD(void set_close_fd(bool close_fd = true), g_unix_output_stream_set_close_fd)
+  _WRAP_METHOD(bool get_close_fd() const, g_unix_output_stream_get_close_fd)
+  _WRAP_METHOD(int get_fd() const, g_unix_output_stream_get_fd)
+
   _WRAP_PROPERTY("fd", int)
   _WRAP_PROPERTY("close-fd", bool)
 };



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