# examples/
/examples/child_watch/child_watch
/examples/compose/example
-/examples/dbus/busserver
-/examples/dbus/peer
-/examples/dbus/userbus
+/examples/dbus/client_bus_listnames
+/examples/dbus/server_without_bus
+/examples/dbus/session_bus_service
/examples/iochannel_stream/example
/examples/keyfile/example
/examples/markup/parser
/glib/glibmm/spawn.h
/glib/glibmm/thread.cc
/glib/glibmm/thread.h
+/glib/glibmm/threads.cc
+/glib/glibmm/threads.h
/glib/glibmm/timezone.cc
/glib/glibmm/timezone.h
/glib/glibmm/unicode.cc
+2.33.3:
+
+2012-07-10 Murray Cumming <murrayc@murrayc.com>
+
+ Gio::InetSocketAddress: Added get_flowinfo() and get_scope_id()
+
+ * gio/src/inetsocketaddress.hg: And add the properties.
+
+2012-07-10 Murray Cumming <murrayc@murrayc.com>
+
+ Gio::OutputStream: Add write_bytes().
+
+ * tools/m4/convert_glib.m4:
+ * gio/src/outputstream.[hg|ccg]: Add write_bytes(), write_bytes_async(),
+ and write_bytes_finish().
+
+2012-07-10 Murray Cumming <murrayc@murrayc.com>
+
+ Added Glib::Bytes and Gio::InputStream::read_bytes().
+
+ * glib/src/bytes.[hg|ccg]:
+ * glib/src/filelist.am:
+ * tools/m4/convert_glib.m4: Added a simple GBytes wrapper.
+ * gio/src/inputstream.[hg|ccg]: Added read_bytes(), read_bytes_async()
+ and read_bytes_finish() using the new Glib::Bytes type.
+
+2012-07-10 Murray Cumming <murrayc@murrayc.com>
+
+ Gio::DBus::Connection: Add get_last_serial().
+
+ * gio/src/dbusconnection.hg: Wrap g_dbus_connection_get_last_serial().
+
+2012-07-02 Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
+
+ generate_wrap_init.pl: Add _INCLUDE_IN_WRAP_INIT, _GMMPROC_WRAP_CONDITIONALLY.
+
+ * tools/generate_wrap_init.pl.in: Handle _INCLUDE_IN_WRAP_INIT and
+ _GMMPROC_WRAP_CONDITIONALLY.
+ * tools/m4/class_shared.m4: Add _INCLUDE_IN_WRAP_INIT and
+ _GMMPROC_WRAP_CONDITIONALLY. Bug #678883.
+
+2012-07-01 Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
+
+ Update .gitignore.
+
+ * .gitignore: Add /glib/glibmm/threads.[h|cc]. Update /examples/dbus/*.
+
2.33.2:
2012-06-19 Murray Cumming <murrayc@murrayc.com>
+2.33.3 (unstable):
+
+Glib:
+* Added the Bytes class, wrapping GBytes.
+ (Murray Cumming)
+
+Gio:
+* InetSocketAddress: Added get_flowinfo() and get_scope_id()
+* OutputStream: Added write_bytes(), write_bytes_async() and write_bytes_finish().
+* InputStream: Added read_bytes(), read_bytes_async() and read_bytes_finish().
+ (Murray Cumming)
+
+Gio::DBus:
+* Connection: Added get_last_serial().
+ (Murray Cumming)
+
+gmmproc:
+* Add _INCLUDE_IN_WRAP_INIT, _GMMPROC_WRAP_CONDITIONALLY.
+ (Kjell Ahlstedt) Bug #678883.
+
2.33.2 (unstable):
* Added some enum values and documentation.
## 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.33.2],
+AC_INIT([glibmm], [2.33.3],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library])
])
-glibreq='2.0 >= 2.33.2'
+glibreq='2.0 >= 2.33.3'
GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
_WRAP_METHOD(Glib::RefPtr<Credentials> get_peer_credentials(), g_dbus_connection_get_peer_credentials, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Credentials> get_peer_credentials() const, g_dbus_connection_get_peer_credentials, refreturn, constversion)
+ _WRAP_METHOD(guint32 get_last_serial() const, g_dbus_connection_get_last_serial)
+
/** Asynchronously invokes the @a method_name method on the @a
* interface_name D-Bus interface on the remote object at @a object_path
* owned by @a bus_name.
_WRAP_METHOD(guint16 get_port() const, g_inet_socket_address_get_port)
+ _WRAP_METHOD(guint32 get_flowinfo() const, g_inet_socket_address_get_flowinfo)
+ _WRAP_METHOD(guint32 get_scope_id() const, g_inet_socket_address_get_scope_id)
+
_WRAP_PROPERTY("address", Glib::RefPtr<InetAddress>)
_WRAP_PROPERTY("port", guint16)
+ _WRAP_PROPERTY("flowinfo", guint32)
+ _WRAP_PROPERTY("scope-id", guint32)
};
} // namespace Gio
slot_copy);
}
+void
+InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
+{
+ // Create a copy of the slot.
+ // A pointer to it will be passed through the callback's data parameter
+ // and deleted in the callback.
+ SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+ g_input_stream_read_bytes_async(gobj(),
+ count,
+ io_priority,
+ Glib::unwrap(cancellable),
+ &SignalProxy_async_callback,
+ slot_copy);
+}
+
+void
+InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_priority)
+{
+ // Create a copy of the slot.
+ // A pointer to it will be passed through the callback's data parameter
+ // and deleted in the callback.
+ SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+ g_input_stream_read_bytes_async(gobj(),
+ count,
+ io_priority,
+ 0,
+ &SignalProxy_async_callback,
+ slot_copy);
+}
+
void
InputStream::skip_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
#include <glibmm/object.h>
#include <glibmm/priorities.h>
+#include <glibmm/bytes.h>
#include <giomm/asyncresult.h>
#include <giomm/cancellable.h>
//TODO: bool read_all(std::string& buffer, gsize count, gsize& bytes_read, const Glib::RefPtr<Cancellable>& cancellable);
//TODO: bool read_all(std::string& buffer, gsize count, gsize& bytes_read)
+
+ _WRAP_METHOD(Glib::RefPtr<Glib::Bytes> read_bytes(gsize count, const Glib::RefPtr<Cancellable>& cancellable), g_input_stream_read_bytes, errthrow)
+
+ //TODO: Documentation.
+ /**
+ * @newin{2,34}
+ */
+ void read_bytes_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = Glib::PRIORITY_DEFAULT);
+
+ /**
+ * @newin{2,34}
+ */
+ void read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_priority = Glib::PRIORITY_DEFAULT);
+ _IGNORE(g_input_stream_read_bytes_async)
+
+ _WRAP_METHOD(Glib::RefPtr<Glib::Bytes> read_bytes_finish(const Glib::RefPtr<AsyncResult>& result), g_input_stream_read_bytes_finish, errthrow)
+
+
+
_WRAP_METHOD(gssize skip(gsize count, const Glib::RefPtr<Cancellable>& cancellable),
g_input_stream_skip,
errthrow)
return retvalue;
}
+
+void
+OutputStream::write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
+{
+ // Create a copy of the slot.
+ // A pointer to it will be passed through the callback's data parameter
+ // and deleted in the callback.
+ SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+ g_output_stream_write_bytes_async(gobj(),
+ const_cast<GBytes*>(Glib::unwrap(bytes)),
+ io_priority,
+ Glib::unwrap(cancellable),
+ &SignalProxy_async_callback,
+ slot_copy);
+}
+
+void
+OutputStream::write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, int io_priority)
+{
+ // Create a copy of the slot.
+ // A pointer to it will be passed through the callback's data parameter
+ // and deleted in the callback.
+ SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+ g_output_stream_write_bytes_async(gobj(),
+ const_cast<GBytes*>(Glib::unwrap(bytes)),
+ io_priority,
+ 0,
+ &SignalProxy_async_callback,
+ slot_copy);
+}
+
gssize OutputStream::splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags)
{
GError* gerror = 0;
*/
bool write_all(const std::string& buffer, gsize& bytes_written);
+ _WRAP_METHOD(gssize write_bytes(const Glib::RefPtr<const Glib::Bytes>& bytes, const Glib::RefPtr<Cancellable>& cancellable), g_output_stream_write_bytes, errthrow)
+
+ //TODO: Documentation.
+ /**
+ * @newin{2,34}
+ */
+ void write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = Glib::PRIORITY_DEFAULT);
+
+ /**
+ * @newin{2,34}
+ */
+ void write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, int io_priority = Glib::PRIORITY_DEFAULT);
+ _IGNORE(g_output_stream_write_bytes_async)
+
+ _WRAP_METHOD(gssize write_bytes_finish(const Glib::RefPtr<AsyncResult>& result), g_output_stream_write_bytes_finish, errthrow)
+
/** Splices an input stream into an output stream.
*
* @param source An InputStream.
--- /dev/null
+/* Copyright (C) 2012 The glibmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+namespace Glib
+{
+
+Glib::RefPtr<Glib::Bytes> Bytes::create(gconstpointer data, gsize size)
+{
+ GBytes* bytes= g_bytes_new(data, size);
+ return Glib::wrap(bytes);
+}
+
+} // namespace Glib
--- /dev/null
+/* Copyright (C) 2012 The glibmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+_DEFS(glibmm,glib)
+
+#include <glibmmconfig.h>
+#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
+#include <glibmm/error.h>
+#include <glibmm/arrayhandle.h>
+#include <glib.h>
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+typedef struct _GBytes GBytes;
+#endif
+
+namespace Glib
+{
+
+
+//Note: The documentation is a reduced version of the C documentation,
+//because this class is only really useful with other C types that we don't bother to wrap.
+//We only wrap it because it is used in the InputStream API.
+
+/** A simple refcounted data type representing an immutable byte sequence
+ * from an unspecified origin.
+ *
+ * The purpose of a the Bytes class is to keep the memory region that it holds
+ * alive for as long as anyone holds a reference to the bytes. When
+ * the last reference count is dropped, the memory is released. Multiple
+ * unrelated callers can use byte data in the Bytes object without coordinating
+ * their activities, resting assured that the byte data will not change or
+ * move while they hold a reference.
+ *
+ * A Bytes object can come from many different origins that may have
+ * different procedures for freeing the memory region. Examples are
+ * memory from g_malloc(), from memory slices, from a GMappedFile or
+ * memory from other allocators.
+ *
+ * @newin{2,34}
+ */
+class Bytes
+{
+ _CLASS_OPAQUE_REFCOUNTED(Bytes, GBytes, NONE, g_bytes_ref, g_bytes_unref)
+ _IGNORE(g_bytes_ref, g_bytes_unref)
+public:
+
+ static Glib::RefPtr<Glib::Bytes> create(gconstpointer data, gsize size);
+
+ _WRAP_METHOD(gconstpointer get_data(gsize& size) const, g_bytes_get_data)
+ _WRAP_METHOD(gsize get_size() const, g_bytes_get_size)
+
+ _WRAP_METHOD(static guint hash(gconstpointer bytes), g_bytes_hash)
+ _WRAP_METHOD(static bool equal(gconstpointer bytes1, gconstpointer bytes2), g_bytes_equal)
+ _WRAP_METHOD(static gint compare(gconstpointer bytes1, gconstpointer bytes2), g_bytes_compare)
+};
+
+} // namespace Glib
# Note that all of thread.hg is deprecated
glibmm_files_hg = \
balancedtree.hg \
+ bytes.hg \
checksum.hg \
convert.hg \
date.hg \
my $debug = 0;
my %objects = (); # Hashmap of arrays of objects (classes) in each file
my %exceptions = (); # Hashmap of arrays of exception classes in each file
-my %win32_nowrap = ();
+my %conditional_compilation = ();
my %deprecated = ();
+my %extra_includes = ();
+
+# The keys in all hashes except %extra_includes are names of header files (xyz.h),
+# corresponding to the read .hg files.
+#
+# The keys in %extra_includes are names of header files to include without reading.
+# %extra_includes is a hash rather than a list because we don't want duplicates.
+# Its values are not used. In C++ it would have been a std::set.
# $objects{$filename_header} is a reference to an array. That array contains
# references to arrays with two or more elements, ($cppname, $basename, @extra_namespace),
print "#ifndef " . uc($parent_dir) ."_DISABLE_DEPRECATED\n"
}
- #On Win32, these files are not compiled:
- if ($win32_nowrap{$file})
+ if ($conditional_compilation{$file})
{
- print "#ifndef G_OS_WIN32\n"
+ print "#$conditional_compilation{$file}\n"
}
print "$message";
- if ($win32_nowrap{$file})
+ if ($conditional_compilation{$file})
{
- print "#endif //G_OS_WIN32\n"
+ print "#endif // $conditional_compilation{$file}\n"
}
if ($deprecated{$file})
# Store header filename, so we can #include it later:
my $filename_header = $filename;
$filename_header =~ s#.*/([^/]+)\.hg#$1.h#;
- $win32_nowrap{$filename_header} = 0;
+ $conditional_compilation{$filename_header} = "";
$deprecated{$filename_header} = 0;
# Keep track of sub-namespaces, if any.
push(@{$exceptions{$filename_header}}, \@names);
}
}
+ elsif (/\b_INCLUDE_IN_WRAP_INIT\((.+)\)/)
+ {
+ $extra_includes{$1} = 1;
+ }
elsif (/\b_GTKMMPROC_WIN32_NO_WRAP\b/)
{
- $win32_nowrap{$filename_header} = 1; # This file will not be compiled on Win32
+ # This file will not be compiled on Win32.
+ # No extra include is required. If G_OS_WIN32 is defined, it's defined in
+ # a file included indirectly by glibmm.h.
+ $conditional_compilation{$filename_header} = "ifndef G_OS_WIN32";
+ }
+ elsif (/\b_GMMPROC_WRAP_CONDITIONALLY\((.+)\)/)
+ {
+ # The compilation of this file will be controlled by a preprocessor directive.
+
+ # Allow m4 quotes in the parameter. There may be cases where the m4 processor
+ # would misunderstand a parameter without quotes.
+ my $par = $1;
+ $par =~ s/^\s*`*\s*//; # Remove m4 quotes and leading and trailing white space.
+ $par =~ s/\s*'*\s*$//;
+ $conditional_compilation{$filename_header} = $par;
}
elsif (/\b_IS_DEPRECATED\b/)
{
#include <${parent_dir}/wrap_init.h>
#include <glibmm/error.h>
#include <glibmm/object.h>
-
-// #include the widget headers so that we can call the get_type() static methods:
EOF
+foreach my $filename_header (sort keys %extra_includes)
+{
+ print "#include <$filename_header>\n";
+}
+
+print "\n// #include the widget headers so that we can call the get_type() static methods:\n";
+
# keys %deprecated contains all filenames, not just the names of deprecated files.
foreach my $filename_header (sort keys %deprecated)
{
dnl generate_wrap_init.pl will look for this in the original .hg file.
dnl
define(`_GTKMMPROC_WIN32_NO_WRAP', dnl
-`//This is not available in on Win32.
-//This source file will not be compiled,
-//and the class will not be registered in wrap_init.h or wrap_init.cc
+`//This is not available on Win32.
+//This source file will not be compiled on Win32,
+//and no class defined in it will be registered by wrap_init`'().
')dnl
+dnl _GMMPROC_WRAP_CONDITIONALLY(preprocessor_if/ifdef/ifndef_directive_without_#)
+dnl Just process it to remove it from the generated file.
+dnl generate_wrap_init.pl will look for this in the original .hg file.
+dnl
+dnl Example calls:
+dnl _GMMPROC_WRAP_CONDITIONALLY(ifndef G_OS_WIN32) # Same as _GTKMMPROC_WIN32_NO_WRAP
+dnl _GMMPROC_WRAP_CONDITIONALLY(ifdef GDK_WINDOWING_X11)
+dnl _GMMPROC_WRAP_CONDITIONALLY(`if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_QUARTZ)')
+dnl
+define(`_GMMPROC_WRAP_CONDITIONALLY', dnl
+`//This is available only #$1.
+//Otherwise this source file will not be compiled,
+//and no class defined in it will be registered by wrap_init`'().
+')dnl
+
+dnl _INCLUDE_IN_WRAP_INIT(file)
+dnl Usually used in combination with _GMMPROC_WRAP_CONDITIONALLY.
+dnl It does not generate any code in the .h and .cc files.
+dnl generate_wrap_init.pl will look for this in the original .hg file.
+dnl
+define(`_INCLUDE_IN_WRAP_INIT',`')dnl
+
dnl _IS_DEPRECATED
dnl ifdef-out the whole .h and .cc files.
dnl generate_wrap_init.pl will look for this in the original .hg file.
_CONVERSION(`OptionGroup&',`GOptionGroup*',`($3).gobj()')
#_CONVERSION(`GOptionGroup*',`OptionGroup',`Glib::wrap(($3), true /* take_copy */)')
+dnl Bytes
+_CONVERSION(`GBytes*',`Glib::RefPtr<Glib::Bytes>',`Glib::wrap($3)')
+_CONVERSION(`GBytes*',`Glib::RefPtr<const Glib::Bytes>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<const Glib::Bytes>&',`GBytes*',__CONVERT_CONST_REFPTR_TO_P_SUN(Glib::Bytes)))
+
dnl Regex
_CONVERSION(`GRegex*',`Glib::RefPtr<Regex>',`Glib::wrap($3)')
_CONVERSION(`GRegex*',`Glib::RefPtr<const Regex>',`Glib::wrap($3)')
_CONVERSION(`const GVariantType*',`VariantType',`Glib::wrap(const_cast<GVariantType*>($3), true)')
_CONVERSION(`GVariantType*',`VariantType',`Glib::wrap(($3), true)')
-dnl Misillaneous
+dnl Miscellaneous
_CONVERSION(`gint64&',`gint64*',`&($3)')