+2.33.14:
+
+2012-10-12 Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
+
+ gmmproc: Add 3-argument @newin.
+
+ * tools/pm/DocsParser.pm: Convert "Since: 1.2.3" to "@newin{1,2,3}".
+ Some C projects (goocanvas, grilo, gstreamer) use "Since: 1.2.3", instead of
+ "Since: 1.2". The corresponding C++ projects need an ALIAS for this @newin
+ in Doxyfile.in, like in mm-common/skeletonmm/doc/reference/Doxyfile.in.
+
+2012-10-08 José Alburquerque <jaalburquerque@gmail.com>
+
+ FileInfo: set_attribute_strings(): Const correction.
+
+ * gio/src/fileinfo.hg: Pass the attr_value vector as a const
+ std::vector<>& and not just a std::vecto<>&. I must not have been
+ paying attention to what I was doing when wrapping this.
+
+2012-10-07 Murray Cumming <murrayc@murrayc.com>
+
+ Require the latest mm-common.
+
+ * configure.ac: This should avoid us creating tarballs without
+ the mm-common improvements.
+
+2012-10-06 Murray Cumming <murrayc@murrayc.com>
+
+ MenuItem: get_attribute(): Remove const overload / make it const.
+
+ * gio/src/menuitem.hg: It does not make sense to have a return
+ by value that is const.
+ * gio/src/menuattributeiter.hg:
+ * gio/src/menumodel.hg: Add TODOs for a future ABI break, so we can
+ fix the same problem here.
+
+2012-10-04 José Alburquerque <jaalburquerque@gmail.com>
+
+ MenuItem: Rename the get_attribute_value() methods to get_attribute().
+
+ * gio/src/menuitem.hg: Rename the just added methods to just
+ get_attribute() instead of get_attribute_value() to make the method
+ name shorter. Also deprecate the set_attribute_value() method and add
+ a set_attribute() method to go with the newly renamed get_attribute()
+ methods.
+
+2012-10-03 José Alburquerque <jaalburquerque@gmail.com>
+
+ MountOperation: Wrap the "show-unmount-progesss" signal.
+
+ * gio/src/mountoperation.hg:
+
+2012-10-03 José Alburquerque <jaalburquerque@gmail.com>
+
+ MenuItem: Add the get_attribute_value() methods.
+
+ * gio/src/menuitem.hg: Add the methods (const and non-const versions)
+ and overloads without the VariantType parameter which can be null,
+ wrapping the g_menu_item_get_attribute_value() function.
+ (MenuItem): Add an overload for the "label" and "submenu" constructor
+ without the label parameter which can be null.
+ (create): Do the same for the create() method of the constructor
+ above.
+ * gio/src/menumodel.hg: Add an _IGNORE (completing a TODO).
+
+2012-10-03 José Alburquerque <jaalburquerque@gmail.com>
+
+ IOStream: Add the splice_async() and splice_finish() methods.
+
+ * gio/src/iostream.{ccg,hg}: Add cancellable and non-cancellable
+ versions of the splice_async() method wrapping the corresponding C
+ function. Add the splice_finish() method wrapping the corresponding C
+ function. Also add the class docs.
+
+2012-10-02 José Alburquerque <jaalburquerque@gmail.com>
+
+ FileInfo, FileAttributeMatcher: Wrap some unwrapped functions.
+
+ * gio/src/fileinfo.hg (FileAttributeMatcher): Add the
+ create_difference() and to_string() methods wrapping the
+ g_file_attribute_matcher_subtract() and the
+ g_file_attribute_matcher_to_string() functions.
+ (FileInfo): Add the has_namespace(), [get|set]_attribute_status(),
+ and [get|set]_attribute_strings() methods wrapping the
+ g_file_info_has_namespace(), g_file_info_[get|set]_attribute_status(),
+ and g_file_info_[get|set]_attribute_stringv() functions.
+ * tools/m4/convert_gio.m4: Add an enum and FileAttributeMatcher
+ conversions.
+
+2012-10-02 José Alburquerque <jaalburquerque@gmail.com>
+
+ VariantIter: Correct an _IGNORE.
+
+ * glib/src/variantiter.hg:
+
+2012-10-01 José Alburquerque <jaalburquerque@gmail.com>
+
+ VariantIter: Add init() method.
+
+ * glib/src/variantiter.hg: Wrap the g_variant_iter_init() function.
+ * tools/m4/convert_glib.m4: Add a necessary conversion.
+ * glib/src/varianttype.hg: Add an _IGNORE.
+
+2012-10-01 Murray Cumming <murrayc@murrayc-desktop>
+
+ DBus::Proxy: Add call(), call_sync() and call_finish() for unix_fd_list.
+
+ * gio/src/dbusproxy.[hg|ccg]: Add method overloads for the call methods
+ that take a GUnixFDList. This is based on the similar methods in
+ dbusconnection.[hg|ccg].
+
+2012-10-01 Murray Cumming <murrayc@murrayc.com>
+
+ DBusConnection: Fix a typo in implementation.
+
+ * gio/src/dbusconnection.ccg:
+ g_dbus_connection_call_with_unix_fd_list() was mistyped. I wonder why
+ the compiler did not complain.
+
+2012-09-30 José Alburquerque <jaalburquerque@gmail.com>
+
+ ActionGroup: Add the query_action() methods.
+
+ * tools/m4/base.m4:
+ * tools/m4/convert_base.m4:
+ * tools/m4/filelist.am:
+ * tools/m4/initialize.m4:
+ * tools/m4/initialize_base.m4:
+ * tools/m4/initialize_gio.m4:
+ * tools/m4/initialize_glib.m4:
+ * tools/m4/initialize_glibmm.m4: Move the _INITIALIZE macros into
+ their own files as is done for the _CONVERT macros so that some basic
+ types that are common (like initializing a bool& from a gboolean) can
+ be defined once and used in other circumstances.
+
+ * gio/src/dbusconnection.hg: Move an _INITIALIZATION macro to the
+ general files above (the gio initialize file).
+
+ * gio/src/actiongroup.hg: Add the query_action() methods (the needed
+ _INITIALIZATION macros are in the glib initialize file).
+
+ * tools/pm/Output.pm (convert_args_cpp_to_c): Correct the indentation
+ of the declarations of the C output variables and the setting of the
+ C++ output parameters from the C variables for methods that use the
+ output parameter feature of gmmproc.
+
+2012-09-30 José Alburquerque <jaalburquerque@gmail.com>
+
+ RegEx: Add the get_has_cr_or_lf() method.
+
+ * glib/src/regex.hg:
+
+2012-09-25 José Alburquerque <jaalburquerque@gmail.com>
+
+ gmmproc: Make the output param feature work for single indirection.
+
+ * tools/pm/Output.pm (convert_args_cpp_to_c): When inserting C object
+ initializations for C objects that will be used to set output
+ parameters, initialize the C object to a "default constructed" object
+ of the same type if there is single indirection and not zero to ensure
+ successful compilation in that case.
+ * tools/m4/method.m4: Whitespace correction of the body of generated
+ non-static methods. This ensures each statement is on its own line
+ and that there are no blank lines to make methods as compact as
+ possible.
+
+ Bug #662371.
+
2.33.13:
2012-09-25 Murray Cumming <murrayc@murrayc.com>
+2.33.14 (unstable):
+
+
+2012-10-12 Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
+
+ gmmproc: Add 3-argument @newin.
+
+ * tools/pm/DocsParser.pm: Convert "Since: 1.2.3" to "@newin{1,2,3}".
+ Some C projects (goocanvas, grilo, gstreamer) use "Since: 1.2.3", instead of
+ "Since: 1.2". The corresponding C++ projects need an ALIAS for this @newin
+ in Doxyfile.in, like in mm-common/skeletonmm/doc/reference/Doxyfile.in.
+
+2012-10-08 José Alburquerque <jaalburquerque@gmail.com>
+
+ FileInfo: set_attribute_strings(): Const correction.
+
+ * gio/src/fileinfo.hg: Pass the attr_value vector as a const
+ std::vector<>& and not just a std::vecto<>&. I must not have been
+ paying attention to what I was doing when wrapping this.
+
+2.33.14:
+
+Glib:
+* RegEx: Add get_has_cr_or_lf().
+ (José Alburquerque)
+* VariantIter: Add init() method.
+ (José Alburquerque)
+
+Gio:
+* ActionGroup: Add the query_action() methods.
+ (José Alburquerque)
+* FileAttributeMatcher: Add create_difference() and to_string().
+* FileInfo: Add has_namespace(), [get|set]_attribute_status(),
+ and [get|set]_attribute_strings().
+ (José Alburquerque)
+* IOStream: Add splice_async() splice_finish().
+* MenuItem: Add get_attribute().
+* MountOperation: Wrap the "show-unmount-progess" signal.
+ (José Alburquerque)
+
+* Gio::DBus:
+ - Proxy: Add call(), call_sync() and call_finish() for unix_fd_list.
+ (Murray Cumming)
+
+* gmmproc:
+ - Make the output param feature work for single indirection.
+ (José Alburquerque) Bug #662371.
+ - Add 3-argument @newin.
+ (Kjell Ahlstedt)
+
+
2.33.13 (unstable):
Gio:
## 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.13],
+AC_INIT([glibmm], [2.33.14],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
AM_MAINTAINER_MODE
AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
-MM_PREREQ([0.9.5])
+MM_PREREQ([0.9.6])
MM_INIT_MODULE([glibmm-2.4])
MM_INIT_MODULE([giomm-2.4])
class VariantBase;
class VariantContainerBase;
+class VariantType;
}
#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> list_actions() const, g_action_group_list_actions)
+ _WRAP_METHOD(bool query_action(const Glib::ustring& action_name, bool& enabled{>>}, Glib::VariantType& parameter_type{>>?}, Glib::VariantBase& state_hint{.>>}, Glib::VariantType& state_type{.>>?}, Glib::VariantBase& state{.>>?}), g_action_group_query_action)
+
_WRAP_METHOD(bool get_action_enabled(const Glib::ustring& action_name) const, g_action_group_get_action_enabled)
_WRAP_METHOD(Glib::VariantType get_action_parameter_type(const Glib::ustring& action_name) const, g_action_group_get_action_parameter_type)
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
- g_dbus_connection_call_with_uinx_fd_list(gobj(), bus_name.c_str(),
+ g_dbus_connection_call_with_unix_fd_list(gobj(), bus_name.c_str(),
object_path.c_str(), interface_name.c_str(), method_name.c_str(),
const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(),
static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list),
const Glib::VariantType& reply_type = Glib::VariantType());
#endif // G_OS_LINUX
-#m4 _INITIALIZATION(`Glib::RefPtr<UnixFDList>&',`GUnixFDList*', `$3 = Glib::wrap($4)')
-
/** Finishes an operation started with call() (with a UnixFDList).
* @param res A AsyncResult obtained from the SlotAsyncReady passed to
* call().
return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference.
}
+#ifdef G_OS_LINUX
+// With a UnixFDList.
+void Connection::call(
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<Cancellable>& cancellable,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ int timeout_msec,
+ CallFlags flags)
+{
+ // 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_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(),
+ const_cast<GVariant*>(parameters.gobj()),
+ static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list),
+ Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy);
+}
+
+// Non-cancellable version (with a UnixFDList).
+void Connection::call(
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ int timeout_msec,
+ CallFlags flags,
+ const Glib::VariantType& reply_type)
+{
+ // 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_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(),
+ const_cast<GVariant*>(parameters.gobj()),
+ static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list),
+ 0, &SignalProxy_async_callback, slot_copy);
+}
+#endif // G_OS_LINUX
+
} //namespace DBus
} // namespace Gio
*/
_WRAP_METHOD(Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_proxy_call_finish, errthrow)
+//TODO: Use _WRAP_METHOD() for this?
/** Synchronously invokes the method_name method on proxy.
* See call(), the asynchronous version of this method for more information.
*
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE
);
+
+#ifdef G_OS_LINUX
+//TODO: Use _WRAP_METHOD() for this?
+ /** Like call() but also takes a GUnixFDList object.
+ * This method is only available on UNIX.
+ *
+ * This is an asynchronous method. When the operation is finished, callback
+ * will be invoked in the thread-default main loop of the thread you are
+ * calling this method from. You can then call call_with_unix_fd_finish() to
+ * get the result of the operation. See call_sync() for the synchronous
+ * version of this function.
+ *
+ * @param method_name The name of the method to invoke.
+ * @param parameters A Glib::VariantContainerBase tuple with parameters for the
+ * method or <tt>0</tt> if not passing parameters.
+ * @param slot A SlotAsyncReady to call when the request is satisfied.
+ * @param cancellable A Cancellable.
+ * @param fd_list A UnixFDList.
+ * @param timeout_msec The timeout in milliseconds, -1 to use the default
+ * timeout or G_MAXINT for no timeout.
+ * @param flags Flags from the Gio::DBus::CallFlags enumeration.
+ * @newin{2,34}
+ */
+ void call(
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<Cancellable>& cancellable,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ int timeout_msec = -1,
+ CallFlags flags = Gio::DBus::CALL_FLAGS_NONE);
+ _IGNORE(g_dbus_proxy_call_with_unix_fd_list)
+
+ /** A non-cancellable version of call() (with a UnixFDList).
+ * @newin{2,34}
+ */
+ void call(
+ const Glib::ustring& object_path,
+ const Glib::ustring& interface_name,
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ const Glib::ustring& bus_name = Glib::ustring(),
+ int timeout_msec = -1,
+ CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ const Glib::VariantType& reply_type = Glib::VariantType());
+#endif // G_OS_LINUX
+
+ /** Finishes an operation started with call() (with a UnixFDList).
+ * @param res A AsyncResult obtained from the SlotAsyncReady passed to
+ * call().
+ * @result A Variant tuple with return values.
+ * @throw Glib::Error.
+ * @newin{2,34}
+ */
+ _WRAP_METHOD(Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res{.}, Glib::RefPtr<UnixFDList>& out_fd_list{.>>}), g_dbus_proxy_call_with_unix_fd_list_finish, errthrow)
+
+ _WRAP_METHOD(
+ Glib::VariantContainerBase call_sync(
+ const Glib::ustring& method_name{.},
+ const Glib::VariantContainerBase& parameters{.},
+ const Glib::RefPtr<Cancellable>& cancellable{.?},
+ const Glib::RefPtr<UnixFDList>& fd_list{.},
+ Glib::RefPtr<UnixFDList>& out_fd_list{.>>},
+ int timeout_msec{.} = -1,
+ CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ ),
+ g_dbus_proxy_call_with_unix_fd_list_sync, errthrow
+ )
+
//_WRAP_PROPERTY("g-bus-type", BusType) // write-only construct-only
_WRAP_PROPERTY("g-connection", Glib::RefPtr<Connection>)
_WRAP_PROPERTY("g-default-timeout", int)
*/
static Glib::RefPtr<FileAttributeMatcher> create(const std::string& attributes = "*");
+ _WRAP_METHOD(Glib::RefPtr<FileAttributeMatcher> create_difference(const Glib::RefPtr<const FileAttributeMatcher>& subtract) const, g_file_attribute_matcher_subtract)
+
_WRAP_METHOD(bool matches(const std::string& full_name) const, g_file_attribute_matcher_matches)
_WRAP_METHOD(bool matches_only(const std::string& full_name) const, g_file_attribute_matcher_matches_only)
_WRAP_METHOD(bool enumerate_namespace(const std::string& ns), g_file_attribute_matcher_enumerate_namespace)
_WRAP_METHOD(std::string enumerate_next(), g_file_attribute_matcher_enumerate_next)
+ _WRAP_METHOD(std::string to_string() const, g_file_attribute_matcher_to_string)
};
/** FileInfo implements methods for getting information that all files should contain, and allows for manipulation of extended attributes.
_WRAP_METHOD(bool has_attribute(const std::string& attribute) const,
g_file_info_has_attribute)
+ _WRAP_METHOD(bool has_namespace(const std::string& name_space) const, g_file_info_has_namespace)
+
#m4 _CONVERSION(`char**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(Glib::StringArrayHandle list_attributes(const std::string& name_space) const,
g_file_info_list_attributes)
_WRAP_METHOD(void remove_attribute(const std::string& attribute),
g_file_info_remove_attribute)
+ _WRAP_METHOD(FileAttributeStatus get_attribute_status(const std::string& attribute) const, g_file_info_get_attribute_status)
+
//TODO: This should return a ustring instead: https://bugzilla.gnome.org/show_bug.cgi?id=615950#c7
_WRAP_METHOD(std::string get_attribute_string(const std::string& attribute) const,
g_file_info_get_attribute_string)
+#m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_attribute_strings(const std::string& attribute) const, g_file_info_get_attribute_stringv)
+
_WRAP_METHOD(Glib::ustring get_attribute_as_string(const std::string& attribute) const,
g_file_info_get_attribute_as_string)
_WRAP_METHOD(std::string get_attribute_byte_string(const std::string& attribute) const,
_WRAP_METHOD(Glib::RefPtr<Glib::Object> get_attribute_object(const std::string& attribute) const,
g_file_info_get_attribute_object)
+ _WRAP_METHOD(bool set_attribute_status(const std::string& attribute, FileAttributeStatus status), g_file_info_set_attribute_status)
+
//TODO: This should take a ustring value instead: https://bugzilla.gnome.org/show_bug.cgi?id=615950#c7
_WRAP_METHOD(void set_attribute_string(const std::string& attribute, const std::string& value),
g_file_info_set_attribute_string)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`char**',`const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+ _WRAP_METHOD(void set_attribute_strings(const std::string& attribute, const std::vector<Glib::ustring>& attr_value), g_file_info_set_attribute_stringv)
+
_WRAP_METHOD(void set_attribute_byte_string(const std::string& attribute, const std::string& value),
g_file_info_set_attribute_byte_string)
_WRAP_METHOD(void set_attribute_boolean(const std::string& attribute, bool value),
_WRAP_METHOD(goffset get_size() const, g_file_info_get_size)
Glib::TimeVal modification_time() const;
+ _IGNORE(g_file_info_get_modification_time)
_WRAP_METHOD(std::string get_symlink_target() const, g_file_info_get_symlink_target)
slot_copy);
}
+void
+IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2,
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
+ IOStreamSpliceFlags flags, 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_io_stream_splice_async(gobj(), Glib::unwrap(stream2),
+ static_cast<GIOStreamSpliceFlags>(flags), io_priority,
+ Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy);
+}
+
+void
+IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2,
+ const SlotAsyncReady& slot, IOStreamSpliceFlags flags, 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_io_stream_splice_async(gobj(), Glib::unwrap(stream2),
+ static_cast<GIOStreamSpliceFlags>(flags), io_priority, 0,
+ &SignalProxy_async_callback, slot_copy);
+}
} // namespace Gio
namespace Gio
{
-/**
+_WRAP_ENUM(IOStreamSpliceFlags, GIOStreamSpliceFlags, NO_GTYPE)
+
+/** IOStream - Base class for implementing read/write streams.
+ * IOStream represents an object that has both read and write streams.
+ * Generally the two streams acts as separate input and output streams, but
+ * they share some common resources and state. For instance, for seekable
+ * streams they may use the same position in both streams.
+ *
+ * Examples of IOStream objects are SocketConnection which represents a two-way
+ * network connection, and FileIOStream which represent a file handle opened in
+ * read-write mode.
+ *
+ * To do the actual reading and writing you need to get the substreams with
+ * get_input_stream() and get_output_stream().
+ *
+ * The IOStream object owns the input and the output streams, not the other way
+ * around, so keeping the substreams alive will not keep the IOStream object
+ * alive. If the IOStream object is freed it will be closed, thus closing the
+ * substream, so even if the substreams stay alive they will always just return
+ * a Gio::IO_ERROR_CLOSED for all operations.
+ *
+ * To close a stream use close() which will close the common stream object and
+ * also the individual substreams. You can also close the substreams
+ * themselves. In most cases this only marks the substream as closed, so
+ * further I/O on it fails. However, some streams may support "half-closed"
+ * states where one direction of the stream is actually shut down.
*
* @ingroup Streams
*
_CLASS_GOBJECT(IOStream, GIOStream, G_IO_STREAM, Glib::Object, GObject)
public:
+
+ /** Asyncronously splice the output stream to the input stream of @a
+ * stream2, and splice the output stream of @a stream2 to the input stream of
+ * this stream.
+ *
+ * When the operation is finished @a slot will be called. You can then call
+ * splice_finish() to get the result of the operation.
+ *
+ * @param stream2 The second IOStream.
+ * @param slot A SlotAsyncReady slot.
+ * @param cancellable A Cancellable object.
+ * @param flags A set of IOStreamSpliceFlags.
+ * @param io_priority The io priority of the request.
+ *
+ * @newin{2,34}
+ */
+ void splice_async(const Glib::RefPtr<IOStream>& stream2,
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
+ IOStreamSpliceFlags flags = Gio::IO_STREAM_SPLICE_NONE,
+ int io_priority = Glib::PRIORITY_DEFAULT);
+ _IGNORE(g_io_stream_splice_async)
+
+ /// A non-cancellable version of splice_async().
+ void splice_async(const Glib::RefPtr<IOStream>& stream2,
+ const SlotAsyncReady& slot,
+ IOStreamSpliceFlags flags = Gio::IO_STREAM_SPLICE_NONE,
+ int io_priority = Glib::PRIORITY_DEFAULT);
+
+ _WRAP_METHOD(static bool splice_finish(const Glib::RefPtr<AsyncResult>& result), g_io_stream_splice_finish, errthrow)
+
_WRAP_METHOD(Glib::RefPtr<InputStream> get_input_stream(), g_io_stream_get_input_stream, refreturn)
_WRAP_METHOD(Glib::RefPtr<OutputStream> get_output_stream(), g_io_stream_get_output_stream, refreturn)
_WRAP_METHOD(bool close(const Glib::RefPtr<Cancellable>& cancellable{?}), g_io_stream_close, errthrow)
_WRAP_METHOD(Glib::ustring get_name() const, g_menu_attribute_iter_get_name)
+ //TODO: When we can break ABI, remove the method overload and just make it const.
+ //It makes no sense to return const by value.
_WRAP_METHOD(Glib::VariantBase get_value(), g_menu_attribute_iter_get_value)
_WRAP_METHOD(const Glib::VariantBase get_value() const, g_menu_attribute_iter_get_value, constversion)
protected:
_WRAP_CTOR(MenuItem(const Glib::ustring& label = Glib::ustring(), const Glib::ustring& detailed_action = Glib::ustring()), g_menu_item_new)
- //TODO: label can be empty, so reorder these parameters?
- _WRAP_CTOR(MenuItem(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu), g_menu_item_new_submenu)
+ _WRAP_CTOR(MenuItem(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& submenu), g_menu_item_new_submenu)
public:
_WRAP_CREATE(const Glib::ustring& label, const Glib::ustring& detailed_action)
- _WRAP_CREATE(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu)
+ _WRAP_CREATE(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& submenu)
//TODO: GMenuItem * g_menu_item_new_section (const Glib::ustring& label,
// const Glib::RefPtr<MenuModel>& section);
- _WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value)
+ _WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value, deprecated "Use set_attribute() instead.")
+ _WRAP_METHOD(void set_attribute(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value)
_IGNORE(g_menu_item_set_attribute)
_WRAP_METHOD(Glib::RefPtr<MenuModel> get_link(const Glib::ustring& link), g_menu_item_get_link, refreturn)
_WRAP_METHOD(void set_label(const Glib::ustring& label), g_menu_item_set_label)
_WRAP_METHOD(void set_submenu(const Glib::RefPtr<MenuModel>& submenu), g_menu_item_set_submenu)
_WRAP_METHOD(void set_section(const Glib::RefPtr<MenuModel>& section), g_menu_item_set_section)
+
+ _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
+
+ // Ignore varargs function.
+ _IGNORE(g_menu_item_get_attribute)
//TODO: Documentation:
void set_action_and_target(const Glib::ustring& action);
public:
#m4begin
dnl See the .ccg implementation for how this conversion works.
+
+ //TODO: When we can break ABI, remove the method overload and just make it const.
+ //It makes no sense to return const by value.
_CONVERSION(`MenuAttribute',`const gchar*',`giomm_get_menu_attribute($3)')
#m4end
_WRAP_METHOD(Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type), g_menu_model_get_item_attribute_value)
_WRAP_METHOD(const Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type) const, g_menu_model_get_item_attribute_value, constversion)
- //TODO?: _WRAP_METHOD(bool get_item_attribute(int item_index, MenuAttribute attribute, const Glib::ustring& format_string, ...), g_menu_model_get_item_attribute)
+ // Ignore varargs function
+ _IGNORE(g_menu_model_get_item_attribute)
#m4begin
dnl See the .ccg implementation for how this conversion works.
//TODO: The array of char* is not very pleasant to wrap:
//_WRAP_SIGNAL( void show_processes(const Glib::ustring& message, GArray* processes, const gchar *choices[]);
+ _WRAP_SIGNAL(void show_unmount_progress(const Glib::ustring& message, gint64 time_left, gint64 bytes_left), "show_unmount_progress")
+
_WRAP_PROPERTY("username", Glib::ustring)
_WRAP_PROPERTY("password", Glib::ustring)
_WRAP_PROPERTY("anonymous", bool)
_WRAP_METHOD(Glib::ustring get_pattern() const, g_regex_get_pattern)
_WRAP_METHOD(int get_max_backref() const, g_regex_get_max_backref)
_WRAP_METHOD(int get_capture_count() const, g_regex_get_capture_count)
+ _WRAP_METHOD(bool get_has_cr_or_lf() const, g_regex_get_has_cr_or_lf)
+
_WRAP_METHOD(int get_string_number(const Glib::ustring& name) const, g_regex_get_string_number)
_WRAP_METHOD(RegexCompileFlags get_compile_flags() const, g_regex_get_compile_flags)
_WRAP_METHOD(RegexMatchFlags get_match_flags() const, g_regex_get_match_flags)
{
class VariantBase;
+class VariantContainerBase;
//This can't be like a real iterator (like Gtk::TextIter),
//because g_iter_value_get_next_value() both gets a value and changes the iterator.
_CLASS_OPAQUE_COPYABLE(VariantIter, GVariantIter, NONE, g_variant_iter_copy, g_variant_iter_free)
_IGNORE(g_variant_iter_copy, g_variant_iter_free)
public:
+ //TODO: The variant parameter should be a VariantContainerBase.
explicit VariantIter(const VariantBase& variant);
+
+ _WRAP_METHOD(gsize init(const VariantContainerBase& value), g_variant_iter_init)
+
dnl // Don't _IGNORE(g_variant_iter_new). It's listed in glib_functions.defs as
dnl // a method of GVariant. Ignoring it would make gmmproc think that this
dnl // file wraps GVariant, and it would list all GVariant methods as unwrapped.
bool next_value(VariantBase& value);
_IGNORE(g_variant_iter_next_value)
-
+
+ // Ignore varargs function
+ _IGNORE(g_variant_iter_next)
};
} // namespace Glib
_WRAP_METHOD(gsize n_items() const, g_variant_type_n_items)
_WRAP_METHOD(VariantType key() const, g_variant_type_key)
_WRAP_METHOD(VariantType value() const, g_variant_type_value)
+
+ // This function is part of unexposed API in gvarianttypeinfo.{h,c} for an
+ // also unexposed GVariantTypeInfo structure of glib.
+ _IGNORE(g_variant_type_info_get)
};
extern const VariantType VARIANT_TYPE_BOOL;
m4_include(convert.m4)
dnl
+dnl Initialization macros
+dnl
+
+m4_include(initialize.m4)
+
+dnl
dnl ----------------------- Utility Macros -------------------------
dnl
m4_ifelse(`$3',,,`define(CF`'__HASH2(`$1',`$2'),`$3')')
')
-# _INITIALIZE(target_type, fromtype, output_param_name, c_return, wrap_line)
-#
-# Print an initialize statement from ctype to cpptype
-define(`_INITIALIZE',`dnl
-m4_ifelse(`$1',void,`$4',`dnl
-pushdef(`__INI',`IN`'__HASH2(`$1',`$2')')dnl
-m4_ifdef(__INI,`m4_indir(__INI,m4_substr(`$1',`0',m4_decr(m4_len(`$1'))),`$2',`$3', $4)',`
-m4_errprint(`No initialization for type $1 from type $2 defined (line: $5, output param: $3, c return: $4)
-')
-m4_m4exit(1)
-')`'dnl
-')`'dnl
-')
-
-# _INITIALIZATION(fromtype, totype, initialization)
-#
-# Functions for populating initialization tables.
-#
-define(`_INITIALIZATION',`
-m4_ifelse(`$3',,,`define(IN`'__HASH2(`$1',`$2'),m4_patsubst(`$3',`; +',`;
- '))')
-')
-
define(`_EQUAL',`define(EV`'__HASH(`$1'),`$2')')
/*******************************************************************/
_CONV_ENUM(G,DriveStartStopType)
_CONV_ENUM(G,EmblemOrigin)
_CONV_ENUM(G,FileAttributeInfoFlags)
+_CONV_ENUM(G,FileAttributeStatus)
_CONV_ENUM(G,FileAttributeType)
_CONV_ENUM(G,FileCopyFlags)
_CONV_ENUM(G,FileCreateFlags)
_CONVERSION(`const FileAttributeValue&',`const GFileAttributeValue*',`$3.gobj()')
_CONVERSION(`GFileAttributeInfoList*',`Glib::RefPtr<FileAttributeInfoList>',`Glib::wrap($3)')
+# FileAttributeMatcher
+_CONVERSION(`GFileAttributeMatcher*',`Glib::RefPtr<FileAttributeMatcher>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<const FileAttributeMatcher>&',`GFileAttributeMatcher*',`const_cast<GFileAttributeMatcher*>(Glib::unwrap($3))')
+
#FileEnumerator
_CONVERSION(`GFileEnumerator*',`Glib::RefPtr<FileEnumerator>',`Glib::wrap($3)')
_CONVERSION(`GValue*', `Glib::ValueBase&', `*reinterpret_cast<Glib::ValueBase*>($3)')
_CONVERSION(`const GValue*', `const Glib::ValueBase&', `*reinterpret_cast<const Glib::ValueBase*>($3)')
+dnl VariantContainerBase
+_CONVERSION(`const VariantContainerBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
+
dnl VariantType
_CONVERSION(`const VariantType&',`const GVariantType*',`($3).gobj()')
_CONVERSION(`const Glib::VariantType&',`const GVariantType*',`($3).gobj()')
doc.m4 \
enum.m4 \
gerror.m4 \
+ initialize.m4 \
+ initialize_base.m4 \
+ initialize_gio.m4 \
+ initialize_glib.m4 \
+ initialize_glibmm.m4 \
list.m4 \
member.m4 \
method.m4 \
--- /dev/null
+dnl Other libraries, such as libgnomeuimm, can provide their own initialize.m4
+dnl files, maybe choosing to include the same files as this one.
+
+include(initialize_glibmm.m4)
--- /dev/null
+dnl
+dnl Macros for keeping track of how to initialize a C++ from a C type.
+
+#
+# Define a hashing for names
+#
+define(`__HASH',`__`'m4_translit(`$*',`ABCDEFGHIJKLMNOPQRSTUVWXYZ<>[]&*, ',`abcdefghijklmnopqrstuvwxyzVBNMRSC_')`'')
+define(`__EQUIV',`m4_ifdef(EV`'__HASH(`$1'),EV`'__HASH(`$1'),`$1')')
+
+dnl __HASH2(firsttype, secondtype)
+dnl
+dnl Provides a textual combination of the two given types which can be used as
+dnl a hash to store and retrieve conversions and initializations. It first
+dnl sees if the two types have equivalent types that should be used in their
+dnl places (using the __EQUIV macro above). Since the types returned by
+dnl __EQUIV may contain commas (because of types such as std::map<>), quote the
+dnl call to the macro to avoid the types to be interpreted as more than one
+dnl argument to the pushdef() calls. Also quote the expansion of the __E1 and
+dnl __E2 macros in the m4_ifelse for the same reason.
+define(`__HASH2',`dnl
+pushdef(`__E1',`__EQUIV(`$1')')pushdef(`__E2',`__EQUIV(`$2')')dnl
+m4_ifelse(_QUOTE(__E1),_QUOTE(__E2),`__EQ',__HASH(__E1)`'__HASH(__E2))`'dnl
+popdef(`__E1')popdef(`__E2')`'')
+
+define(`IN__EQ',`$3')
+
+# _INITIALIZE(target_type, fromtype, output_param_name, c_return, wrap_line)
+#
+# Print an initialize statement from ctype to cpptype
+define(`_INITIALIZE',`dnl
+m4_ifelse(`$1',void,`$4',`dnl
+pushdef(`__INI',`IN`'__HASH2(`$1',`$2')')dnl
+m4_ifdef(__INI,`m4_indir(__INI,m4_substr(`$1',`0',m4_decr(m4_len(`$1'))),`$2',`$3', $4)',`
+m4_errprint(`No initialization for type $1 from type $2 defined (line: $5, output param: $3, c return: $4)
+')
+m4_m4exit(1)
+')`'dnl
+')`'dnl
+')
+
+# _INITIALIZATION(fromtype, totype, initialization)
+#
+# Functions for populating initialization tables.
+#
+define(`_INITIALIZATION',`
+m4_ifelse(`$3',,,`define(IN`'__HASH2(`$1',`$2'),m4_patsubst(`$3',`; +',`;
+ '))')
+')
+
+
+include(initialize_glib.m4)
--- /dev/null
+dnl
+dnl Initializations for giomm C++ types from Gio C types.
+dnl
+
+dnl UnixFDList
+_INITIALIZATION(`Glib::RefPtr<UnixFDList>&',`GUnixFDList*', `$3 = Glib::wrap($4)')
--- /dev/null
+dnl
+dnl Initialization rules for glibmm C++ types from Glib C types.
+dnl
+
+dnl Basic Types
+_INITIALIZATION(`bool&',`gboolean',`$3 = static_cast<bool>($4)')
+
+
+dnl VariantBase
+_INITIALIZATION(`Glib::VariantBase&',`GVariant*',`$3 = Glib::wrap($4)')
+
+dnl VariantType
+_INITIALIZATION(`Glib::VariantType&',`const GVariantType*',`$3 = Glib::wrap(const_cast<GVariantType*>($4))')
--- /dev/null
+dnl $Id$
+
+include(initialize_base.m4)
+include(initialize_glib.m4)
+include(initialize_gio.m4)
+
')`'dnl
ifelse(`$16',,dnl If no C++ output parameter is specified
`ifelse(`$3',void,dnl If the C function returns voids:
-` $2(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7);dnl
+` $2(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7);
dnl Insert the initializations for the C output parameters
ifelse(`$8',,,`$8
')dnl
-'dnl If the C function returns non-void:
-,dnl Insert the declarations for C output parameters
+',dnl If the C function returns non-void:
dnl Store the return if there are C output parameters.
-`ifelse(`$6',,` return ',` `$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');dnl
+`ifelse(`$6',,` return ',` `$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
dnl Insert the initializations for the C output parameters
ifelse(`$8',,,`$8
')dnl
ifelse(`$6',,,`$6
')`'dnl
ifelse(`$16',,dnl If no C++ output parameter is specified:
-` ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');dnl
+` ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
'dnl
,dnl A C++ output parameter is specified:
` _INITIALIZE($17,$4,`$16',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)',$18);
'dnl
)dnl
-ifelse(`$11',,,`
+ifelse(`$11',,,`dnl
if(gerror)
::Glib::Error::throw_exception(gerror);
')dnl
-ifelse(`$10',,,`
+ifelse(`$10',,,`dnl
if(ifelse(`$16',,`retvalue',$16))
ifelse(`$16',,`retvalue',$16)->reference(); //The function does not do a ref for us.
')dnl
dnl Insert the initializations for the C output parameters
ifelse(`$8',,,`$8
')`'dnl
-ifelse(`$3',void,,` return retvalue;')dnl
+ifelse(`$3',void,,` return retvalue;
+')dnl
')dnl End errthrow/refreturn
-',` return const_cast<__CPPNAME__*>(this)->$1($14);')
+',` return const_cast<__CPPNAME__*>(this)->$1($14);
+')dnl
}
ifelse(`$15',,,`
s"<listitem>(.*?)(\n?)</listitem>(\n?)"- $1\n"sg;
# Use our Doxygen @newin alias:
+ s/\bSince:\s*(\d+)\.(\d+)\.(\d+)\b/\@newin{$1,$2,$3}/g;
s/\bSince:\s*(\d+)\.(\d+)\b/\@newin{$1,$2}/g;
s"\b->\b"->"g;
my $c_param_types = $$objCDefsFunc{param_types};
my $c_param_names = $$objCDefsFunc{param_names};
- my @conversions;
- my @declarations;
- my @initializations;
+ my @conversions = ();
+ my @declarations = ();
+ my @initializations = ();
my $num_c_args_expected = scalar(@{$c_param_types});
if( !($static) ) { $num_c_args_expected--; } #The cpp method will need an Object* paramater at the start.
# Remove a possible final '*' from the output parameter type because it
# will be passed by C reference (&name).
$cOutputParamType =~ s/\*$//;
+
+ # Only initialize pointers to zero. Otherwise, use the default
+ # constructor of the type.
+ my $initialization = "";
+ if($cOutputParamType =~ /\*$/)
+ {
+ $initialization = " = 0";
+ }
+ else
+ {
+ $initialization = " = $cOutputParamType()";
+ }
- push(@declarations, " $cOutputParamType $cOutputParamName = 0;");
+ push(@declarations, " $cOutputParamType $cOutputParamName$initialization;");
push(@conversions, "&" . $cOutputParamName);
- push(@initializations, sprintf(" _INITIALIZE(\`%s\',%s,%s,%s,%s);",
+ push(@initializations, sprintf("_INITIALIZE(\`%s\',%s,%s,%s,%s);",
$cppParamType,
$cOutputParamType,
$cppParamName,
}
}
- return ( join(", ", @conversions), join("\n ", @declarations),
+ return ( join(", ", @conversions), join("\n", @declarations),
join("\n ", @initializations) );
}