glibmm r573 - in trunk: . gio/src tools/extra_defs_gen tools/m4



Author: murrayc
Date: Sun Feb  3 22:37:21 2008
New Revision: 573
URL: http://svn.gnome.org/viewvc/glibmm?rev=573&view=rev

Log:
2008-02-03  Murray Cumming  <murrayc murrayc com>

* tools/extra_defs_gen/generate_defs_gio.cc: Added types.
* gio/src/gio_signals.defs: Regenerated.

* tools/m4/convert_gio.m4:
* gio/src/drive.hg:
* gio/src/filterinputstream.hg:
* gio/src/filteroutputstream.hg:
* gio/src/mount.hg:
* gio/src/mountoperation.hg:
* gio/src/volume.hg:
* gio/src/volumemonitor.hg: Added signals and properties.

* gio/src/file.ccg:
* gio/src/file.hg: Added query_filesystem_info() without a cancellable.

Modified:
   trunk/ChangeLog
   trunk/gio/src/drive.hg
   trunk/gio/src/file.ccg
   trunk/gio/src/file.hg
   trunk/gio/src/filterinputstream.hg
   trunk/gio/src/filteroutputstream.hg
   trunk/gio/src/gio_signals.defs
   trunk/gio/src/mount.hg
   trunk/gio/src/mountoperation.hg
   trunk/gio/src/volume.hg
   trunk/gio/src/volumemonitor.hg
   trunk/tools/extra_defs_gen/generate_defs_gio.cc
   trunk/tools/m4/convert_gio.m4

Modified: trunk/gio/src/drive.hg
==============================================================================
--- trunk/gio/src/drive.hg	(original)
+++ trunk/gio/src/drive.hg	Sun Feb  3 22:37:21 2008
@@ -109,10 +109,11 @@
                g_drive_poll_for_media_finish,
                errthrow)
 
-  /* vfuncs */
+  _WRAP_METHOD(std::string get_identifier(const std::string& kind) const, g_drive_get_identifier)
+  _WRAP_METHOD(Glib::StringArrayHandle enumerate_identifiers() const, g_drive_enumerate_identifiers)
 
   _WRAP_VFUNC(Glib::ustring get_name() const, get_name)
-  //TODO: Careful of ref-countign: _WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, get_icon)
+  //TODO: Careful of ref-counting: _WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, get_icon)
   _WRAP_VFUNC(bool has_volumes() const, has_volumes)
   //TODO: finish
 };

Modified: trunk/gio/src/file.ccg
==============================================================================
--- trunk/gio/src/file.ccg	(original)
+++ trunk/gio/src/file.ccg	Sun Feb  3 22:37:21 2008
@@ -375,6 +375,27 @@
 }
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<FileInfo> File::query_filesystem_info(const std::string& attributes)
+#else
+Glib::RefPtr<FileInfo> File::query_filesystem_info(const std::string& attributes, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), NULL, &(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
+
+  if(retvalue)
+    retvalue->reference(); //The function does not do a ref for us.
+  return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 Glib::RefPtr<FileEnumerator> File::enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags)
 #else
 Glib::RefPtr<FileEnumerator> File::enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)

Modified: trunk/gio/src/file.hg
==============================================================================
--- trunk/gio/src/file.hg	(original)
+++ trunk/gio/src/file.hg	Sun Feb  3 22:37:21 2008
@@ -626,7 +626,7 @@
                g_file_query_info_finish,
                refreturn, errthrow)
 
