Imported Upstream version 2.49.2 upstream/2.49.2
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:12:09 +0000 (00:12 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:12:09 +0000 (00:12 -0700)
23 files changed:
MSVC_Net2013/giomm.vcxproj
MSVC_Net2013/giomm.vcxproj.filters
MSVC_Net2013/glibmm-install.props
MSVC_Net2013/glibmm.vcxproj
MSVC_Net2013/glibmm.vcxproj.filters
NEWS
configure.ac
gio/src/bufferedinputstream.hg
gio/src/filterinputstream.ccg
gio/src/filterinputstream.hg
gio/src/filteroutputstream.ccg
gio/src/filteroutputstream.hg
gio/src/gio_vfuncs.defs
gio/src/inputstream.hg
gio/src/memoryoutputstream.ccg
gio/src/memoryoutputstream.hg
gio/src/outputstream.hg
gio/src/pollableinputstream.hg
gio/src/pollableoutputstream.hg
tools/defs_gen/h2def.py
tools/m4/vfunc.m4
tools/pm/Output.pm
tools/pm/WrapParser.pm

index 3e86d74..bc4fc3d 100644 (file)
     <ClCompile Include="..\gio\giomm\initable.cc" />
     <ClCompile Include="..\gio\giomm\inputstream.cc" />
     <ClCompile Include="..\gio\giomm\iostream.cc" />
+    <ClCompile Include="..\gio\giomm\listmodel.cc" />
+    <ClCompile Include="..\gio\giomm\liststore.cc" />
     <ClCompile Include="..\gio\giomm\loadableicon.cc" />
     <ClCompile Include="..\gio\giomm\memoryinputstream.cc" />
     <ClCompile Include="..\gio\giomm\memoryoutputstream.cc" />
     <ClInclude Include="..\gio\giomm\initable.h" />
     <ClInclude Include="..\gio\giomm\inputstream.h" />
     <ClInclude Include="..\gio\giomm\iostream.h" />
+    <ClInclude Include="..\gio\giomm\listmodel.h" />
+    <ClInclude Include="..\gio\giomm\liststore.h" />
     <ClInclude Include="..\gio\giomm\loadableicon.h" />
     <ClInclude Include="..\gio\giomm\memoryinputstream.h" />
     <ClInclude Include="..\gio\giomm\memoryoutputstream.h" />
index 6a82c03..4f01b13 100644 (file)
@@ -80,6 +80,8 @@
     <ClCompile Include="..\gio\giomm\initable.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\gio\giomm\inputstream.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\gio\giomm\iostream.cc"><Filter>Source Files</Filter></ClCompile>
+    <ClCompile Include="..\gio\giomm\listmodel.cc"><Filter>Source Files</Filter></ClCompile>
+    <ClCompile Include="..\gio\giomm\liststore.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\gio\giomm\loadableicon.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\gio\giomm\memoryinputstream.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\gio\giomm\memoryoutputstream.cc"><Filter>Source Files</Filter></ClCompile>
     <ClInclude Include="..\gio\giomm\initable.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\gio\giomm\inputstream.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\gio\giomm\iostream.h"><Filter>Header Files</Filter></ClInclude>
+    <ClInclude Include="..\gio\giomm\listmodel.h"><Filter>Header Files</Filter></ClInclude>
+    <ClInclude Include="..\gio\giomm\liststore.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\gio\giomm\loadableicon.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\gio\giomm\memoryinputstream.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\gio\giomm\memoryoutputstream.h"><Filter>Header Files</Filter></ClInclude>
index f039e6b..2848409 100644 (file)
@@ -37,6 +37,7 @@ copy ..\glib\glibmm\convert.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(Api
 copy ..\glib\glibmm\date.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
 copy ..\glib\glibmm\datetime.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
 copy ..\glib\glibmm\debug.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
+copy ..\glib\glibmm\enums.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
 copy ..\glib\glibmm\dispatcher.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
 copy ..\glib\glibmm\error.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
 copy ..\glib\glibmm\exception.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm
@@ -109,6 +110,7 @@ copy ..\glib\glibmm\private\checksum_p.h $(CopyDir)\include\glibmm-$(ApiMajorVer
 copy ..\glib\glibmm\private\convert_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
 copy ..\glib\glibmm\private\date_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
 copy ..\glib\glibmm\private\datetime_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
+copy ..\glib\glibmm\private\enums_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
 copy ..\glib\glibmm\private\fileutils_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
 copy ..\glib\glibmm\private\interface_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
 copy ..\glib\glibmm\private\iochannel_p.h $(CopyDir)\include\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\glibmm\private
@@ -200,6 +202,8 @@ copy ..\gio\giomm\init.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorV
 copy ..\gio\giomm\initable.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
 copy ..\gio\giomm\inputstream.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
 copy ..\gio\giomm\iostream.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
+copy ..\gio\giomm\listmodel.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
+copy ..\gio\giomm\liststore.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
 copy ..\gio\giomm\loadableicon.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
 copy ..\gio\giomm\memoryinputstream.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
 copy ..\gio\giomm\memoryoutputstream.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm
@@ -324,6 +328,8 @@ copy ..\gio\giomm\private\inetsocketaddress_p.h $(CopyDir)\include\giomm-$(ApiMa
 copy ..\gio\giomm\private\initable_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
 copy ..\gio\giomm\private\inputstream_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
 copy ..\gio\giomm\private\iostream_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
+copy ..\gio\giomm\private\listmodel_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
+copy ..\gio\giomm\private\liststore_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
 copy ..\gio\giomm\private\loadableicon_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
 copy ..\gio\giomm\private\memoryinputstream_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
 copy ..\gio\giomm\private\memoryoutputstream_p.h $(CopyDir)\include\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\giomm\private
index 8bfeb6e..6594edc 100644 (file)
     <ClCompile Include="..\glib\glibmm\datetime.cc" />
     <ClCompile Include="..\glib\glibmm\debug.cc" />
     <ClCompile Include="..\glib\glibmm\dispatcher.cc" />
+    <ClCompile Include="..\glib\glibmm\enums.cc" />
     <ClCompile Include="..\glib\glibmm\error.cc" />
     <ClCompile Include="..\glib\glibmm\exception.cc" />
     <ClCompile Include="..\glib\glibmm\exceptionhandler.cc" />
     <ClInclude Include="..\glib\glibmm\datetime.h" />
     <ClInclude Include="..\glib\glibmm\debug.h" />
     <ClInclude Include="..\glib\glibmm\dispatcher.h" />
+    <ClInclude Include="..\glib\glibmm\enums.h" />
     <ClInclude Include="..\glib\glibmm\error.h" />
     <ClInclude Include="..\glib\glibmm\exception.h" />
     <ClInclude Include="..\glib\glibmm\exceptionhandler.h" />
index 7887ad2..578c253 100644 (file)
@@ -29,6 +29,7 @@
     <ClCompile Include="..\glib\glibmm\datetime.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\glib\glibmm\debug.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\glib\glibmm\dispatcher.cc"><Filter>Source Files</Filter></ClCompile>
+    <ClCompile Include="..\glib\glibmm\enums.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\glib\glibmm\error.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\glib\glibmm\exception.cc"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\glib\glibmm\exceptionhandler.cc"><Filter>Source Files</Filter></ClCompile>
     <ClInclude Include="..\glib\glibmm\datetime.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\glib\glibmm\debug.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\glib\glibmm\dispatcher.h"><Filter>Header Files</Filter></ClInclude>
+    <ClInclude Include="..\glib\glibmm\enums.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\glib\glibmm\error.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\glib\glibmm\exception.h"><Filter>Header Files</Filter></ClInclude>
     <ClInclude Include="..\glib\glibmm\exceptionhandler.h"><Filter>Header Files</Filter></ClInclude>
diff --git a/NEWS b/NEWS
index 0ad1608..1c98989 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,31 @@
+2.49.2:
+
+Gio:
+* FilterInputStream: Added a constructor.
+  (Krzysztof Kosiński, Kjell Ahlstedt) Bug #572471
+* FilterOutputStream:
+  - Correct the property_base_stream() return type.
+  (Krzysztof Kosiński) Bug #572471
+  (Krzysztof Kosiński, Kjell Ahlstedt) Bug #572471
+* InputStream: Added a constructor, is_closed(), has_pending(),
+  set_pending(), clear_pending()
+  (Krzysztof Kosiński, Kjell Ahlstedt) Bug #572471
+* OutputStream: Added a constructor, is_closed(), is_closing(),
+  has_pending(), set_pending(), and clear_pending().
+  (Krzysztof Kosiński, Kjell Ahlstedt) Bug #572471
+* Pollable, InputStream, OutputStream: Return -1 on error in vfuncs.
+  (Kjell Ahlstedt)
+
+gmmproc:
+* Make h2def.py recognize some GDK_PIXBUF macros
+  (Kjell Ahlstedt)
+* Add optional argument err_return_value in _WRAP_VFUNC
+  (Kjell Ahlstedt)
+
+Build:
+* Visual Studio build files: Update projects
+  (Chun-wei Fan)
+
 2.49.1:
 
 gmmproc:
index f0c19c4..76cad4b 100644 (file)
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([glibmm], [2.49.1],
+AC_INIT([glibmm], [2.49.2],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
index d940f43..9661d1e 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -109,9 +107,9 @@ public:
   _WRAP_PROPERTY("buffer-size", guint)
 
 protected:
+  //TODO: When we can break ABI, add vfunc. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
 #m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
-  //_WRAP_VFUNC(gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable, GError** error), "fill")
-
+  //_WRAP_VFUNC(gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable), fill, errthrow, err_return_value -1)
 };
 
 } // namespace Gio
index 40517b7..f69b83d 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
  */
 
 #include <gio/gio.h>
+
+namespace Gio {
+
+FilterInputStream::FilterInputStream(const Glib::RefPtr<InputStream>& base_stream)
+: _CONSTRUCT("base_stream", const_cast<GInputStream*>(Glib::unwrap(base_stream)))
+{
+}
+
+} // namespace Gio
index 6d09e4d..bd35f73 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -37,6 +35,11 @@ namespace Gio
 class FilterInputStream : public Gio::InputStream
 {
   _CLASS_GOBJECT(FilterInputStream, GFilterInputStream, G_FILTER_INPUT_STREAM, Gio::InputStream, GInputStream)
+
+protected:
+  // This needs to be hand-coded because there is no public GFilterInputStream constructor.
+  explicit FilterInputStream(const Glib::RefPtr<InputStream>& base_stream);
+
 public:
   _WRAP_METHOD(Glib::RefPtr<InputStream> get_base_stream(),
                g_filter_input_stream_get_base_stream,
index 40517b7..49d0402 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
  */
 
 #include <gio/gio.h>
+
+namespace Gio {
+
+FilterOutputStream::FilterOutputStream(const Glib::RefPtr<OutputStream>& base_stream)
+: _CONSTRUCT("base_stream", const_cast<GOutputStream*>(Glib::unwrap(base_stream)))
+{
+}
+
+} // namespace Gio
index 47b5e01..6af0821 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -38,6 +36,11 @@ namespace Gio
 class FilterOutputStream : public Gio::OutputStream
 {
   _CLASS_GOBJECT(FilterOutputStream, GFilterOutputStream, G_FILTER_OUTPUT_STREAM, Gio::OutputStream, GOutputStream)
+
+protected:
+  // This needs to be hand-coded because there is no public GFilterOutputStream constructor.
+  explicit FilterOutputStream(const Glib::RefPtr<OutputStream>& base_stream);
+
 public:
   _WRAP_METHOD(Glib::RefPtr<OutputStream> get_base_stream(),
                g_filter_output_stream_get_base_stream,
@@ -50,7 +53,7 @@ public:
   _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("base-stream", Glib::RefPtr<OutputStream>)
   _WRAP_PROPERTY("close-base-stream", bool)
 };
 
index 8026173..4bcfa1e 100644 (file)
   )
 )
 
+; GFileInputStream
+
+(define-vfunc tell
+ (of-object "GFileInputStream")
+ (return-type "goffset")
+)
+
+(define-vfunc can_seek
+ (of-object "GFileInputStream")
+ (return-type "gboolean")
+)
+
+(define-vfunc seek
+ (of-object "GFileInputStream")
+ (return-type "gboolean")
+ (parameters
+  '("goffset" "offset")
+  '("GSeekType" "type")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc query_info
+ (of-object "GFileInputStream")
+ (return-type "GFileInfo*")
+ (parameters
+  '("const-char*" "attributes")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc query_info_async
+ (of-object "GFileInputStream")
+ (return-type "void")
+ (parameters
+  '("const-char*" "attributes")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc query_info_finish
+ (of-object "GFileInputStream")
+ (return-type "GFileInfo*")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+; GFileOutputStream
+
+(define-vfunc tell
+ (of-object "GFileOutputStream")
+ (return-type "goffset")
+)
+
+(define-vfunc can_seek
+ (of-object "GFileOutputStream")
+ (return-type "gboolean")
+)
+
+(define-vfunc seek
+ (of-object "GFileOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("goffset" "offset")
+  '("GSeekType" "type")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc can_truncate
+ (of-object "GFileOutputStream")
+ (return-type "gboolean")
+)
+
+(define-vfunc truncate_fn
+ (of-object "GFileOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("goffset" "offset")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc query_info
+ (of-object "GFileOutputStream")
+ (return-type "GFileInfo*")
+ (parameters
+  '("const-char*" "attributes")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc query_info_async
+ (of-object "GFileOutputStream")
+ (return-type "void")
+ (parameters
+  '("const-char*" "attributes")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc query_info_finish
+ (of-object "GFileOutputStream")
+ (return-type "GFileInfo*")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc get_etag
+ (of-object "GFileOutputStream")
+ (return-type "char*")
+)
+
 ; GIcon
 
 (define-vfunc hash
   )
 )
 
+; GInputStream
+
+(define-vfunc read_fn
+ (of-object "GInputStream")
+ (return-type "gssize")
+ (parameters
+  '("void*" "buffer")
+  '("gsize" "count")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc skip
+ (of-object "GInputStream")
+ (return-type "gssize")
+ (parameters
+  '("gsize" "count")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc close_fn
+ (of-object "GInputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc read_async
+ (of-object "GInputStream")
+ (return-type "void")
+ (parameters
+  '("void*" "buffer")
+  '("gsize" "count")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc read_finish
+ (of-object "GInputStream")
+ (return-type "gssize")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc skip_async
+ (of-object "GInputStream")
+ (return-type "void")
+ (parameters
+  '("gsize" "count")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc skip_finish
+ (of-object "GInputStream")
+ (return-type "gssize")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc close_async
+ (of-object "GInputStream")
+ (return-type "void")
+ (parameters
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc close_finish
+ (of-object "GInputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+; GListModel
+
+(define-vfunc get_item_type
+  (of-object "GListModel")
+  (return-type "GType")
+)
+
+(define-vfunc get_n_items
+  (of-object "GListModel")
+  (return-type "guint")
+)
+
+(define-vfunc get_item
+  (of-object "GListModel")
+  (return-type "gpointer")
+  (parameters
+   '("guint" "position")
+  )
+)
+
 ; GLoadableIcon
 
 (define-vfunc load
  )
 )
 
+; GOutputStream
+
+(define-vfunc write_fn
+ (of-object "GOutputStream")
+ (return-type "gssize")
+ (parameters
+  '("const-void*" "buffer")
+  '("gsize" "count")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc splice
+ (of-object "GOutputStream")
+ (return-type "gssize")
+ (parameters
+  '("GInputStream*" "source")
+  '("GOutputStreamSpliceFlags" "flags")
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc flush
+ (of-object "GOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc close_fn
+ (of-object "GOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc write_async
+ (of-object "GOutputStream")
+ (return-type "void")
+ (parameters
+  '("const-void*" "buffer")
+  '("gsize" "count")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc write_finish
+ (of-object "GOutputStream")
+ (return-type "gssize")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc splice_async
+ (of-object "GOutputStream")
+ (return-type "void")
+ (parameters
+  '("GInputStream*" "source")
+  '("GOutputStreamSpliceFlags" "flags")
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc splice_finish
+ (of-object "GOutputStream")
+ (return-type "gssize")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc flush_async
+ (of-object "GOutputStream")
+ (return-type "void")
+ (parameters
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc flush_finish
+ (of-object "GOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc close_async
+ (of-object "GOutputStream")
+ (return-type "void")
+ (parameters
+  '("int" "io_priority")
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc close_finish
+ (of-object "GOutputStream")
+ (return-type "gboolean")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+; GPermission
+
+(define-vfunc acquire
+ (of-object "GPermission")
+ (return-type "gboolean")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc acquire_async
+ (of-object "GPermission")
+ (return-type "void")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc acquire_finish
+ (of-object "GPermission")
+ (return-type "gboolean")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc release
+ (of-object "GPermission")
+ (return-type "gboolean")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GError**" "error")
+ )
+)
+
+(define-vfunc release_async
+ (of-object "GPermission")
+ (return-type "void")
+ (parameters
+  '("GCancellable*" "cancellable")
+  '("GAsyncReadyCallback" "callback")
+  '("gpointer" "user_data")
+ )
+)
+
+(define-vfunc release_finish
+ (of-object "GPermission")
+ (return-type "gboolean")
+ (parameters
+  '("GAsyncResult*" "result")
+  '("GError**" "error")
+ )
+)
+
 ; GPollableInputStream
 
 (define-vfunc can_poll
  )
 )
 
-; GPermission
-
-(define-vfunc acquire
- (of-object "GPermission")
- (return-type "gboolean")
- (parameters
-  '("GCancellable*" "cancellable")
-  '("GError**" "error")
- )
-)
-
-(define-vfunc acquire_async
- (of-object "GPermission")
- (return-type "void")
- (parameters
-  '("GCancellable*" "cancellable")
-  '("GAsyncReadyCallback" "callback")
-  '("gpointer" "user_data")
- )
-)
-
-(define-vfunc acquire_finish
- (of-object "GPermission")
- (return-type "gboolean")
- (parameters
-  '("GAsyncResult*" "result")
-  '("GError**" "error")
- )
-)
-
-(define-vfunc release
- (of-object "GPermission")
- (return-type "gboolean")
- (parameters
-  '("GCancellable*" "cancellable")
-  '("GError**" "error")
- )
-)
-
-(define-vfunc release_async
- (of-object "GPermission")
- (return-type "void")
- (parameters
-  '("GCancellable*" "cancellable")
-  '("GAsyncReadyCallback" "callback")
-  '("gpointer" "user_data")
- )
-)
-
-(define-vfunc release_finish
- (of-object "GPermission")
- (return-type "gboolean")
- (parameters
-  '("GAsyncResult*" "result")
-  '("GError**" "error")
- )
-)
-
-; GListModel
-(define-vfunc get_item_type
-  (of-object "GListModel")
-  (return-type "GType")
-)
-
-(define-vfunc get_n_items
-  (of-object "GListModel")
-  (return-type "guint")
-)
-
-(define-vfunc get_item
-  (of-object "GListModel")
-  (return-type "gpointer")
-  (parameters
-   '("guint" "position")
-  )
-)
index 745c11d..b98da27 100644 (file)
@@ -40,6 +40,9 @@ class InputStream : public Glib::Object
 {
   _CLASS_GOBJECT(InputStream, GInputStream, G_INPUT_STREAM, Glib::Object, GObject)
 
+protected:
+  _CTOR_DEFAULT
+
 public:
   _WRAP_METHOD(gssize read(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_input_stream_read,
@@ -380,8 +383,18 @@ public:
                g_input_stream_close_finish,
                errthrow)
 
-  // These are private inside the module (for implementations)
-  _IGNORE(g_input_stream_has_pending, g_input_stream_is_closed, g_input_stream_set_pending, g_input_stream_clear_pending)
+  _WRAP_METHOD(bool is_closed() const, g_input_stream_is_closed, newin "2,50")
+  _WRAP_METHOD(bool has_pending() const, g_input_stream_has_pending, newin "2,50")
+
+protected:
+  _WRAP_METHOD(bool set_pending(), g_input_stream_set_pending, errthrow, newin "2,50")
+  _WRAP_METHOD(void clear_pending(), g_input_stream_clear_pending, newin "2,50")
+
+  //TODO: When we can break ABI, add vfuncs. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
+#m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
+  //_WRAP_VFUNC(gssize read(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), read_fn, errthrow, err_return_value -1)
+  //_WRAP_VFUNC(gssize skip(gsize count, const Glib::RefPtr<Cancellable>& cancellable), skip, errthrow, err_return_value -1)
+  //_WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
 };
 
 } // namespace Gio
index 028f74e..45f52e0 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2008 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
 
 #include <gio/gio.h>
 #include <glibmm/bytes.h>
+
+namespace Gio
+{
+
+// Equivalent to g_memory_output_stream_new_resizable().
+MemoryOutputStream::MemoryOutputStream()
+: _CONSTRUCT("data", nullptr, "size", 0, "realloc-function", g_realloc,
+             "destroy-function", g_free)
+{
+}
+
+} // namespace Gio
index 8f08c03..4b1048b 100644 (file)
@@ -49,11 +49,18 @@ class MemoryOutputStream :
 {
   _CLASS_GOBJECT(MemoryOutputStream, GMemoryOutputStream, G_MEMORY_OUTPUT_STREAM, Gio::OutputStream, GOutputStream)
   _IMPLEMENTS_INTERFACE(Seekable)
+
 protected:
+  // Hand-coded because it's equivalent to g_memory_output_stream_new_resizable(),
+  // which sets some properties to non-default values.
+  /** Creates a resizable stream.
+   */
+  MemoryOutputStream();
   // TODO: more C++-like interface using sigc++
   _WRAP_CTOR(MemoryOutputStream(void* data, gsize size, GReallocFunc realloc_function, GDestroyNotify destroy_function), g_memory_output_stream_new)
 
 public:
+  _WRAP_CREATE()
   // TODO: more C++-like interface using sigc++
   _WRAP_CREATE(void* data, gsize size, GReallocFunc realloc_function, GDestroyNotify destroy_function)
 
index afbf1e8..d1e3f41 100644 (file)
@@ -22,6 +22,7 @@
 
 _DEFS(giomm,gio)
 _PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(gio/gio.h) // for GOutputStreamSpliceFlags
 
 namespace Gio
 {
@@ -38,6 +39,9 @@ class OutputStream : public Glib::Object
 {
   _CLASS_GOBJECT(OutputStream, GOutputStream, G_OUTPUT_STREAM, Glib::Object, GObject)
 
+protected:
+  _CTOR_DEFAULT
+
 public:
 
   _WRAP_METHOD(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}),
@@ -491,9 +495,21 @@ public:
                g_output_stream_close_finish,
                errthrow)
 
-  // These are private inside the module (for implementations)
-  _IGNORE(g_output_stream_has_pending, g_output_stream_is_closed, g_output_stream_is_closing, g_output_stream_set_pending, g_output_stream_clear_pending)
-
+  _WRAP_METHOD(bool is_closed() const, g_output_stream_is_closed, newin "2,50")
+  _WRAP_METHOD(bool is_closing() const, g_output_stream_is_closing, newin "2,50")
+  _WRAP_METHOD(bool has_pending() const, g_output_stream_has_pending, newin "2,50")
+
+protected:
+  _WRAP_METHOD(bool set_pending(), g_output_stream_set_pending, errthrow, newin "2,50")
+  _WRAP_METHOD(void clear_pending(), g_output_stream_clear_pending, newin "2,50")
+
+  //TODO: When we can break ABI, add vfuncs. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
+#m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`GInputStream*', `const Glib::RefPtr<InputStream>&', `Glib::wrap($3, true)')
+  //_WRAP_VFUNC(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), write_fn, errthrow, err_return_value -1)
+  //_WRAP_VFUNC(gssize splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable{.}, OutputStreamSpliceFlags flags{.}), splice, errthrow, err_return_value -1)
+  //_WRAP_VFUNC(bool flush(const Glib::RefPtr<Cancellable>& cancellable), flush, errthrow)
+  //_WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
 };
 
 } // namespace Gio
index ce4af17..b1c3178 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2012 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -59,7 +57,7 @@ public:
 
   //TODO: _WRAP_VFUNC(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), "create_source")
 
-  _WRAP_VFUNC(gssize read_nonblocking(void* buffer, gsize count), "read_nonblocking", errthrow)
+  _WRAP_VFUNC(gssize read_nonblocking(void* buffer, gsize count), "read_nonblocking", errthrow, err_return_value -1)
 };
 
 } // namespace Gio
index c6807c5..c735fc6 100644 (file)
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2012 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -60,7 +58,7 @@ public:
 
   //TODO:_WRAP_VFUNC(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), "create_source")
 
-  _WRAP_VFUNC(gssize write_nonblocking(const void* buffer, gsize count), "write_nonblocking", errthrow)
+  _WRAP_VFUNC(gssize write_nonblocking(const void* buffer, gsize count), "write_nonblocking", errthrow, err_return_value -1)
 };
 
 } // namespace Gio
index 20b3185..1c0a79b 100755 (executable)
@@ -306,20 +306,21 @@ def clean_func(buf):
     pat = re.compile(r"""G_GNUC_WARN_UNUSED_RESULT|G_INLINE_FUNC""", re.MULTILINE)
     buf = pat.sub('', buf)
 
-    #strip *_DEPRECATED_IN_*_FOR (*):
-    pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(.*\)\S*""", re.MULTILINE)
+    #strip *_DEPRECATED_IN_*_FOR (*)
+    #e.g. GDK_DEPRECATED_IN_*_FOR (*) and GDK_PIXBUF_DEPRECATED_IN_*_FOR (*)
+    pat = re.compile(r"""([A-Z]+_){1,2}?DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(.*\)\S*""", re.MULTILINE)
     buf = pat.sub('', buf)
 
     #strip *_DEPRECATED*
-    pat = re.compile(r"""[A-Z]+_DEPRECATED\S*""", re.MULTILINE)
+    pat = re.compile(r"""([A-Z]+_){1,2}?DEPRECATED\S*""", re.MULTILINE)
     buf = pat.sub('', buf)
 
     #strip *_AVAILABLE_IN_*
-    pat = re.compile(r"""[A-Z]+_AVAILABLE_IN_[0-9]_[0-9]\S*""", re.MULTILINE)
+    pat = re.compile(r"""([A-Z]+_){1,2}?AVAILABLE_IN_[0-9]_[0-9]\S*""", re.MULTILINE)
     buf = pat.sub('', buf)
 
     #strip *_AVAILABLE_IN_ALL
-    pat = re.compile(r"""[A-Z]+_AVAILABLE_IN_ALL\S*""", re.MULTILINE)
+    pat = re.compile(r"""([A-Z]+_){1,2}?AVAILABLE_IN_ALL\S*""", re.MULTILINE)
     buf = pat.sub('', buf)
 
     #strip G_DECLARE_FINAL_TYPE (*)
index 5b6f114..e1609a9 100644 (file)
@@ -24,8 +24,8 @@ dnl                   $5               $6           $7            $8
 dnl            `<cargs and names>',`<cnames>',`<cpparg names>',firstarg,
 dnl                $9               $10        $11     $12
 dnl             refreturn_ctype, keep_return, ifdef, errthrow,
-dnl               $13           $14            $15             $16
-dnl            slot_type, c_data_param_name, return_value, exception_handler)
+dnl               $13           $14            $15             $16               $17
+dnl            slot_type, c_data_param_name, return_value, err_return_value, exception_handler)
 dnl
 dnl Note: _get_current_wrapper_inline() could be used throughout for performance instead of _get_current_wrapper(),
 dnl and is_derived_() instead of is_derived_(),
@@ -89,15 +89,15 @@ ifelse($10,keep_return,`dnl
 ')dnl end refreturn_ctype
 ')dnl end void
       }
-ifelse($16,,,`dnl if (exception_handler)
+ifelse($17,,,`dnl if (exception_handler)
       catch(...)
       {
         try
         {
 ifelse($9,refreturn_ctype,`dnl
-          return Glib::unwrap_copy`'(obj->$16`'());
+          return Glib::unwrap_copy`'(obj->$17`'());
 ', `dnl
-          return _CONVERT($3, $4, `obj->$16`'()');
+          return _CONVERT($3, $4, `obj->$17`'()');
 ')dnl
         }
 ')dnl end exception_handler
@@ -108,11 +108,11 @@ ifelse($12,errthrow,`dnl
 ifelse($4,void,`dnl
         return;
 ',`dnl
-ifelse(`$15', `',`dnl
+ifelse(`$16', `',`dnl
         using RType = $4;
         return RType`'();
 ',`dnl
-        return _CONVERT($3,$4,`$15');
+        return _CONVERT($3,$4,`$16');
 ')dnl
 ')dnl
       }
@@ -121,7 +121,7 @@ ifelse(`$15', `',`dnl
       {
         Glib::exception_handlers_invoke`'();
       }
-ifelse($16,,,`dnl if (exception_handler)
+ifelse($17,,,`dnl if (exception_handler)
       }
 ')dnl
     }
index 6af2775..b920791 100644 (file)
@@ -240,9 +240,10 @@ sub output_wrap_vfunc_cc($$$$$$$$)
      convert_args_c_to_cpp($objCFunc, $objCppfunc, $line_num);
 
     my $returnValue = $$objCppfunc{return_value};
+    my $errReturnValue = $$objCppfunc{err_return_value};
     my $exceptionHandler = $$objCppfunc{exception_handler};
 
-    my $str = sprintf("_VFUNC_PCC(%s,%s,%s,%s,\`%s\',\`%s\',\`%s\',%s,%s,%s,%s,%s,%s,%s,%s,%s)dnl\n",
+    my $str = sprintf("_VFUNC_PCC(%s,%s,%s,%s,\`%s\',\`%s\',\`%s\',%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)dnl\n",
       $$objCppfunc{name},
       $cname,
       $$objCppfunc{rettype},
@@ -258,6 +259,7 @@ sub output_wrap_vfunc_cc($$$$$$$$)
       $$objCppfunc{slot_type},
       $$objCppfunc{c_data_param_name},
       $returnValue,
+      $errReturnValue,
       $exceptionHandler);
 
     $self->append($str);
index 9a03e73..3f71ece 100644 (file)
@@ -1325,6 +1325,7 @@ sub on_wrap_vfunc($)
   my $keep_return = 0;
   my $refreturn_ctype = 0;
   my $returnValue = "";
+  my $errReturnValue = "";
   my $exceptionHandler = "";
   my $custom_vfunc = 0;
   my $custom_vfunc_callback = 0;
@@ -1360,6 +1361,14 @@ sub on_wrap_vfunc($)
     {
       $returnValue = $1;
     }
+    # Return value, if the C++ vfunc throws an exception which is propagated
+    # to the C callback.
+    # (Default is the default value of the return type or, if return_value
+    # is specified, the return_value.)
+    elsif($argRef =~ /^err_return_value\s+(.*)/)
+    {
+      $errReturnValue = $1;
+    }
     # If exception handler is not defined, then Glib::exception_handlers_invoke
     # method will be used for exception handling.
     elsif($argRef =~ /^exception_handler\s+(.*)/)
@@ -1402,11 +1411,13 @@ sub on_wrap_vfunc($)
       $no_slot_copy = 1;
     }
   }
+  $errReturnValue = $returnValue if ($returnValue ne "" and $errReturnValue eq "");
 
   $self->output_wrap_vfunc($argCppDecl, $argCName, $$self{filename}, $$self{line_num},
                            $refreturn, $keep_return, $refreturn_ctype, $custom_vfunc,
                            $custom_vfunc_callback, $ifdef, $errthrow,
-                           $slot_name, $slot_callback, $no_slot_copy, $returnValue, $exceptionHandler);
+                           $slot_name, $slot_callback, $no_slot_copy,
+                           $returnValue, $errReturnValue, $exceptionHandler);
 }
 
 # Common part of _WRAP_ENUM(), _WRAP_ENUM_DOCS_ONLY() and _WRAP_GERROR().
@@ -1689,12 +1700,13 @@ sub output_wrap_signal($$$$$$$$$$$$$$$$$)
 # void output_wrap_vfunc($CppDecl, $vfunc_name, $filename, $line_num,
 #                  $refreturn, $keep_return, $refreturn_ctype,
 #                  $custom_vfunc, $custom_vfunc_callback, $ifdef, $errthrow,
-#                  $slot_name, $slot_callback, $no_slot_copy, $returnValue, $exceptionHandler)
-sub output_wrap_vfunc($$$$$$$$$$$$$$$$$)
+#                  $slot_name, $slot_callback, $no_slot_copy, $returnValue,
+#                  $errReturnValue, $exceptionHandler)
+sub output_wrap_vfunc($$$$$$$$$$$$$$$$$$)
 {
   my ($self, $CppDecl, $vfunc_name, $filename, $line_num, $refreturn, $keep_return, $refreturn_ctype,
       $custom_vfunc, $custom_vfunc_callback, $ifdef, $errthrow,
-      $slot_name, $slot_callback, $no_slot_copy, $returnValue, $exceptionHandler) = @_;
+      $slot_name, $slot_callback, $no_slot_copy, $returnValue, $errReturnValue, $exceptionHandler) = @_;
 
   #Some checks:
   return if ($self->output_wrap_check($CppDecl, $vfunc_name, $filename, $line_num, '_WRAP_VFUNC'));
@@ -1727,6 +1739,7 @@ sub output_wrap_vfunc($$$$$$$$$$$$$$$$$)
   $$objCppVfunc{rettype_needs_ref} = $refreturn;
   $$objCppVfunc{keep_return} = $keep_return;
   $$objCppVfunc{return_value} = $returnValue;
+  $$objCppVfunc{err_return_value} = $errReturnValue;
   $$objCppVfunc{exception_handler} = $exceptionHandler;
   $$objCppVfunc{name} .= "_vfunc"; #All vfuncs should have the "_vfunc" suffix, and a separate easily-named invoker method.