glibmm r593 - in trunk: . gio/src
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r593 - in trunk: . gio/src
- Date: Sat, 9 Feb 2008 16:12:28 +0000 (GMT)
Author: murrayc
Date: Sat Feb 9 16:12:27 2008
New Revision: 593
URL: http://svn.gnome.org/viewvc/glibmm?rev=593&view=rev
Log:
2008-02-09 Murray Cumming <murrayc murrayc com>
* gio/src/gio_vfuncs.defs: Added hand-written vfunc .defs for
GVolume and GVolumeMonitor.
* gio/src/volume.hg:
* gio/src/volumemonitor.hg: Added vfuncs, though not using all C++ types
yet. I am not really sure that these will ever be useful (if anyone will
ever want to implement them in C++).
Modified:
trunk/ChangeLog
trunk/gio/src/gio_vfuncs.defs
trunk/gio/src/volume.hg
trunk/gio/src/volumemonitor.hg
Modified: trunk/gio/src/gio_vfuncs.defs
==============================================================================
--- trunk/gio/src/gio_vfuncs.defs (original)
+++ trunk/gio/src/gio_vfuncs.defs Sat Feb 9 16:12:27 2008
@@ -1,6 +1,7 @@
;; -*- scheme -*-
; virtual function definitions
; define-vfunc is g*mm-specific
+; These are hand-written.
; GAsyncResult
@@ -308,3 +309,157 @@
'("GError**" "error")
)
)
+
+; GVolume
+
+(define-vfunc get_name
+ (of-object "GVolume")
+ (return-type "char*")
+)
+
+(define-vfunc get_icon
+ (of-object "GVolume")
+ (return-type "GIcon*")
+)
+
+(define-vfunc get_uuid
+ (of-object "GVolume")
+ (return-type "char*")
+)
+
+(define-vfunc get_drive
+ (of-object "GVolume")
+ (return-type "GDrive*")
+)
+
+(define-vfunc get_mount
+ (of-object "GVolume")
+ (return-type "GMount*")
+)
+
+(define-vfunc can_mount
+ (of-object "GVolume")
+ (return-type "gboolean")
+)
+
+(define-vfunc can_eject
+ (of-object "GVolume")
+ (return-type "gboolean")
+)
+
+(define-vfunc mount_fn
+ (of-object "GVolume")
+ (return-type "void")
+ (parameters
+ '("GMountOperation*" "mount_operation")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc mount_finish
+ (of-object "GVolume")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
+)
+
+
+(define-vfunc eject
+ (of-object "GVolume")
+ (return-type "void")
+ (parameters
+ '("GMountUnmountFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc eject_finish
+ (of-object "GVolume")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
+)
+
+(define-vfunc get_identifier
+ (of-object "GVolume")
+ (return-type "char*")
+ (parameters
+ '("const-char*" "kind")
+ )
+)
+
+(define-vfunc enumerate_identifiers
+ (of-object "GVolume")
+ (return-type "char**")
+)
+
+(define-vfunc should_automount
+ (of-object "GVolume")
+ (return-type "gboolean")
+)
+
+
+; GVolumeMonitor
+
+; This doesn't even take a GVolumeMonitor.
+; Maybe it is not a real vfunc. murrayc.
+(define-vfunc is_supported
+ (of-object "GVolumeMonitor")
+ (return-type "gboolean")
+)
+
+(define-vfunc get_connected_drives
+ (of-object "GVolumeMonitor")
+ (return-type "GList*")
+)
+
+(define-vfunc get_connected_drives
+ (of-object "GVolumeMonitor")
+ (return-type "GList*")
+)
+
+(define-vfunc get_volumes
+ (of-object "GVolumeMonitor")
+ (return-type "GList*")
+)
+
+(define-vfunc get_mounts
+ (of-object "GVolumeMonitor")
+ (return-type "GList*")
+)
+
+(define-vfunc get_volume_for_uuid
+ (of-object "GVolumeMonitor")
+ (return-type "GVolume*")
+ (parameters
+ '("const-char*" "uuid")
+ )
+)
+
+(define-vfunc get_mount_for_uuid
+ (of-object "GVolumeMonitor")
+ (return-type "GMount*")
+ (parameters
+ '("const-char*" "uuid")
+ )
+)
+
+; This doesn't take a GVolumeMonitor.
+; Maybe it is not a real vfunc. murrayc
+(define-vfunc adopt_orphan_mount
+ (of-object "GVolumeMonitor")
+ (return-type "GVolume*")
+ (parameters
+ '("GMount*" "mount")
+ )
+)
+
+
Modified: trunk/gio/src/volume.hg
==============================================================================
--- trunk/gio/src/volume.hg (original)
+++ trunk/gio/src/volume.hg Sat Feb 9 16:12:27 2008
@@ -155,8 +155,29 @@
_WRAP_SIGNAL(void changed(), changed)
_WRAP_SIGNAL(void removed(), removed)
- /* vfuncs */
- //TODO
+ _WRAP_VFUNC(std::string get_name(), get_name)
+ _WRAP_VFUNC(Glib::RefPtr<Icon> get_icon(), get_icon)
+ _WRAP_VFUNC(std::string get_uuid(), get_uuid)
+
+#m4 _CONVERSION(`Glib::RefPtr<Drive>',`GDrive*',__CONVERT_CONST_REFPTR_TO_P)
+ _WRAP_VFUNC(Glib::RefPtr<Drive> get_drive(), get_drive)
+
+#m4 _CONVERSION(`Glib::RefPtr<Mount>',`GMount*',__CONVERT_CONST_REFPTR_TO_P)
+ _WRAP_VFUNC(Glib::RefPtr<Mount> get_mount(), get_mount)
+
+ _WRAP_VFUNC(bool can_mount(), can_mount)
+ _WRAP_VFUNC(bool can_eject(), can_eject)
+ _WRAP_VFUNC(void mount_fn(GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data), mount_fn) //TODO: Rename to mount()?
+ _WRAP_VFUNC(bool mount_finish(GAsyncResult* result, GError** error), mount_finish)
+ _WRAP_VFUNC(void eject(GMountUnmountFlags flags, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data), eject)
+ _WRAP_VFUNC(bool eject_finish(GAsyncResult* result, GError** error), eject_finish)
+
+ _WRAP_VFUNC(std::string get_identifier(const std::string& kind), get_identifier)
+
+ //TODO: Use an ArrayHandle.
+ _WRAP_VFUNC(char** enumerate_identifiers(), enumerate_identifiers)
+
+ _WRAP_VFUNC(bool should_automount(), should_automount)
};
} // namespace Gio
Modified: trunk/gio/src/volumemonitor.hg
==============================================================================
--- trunk/gio/src/volumemonitor.hg (original)
+++ trunk/gio/src/volumemonitor.hg Sat Feb 9 16:12:27 2008
@@ -73,7 +73,18 @@
_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
+ gboolean (*is_supported) (void);
+
+ //TODO: Use ListHandle?
+ _WRAP_VFUNC(GList* get_volumes(), get_volumes)
+ _WRAP_VFUNC(GList* get_mounts(), get_mounts)
+
+#m4 _CONVERSION(`Glib::RefPtr<Volume>',`GVolume*',__CONVERT_CONST_REFPTR_TO_P)
+ _WRAP_VFUNC(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), get_volume_for_uuid)
+
+#m4 _CONVERSION(`Glib::RefPtr<Mount>',`GMount*',__CONVERT_CONST_REFPTR_TO_P)
+ _WRAP_VFUNC(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), get_mount_for_uuid)
+
//There are no properties.
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]