-  /** Similar to g_file_query_info(), but obtains information
+  /** Similar to query_info(), but obtains information
    * about the filesystem the file is on, rather than the file itself.
    * For instance the amount of space availible and the type of
    * the filesystem.
@@ -656,6 +656,33 @@
 #else
   Glib::RefPtr<FileInfo> query_filesystem_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, std::auto_ptr<Glib::Error>& error);
 #endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  /** Similar to query_info(), but obtains information
+   * about the filesystem the file is on, rather than the file itself.
+   * For instance the amount of space availible and the type of
+   * the filesystem.
+   * 
+   * The @a attribute  value is a string that specifies the file attributes that
+   * should be gathered. It is not an error if its not possible to read a particular
+   * requested attribute from a file, it just won't be set. @a attribute  should
+   * be a comma-separated list of attribute or attribute wildcards. The wildcard "*"
+   * means all attributes, and a wildcard like "fs:*" means all attributes in the fs
+   * namespace. The standard namespace for filesystem attributes is "fs".
+   * Common attributes of interest are FILE_ATTRIBUTE_FILESYSTEM_SIZE
+   * (the total size of the filesystem in bytes), FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
+   * bytes availible), and FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
+   * 
+   * 
+   * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
+   * Other errors are possible too, and depend on what kind of filesystem the file is on.
+   * @param attributes An attribute query string.
+   * @return A FileInfo or an empty RefPtr if there was an error.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  Glib::RefPtr<FileInfo> query_filesystem_info(const std::string& attributes = "*");
+#else
+  Glib::RefPtr<FileInfo> query_filesystem_info(const std::string& attributes, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
   _IGNORE(g_file_query_filesystem_info)
 
   _WRAP_METHOD(Glib::RefPtr<Mount> find_enclosing_mount(const Glib::RefPtr<Cancellable>& cancellable), 

Modified: trunk/gio/src/filterinputstream.hg
==============================================================================
--- trunk/gio/src/filterinputstream.hg	(original)
+++ trunk/gio/src/filterinputstream.hg	Sun Feb  3 22:37:21 2008
@@ -37,6 +37,8 @@
   _WRAP_METHOD(Glib::RefPtr<const InputStream> get_base_stream() const,
                g_filter_input_stream_get_base_stream,
                refreturn, constversion)
+
+  _WRAP_PROPERTY("base-stream", Glib::RefPtr<InputStream>)
 };
 
 } // namespace Gio

Modified: trunk/gio/src/filteroutputstream.hg
==============================================================================
--- trunk/gio/src/filteroutputstream.hg	(original)
+++ trunk/gio/src/filteroutputstream.hg	Sun Feb  3 22:37:21 2008
@@ -37,6 +37,8 @@
   _WRAP_METHOD(Glib::RefPtr<const OutputStream> get_base_stream() const,
                g_filter_output_stream_get_base_stream,
                refreturn, constversion)
+
+  _WRAP_PROPERTY("base-stream", Glib::RefPtr<InputStream>)
 };
 
 } // namespace Gio

Modified: trunk/gio/src/gio_signals.defs
==============================================================================
--- trunk/gio/src/gio_signals.defs	(original)
+++ trunk/gio/src/gio_signals.defs	Sun Feb  3 22:37:21 2008
@@ -8,6 +8,113 @@
   (when "last")
 )
 
+;; From GBufferedInputStream
+
+(define-property base-stream
+  (of-object "GBufferedInputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property buffer-size
+  (of-object "GBufferedInputStream")
+  (prop-type "GParamUInt")
+  (docs "The size of the backend buffer")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; From GBufferedOutputStream
+
+(define-property base-stream
+  (of-object "GBufferedOutputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property buffer-size
+  (of-object "GBufferedOutputStream")
+  (prop-type "GParamUInt")
+  (docs "The size of the backend buffer")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property auto-grow
+  (of-object "GBufferedOutputStream")
+  (prop-type "GParamBoolean")
+  (docs "Whether the buffer should automatically grow")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; From GDataInputStream
+
+(define-property base-stream
+  (of-object "GDataInputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property buffer-size
+  (of-object "GDataInputStream")
+  (prop-type "GParamUInt")
+  (docs "The size of the backend buffer")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property byte-order
+  (of-object "GDataInputStream")
+  (prop-type "GParamEnum")
+  (docs "The byte order")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property newline-type
+  (of-object "GDataInputStream")
+  (prop-type "GParamEnum")
+  (docs "The accepted types of line ending")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; From GDataOutputStream
+
+(define-property base-stream
+  (of-object "GDataOutputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property byte-order
+  (of-object "GDataOutputStream")
+  (prop-type "GParamEnum")
+  (docs "The byte order")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GDrive
 
 ;; From GFile
@@ -53,10 +160,36 @@
 
 ;; From GFileOutputStream
 
+;; From GFilterInputStream
+
+(define-property base-stream
+  (of-object "GFilterInputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+;; From GFilterOutputStream
+
+(define-property base-stream
+  (of-object "GFilterOutputStream")
+  (prop-type "GParamObject")
+  (docs "The underlying base stream the io ops will be done on")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
 ;; From GInputStream
 
 ;; From GLoadableIcon
 
+;; From GMemoryInputStream
+
+;; From GMemoryOutputStream
+
 ;; From GMount
 
 ;; From GMountOperation
@@ -146,9 +279,102 @@
   (construct-only #f)
 )
 
+;; From GSeekable
+
 ;; From GSimpleAsyncResult
 
 ;; From GVolume
 
-;; Warning: g_object_interface_list_properties() returned NULL for GVolume
+;; From GVolumeMonitor
+
+(define-signal volume-added
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GVolume*" "p0")
+  )
+)
+
+(define-signal volume-removed
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GVolume*" "p0")
+  )
+)
+
+(define-signal volume-changed
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GVolume*" "p0")
+  )
+)
+
+(define-signal mount-added
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GMount*" "p0")
+  )
+)
+
+(define-signal mount-removed
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GMount*" "p0")
+  )
+)
+
+(define-signal mount-pre-unmount
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GMount*" "p0")
+  )
+)
+
+(define-signal mount-changed
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GMount*" "p0")
+  )
+)
+
+(define-signal drive-connected
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GDrive*" "p0")
+  )
+)
+
+(define-signal drive-disconnected
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GDrive*" "p0")
+  )
+)
+
+(define-signal drive-changed
+  (of-object "GVolumeMonitor")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GDrive*" "p0")
+  )
+)
+
 

Modified: trunk/gio/src/mount.hg
==============================================================================
--- trunk/gio/src/mount.hg	(original)
+++ trunk/gio/src/mount.hg	Sun Feb  3 22:37:21 2008
@@ -165,6 +165,7 @@
 
   _WRAP_METHOD(bool eject_finish(const Glib::RefPtr<AsyncResult>& result), g_mount_eject_finish, errthrow)
 
+  //TODO: For some reason these are not in gio_signals.defs. We may need to hand-write them in gio_others.defs. murrayc.
   _WRAP_SIGNAL(void changed(), changed)
   _WRAP_SIGNAL(void unmounted(), unmounted)
 

Modified: trunk/gio/src/mountoperation.hg
==============================================================================
--- trunk/gio/src/mountoperation.hg	(original)
+++ trunk/gio/src/mountoperation.hg	Sun Feb  3 22:37:21 2008
@@ -21,11 +21,12 @@
 
 _DEFS(giomm,gio)
 _PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(gio/gio.h)
 
 namespace Gio
 {
 
-_WRAP_ENUM(PasswordFlags, GPasswordFlags, NO_GTYPE)
+_WRAP_ENUM(AskPasswordFlags, GAskPasswordFlags, NO_GTYPE)
 _WRAP_ENUM(PasswordSave, GPasswordSave, NO_GTYPE)
 _WRAP_ENUM(MountOperationResult, GMountOperationResult, NO_GTYPE)
 
@@ -74,6 +75,22 @@
   _WRAP_METHOD(int get_choice() const, g_mount_operation_get_choice)
   _WRAP_METHOD(void set_choice(int choice), g_mount_operation_set_choice)
   _WRAP_METHOD(void reply(MountOperationResult result), g_mount_operation_reply)
+
+#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
+  _WRAP_SIGNAL(void ask_password(const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags), ask_password)
+  //TODO:_WRAP_SIGNAL(void ask_question(const Glib::ustring& message, const Glib::ustring& choices[]), ask_question)
+  _WRAP_SIGNAL(void reply(MountOperationResult result), reply)
+
+
+  _WRAP_PROPERTY("username", Glib::ustring)
+  _WRAP_PROPERTY("password", Glib::ustring)
+  _WRAP_PROPERTY("anonymous", bool)
+  _WRAP_PROPERTY("domain", Glib::ustring)
+  _WRAP_PROPERTY("password-save", PasswordSave)
+  _WRAP_PROPERTY("choice", int)
+
+  //TODO: vfuncs
+
 };
 
 } // namespace Gio

Modified: trunk/gio/src/volume.hg
==============================================================================
--- trunk/gio/src/volume.hg	(original)
+++ trunk/gio/src/volume.hg	Sun Feb  3 22:37:21 2008
@@ -151,7 +151,9 @@
   _WRAP_METHOD(Glib::StringArrayHandle enumerate_identifiers() const,
                g_volume_enumerate_identifiers)
 
-  _WRAP_SIGNAL(void changed(), "changed")
+  //TODO: For some reason these are not in gio_signals.defs. We may need to hand-write them in gio_others.defs. murrayc.
+  _WRAP_SIGNAL(void changed(), changed)
+  _WRAP_SIGNAL(void removed(), removed)
 
   /* vfuncs */
   //TODO

