glibmm r515 - in trunk: . gio/src tools/extra_defs_gen tools/m4
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r515 - in trunk: . gio/src tools/extra_defs_gen tools/m4
- Date: Wed, 16 Jan 2008 20:39:41 +0000 (GMT)
Author: murrayc
Date: Wed Jan 16 20:39:41 2008
New Revision: 515
URL: http://svn.gnome.org/viewvc/glibmm?rev=515&view=rev
Log:
murrayc murrayc-desktop:~/svn/gnome220/glibmm$ more ChangeLog
2008-01-16 Murray Cumming <murrayc murrayc com>
* gio/src/Makefile_list_of_hg.am_fragment:
* tools/m4/convert_gio.m4:
* gio/src/filemonitor.hg:
* gio/src/filemonitor.hg: Added FileMonitor.
* gio/src/file.hg: Tried to wrap monitor_file() and
monitor_directory but there is a problem with the GError in
the generated code.
* tools/extra_defs_gen/generate_defs_gio.cc: Added GFileMonitor.
Added:
trunk/gio/src/filemonitor.ccg
- copied unchanged from r513, /trunk/gio/src/cancellable.ccg
trunk/gio/src/filemonitor.hg
- copied, changed from r513, /trunk/gio/src/cancellable.hg
Modified:
trunk/ChangeLog
trunk/gio/src/Makefile_list_of_hg.am_fragment
trunk/gio/src/file.hg
trunk/tools/extra_defs_gen/generate_defs_gio.cc
trunk/tools/m4/convert_gio.m4
Modified: trunk/gio/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- trunk/gio/src/Makefile_list_of_hg.am_fragment (original)
+++ trunk/gio/src/Makefile_list_of_hg.am_fragment Wed Jan 16 20:39:41 2008
@@ -5,7 +5,10 @@
files_posix_hg =
files_win32_hg =
-files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg file.hg fileattribute.hg fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileoutputstream.hg icon.hg inputstream.hg loadableicon.hg mountoperation.hg outputstream.hg seekable.hg simpleasyncresult.hg volume.hg
+files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg file.hg fileattribute.hg \
+ fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileoutputstream.hg filemonitor.hg \
+ icon.hg inputstream.hg loadableicon.hg mountoperation.hg outputstream.hg seekable.hg \
+ simpleasyncresult.hg volume.hg
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
Modified: trunk/gio/src/file.hg
==============================================================================
--- trunk/gio/src/file.hg (original)
+++ trunk/gio/src/file.hg Wed Jan 16 20:39:41 2008
@@ -26,6 +26,7 @@
#include <giomm/fileenumerator.h>
#include <giomm/fileinfo.h>
#include <giomm/fileinputstream.h>
+#include <giomm/filemonitor.h>
#include <giomm/fileoutputstream.h>
#include <giomm/mountoperation.h>
#include <giomm/volume.h>
@@ -611,7 +612,10 @@
g_file_eject_mountable_finish,
errthrow)
- // TODO: g_file_monitor_*
+ //TODO: The GError isn't being passed to the C functoin, for some reason. murrayc.
+ //_WRAP_METHOD(Glib::RefPtr<FileMonitor> monitor_directory(FileMonitorFlags flags, const Glib::RefPtr<Cancellable>& cancellable), g_file_monitor_directory, errthrow)
+ //_WRAP_METHOD(Glib::RefPtr<FileMonitor> monitor_file(FileMonitorFlags flags, const Glib::RefPtr<Cancellable>& cancellable), g_file_monitor_file, errthrow)
+
//TODO: Documentation.
//TODO: atm I don't understand what's etag_out:
@@ -711,6 +715,8 @@
// "get_child_for_display_name",
// errthrow)
+#m4 _CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)')
+
_WRAP_VFUNC(bool contains_file(const Glib::RefPtr<File>& descendant) const,
"contains_file")
Copied: trunk/gio/src/filemonitor.hg (from r513, /trunk/gio/src/cancellable.hg)
==============================================================================
--- /trunk/gio/src/cancellable.hg (original)
+++ trunk/gio/src/filemonitor.hg Wed Jan 16 20:39:41 2008
@@ -17,9 +17,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-//TODO: Avoid this:
-#include <gio/gio.h>
-
#include <glibmm/object.h>
_DEFS(giomm,gio)
@@ -28,38 +25,33 @@
namespace Gio
{
-/** Allows actions to be cancelled.
- * Cancellable is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations.
- *
+_WRAP_ENUM(FileMonitorEvent, GFileMonitorEvent, NO_GTYPE)
+
+/** Monitors a file or directory for changes.
+ * TODO: Documentation: See http://bugzilla.gnome.org/show_bug.cgi?id=509994.
* @newin2p16
*/
-class Cancellable : public Glib::Object
+class FileMonitor : public Glib::Object
{
- _CLASS_GOBJECT(Cancellable, GCancellable, G_CANCELLABLE, Glib::Object, GObject)
-
+ _CLASS_GOBJECT(FileMonitor, GFileMonitor, G_FILE_MONITOR, Glib::Object, GObject)
protected:
- _CTOR_DEFAULT
public:
- _WRAP_CREATE()
-
- _WRAP_METHOD(bool is_cancelled() const, g_cancellable_is_cancelled)
-
- _IGNORE(g_cancellable_set_error_if_cancelled)
-
- //May return -1 if fds not supported, or on errors .
- _WRAP_METHOD(int get_fd() const, g_cancellable_get_fd)
-
- //This is safe to call from another thread.
- _WRAP_METHOD(void cancel(), g_cancellable_cancel)
-
- _WRAP_METHOD(static Glib::RefPtr<Cancellable> get_current(), g_cancellable_get_current, refreturn)
+
+ _WRAP_METHOD(bool cancel(), g_file_monitor_cancel)
+ _WRAP_METHOD(bool is_cancelled() const, g_file_monitor_is_cancelled)
+ _WRAP_METHOD(void set_rate_limit(int limit_msecs), g_file_monitor_set_rate_limit)
+
+ //g_file_monitor_emit_event is for implementations.
+ _IGNORE(g_file_monitor_emit_event)
+
+ _WRAP_SIGNAL(void changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type), "changed")
+
+ //TODO: Write .defs for the vfunc:
+ _WRAP_VFUNC(bool cancel(), cancel);
- _WRAP_METHOD(void push_current(),
- g_cancellable_push_current)
- _WRAP_METHOD(void pop_current(),
- g_cancellable_pop_current)
- _WRAP_METHOD(void reset(), g_cancellable_reset)
+ _WRAP_PROPERTY("rate-limit", int)
+ _WRAP_PROPERTY("cancelled", bool)
};
} // namespace Gio
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 Wed Jan 16 20:39:41 2008
@@ -32,6 +32,7 @@
<< get_defs(G_TYPE_FILE_ENUMERATOR)
<< get_defs(G_TYPE_FILE_INFO)
<< get_defs(G_TYPE_FILE_ICON)
+ << get_defs(G_TYPE_FILE_MONITOR)
// << get_defs(G_TYPE_FILE_ATTRIBUTE_INFO_LIST)
// << get_defs(G_TYPE_FILE_ATTRIBUTE_MATCHER)
<< get_defs(G_TYPE_FILE_INPUT_STREAM)
Modified: trunk/tools/m4/convert_gio.m4
==============================================================================
--- trunk/tools/m4/convert_gio.m4 (original)
+++ trunk/tools/m4/convert_gio.m4 Wed Jan 16 20:39:41 2008
@@ -35,7 +35,7 @@
_CONVERSION(`Glib::RefPtr<File>',`GFile*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<File>&',`GFile*',__CONVERT_CONST_REFPTR_TO_P)
_CONVERSION(`GFile*',`Glib::RefPtr<File>',`Glib::wrap($3)')
-_CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)')
+
# FileAttribute
_CONVERSION(`GFileAttributeValue*',`FileAttributeValue',`Glib::wrap($3)')
@@ -58,6 +58,9 @@
# FileInputStream
_CONVERSION(`GFileInputStream*',`Glib::RefPtr<FileInputStream>',`Glib::wrap($3)')
+# FileMonitor
+_CONVERSION(`GFileMonitor*',`Glib::RefPtr<FileMonitor>',`Glib::wrap($3)')
+
# FileOutputStream
_CONVERSION(`GFileOutputStream*',`Glib::RefPtr<FileOutputStream>',`Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]