[glibmm/glibmm-3maybe] Remove deprecated API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-3maybe] Remove deprecated API.
- Date: Tue, 8 Jun 2010 14:34:15 +0000 (UTC)
commit 9f1d0006e1b641b1317735ef96226b25d1ce49fc
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Jun 8 16:25:50 2010 +0200
Remove deprecated API.
* gio/src/asyncresult.hg:
* gio/src/file.hg:
* gio/src/volumemonitor.hg:
* glib/src/date.hg:
* glib/src/memoryinputstream.[hg|ccg]: Remove deprecated methods.
* glib/src/iochannel.[hg|ccg]: Remove the deprecated ability to derive
and implement from this class, significantly simplifying the code.
* glib/glibmm/filelist.am:
* glib/glibmm/streamiochannel.[h|cc]: Remove this deprecated derived class.
ChangeLog | 34 +++--
gio/src/asyncresult.hg | 7 -
gio/src/file.hg | 4 -
gio/src/memoryinputstream.ccg | 15 +--
gio/src/memoryinputstream.hg | 11 --
gio/src/volumemonitor.hg | 10 +-
glib/glibmm.h | 5 +-
glib/glibmm/filelist.am | 2 -
glib/glibmm/streamiochannel.cc | 193 -----------------------
glib/glibmm/streamiochannel.h | 59 -------
glib/src/date.ccg | 15 --
glib/src/date.hg | 22 ---
glib/src/iochannel.ccg | 329 +---------------------------------------
glib/src/iochannel.hg | 38 +----
14 files changed, 35 insertions(+), 709 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a1023dd..c5657c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-08 Murray Cumming <murrayc murrayc com>
+
+ Remove deprecated API.
+
+ * gio/src/asyncresult.hg:
+ * gio/src/file.hg:
+ * gio/src/volumemonitor.hg:
+ * glib/src/date.hg:
+ * glib/src/memoryinputstream.[hg|ccg]: Remove deprecated methods.
+ * glib/src/iochannel.[hg|ccg]: Remove the deprecated ability to derive
+ and implement from this class, significantly simplifying the code.
+ * glib/glibmm/filelist.am:
+ * glib/glibmm/streamiochannel.[h|cc]: Remove this deprecated derived class.
+
2010-06-07 Daniel Elstner <danielk openismus com>
Do not install the schema of the gsettings example
@@ -20,37 +34,37 @@
Documentation: Mention module names in Enums and Flags doxygen groups.
- * tools/m4/enum.m4: Add the module name (such as gdkmm or gtkmm) to the
- doxygen Enums and Flags groups, to avoid duplicate names appearing in the
+ * tools/m4/enum.m4: Add the module name (such as gdkmm or gtkmm) to the
+ doxygen Enums and Flags groups, to avoid duplicate names appearing in the
Modules list.
2010-06-06 Murray Cumming <murrayc murrayc com>
Settings: Fix the build with the latest glib from git master.
- * gio/src/gio_methods.defs: Remove extra length parameters, removed from the
+ * gio/src/gio_methods.defs: Remove extra length parameters, removed from the
C API. This is a generated file, but this change is simple.
- * gio/src/settings.[hg|ccg]: get_string_array(), set_string_array():
- Remove the length parameter, and just use _WRAP_METHOD() now that it is simple
+ * gio/src/settings.[hg|ccg]: get_string_array(), set_string_array():
+ Remove the length parameter, and just use _WRAP_METHOD() now that it is simple
enough for that.
* tools/m4/convert_gio.m4: Add a necessary conversion.
- * glib/src/glib_functions.defs: Remove some bad unused definitions that
+ * glib/src/glib_functions.defs: Remove some bad unused definitions that
were causing annoying warnings.
2010-06-06 Murray Cumming <murrayc murrayc com>
Remove default conversion to StringArrayHandle
- * tools/m4/convert_gio.m4: Remove a default conversion from char** to
- StringArrayHandle, because there can be no good default, because each use
+ * tools/m4/convert_gio.m4: Remove a default conversion from char** to
+ StringArrayHandle, because there can be no good default, because each use
can have different ownership, so it risks hiding an error.
* gio/src/drive.hg:
* gio/src/fileinfo.hg:
* gio/src/filenamecompleter.hg:
* gio/src/volume.hg: Add a local #m4 conversion instead.
- One day we will have the new introspection information (with the ownership)
+ One day we will have the new introspection information (with the ownership)
available to gmmproc so we don't need to do this.
-
+
2010-06-04 Chris Kühl <blixtra gmail com>
Removal of length parameter for g_settings_[gs]et_strv
diff --git a/gio/src/asyncresult.hg b/gio/src/asyncresult.hg
index fa1a809..535cf82 100644
--- a/gio/src/asyncresult.hg
+++ b/gio/src/asyncresult.hg
@@ -109,13 +109,6 @@ public:
//Note that this returns a reference, unlike most GTK+ get_*() functions,
//so we don't need to use refreturn.
- _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_source_object(),
- g_async_result_get_source_object, deprecated "Use get_source_object_base()")
- _WRAP_METHOD(Glib::RefPtr<const Glib::Object> get_source_object() const,
- g_async_result_get_source_object, constversion, deprecated "Use get_source_object_base()")
-
- //Note that this returns a reference, unlike most GTK+ get_*() functions,
- //so we don't need to use refreturn.
Glib::RefPtr<Glib::ObjectBase> get_source_object_base();
Glib::RefPtr<const Glib::ObjectBase> get_source_object_base() const;
diff --git a/gio/src/file.hg b/gio/src/file.hg
index b6131b1..5b59d51 100644
--- a/gio/src/file.hg
+++ b/gio/src/file.hg
@@ -17,10 +17,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef G_DISABLE_DEPRECATED
-#m4 _POP()
-
#include <glibmm/error.h>
#include <glibmm/interface.h>
#include <giomm/appinfo.h>
diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg
index 0801e02..2f507c6 100644
--- a/gio/src/memoryinputstream.ccg
+++ b/gio/src/memoryinputstream.ccg
@@ -28,20 +28,7 @@ void MemoryInputStream::add_data(const std::string& data)
g_memory_input_stream_add_data(gobj(), data_copy, -1, g_free);
}
-
-void MemoryInputStream::add_data(const void* data, gssize len)
-{
- char *data_copy = 0;
-
- // copy the data so that the caller doesn't need to keep the data alive
- if (len < 0)
- data_copy = g_strdup (static_cast<const gchar*>(data));
- else
- data_copy = static_cast<gchar*>(g_memdup (data, len));
-
- g_memory_input_stream_add_data(gobj(), data_copy, len, g_free);
-}
-
+//TODO: This needs to be a slot. See glib bug https://bugzilla.gnome.org/show_bug.cgi?id=589887
void MemoryInputStream::add_data(const void* data, gssize len, GDestroyNotify destroy)
{
g_memory_input_stream_add_data(gobj(), data, len, destroy);
diff --git a/gio/src/memoryinputstream.hg b/gio/src/memoryinputstream.hg
index 925303a..345c767 100644
--- a/gio/src/memoryinputstream.hg
+++ b/gio/src/memoryinputstream.hg
@@ -54,17 +54,6 @@ public:
/** Appends to data that can be read from the input stream.
*
- * Note that the data will copied internally and freed when no longer needed.
- *
- * @param data Input data.
- * @param len Length of the data, may be -1 if data is a null-terminated string.
- *
- * @deprecated Use version with destroy notification
- */
- void add_data(const void* data, gssize len);
-
- /** Appends to data that can be read from the input stream.
- *
* @param data Input data.
* @param len Length of the data, may be -1 if data is a null-terminated string.
* @param destroy A function to be called to free the data when it is no
diff --git a/gio/src/volumemonitor.hg b/gio/src/volumemonitor.hg
index 2e4d4c8..3a9a1d2 100644
--- a/gio/src/volumemonitor.hg
+++ b/gio/src/volumemonitor.hg
@@ -17,10 +17,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef G_DISABLE_DEPRECATED
-#m4 _POP()
-
#include <giomm/drive.h>
#include <giomm/volume.h>
#include <giomm/mount.h>
@@ -59,11 +55,7 @@ public:
_WRAP_METHOD(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), g_volume_monitor_get_volume_for_uuid, refreturn)
_WRAP_METHOD(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), g_volume_monitor_get_mount_for_uuid, refreturn)
-_DEPRECATE_IFDEF_START
-
- _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount)
-
-_DEPRECATE_IFDEF_END
+ _IGNORE(g_volume_monitor_adopt_orphan_mount) //deprecated
#m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Volume>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void volume_added(const Glib::RefPtr<Volume>& volume), volume_added)
diff --git a/glib/glibmm.h b/glib/glibmm.h
index 76a2f0d..308ed5b 100644
--- a/glib/glibmm.h
+++ b/glib/glibmm.h
@@ -24,8 +24,8 @@
*
* @section description Description
*
- * glibmm is the official C++ interface for the popular cross-platform library %Glib.
- * It provides non-UI API that is not available in standard C++ and makes it
+ * glibmm is the official C++ interface for the popular cross-platform library %Glib.
+ * It provides non-UI API that is not available in standard C++ and makes it
* possible for gtkmm to wrap GObject-based APIs.
* See also the <a href="http://library.gnome.org/devel/gtkmm-tutorial/stable/">
* Programming with gtkmm</a> book for a tutorial on programming with gtkmm and
@@ -96,7 +96,6 @@
#include <glibmm/iochannel.h>
#include <glibmm/init.h>
#include <glibmm/keyfile.h>
-#include <glibmm/streamiochannel.h>
#include <glibmm/listhandle.h>
#include <glibmm/main.h>
#include <glibmm/markup.h>
diff --git a/glib/glibmm/filelist.am b/glib/glibmm/filelist.am
index ccc7202..e289b8f 100644
--- a/glib/glibmm/filelist.am
+++ b/glib/glibmm/filelist.am
@@ -27,7 +27,6 @@ glibmm_files_extra_cc = \
sarray.cc \
signalproxy.cc \
signalproxy_connectionnode.cc \
- streamiochannel.cc \
stringutils.cc \
threadpool.cc \
timer.cc \
@@ -69,7 +68,6 @@ glibmm_files_extra_h = \
sarray.h \
signalproxy_connectionnode.h \
slisthandle.h \
- streamiochannel.h \
stringutils.h \
threadpool.h \
timer.h \
diff --git a/glib/src/date.ccg b/glib/src/date.ccg
index 75ff144..cdd309c 100644
--- a/glib/src/date.ccg
+++ b/glib/src/date.ccg
@@ -79,21 +79,6 @@ void Date::set_parse(const Glib::ustring& str)
}
-_DEPRECATE_IFDEF_START
-
-//Avoid a build problem in the case that time_t is equivalent to guint32 (GTime is also guint32)
-//That would make the set_time() method overload impossible.
-#ifdef GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-void Date::set_time(GTime time)
-{
- //This method, and the C function that it wraps, are deprecated.
- g_date_set_time(&gobject_, time);
-}
-#endif //GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-
-_DEPRECATE_IFDEF_END
-
-
void Date::set_time(time_t timet)
{
g_date_set_time_t(&gobject_, timet);
diff --git a/glib/src/date.hg b/glib/src/date.hg
index e02aa1f..a76983b 100644
--- a/glib/src/date.hg
+++ b/glib/src/date.hg
@@ -19,11 +19,6 @@
_DEFS(glibmm,glib)
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-/* So we can use deprecated functions in our deprecated methods */
-#undef G_DISABLE_DEPRECATED
-#m4 _POP()
-
#include <glibmmconfig.h>
#include <glibmm/ustring.h>
#include <glib.h>
@@ -116,23 +111,6 @@ public:
void set_parse (const Glib::ustring& str);
- _DEPRECATE_IFDEF_START
-
- //Avoid a build problem in the case that time_t is equivalent to guint32 (GTime is also guint32)
- //That would make the set_time() method overload impossible.
- #ifdef GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
- /** Sets the value of a date from a GTime (time_t) value.
- *
- * @param time GTime value to set.
- *
- * @deprecated Please use set_time(time_t) or set_time(const GTimeVal&).
- */
- void set_time(GTime time);
- #endif //GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-
- _DEPRECATE_IFDEF_END
-
-
/** Sets the value of a date from a <type>time_t</type> value.
*
* @param timet time_t value to set
diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg
index d800939..1d025f2 100644
--- a/glib/src/iochannel.ccg
+++ b/glib/src/iochannel.ccg
@@ -24,124 +24,17 @@
#include <glibmm/main.h>
-namespace
-{
-
-// Glib::IOChannel reference counting issues:
-//
-// Normally, you'd expect that the C++ object stays around as long as the
-// C instance does. Also Glib::wrap() usually returns always the same C++
-// wrapper object for a single C instance.
-//
-// Unfortunately it isn't possible to implement these features if we didn't
-// create the underlying GIOChannel. That is, when wrapping existing
-// GIOChannel instances such as returned by e.g. g_io_channel_unix_new() or
-// g_io_channel_new_file(). Neither is there a way to hook up a wrapper
-// object in an existing GIOChannel, nor exists any destroy notification.
-//
-// So that means: If the IOChannel is implemented in C++ -- that is, our
-// GlibmmIOChannel backend is used -- we use the GIOChannel reference
-// counting mechanism. If the IOChannel backend is unknown, then the
-// wrapper instance holds always exactly one reference to the GIOChannel.
-// The wrapper object itself is then managed via our own refcounting
-// mechanism. To do that a utility class ForeignIOChannel is introduced to
-// override reference() and unreference().
-
-class ForeignIOChannel : public Glib::IOChannel
-{
-public:
- ForeignIOChannel(GIOChannel* gobject, bool take_copy)
- : Glib::IOChannel(gobject, take_copy), ref_count_(0) {}
-
- virtual void reference() const;
- virtual void unreference() const;
-
-private:
- mutable int ref_count_;
-};
-
-void ForeignIOChannel::reference() const
-{
- ++ref_count_;
-}
-
-void ForeignIOChannel::unreference() const
-{
- if (!(--ref_count_)) delete this;
-}
-
-} // anonymous namespace
-
-
namespace Glib
{
-class GlibmmIOChannel
-{
-public:
- GIOChannel base;
- Glib::IOChannel* wrapper;
-
- static const GIOFuncs vfunc_table;
-
- static GIOStatus io_read(GIOChannel* channel, char* buf, gsize count,
- gsize* bytes_read, GError** err);
-
- static GIOStatus io_write(GIOChannel* channel, const char* buf, gsize count,
- gsize* bytes_written, GError** err);
-
- static GIOStatus io_seek (GIOChannel* channel, gint64 offset, GSeekType type, GError** err);
- static GIOStatus io_close(GIOChannel* channel, GError** err);
-
- static GSource* io_create_watch(GIOChannel* channel, GIOCondition condition);
- static void io_free(GIOChannel* channel);
-
- static GIOStatus io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err);
- static GIOFlags io_get_flags(GIOChannel* channel);
-};
-
-// static
-const GIOFuncs GlibmmIOChannel::vfunc_table =
-{
- &GlibmmIOChannel::io_read,
- &GlibmmIOChannel::io_write,
- &GlibmmIOChannel::io_seek,
- &GlibmmIOChannel::io_close,
- &GlibmmIOChannel::io_create_watch,
- &GlibmmIOChannel::io_free,
- &GlibmmIOChannel::io_set_flags,
- &GlibmmIOChannel::io_get_flags,
-};
-
/**** GLib::IOChannel ******************************************************/
-/* Construct a custom C++-implemented IOChannel. GlibmmIOChannel is an
- * extended GIOChannel struct which allows us to hook up a pointer to this
- * persistent wrapper instance.
- */
-IOChannel::IOChannel()
-:
- gobject_ (static_cast<GIOChannel*>(g_malloc(sizeof(GlibmmIOChannel))))
-{
- g_io_channel_init(gobject_);
- gobject_->funcs = const_cast<GIOFuncs*>(&GlibmmIOChannel::vfunc_table);
-
- reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = this;
-}
-/* Construct an IOChannel wrapper for an already created GIOChannel.
- * See the comment at the top of this file for an explanation of the
- * problems with this approach.
- */
IOChannel::IOChannel(GIOChannel* gobject, bool take_copy)
:
gobject_ (gobject)
{
- // This ctor should never be called for GlibmmIOChannel instances.
- g_assert(gobject != 0);
- g_assert(gobject->funcs != &GlibmmIOChannel::vfunc_table);
-
if(take_copy)
g_io_channel_ref(gobject_);
}
@@ -150,19 +43,6 @@ IOChannel::~IOChannel()
{
if(gobject_)
{
- // Check whether this IOChannel is implemented in C++, i.e. whether it
- // uses our GlibmmIOChannel forwarding backend. Normally, this will never
- // be true because the wrapper should only be deleted in the io_free()
- // callback, which clears gobject_ before deleting. But in case the ctor
- // of a derived class threw an exception the GIOChannel must be destroyed
- // prematurely.
- //
- if(gobject_->funcs == &GlibmmIOChannel::vfunc_table)
- {
- // Disconnect the wrapper object so that it won't be deleted twice.
- reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = 0;
- }
-
GIOChannel *const tmp_gobject = gobject_;
gobject_ = 0;
@@ -316,48 +196,6 @@ Glib::RefPtr<IOSource> IOChannel::create_watch(IOCondition condition)
return IOSource::create(Glib::RefPtr<IOChannel>(this), condition);
}
-IOStatus IOChannel::read_vfunc(char*, gsize, gsize&)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus IOChannel::write_vfunc(const char*, gsize, gsize&)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus IOChannel::seek_vfunc(gint64, SeekType)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus IOChannel::close_vfunc()
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-Glib::RefPtr<Glib::Source> IOChannel::create_watch_vfunc(IOCondition)
-{
- g_assert_not_reached();
- return Glib::RefPtr<Glib::Source>();
-}
-
-IOStatus IOChannel::set_flags_vfunc(IOFlags)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOFlags IOChannel::get_flags_vfunc()
-{
- g_assert_not_reached();
- return IOFlags(0);
-}
-
void IOChannel::reference() const
{
g_io_channel_ref(gobject_);
@@ -374,175 +212,12 @@ Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy)
if(gobject)
{
- if(gobject->funcs == &GlibmmIOChannel::vfunc_table)
- {
- cpp_object = reinterpret_cast<GlibmmIOChannel*>(gobject)->wrapper;
-
- if(take_copy && cpp_object)
- cpp_object->reference();
- }
- else
- {
- cpp_object = new ForeignIOChannel(gobject, take_copy);
- cpp_object->reference(); // the refcount is initially 0
- }
+ cpp_object = new IOChannel(gobject, take_copy);
+ cpp_object->reference(); // the refcount is initially 0
}
return Glib::RefPtr<IOChannel>(cpp_object);
}
-/**** Glib::GlibmmIOChannel ************************************************/
-
-GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
- gsize* bytes_read, GError** err)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus) wrapper->read_vfunc(buf, count, *bytes_read);
- }
- catch(Glib::Error& error)
- {
- error.propagate(err);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count,
- gsize* bytes_written, GError** err)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus) wrapper->write_vfunc(buf, count, *bytes_written);
- }
- catch(Glib::Error& error)
- {
- error.propagate(err);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus) wrapper->seek_vfunc(offset, (SeekType) type);
- }
- catch(Glib::Error& error)
- {
- error.propagate(err);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus) wrapper->close_vfunc();
- }
- catch(Glib::Error& error)
- {
- error.propagate(err);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
-
- return G_IO_STATUS_ERROR;
-}
-
-// static
-GSource* GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition condition)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- const Glib::RefPtr<Source> source = wrapper->create_watch_vfunc((IOCondition) condition);
- return (source) ? source->gobj_copy() : 0;
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
-// static
-void GlibmmIOChannel::io_free(GIOChannel* channel)
-{
- if(IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper)
- {
- wrapper->gobject_ = 0;
- delete wrapper;
- }
-
- g_free(channel);
-}
-
-GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus) wrapper->set_flags_vfunc((IOFlags) flags);
- }
- catch(Glib::Error& error)
- {
- error.propagate(err);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-// static
-GIOFlags GlibmmIOChannel::io_get_flags(GIOChannel* channel)
-{
- IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOFlags) wrapper->get_flags_vfunc();
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return GIOFlags(0);
-}
-
} // namespace Glib
-
diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg
index f4853c3..a2a2bf1 100644
--- a/glib/src/iochannel.hg
+++ b/glib/src/iochannel.hg
@@ -68,15 +68,6 @@ class GlibmmIOChannel;
* set_encoding("ISO-8859-15"). To set the channel to no encoding, use
* set_encoding() without any arguments.
*
- * You can create an IOChannel with one of the static create methods, or
- * implement one yourself, in which case you have to 1) override all
- * _vfunc() members. 2) set the GIOChannel flags in your constructor.
- *
- * @note This feature of being able to implement a custom Glib::IOChannel is
- * deprecated in glibmm 2.2. The vfunc interface has not yet stabilized
- * enough to allow that -- the C++ wrapper went in by pure accident. Besides,
- * it isn't terribly useful either. Thus please refrain from overriding any
- * IOChannel vfuncs.
*/
class IOChannel : public sigc::trackable
{
@@ -91,6 +82,11 @@ class IOChannel : public sigc::trackable
g_io_channel_write, g_io_channel_win32_make_pollfd)
public:
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ IOChannel(GIOChannel* gobject, bool take_copy);
+#endif
+
virtual ~IOChannel();
/** Open a file @a filename as an I/O channel using mode @a mode.
@@ -416,33 +412,9 @@ public:
protected:
GIOChannel* gobject_;
- /** Constructor that should be used by derived classes.
- * Use this constructor if you want to inherit from IOChannel.
- * It will set up a GIOChannel that will call the vfuncs of your
- * class even if it is being used from C code, and it will keep
- * a reference to the C++ code while the GIOChannel exists.
- */
- IOChannel();
_IGNORE(g_io_channel_init)
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- IOChannel(GIOChannel* gobject, bool take_copy);
-#endif
-
- virtual IOStatus read_vfunc(char* buf, gsize count, gsize& bytes_read);
- virtual IOStatus write_vfunc(const char* buf, gsize count, gsize& bytes_written);
- virtual IOStatus seek_vfunc(gint64 offset, SeekType type);
- virtual IOStatus close_vfunc();
- virtual IOStatus set_flags_vfunc(IOFlags flags);
- virtual IOFlags get_flags_vfunc();
- virtual Glib::RefPtr<Glib::Source> create_watch_vfunc(IOCondition cond);
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- friend class Glib::GlibmmIOChannel;
-#endif
};
Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy = false);
} // namespace Glib
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]