Modified: trunk/gio/src/volumemonitor.hg
==============================================================================
--- trunk/gio/src/volumemonitor.hg	(original)
+++ trunk/gio/src/volumemonitor.hg	Sun Feb  3 22:37:21 2008
@@ -57,8 +57,23 @@
 
   _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount)
 
-  
-  //TODO: signals, vfuncs
+#m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Volume>&',`Glib::wrap($3, true)')
+  _WRAP_SIGNAL(void volume_added(const Glib::RefPtr<Volume>& volume), volume_added)
+  _WRAP_SIGNAL(void volume_removed(const Glib::RefPtr<Volume>& volume), volume_removed)
+  _WRAP_SIGNAL(void volume_changed(const Glib::RefPtr<Volume>& volume), volume_changed)
+
+#m4 _CONVERSION(`GMount*',`const Glib::RefPtr<Mount>&',`Glib::wrap($3, true)')
+  _WRAP_SIGNAL(void mount_added(const Glib::RefPtr<Mount>& mount), mount_added)
+  _WRAP_SIGNAL(void mount_removed(const Glib::RefPtr<Mount>& mount), mount_removed)
+  _WRAP_SIGNAL(void mount_pre_unmount(const Glib::RefPtr<Mount>& mount), mount_pre_unmount)
+  _WRAP_SIGNAL(void mount_changed(const Glib::RefPtr<Mount>& mount), mount_changed)
+
+#m4 _CONVERSION(`GDrive*',`const Glib::RefPtr<Drive>&',`Glib::wrap($3, true)')
+  _WRAP_SIGNAL(void drive_connected(const Glib::RefPtr<Drive>& drive), drive_connected)
+  _WRAP_SIGNAL(void drive_disconnected(const Glib::RefPtr<Drive>& drive), drive_disconnected)
+  _WRAP_SIGNAL(void drive_changed(const Glib::RefPtr<Drive>& drive), drive_changed)
+
+  //TODO: vfuncs
 
   //There are no properties.
 };

Modified: trunk/tools/extra_defs_gen/generate_defs_gio.cc
==============================================================================
--- trunk/tools/extra_defs_gen/generate_defs_gio.cc	(original)
+++ trunk/tools/extra_defs_gen/generate_defs_gio.cc	Sun Feb  3 22:37:21 2008
@@ -27,6 +27,10 @@
 
   std::cout << get_defs(G_TYPE_ASYNC_RESULT)
             << get_defs(G_TYPE_CANCELLABLE)
+            << get_defs(G_TYPE_BUFFERED_INPUT_STREAM)
+            << get_defs(G_TYPE_BUFFERED_OUTPUT_STREAM)
+            << get_defs(G_TYPE_DATA_INPUT_STREAM)
+            << get_defs(G_TYPE_DATA_OUTPUT_STREAM)
             << get_defs(G_TYPE_DRIVE)
             << get_defs(G_TYPE_FILE)
             << get_defs(G_TYPE_FILE_ENUMERATOR)
@@ -37,17 +41,24 @@
 //            << get_defs(G_TYPE_FILE_ATTRIBUTE_MATCHER)
             << get_defs(G_TYPE_FILE_INPUT_STREAM)
             << get_defs(G_TYPE_FILE_OUTPUT_STREAM)
+            << get_defs(G_TYPE_FILTER_INPUT_STREAM)
+            << get_defs(G_TYPE_FILTER_OUTPUT_STREAM)
 
             << get_defs(G_TYPE_INPUT_STREAM)
             << get_defs(G_TYPE_LOADABLE_ICON)
+            << get_defs(G_TYPE_MEMORY_INPUT_STREAM)
+            << get_defs(G_TYPE_MEMORY_OUTPUT_STREAM)
             << get_defs(G_TYPE_MOUNT)
             << get_defs(G_TYPE_MOUNT_OPERATION)
+            << get_defs(G_TYPE_SEEKABLE)
             << get_defs(G_TYPE_SIMPLE_ASYNC_RESULT)
 
             //TODO: This causes a g_warning:
             //GLib-GObject-CRITICAL **: g_param_spec_pool_list: assertion `pool != NULL' failed"
             << get_defs(G_TYPE_VOLUME)
 
+            << get_defs(G_TYPE_VOLUME_MONITOR)
+
             << std::endl;
   
   return 0;

Modified: trunk/tools/m4/convert_gio.m4
==============================================================================
--- trunk/tools/m4/convert_gio.m4	(original)
+++ trunk/tools/m4/convert_gio.m4	Sun Feb  3 22:37:21 2008
@@ -1,4 +1,5 @@
 _CONV_ENUM(G,PasswordSave)
+_CONV_ENUM(G,AskPasswordFlags)
 _CONV_ENUM(G,MountOperationResult)
 _CONV_ENUM(G,MountUnmountFlags)
 _CONV_ENUM(G,FileAttributeType)
@@ -90,6 +91,9 @@
 _CONVERSION(`GPasswordSave',`PasswordSave',`($2)$3')
 _CONVERSION(`PasswordSave',`GPasswordSave',`($2)$3')
 
+#MountOperation
+#_CONVERSION(`GAskPasswordFlags',`AskPasswordFlags',`($2)$3')
+
 # OutputStream
 _CONVERSION(`GOutputStream*',`Glib::RefPtr<OutputStream>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<OutputStream>&',`GOutputStream*',__CONVERT_CONST_REFPTR_TO_P)
@@ -99,4 +103,7 @@
 
 # VolumeMonitor
 _CONVERSION(`GVolumeMonitor*',`Glib::RefPtr<VolumeMonitor>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Drive>&',`GDrive*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Mount>&',`GMount*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Volume>&',`GVolume*',__CONVERT_CONST_REFPTR_TO_P)
 



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