From 05cc3d31e9b0bd17af43629452b955d0fece0ddf Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 14 Nov 2014 12:54:13 +0100 Subject: Add Gio::Resource * gio/src/resource.[hg|ccg]: Add class Resource, enum ResourceFlags and enum ResourceLookupFlags. * glib/src/bytes.hg: Mention Resource in a comment. * tools/m4/convert_gio.m4: Add conversions for GResource, GResourceFlags and GResourceLookupFlags. Bug #739206. --- gio/src/resource.ccg | 51 ++++++++++++- gio/src/resource.hg | 186 +++++++++++++++++++++++++++++++++++++++++++++++- glib/src/bytes.hg | 4 +- tools/m4/convert_gio.m4 | 5 ++ 4 files changed, 239 insertions(+), 7 deletions(-) diff --git a/gio/src/resource.ccg b/gio/src/resource.ccg index b80d676f..cd5eb8c6 100644 --- a/gio/src/resource.ccg +++ b/gio/src/resource.ccg @@ -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 @@ -21,5 +19,54 @@ namespace Gio { +// Hand-coded because we want ResourceFlags& instead of guint32&. +void Resource::get_info(const Glib::ustring& path, gsize& size, + ResourceFlags& flags, ResourceLookupFlags lookup_flags) const +{ + guint32 file_flags = 0; + GError* gerror = 0; + // Ignore the gboolean return value from g_resource_get_info(). + // gerror is set if and only if the return value is FALSE. + g_resource_get_info(const_cast(gobj()), path.c_str(), + (GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); + flags = static_cast(file_flags); +} + +void Resource::get_info(const Glib::ustring& path, ResourceLookupFlags lookup_flags) const +{ + GError* gerror = 0; + g_resource_get_info(const_cast(gobj()), path.c_str(), + (GResourceLookupFlags)lookup_flags, 0, 0, &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); +} + +// Hand-coded because we want ResourceFlags& instead of guint32&. +//static +void Resource::get_info_global(const Glib::ustring& path, gsize& size, + ResourceFlags& flags, ResourceLookupFlags lookup_flags) +{ + guint32 file_flags = 0; + GError* gerror = 0; + // Ignore the gboolean return value from g_resources_get_info(). + // gerror is set if and only if the return value is FALSE. + g_resources_get_info(path.c_str(), + (GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); + flags = static_cast(file_flags); +} + +//static +void Resource::get_info_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags) +{ + GError* gerror = 0; + g_resources_get_info(path.c_str(), + (GResourceLookupFlags)lookup_flags, 0, 0, &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); +} } // namespace Gio diff --git a/gio/src/resource.hg b/gio/src/resource.hg index ad1ddd93..e01d9cf8 100644 --- a/gio/src/resource.hg +++ b/gio/src/resource.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2012 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -18,9 +16,19 @@ */ #include +#include +#include +#include +#include +#include +#include _DEFS(giomm,gio) +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GResource GResource; +#endif + namespace Gio { @@ -28,4 +36,178 @@ namespace Gio */ _WRAP_GERROR(ResourceError, GResourceError, G_RESOURCE_ERROR, NO_GTYPE) +_WRAP_ENUM(ResourceFlags, GResourceFlags) +_WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) + +/** Resource framework. + * + * Applications and libraries often contain binary or textual data that is + * really part of the application, rather than user data. For instance + * Gtk::Builder .ui files, splashscreen images, Gio::Menu markup xml, CSS files, + * icons, etc. These are often shipped as files in `$datadir/appname`, or + * manually included as literal strings in the code. + * + * The Gio::Resource API and the glib-compile-resources program + * provide a convenient and efficient alternative to this which has some nice properties. You + * maintain the files as normal files, so its easy to edit them, but during the build the files + * are combined into a binary bundle that is linked into the executable. This means that loading + * the resource files is efficient (as they are already in memory, shared with other instances) and + * simple (no need to check for things like I/O errors or locate the files in the filesystem). It + * also makes it easier to create relocatable applications. + * + * Resource files can also be marked as compressed. Such files will be included in the resource bundle + * in a compressed form, but will be automatically uncompressed when the resource is used. This + * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away. + * + * Resource files can also be marked to be preprocessed, by setting the value of the + * `preprocess` attribute to a comma-separated list of preprocessing options. + * The only options currently supported are: + * + *
+ *
xml-stripblanks
+ *
which will use the xmllint command + * to strip ignorable whitespace from the xml file. For this to work, + * the `XMLLINT` environment variable must be set to the full path to + * the xmllint executable, or xmllint must be in the `PATH`; otherwise + * the preprocessing step is skipped.
+ * + *
to-pixdata
+ *
which will use the gdk-pixbuf-pixdata command to convert + * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside + * the resource file, rather than an (uncompressed) copy of it. For this, the gdk-pixbuf-pixdata + * program must be in the PATH, or the `GDK_PIXBUF_PIXDATA` environment variable must be + * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will + * abort.
+ *
+ * + * Resource bundles are created by the glib-compile-resources program + * which takes an xml file that describes the bundle, and a set of files that the xml references. These + * are combined into a binary resource bundle. + * + * An example resource description: + * @code + * + * + * + * data/splashscreen.png + * dialog.ui + * menumarkup.xml + * + * + * @endcode + * + * This will create a resource bundle with the following files: + * @code + * /org/gtk/Example/data/splashscreen.png + * /org/gtk/Example/dialog.ui + * /org/gtk/Example/menumarkup.xml + * @endcode + * + * Note that all resources in the process share the same namespace, so use java-style + * path prefixes (like in the above example) to avoid conflicts. + * + * You can then use glib-compile-resources to compile the xml to a binary bundle + * that you can load with Gio::Resource::create_from_file(). However, its more common to use the --generate-source and + * --generate-header arguments to create a source file and header to link directly into your application. + * + * Once a Gio::Resource has been created and registered all the data in it can be accessed globally in the process by + * using API calls like Gio::Resource::open_stream_from_global_resources() to stream the data + * or Gio::Resource::lookup_data_in_global_resources() to get a direct pointer + * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with Gio::File to access + * the resource data. + * + * There are two forms of the generated source, the default version uses the compiler support for constructor + * and destructor functions (where available) to automatically create and register the Gio::Resource on startup + * or library load time. If you pass --manual-register, two functions to register/unregister the resource is instead + * created. This requires an explicit initialization call in your application/library, but it works on all platforms, + * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.) + * + * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries + * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away + * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses + * is for your own resources, and resource data is often used once, during parsing, and then released. + * + * @newin{2,44} + */ +class Resource +{ + _CLASS_OPAQUE_REFCOUNTED(Resource, GResource, NONE, g_resource_ref, g_resource_unref) + _IGNORE(g_resource_ref, g_resource_unref) + +public: + _WRAP_METHOD(static Glib::RefPtr create_from_data(const Glib::RefPtr& data), g_resource_new_from_data, errthrow) + _WRAP_METHOD(static Glib::RefPtr create_from_file(const std::string& filename), g_resource_load, errthrow) + _WRAP_METHOD(Glib::RefPtr open_stream(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_open_stream, errthrow) + _WRAP_METHOD(Glib::RefPtr lookup_data(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow) + +#m4 _CONVERSION(`char**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector enumerate_children(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow) + + /** Looks for a file at the specified @a path in the resource and + * if found returns information about it. + * + * @a lookup_flags controls the behaviour of the lookup. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param[out] size A location to place the length of the contents of the file. + * @param[out] flags A location to place the flags about the file. + * @param lookup_flags A ResourceLookupFlags. + * @throw Gio::ResourceError if the file was not found. + */ + void get_info(const Glib::ustring& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; + _IGNORE(g_resource_get_info) + + /** Looks for a file at the specified @a path in the resource. + * + * @a lookup_flags controls the behaviour of the lookup. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param lookup_flags A ResourceLookupFlags. + * @throw Gio::ResourceError if the file was not found. + */ + void get_info(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; + + // 'register' is a keyword. Can't be the name of a method. + _WRAP_METHOD(void register_global(), g_resources_register) + _WRAP_METHOD(void unregister_global(), g_resources_unregister) + _WRAP_METHOD(static Glib::RefPtr open_stream_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_open_stream, errthrow) + _WRAP_METHOD(static Glib::RefPtr lookup_data_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_lookup_data, errthrow) + _WRAP_METHOD(static std::vector enumerate_children_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow) + + /** Looks for a file at the specified @a path in the set of + * globally registered resources and if found returns information about it. + * + * @a lookup_flags controls the behaviour of the lookup. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param[out] size A location to place the length of the contents of the file. + * @param[out] flags A location to place the flags about the file. + * @param lookup_flags A ResourceLookupFlags. + * @throw Gio::ResourceError if the file was not found. + */ + static void get_info_global(const Glib::ustring& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); + _IGNORE(g_resources_get_info) + + /** Looks for a file at the specified @a path in the set of + * globally registered resources. + * + * @a lookup_flags controls the behaviour of the lookup. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param lookup_flags A ResourceLookupFlags. + * @throw Gio::ResourceError if the file was not found. + */ + static void get_info_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); + + _IGNORE(g_static_resource_init, g_static_resource_fini, g_static_resource_get_resource)dnl//Used only by the glib-compile-resources command +}; + } // namespace Gio diff --git a/glib/src/bytes.hg b/glib/src/bytes.hg index 255c6689..31f1fc9f 100644 --- a/glib/src/bytes.hg +++ b/glib/src/bytes.hg @@ -30,11 +30,9 @@ typedef struct _GBytes GBytes; 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. +//We only wrap it because it is used in the InputStream, OutputStream and Resource APIs. /** A simple refcounted data type representing an immutable byte sequence * from an unspecified origin. diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 58d2a652..3d170668 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -35,6 +35,8 @@ _CONV_ENUM(G,MountUnmountFlags) _CONV_ENUM(G,OutputStreamSpliceFlags) _CONV_ENUM(G,PasswordSave) _CONV_ENUM(G,ResolverRecordType) +_CONV_ENUM(G,ResourceFlags) +_CONV_ENUM(G,ResourceLookupFlags) _CONV_ENUM(G,SettingsBindFlags) _CONV_ENUM(G,SocketClientEvent) _CONV_ENUM(G,SocketFamily) @@ -252,6 +254,9 @@ _CONVERSION(`GProxy*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr&',`GProxyAddress*',__CONVERT_CONST_REFPTR_TO_P) +#Resource +_CONVERSION(`GResource*',`Glib::RefPtr',`Glib::wrap($3)') + #Settings _CONVERSION(`GSettings*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*-const*',`($3).data()') -- cgit v1.2.1 From e40fd4d4ddc30dc5e4b47fffef68930ff85708d5 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 14 Nov 2014 13:21:17 +0100 Subject: Docs: Use doxygen-extra.css * configure.ac: Require mm-common 0.9.7. * .gitignore: Ignore doxygen-extra.css. * docs/reference/Doxyfile.in: Use doxygen-extra.css instead of doxygen.css. --- .gitignore | 1 + configure.ac | 2 +- docs/reference/Doxyfile.in | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d5a8d646..265d489b 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ giommconfig.h /docs/doc-install.pl /docs/doc-postprocess.pl /docs/doxygen.css +/docs/doxygen-extra.css /docs/tagfile-to-devhelp2.xsl /docs/reference/Doxyfile /docs/reference/doxygen.log diff --git a/configure.ac b/configure.ac index 37f61a85..a8ea03ed 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AM_MAINTAINER_MODE AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I ]) -MM_PREREQ([0.9.6]) +MM_PREREQ([0.9.7]) MM_INIT_MODULE([glibmm-2.4]) MM_INIT_MODULE([giomm-2.4]) diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in index 2f5242bb..55f7c97f 100644 --- a/docs/reference/Doxyfile.in +++ b/docs/reference/Doxyfile.in @@ -168,8 +168,8 @@ HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = -HTML_STYLESHEET = "@abs_top_srcdir@/docs/doxygen.css" -HTML_EXTRA_STYLESHEET = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = "$(MMDOCTOOLDIR)/doxygen-extra.css" HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 -- cgit v1.2.1 From 26d5c9611cd1bf8d89fc6fd2984dfd0498fcaf71 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 20 Nov 2014 13:03:06 +0100 Subject: Gio::Resource: Add get_file_exists_nothrow(). Rename some methods * gio/src/resource.[hg|ccg]: Add get_file_exists_nothrow() and get_file_exists_global_nothrow(). Rename the get_info() and get_info_global() methods that only check if a file exists. Use std::string for path names. Bug #739206. --- gio/src/resource.ccg | 20 +++++++++++--- gio/src/resource.hg | 74 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/gio/src/resource.ccg b/gio/src/resource.ccg index cd5eb8c6..4a4b7162 100644 --- a/gio/src/resource.ccg +++ b/gio/src/resource.ccg @@ -20,7 +20,7 @@ namespace Gio { // Hand-coded because we want ResourceFlags& instead of guint32&. -void Resource::get_info(const Glib::ustring& path, gsize& size, +void Resource::get_info(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) const { guint32 file_flags = 0; @@ -34,7 +34,7 @@ void Resource::get_info(const Glib::ustring& path, gsize& size, flags = static_cast(file_flags); } -void Resource::get_info(const Glib::ustring& path, ResourceLookupFlags lookup_flags) const +void Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const { GError* gerror = 0; g_resource_get_info(const_cast(gobj()), path.c_str(), @@ -43,9 +43,15 @@ void Resource::get_info(const Glib::ustring& path, ResourceLookupFlags lookup_fl ::Glib::Error::throw_exception(gerror); } +bool Resource::get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) const +{ + return g_resource_get_info(const_cast(gobj()), path.c_str(), + (GResourceLookupFlags)lookup_flags, 0, 0, 0); +} + // Hand-coded because we want ResourceFlags& instead of guint32&. //static -void Resource::get_info_global(const Glib::ustring& path, gsize& size, +void Resource::get_info_global(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) { guint32 file_flags = 0; @@ -60,7 +66,7 @@ void Resource::get_info_global(const Glib::ustring& path, gsize& size, } //static -void Resource::get_info_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags) +void Resource::get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags) { GError* gerror = 0; g_resources_get_info(path.c_str(), @@ -69,4 +75,10 @@ void Resource::get_info_global(const Glib::ustring& path, ResourceLookupFlags lo ::Glib::Error::throw_exception(gerror); } +//static +bool Resource::get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) +{ + return g_resources_get_info(path.c_str(), (GResourceLookupFlags)lookup_flags, 0, 0, 0); +} + } // namespace Gio diff --git a/gio/src/resource.hg b/gio/src/resource.hg index e01d9cf8..a74c4698 100644 --- a/gio/src/resource.hg +++ b/gio/src/resource.hg @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -137,75 +136,102 @@ class Resource public: _WRAP_METHOD(static Glib::RefPtr create_from_data(const Glib::RefPtr& data), g_resource_new_from_data, errthrow) _WRAP_METHOD(static Glib::RefPtr create_from_file(const std::string& filename), g_resource_load, errthrow) - _WRAP_METHOD(Glib::RefPtr open_stream(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_open_stream, errthrow) - _WRAP_METHOD(Glib::RefPtr lookup_data(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow) + _WRAP_METHOD(Glib::RefPtr open_stream(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_open_stream, errthrow) + _WRAP_METHOD(Glib::RefPtr lookup_data(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow) -#m4 _CONVERSION(`char**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') - _WRAP_METHOD(std::vector enumerate_children(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow) +#m4 _CONVERSION(`char**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector enumerate_children(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow) /** Looks for a file at the specified @a path in the resource and * if found returns information about it. - * + * * @a lookup_flags controls the behaviour of the lookup. - * + * * @newin{2,44} - * + * * @param path A pathname inside the resource. * @param[out] size A location to place the length of the contents of the file. * @param[out] flags A location to place the flags about the file. * @param lookup_flags A ResourceLookupFlags. * @throw Gio::ResourceError if the file was not found. */ - void get_info(const Glib::ustring& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; + void get_info(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; _IGNORE(g_resource_get_info) /** Looks for a file at the specified @a path in the resource. - * + * * @a lookup_flags controls the behaviour of the lookup. - * + * * @newin{2,44} - * + * * @param path A pathname inside the resource. * @param lookup_flags A ResourceLookupFlags. * @throw Gio::ResourceError if the file was not found. */ - void get_info(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; + void get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; + + /** Looks for a file at the specified @a path in the resource. + * + * @a lookup_flags controls the behaviour of the lookup. + * This method returns a bool instead of throwing in exception in case of errors. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param lookup_flags A ResourceLookupFlags. + * @return true if the file was found, false if there were errors. + */ + bool get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; // 'register' is a keyword. Can't be the name of a method. _WRAP_METHOD(void register_global(), g_resources_register) _WRAP_METHOD(void unregister_global(), g_resources_unregister) - _WRAP_METHOD(static Glib::RefPtr open_stream_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_open_stream, errthrow) - _WRAP_METHOD(static Glib::RefPtr lookup_data_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_lookup_data, errthrow) - _WRAP_METHOD(static std::vector enumerate_children_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow) + _WRAP_METHOD(static Glib::RefPtr open_stream_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_open_stream, errthrow) + _WRAP_METHOD(static Glib::RefPtr lookup_data_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_lookup_data, errthrow) + _WRAP_METHOD(static std::vector enumerate_children_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow) /** Looks for a file at the specified @a path in the set of * globally registered resources and if found returns information about it. - * + * * @a lookup_flags controls the behaviour of the lookup. - * + * * @newin{2,44} - * + * * @param path A pathname inside the resource. * @param[out] size A location to place the length of the contents of the file. * @param[out] flags A location to place the flags about the file. * @param lookup_flags A ResourceLookupFlags. * @throw Gio::ResourceError if the file was not found. */ - static void get_info_global(const Glib::ustring& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); + static void get_info_global(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); _IGNORE(g_resources_get_info) /** Looks for a file at the specified @a path in the set of * globally registered resources. - * + * * @a lookup_flags controls the behaviour of the lookup. - * + * * @newin{2,44} - * + * * @param path A pathname inside the resource. * @param lookup_flags A ResourceLookupFlags. * @throw Gio::ResourceError if the file was not found. */ - static void get_info_global(const Glib::ustring& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); + static void get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); + + /** Looks for a file at the specified @a path in the set of + * globally registered resources. + * + * @a lookup_flags controls the behaviour of the lookup. + * This method returns a bool instead of throwing in exception in case of errors. + * + * @newin{2,44} + * + * @param path A pathname inside the resource. + * @param lookup_flags A ResourceLookupFlags. + * @return true if the file was found, false if there were errors. + */ + static bool get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE); _IGNORE(g_static_resource_init, g_static_resource_fini, g_static_resource_get_resource)dnl//Used only by the glib-compile-resources command }; -- cgit v1.2.1 From 983dd287da4b00baedbd04ce0f777c043d93f5b0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 20 Nov 2014 16:54:58 +0100 Subject: Add Glib::Binding * .gitignore: Ignore binding.[h|cc]. * glib/glibmm/objectbase.h: Add a comment. * glib/src/filelist.am: Add glib_signals.defs and binding.hg. * glib/src/glib.defs: Add glib_signals.defs. * glib/glibmm.h: Add binding.h. * tools/extra_defs_gen/generate_defs_glib.cc: Add get_defs(G_TYPE_BINDING). * tools/m4/convert_glib.m4: Add conversion for BindingFlags. * tools/generate_wrap_init.pl.in: Define GLIBMM_INCLUDED_FROM_WRAP_INIT_CC. * glib/src/binding.[hg|ccg]: New files with enum BindingFlags and class Binding. * glib/src/glib_signals.defs: New file with info about GBinding's properties. Bug #738663. --- .gitignore | 2 + glib/glibmm.h | 8 +- glib/glibmm/objectbase.h | 5 +- glib/src/binding.ccg | 148 ++++++++++ glib/src/binding.hg | 423 +++++++++++++++++++++++++++++ glib/src/filelist.am | 2 + glib/src/glib.defs | 1 + glib/src/glib_signals.defs | 78 ++++++ tools/extra_defs_gen/generate_defs_glib.cc | 5 +- tools/generate_wrap_init.pl.in | 3 +- tools/m4/convert_glib.m4 | 1 + 11 files changed, 668 insertions(+), 8 deletions(-) create mode 100644 glib/src/binding.ccg create mode 100644 glib/src/binding.hg create mode 100644 glib/src/glib_signals.defs diff --git a/.gitignore b/.gitignore index 265d489b..dc64b965 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,8 @@ giommconfig.h /glib/glibmm-*.pc /glib/glibmm/balancedtree.cc /glib/glibmm/balancedtree.h +/glib/glibmm/binding.cc +/glib/glibmm/binding.h /glib/glibmm/bytearray.cc /glib/glibmm/bytearray.h /glib/glibmm/bytes.cc diff --git a/glib/glibmm.h b/glib/glibmm.h index 296db7b7..fb409f81 100644 --- a/glib/glibmm.h +++ b/glib/glibmm.h @@ -82,8 +82,8 @@ #include //#include //This must be included by the application, after system headers such as . -//Include this first because we need it to be the first thing to include , -//so we can do an undef trick to still use deprecated API in the header: +//Include this first because we need it to be the first thing to include , +//so we can do an undef trick to still use deprecated API in the header: #include #include @@ -91,6 +91,10 @@ #include #include #include +#ifndef GLIBMM_INCLUDED_FROM_WRAP_INIT_CC +// wrap_init.cc includes this file after it has cleared G_GNUC_CONST. +#include +#endif #include #include #include diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index 9c4c4e8e..a3afd834 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -1,4 +1,3 @@ -// -*- c++ -*- #ifndef _GLIBMM_OBJECTBASE_H #define _GLIBMM_OBJECTBASE_H @@ -144,7 +143,9 @@ public: */ void thaw_notify(); - //TODO: Why are these virtual? + // Why are these virtual? + // Don't know why they were originally made virtual, but it came in handy when + // I wrapped GBinding in Glib::Binding. /Kjell /** Increment the reference count for this object. * You should never need to do this manually - use the object via a RefPtr instead. */ diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg new file mode 100644 index 00000000..c9e839b7 --- /dev/null +++ b/glib/src/binding.ccg @@ -0,0 +1,148 @@ +/* Copyright (C) 2014 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, see . + */ + +#include +#include + +namespace +{ +struct BindingTransformSlots +{ + BindingTransformSlots( + const Glib::Binding::BindingTransformSlot& transform_to, + const Glib::Binding::BindingTransformSlot& transform_from) + : + from_source_to_target(transform_to), from_target_to_source(transform_from) + {} + + Glib::Binding::BindingTransformSlot from_source_to_target; + Glib::Binding::BindingTransformSlot from_target_to_source; +}; + +gboolean Binding_transform_callback_common(GBinding* binding, + const GValue* from_value, GValue* to_value, + Glib::Binding::BindingTransformSlot& the_slot) +{ + bool result = false; + try + { + Glib::RefPtr cpp_binding = Glib::wrap(binding, true); + result = the_slot(cpp_binding, from_value, to_value); + } + catch (...) + { + Glib::exception_handlers_invoke(); + } + return result; +} + +gboolean Binding_transform_to_callback(GBinding* binding, + const GValue* from_value, GValue* to_value, gpointer user_data) +{ + Glib::Binding::BindingTransformSlot& the_slot = + static_cast(user_data)->from_source_to_target; + + return Binding_transform_callback_common(binding, from_value, to_value, the_slot); +} + +gboolean Binding_transform_from_callback(GBinding* binding, + const GValue* from_value, GValue* to_value, gpointer user_data) +{ + Glib::Binding::BindingTransformSlot& the_slot = + static_cast(user_data)->from_target_to_source; + + return Binding_transform_callback_common(binding, from_value, to_value, the_slot); +} + +void Binding_transform_callback_destroy(gpointer user_data) +{ + delete static_cast(user_data); +} + +} // anonymous namespace + +namespace Glib +{ +//static +Glib::RefPtr Binding::bind_property_value( + const PropertyProxy_Base& source_property, + const PropertyProxy_Base& target_property, + BindingFlags flags, + const BindingTransformSlot& transform_to, + const BindingTransformSlot& transform_from) +{ + GBinding* binding = 0; + if (transform_to.empty() && transform_from.empty()) + { + // No user-supplied transformations. + binding = g_object_bind_property( + source_property.get_object()->gobj(), source_property.get_name(), + target_property.get_object()->gobj(), target_property.get_name(), + (GBindingFlags)flags); + } + else + { + // Create copies of the slots. A pointer to this will be passed + // through the callback's data parameter. It will be deleted + // when Binding_transform_callback_destroy() is called. + BindingTransformSlots* slots_copy = new BindingTransformSlots(transform_to, transform_from); + + binding = g_object_bind_property_full( + source_property.get_object()->gobj(), source_property.get_name(), + target_property.get_object()->gobj(), target_property.get_name(), + (GBindingFlags)flags, + transform_to.empty() ? 0 : &Binding_transform_to_callback, + transform_from.empty() ? 0 : &Binding_transform_from_callback, + slots_copy, &Binding_transform_callback_destroy); + } + + if (!binding) + return Glib::RefPtr(); + + // Take an extra ref. GBinding uses one ref itself, and drops it if + // either the source object or the target object is finalized. + // The GBinding object must not be destroyed while there are RefPtrs around. + g_object_ref(binding); + return Glib::RefPtr(new Binding(binding)); +} + +void Binding::unbind() +{ + // Call g_binding_unbind() only once. It always calls g_object_unref(). + if (g_binding_get_source(gobj())) + g_binding_unbind(gobj()); +} + +// Override unreference() from ObjectBase. +// +// Why is this necessary? Because GBinding is an unusual kind of GObject. +// It calls g_object_unref() itself, if either the source object or the +// target object is finalized, almost like g_binding_unbind(). +// But the GBinding object shall be destroyed when and only when the last +// reference from a Glib::RefPtr is dropped. +void Binding::unreference() const +{ + GBinding* const binding = const_cast(gobj()); + + // If the last Glib::RefPtr is being deleted, and the binding has not been unbound, + // then drop the extra reference that was added by bind_property_value(). + if (gobject_->ref_count == 2 && g_binding_get_source(binding)) + g_object_unref(binding); + + Object::unreference(); +} + +} // namespace Glib diff --git a/glib/src/binding.hg b/glib/src/binding.hg new file mode 100644 index 00000000..f7760376 --- /dev/null +++ b/glib/src/binding.hg @@ -0,0 +1,423 @@ +/* Copyright (C) 2014 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, see . + */ + +#include +#include +#include +#include + +_DEFS(glibmm,glib) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Glib +{ +_WRAP_ENUM(BindingFlags, GBindingFlags) + +/** Bind two object properties. + * + * Glib::Binding is the representation of a binding between a property on a + * Glib::ObjectBase instance (or source) and another property on another Glib::ObjectBase + * instance (or target). Whenever the source property changes, the same + * value is applied to the target property; for instance, the following binding: + * + * @code + * Glib::Binding::bind_property(object1->property_a(), object2->property_b()); + * @endcode + * + * will cause property_b() of @a object2 to be updated + * every time the value of property_a() of @a object1 changes. + * + * It is possible to create a bidirectional binding between two properties + * of two Glib::ObjectBase instances, so that if either property changes, the + * other is updated as well, for instance: + * + * @code + * Glib::Binding::bind_property(object1->property_a(), object2->property_b(), + * Glib::BINDING_BIDIRECTIONAL); + * @endcode + * + * will keep the two properties in sync. + * + * It is also possible to set a custom transformation function (in both + * directions, in case of a bidirectional binding) to apply a custom + * transformation from the source value to the target value before + * applying it; for instance, the following binding: + * + * @code + * bool celsius_to_fahrenheit(const Glib::RefPtr& binding, + * const double& celsius, double& fahrenheit); + * bool fahrenheit_to_celsius(const Glib::RefPtr& binding, + * const double& fahrenheit, double& celsius); + * Glib::Binding::bind_property(adjustment1->property_value(), + * adjustment2->property_value(), Glib::BINDING_BIDIRECTIONAL, + * sigc::ptr_fun(celsius_to_fahrenheit), sigc::ptr_fun(fahrenheit_to_celsius)); + * @endcode + * + * will keep property_value() of the two adjustments in sync; the + * celsius_to_fahrenheit() function will be called whenever + * property_value() of @a adjustment1 changes and will transform the current value + * of the property before applying it to property_value() of @a adjustment2. + * + * Vice versa, the fahrenheit_to_celsius() function will be called whenever + * property_value() of @a adjustment2 changes, and will transform the + * current value of the property before applying it to property_value() + * of @a adjustment1. + * + * Note that Glib::Binding does not resolve cycles by itself; a cycle like + * + * @code + * object1->property_A() -> object2->property_B() + * object2->property_B() -> object3->property_C() + * object3->property_C() -> object1->property_A() + * @endcode + * + * might lead to an infinite loop. The loop, in this particular case, + * can be avoided if the objects emit the GObject::notify signal only + * if the value has effectively been changed. A binding is implemented + * using the GObject::notify signal, so it is susceptible to all the + * various ways of blocking a signal emission, like Glib::SignalProxyNormal::emission_stop() + * or g_signal_handler_block(). + * + * A binding will be severed, and the resources it allocates freed, whenever + * either one of the Glib::ObjectBase instances it refers to is deleted, + * when unbind() is called, or when the Glib::Binding instance loses + * its last reference. + * + * @newin{2,44} + */ +class Binding : public Glib::Object +{ + _CLASS_GOBJECT(Binding, GBinding, G_BINDING, Glib::Object, GObject) + +public: + /** For instance,
+ * bool on_transform_to(const Glib::RefPtr& binding, const GValue* from_value, GValue* to_value); + * + * @return true if the transformation was successful, and false otherwise. + */ + typedef sigc::slot&, const GValue*, GValue*> BindingTransformSlot; + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set the transformation functions to be used by the binding. + * + * If @a flags contains Glib::BINDING_BIDIRECTIONAL then the binding will be mutual: + * if @a target_property changes then the @a source_property + * will be updated as well. The @a transform_from function is only used in case + * of bidirectional bindings, otherwise it will be ignored. + * + * The binding will automatically be removed when either the source or the + * target instance is deleted. To remove the binding without affecting the + * source and the target you can call unbind() on the returned Binding instance. + * + * A Glib::ObjectBase instance can have multiple bindings. + * + * If you supply transformation functions, it is usually easier to use one of the + * bind_property() overloads, to avoid the use of GValue in the transformation functions. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @param transform_from The transformation function from the target to the source, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @newin{2,44} + */ + static Glib::RefPtr bind_property_value( + const PropertyProxy_Base& source_property, + const PropertyProxy_Base& target_property, + BindingFlags flags = BINDING_DEFAULT, + const BindingTransformSlot& transform_to = BindingTransformSlot(), + const BindingTransformSlot& transform_from = BindingTransformSlot()); + + _IGNORE(g_object_bind_property, g_object_bind_property_full, g_object_bind_property_with_closures) + + /** Creates a binding between @a source_property and @a target_property. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + static Glib::RefPtr bind_property( + const PropertyProxy_Base& source_property, + const PropertyProxy_Base& target_property, + BindingFlags flags = BINDING_DEFAULT) + { + return bind_property_value(source_property, target_property, flags); + } + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set a transformation function to be used by the binding. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @tparam T_source Type of the source property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_target Type of the target property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_functor_to Type of functor that translates from the source to the target. + * Must be convertible to
+ * sigc::slot&, const T_source&, T_target&>. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + template + static Glib::RefPtr bind_property( + const PropertyProxy& source_property, + const PropertyProxy& target_property, + BindingFlags flags, + const T_functor_to& transform_to) + { + sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + + return bind_property_value(source_property, target_property, flags, + slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + } + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set a transformation function to be used by the binding. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @tparam T_source Type of the source property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_target Type of the target property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_functor_to Type of functor that translates from the source to the target. + * Must be convertible to
+ * sigc::slot&, const T_source&, T_target&>. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + template + static Glib::RefPtr bind_property( + const PropertyProxy& source_property, + const PropertyProxy_WriteOnly& target_property, + BindingFlags flags, + const T_functor_to& transform_to) + { + sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + + return bind_property_value(source_property, target_property, flags, + slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + } + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set a transformation function to be used by the binding. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @tparam T_source Type of the source property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_target Type of the target property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_functor_to Type of functor that translates from the source to the target. + * Must be convertible to
+ * sigc::slot&, const T_source&, T_target&>. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + template + static Glib::RefPtr bind_property( + const PropertyProxy_ReadOnly& source_property, + const PropertyProxy& target_property, + BindingFlags flags, + const T_functor_to& transform_to) + { + sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + + return bind_property_value(source_property, target_property, flags, + slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + } + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set a transformation function to be used by the binding. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @tparam T_source Type of the source property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_target Type of the target property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_functor_to Type of functor that translates from the source to the target. + * Must be convertible to
+ * sigc::slot&, const T_source&, T_target&>. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + template + static Glib::RefPtr bind_property( + const PropertyProxy_ReadOnly& source_property, + const PropertyProxy_WriteOnly& target_property, + BindingFlags flags, + const T_functor_to& transform_to) + { + sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + + return bind_property_value(source_property, target_property, flags, + slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + } + + /** Creates a binding between @a source_property and @a target_property, + * allowing you to set the transformation functions to be used by the binding. + * + * @param source_property The source property to bind. + * @param target_property The target property to bind. + * @param flags Flags to pass to Binding. + * @param transform_to The transformation function from the source to the target, + * or an empty slot to use the default. + * @param transform_from The transformation function from the target to the source, + * or an empty slot to use the default. + * @return The Binding instance representing the binding between the two + * Glib::ObjectBase instances, or 0 in case of error. + * + * @tparam T_source Type of the source property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_target Type of the target property. Must be a type that can be + * stored in a Glib::Value object. + * @tparam T_functor_to Type of functor that translates from the source to the target. + * Must be convertible to
+ * sigc::slot&, const T_source&, T_target&>. + * @tparam T_functor_from Type of functor that translates from the target to the source. + * Must be convertible to
+ * sigc::slot&, const T_target&, T_source&>. + * + * @see bind_property_value() + * + * @newin{2,44} + */ + template + static Glib::RefPtr bind_property( + const PropertyProxy& source_property, + const PropertyProxy& target_property, + BindingFlags flags, + const T_functor_to& transform_to, + const T_functor_from& transform_from) + { + sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + sigc::slot&, const T_target&, T_source&> slot_transform_from = transform_from; + + return bind_property_value(source_property, target_property, flags, + slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to), + slot_transform_from.empty() ? BindingTransformSlot() : TransformProp(slot_transform_from)); + } + + _WRAP_METHOD(Glib::RefPtr get_source(), g_binding_get_source, refreturn) + _WRAP_METHOD(Glib::RefPtr get_source() const, g_binding_get_source, refreturn, constversion) + _WRAP_METHOD(Glib::ustring get_source_property() const, g_binding_get_source_property) + _WRAP_METHOD(Glib::RefPtr get_target(), g_binding_get_target, refreturn) + _WRAP_METHOD(Glib::RefPtr get_target() const, g_binding_get_target, refreturn, constversion) + _WRAP_METHOD(Glib::ustring get_target_property() const, g_binding_get_target_property) + _WRAP_METHOD(BindingFlags get_flags() const, g_binding_get_flags) + + /** Explicitly releases the binding between the source and the target + * property expressed by this Binding instance. + * + * The binding is also released if either the source object or the target + * object is deleted, or this Binding instance loses its last reference, + * i.e. there is no more Glib::RefPtr that holds a pointer to it. + * + * @newin{2,44} + */ + void unbind(); + _IGNORE(g_binding_unbind) + + _WRAP_PROPERTY("flags", Glib::BindingFlags) + _WRAP_PROPERTY("source", Glib::RefPtr) + _WRAP_PROPERTY("source-property", Glib::ustring) + _WRAP_PROPERTY("target", Glib::RefPtr) + _WRAP_PROPERTY("target-property", Glib::ustring) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + /** Decrement the reference count for this object. + * You should never need to do this manually - use the object via a RefPtr instead. + */ + virtual void unreference() const; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +private: + // The functor TransformProp can be implicitly converted to a BindingTransformSlot + // and used in a call to bind_property_value(). + template + class TransformProp : public sigc::functor_base + { + public: + typedef bool result_type; + typedef sigc::slot&, const T_from&, T_to&> TypedBindingTransformSlot; + + TransformProp(const TypedBindingTransformSlot& slot) : typed_transform(slot) {} + + bool operator()(const Glib::RefPtr& binding, const GValue* from_value, GValue* to_value) + { + Glib::Value from_glib_value; + from_glib_value.init(from_value); + Glib::Value to_glib_value; + to_glib_value.init(to_value); + T_to to = to_glib_value.get(); + + const bool result = typed_transform(binding, from_glib_value.get(), to); + to_glib_value.set(to); + g_value_copy(to_glib_value.gobj(), to_value); + return result; + } + + private: + TypedBindingTransformSlot typed_transform; + }; +}; + +} // namespace Glib diff --git a/glib/src/filelist.am b/glib/src/filelist.am index d240146d..c66e01b0 100644 --- a/glib/src/filelist.am +++ b/glib/src/filelist.am @@ -6,6 +6,7 @@ glibmm_files_defs = \ glib_deprecated_enums.defs \ glib_functions.defs \ glib_extra_objects.defs \ + glib_signals.defs \ gmodule_enums.defs \ gmodule_functions.defs \ gobject.defs \ @@ -16,6 +17,7 @@ glibmm_files_defs = \ glibmm_files_any_hg = \ balancedtree.hg \ + binding.hg \ bytes.hg \ bytearray.hg \ checksum.hg \ diff --git a/glib/src/glib.defs b/glib/src/glib.defs index 18231910..e106d6b7 100644 --- a/glib/src/glib.defs +++ b/glib/src/glib.defs @@ -3,6 +3,7 @@ (include glib_enums.defs) (include glib_deprecated_enums.defs) (include glib_extra_objects.defs) +(include glib_signals.defs) (include gobject_enums.defs) (include gobject_functions.defs) (include gmodule_functions.defs) diff --git a/glib/src/glib_signals.defs b/glib/src/glib_signals.defs new file mode 100644 index 00000000..d65d39ed --- /dev/null +++ b/glib/src/glib_signals.defs @@ -0,0 +1,78 @@ +;; From GBinding + +(define-property source + (of-object "GBinding") + (prop-type "GParamObject") + (docs "The source of the binding") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property target + (of-object "GBinding") + (prop-type "GParamObject") + (docs "The target of the binding") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property source-property + (of-object "GBinding") + (prop-type "GParamString") + (docs "The property on the source to bind") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property target-property + (of-object "GBinding") + (prop-type "GParamString") + (docs "The property on the target to bind") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property flags + (of-object "GBinding") + (prop-type "GParamFlags") + (docs "The binding flags") + (readable #t) + (writable #t) + (construct-only #t) +) + +;; GBytes is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GChecksum is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GDate is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GDateTime is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GIOChannel is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GKeyFile is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GMainContext is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GMainLoop is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GMatchInfo is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GRegex is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GSource is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GThread is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GVariant is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GVariantBuilder is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GVariantDict is neither a GObject nor a GInterface. Not checked for signals and properties. + + diff --git a/tools/extra_defs_gen/generate_defs_glib.cc b/tools/extra_defs_gen/generate_defs_glib.cc index 2ead0a0e..1e32edba 100644 --- a/tools/extra_defs_gen/generate_defs_glib.cc +++ b/tools/extra_defs_gen/generate_defs_glib.cc @@ -1,5 +1,3 @@ -/* $Id$ */ - /* generate_defs_gtk.cc * * Copyright (C) 2001 The Free Software Foundation @@ -27,7 +25,8 @@ int main() // g_type_init() is deprecated as of 2.36. // g_type_init(); - std::cout << get_defs( G_TYPE_BYTES ) + std::cout << get_defs( G_TYPE_BINDING ) + << get_defs( G_TYPE_BYTES ) << get_defs( G_TYPE_CHECKSUM ) << get_defs( G_TYPE_DATE ) << get_defs( G_TYPE_DATE_TIME ) diff --git a/tools/generate_wrap_init.pl.in b/tools/generate_wrap_init.pl.in index 59cd6540..1381dfe3 100644 --- a/tools/generate_wrap_init.pl.in +++ b/tools/generate_wrap_init.pl.in @@ -192,7 +192,7 @@ while ($ARGV[0]) elsif (/\b_NO_WRAP_INIT_REGISTRATION\b/) { $exclude_from_wrap_init{$filename_header} = 1; - } + } } shift @ARGV; @@ -205,6 +205,7 @@ while ($ARGV[0]) print << "EOF"; // Generated by generate_wrap_init.pl -- DO NOT MODIFY! +#define GLIBMM_INCLUDED_FROM_WRAP_INIT_CC #include // Disable the 'const' function attribute of the get_type() functions. diff --git a/tools/m4/convert_glib.m4 b/tools/m4/convert_glib.m4 index f7e768cf..0c70cdf2 100644 --- a/tools/m4/convert_glib.m4 +++ b/tools/m4/convert_glib.m4 @@ -60,6 +60,7 @@ dnl dnl # These are for fixmegtkconst _CONVERSION(`const guchar*',`guchar*',`const_cast($3)',`$3') +_CONV_GLIB_ENUM(BindingFlags) _CONV_GLIB_ENUM(IOCondition) _CONV_GLIB_ENUM(IOFlags) _CONV_GLIB_ENUM(IOStatus) -- cgit v1.2.1 From 491b05f2a8e503109400e692aee0f5f7da788284 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 21 Nov 2014 14:09:44 +0100 Subject: gmmproc: _WRAP_GERROR: Add documentation to the generated enum Code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * tools/pm/Output.pm: output_wrap_gerror(): Get the enum documentation from the docs.xml file. * tools/m4/gerror.m4: Include the documentation before 'enum Code' in the generated code. _WRAP_GERROR was overlooked when José Alburquerque implemented the documentation of other enums (bug 544694). --- tools/m4/gerror.m4 | 7 ++++--- tools/pm/Output.pm | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/m4/gerror.m4 b/tools/m4/gerror.m4 index f18109f8..a8b8437e 100644 --- a/tools/m4/gerror.m4 +++ b/tools/m4/gerror.m4 @@ -1,7 +1,6 @@ -dnl $Id$ - dnl -dnl _GERROR(PixbufError,GdkPixbufError,GDK_PIXBUF_ERROR,`',[NO_GTYPE]) +dnl _GERROR(PixbufError,GdkPixbufError,GDK_PIXBUF_ERROR,`',[NO_GTYPE], `') +dnl $1 $2 $3 $4 $5 $6 dnl m4_define(`_GERROR',`dnl @@ -16,6 +15,8 @@ _POP() class __CPPNAME__ : public Glib::Error { public: + $6 + */ enum Code { $4 diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 22af9ef8..05e0fa16 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -759,12 +759,23 @@ sub output_wrap_gerror($$$$$$$) my $no_gtype = ""; my $elements = $objEnum->build_element_list(\@flags, \$no_gtype, " "); - my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',%s)dnl\n", + # Get the enum documentation from the parsed docs. + my $enum_docs = + DocsParser::lookup_enum_documentation("$c_enum", "Code", \@flags); + + # Make sure indentation of enum documentation is correct. + $enum_docs =~ s/\n\s*\*/\n \*/g; + + # Prevent Doxygen from auto-linking to a class called Error. + $enum_docs =~ s/([^%])(Error code)/$1%$2/g; + + my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',%s,\`%s\')dnl\n", $cpp_type, $c_enum, $domain, $elements, - $no_gtype + $no_gtype, + $enum_docs ); $self->append($str); -- cgit v1.2.1 From e7dea6d41dffe9f9f77c3e1a9a68ce66a4555d8f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 21 Nov 2014 14:42:23 +0100 Subject: Glib::Checksum::ChecksumType: Remove erroneous documentation * glib/src/checksum.hg: Remove the erroneous '@class ChecksumType' comment. Should have been '@enum ChecksumType'. It's unnecessary now that gmmproc generates enum documentation. --- glib/src/checksum.hg | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/glib/src/checksum.hg b/glib/src/checksum.hg index ec1351fa..84a7ba0d 100644 --- a/glib/src/checksum.hg +++ b/glib/src/checksum.hg @@ -41,22 +41,8 @@ class Checksum { _CLASS_OPAQUE_COPYABLE(Checksum, GChecksum, NONE, g_checksum_copy, g_checksum_free) _IGNORE(g_checksum_copy, g_checksum_free) -public: - /** - * @class ChecksumType: - * @a CHECKSUM_MD5: Use the MD5 hashing algorithm - * @a CHECKSUM_SHA1: Use the SHA-1 hashing algorithm - * @a CHECKSUM_SHA256: Use the SHA-256 hashing algorithm - * - * The hashing algorithm to be used by Checksum when performing the - * digest of some data. - * - * Note that the ChecksumType enumeration may be extended at a later - * date to include new hashing algorithm types. - * - * @newin{2,16} - */ +public: _WRAP_ENUM(ChecksumType, GChecksumType, NO_GTYPE) #m4 _CONVERSION(`ChecksumType', `GChecksumType', `(($2)$3)') -- cgit v1.2.1 From e241f1593580314ea7215769eea2a0dc0b83feea Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 1 Dec 2014 10:20:19 +0100 Subject: gmmproc: Change messages that MS Visual Studio can misunderstand * tools/gmmproc.in: * tools/pm/DocsParser.pm: * tools/pm/Output.pm: Change messages that MS Visual Studio can misunderstand. https://mail.gnome.org/archives/gtkmm-list/2014-November/msg00044.html --- tools/gmmproc.in | 11 ++++++++--- tools/pm/DocsParser.pm | 5 +++-- tools/pm/Output.pm | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/gmmproc.in b/tools/gmmproc.in index 8b576539..e9295031 100644 --- a/tools/gmmproc.in +++ b/tools/gmmproc.in @@ -123,22 +123,27 @@ if ($main::unwrapped) # Don't take non-readable construct-only properties into account. my @properties = grep { $$_{entity_type} eq 'property' and ( $$_{readable} or not $$_{construct_only} ) } @unwrapped; + # Don't print a name of any kind between the first and second colon on a line, + # if there is any chance that "error" is (part of) the name. + # MS Visual Studio will misunderstand. + # See https://mail.gnome.org/archives/gtkmm-list/2014-November/msg00044.html + local $, = "\ngmmproc: "; local $\ = "\n"; if (@methods) { - print STDERR ("gmmproc: $main::source: Unwrapped functions:", + print STDERR ("gmmproc, $main::source: Unwrapped functions:", map($$_{c_name}, @methods)); } if (@properties) { - print STDERR ("gmmproc: $main::source: Unwrapped properties:", + print STDERR ("gmmproc, $main::source: Unwrapped properties:", map($$_{class} . '::' . $$_{name}, @properties)); } if (@signals) { - print STDERR ("gmmproc: $main::source: Unwrapped signals:", + print STDERR ("gmmproc, $main::source: Unwrapped signals:", map($$_{class} . '::' . $$_{name}, @signals)); } } diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index c771fc3c..23af3a63 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -375,7 +375,8 @@ sub remove_example_code($$) ($$text =~ s".*?"\n[C example ellipted]"sg); $example_removals += ($$text =~ s"\|\[.*?]\|"\n[C example ellipted]"sg); - print STDERR "gmmproc: $main::source: $obj_name: Example code discarded.\n" + # See "MS Visual Studio" comment in gmmproc.in. + print STDERR "gmmproc, $main::source, $obj_name: Example code discarded.\n" if ($example_removals); } @@ -691,7 +692,7 @@ sub lookup_object_of_method($$) } else { - print "DocsParser.pm:lookup_object_of_method(): Warning: GtkDefs::lookup_object() failed for object name=" . $object . ", function name=" . $name . "\n"; + print "DocsParser.pm: lookup_object_of_method(): Warning: GtkDefs::lookup_object() failed for object name=" . $object . ", function name=" . $name . "\n"; print " This may be a missing define-object in a *.defs file.\n" } } diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 05e0fa16..3eff0977 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -72,15 +72,16 @@ sub output_wrap_failed($$$) { my ($self, $cname, $error) = @_; + # See "MS Visual Studio" comment in gmmproc.in. my $str = sprintf("//gtkmmproc error: %s : %s", $cname, $error); - print STDERR "Output.pm: $main::source: $cname : $error\n"; + print STDERR "Output.pm, $main::source, $cname : $error\n"; $self->append($str); } sub error { my $format=shift @_; - printf STDERR "Output.pm: $main::source: $format",@_; + printf STDERR "Output.pm, $main::source: $format",@_; } sub ifdef($$) -- cgit v1.2.1 From 2a21d3c3d15e55bd541ce8c4b69f04a022da2340 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 1 Dec 2014 18:36:23 +0100 Subject: gmmproc: Tidy up the generation of enum docs * tools/m4/gerror.m4: Add "/** " at the start of the documentation, like enum.m4 does. * tools/pm/DocsParser.pm: lookup_enum_documentation(): Don't add "/** " which is deleted by the caller. Add "\n * " with the right indentation. * tools/pm/Output.pm: output_wrap_enum(), output_wrap_enum_docs_only(), output_wrap_gerror(): Don't delete "/** ". Don't change indentation. --- tools/m4/gerror.m4 | 2 +- tools/pm/DocsParser.pm | 10 +++++----- tools/pm/Output.pm | 25 ++++--------------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/tools/m4/gerror.m4 b/tools/m4/gerror.m4 index a8b8437e..e48aef6e 100644 --- a/tools/m4/gerror.m4 +++ b/tools/m4/gerror.m4 @@ -15,7 +15,7 @@ _POP() class __CPPNAME__ : public Glib::Error { public: - $6 + /** $6 */ enum Code { diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 23af3a63..1997945e 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -233,9 +233,9 @@ sub parse_on_cdata($$) } } -sub lookup_enum_documentation($$$) +sub lookup_enum_documentation($$$$) { - my ($c_enum_name, $cpp_enum_name, $ref_flags) = @_; + my ($c_enum_name, $cpp_enum_name, $indent, $ref_flags) = @_; my @subst_in = []; my @subst_out = []; @@ -305,9 +305,9 @@ sub lookup_enum_documentation($$$) remove_example_code($c_enum_name, \$docs); - # Convert to Doxygen-style comment. - $docs =~ s/\n/\n \* /g; - $docs = "\/\*\* " . $docs; + # Add indentation and an asterisk on all lines except the first. + # $docs does not contain leading "/**" and trailing "*/". + $docs =~ s/\n/\n${indent}\* /g; return $docs; } diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 3eff0977..de13f5ea 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -676,14 +676,7 @@ sub output_wrap_enum($$$$$$$) # Get the enum documentation from the parsed docs. my $enum_docs = - DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", \@flags); - - # Remove initial Doxygen comment block start ('/**') from the enum docs - # to merge the passed in Doxygen comment block. - $enum_docs =~ s/\/\*\*\s+//g; - - # Make sure indentation of passed in comment is correct. - $comment =~ s/\n\s*\*/\n */g; + DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", " ", \@flags); # Merge the passed in comment to the existing enum documentation. $comment = $comment . "\n * " . $enum_docs; @@ -707,7 +700,7 @@ sub output_wrap_enum_docs_only($$$$$$$) # Get the existing enum description from the parsed docs. my $enum_docs = - DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", \@flags); + DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", " ", \@flags); if($enum_docs eq "") { @@ -718,15 +711,8 @@ sub output_wrap_enum_docs_only($$$$$$$) # Include the enum docs in the module's enum docs group. $enum_docs .= "\n * \@ingroup ${module_canonical}Enums\n"; - # Remove initial Doxygen comment block start ('/**') from the enum docs - # to merge the passed in Doxygen comment block. - $enum_docs =~ s/\/\*\*\s+//g; - # Merge the passed in comment to the existing enum documentation. - $comment = "\/\*\* " . $comment . "\n * " . $enum_docs . "\n */\n"; - - # Make sure indentation of passed in comment is correct. - $comment =~ s/\n\s*\*/\n */g; + $comment = "/** " . $comment . "\n * " . $enum_docs . "\n */\n"; $self->append($comment); } @@ -762,10 +748,7 @@ sub output_wrap_gerror($$$$$$$) # Get the enum documentation from the parsed docs. my $enum_docs = - DocsParser::lookup_enum_documentation("$c_enum", "Code", \@flags); - - # Make sure indentation of enum documentation is correct. - $enum_docs =~ s/\n\s*\*/\n \*/g; + DocsParser::lookup_enum_documentation("$c_enum", "Code", " ", \@flags); # Prevent Doxygen from auto-linking to a class called Error. $enum_docs =~ s/([^%])(Error code)/$1%$2/g; -- cgit v1.2.1 From c7fd894c8d2c39e4b11a7008564b9a7ef14860fa Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 3 Dec 2014 11:10:14 +0100 Subject: Regenerate gio .defs. --- gio/src/gio_enums.defs | 16 ++++++++----- gio/src/gio_methods.defs | 62 +++++++++++++++++++++++++++++++++++++++++++++++- gio/src/gio_signals.defs | 2 +- 3 files changed, 72 insertions(+), 8 deletions(-) diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs index 3e08b5fc..141c1b62 100644 --- a/gio/src/gio_enums.defs +++ b/gio/src/gio_enums.defs @@ -451,7 +451,9 @@ ;; G_IO_ERROR_PROXY_AUTH_FAILED, ;; G_IO_ERROR_PROXY_NEED_AUTH, ;; G_IO_ERROR_PROXY_NOT_ALLOWED, -;; G_IO_ERROR_BROKEN_PIPE +;; G_IO_ERROR_BROKEN_PIPE, +;; G_IO_ERROR_CONNECTION_CLOSED = G_IO_ERROR_BROKEN_PIPE, +;; G_IO_ERROR_NOT_CONNECTED ;; } GIOErrorEnum; (define-enum-extended IOErrorEnum @@ -504,6 +506,8 @@ '("proxy-need-auth" "G_IO_ERROR_PROXY_NEED_AUTH" "42") '("proxy-not-allowed" "G_IO_ERROR_PROXY_NOT_ALLOWED" "43") '("broken-pipe" "G_IO_ERROR_BROKEN_PIPE" "44") + '("connection-closed" "G_IO_ERROR_CONNECTION_CLOSED" "44") + '("not-connected" "G_IO_ERROR_NOT_CONNECTED" "45") ) ) @@ -1213,9 +1217,9 @@ ;; G_CREDENTIALS_TYPE_INVALID, ;; G_CREDENTIALS_TYPE_LINUX_UCRED, ;; G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED, -;; G_CREDENTIALS_TYPE_NETBSD_UNPCBID, ;; G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED, -;; G_CREDENTIALS_TYPE_SOLARIS_UCRED +;; G_CREDENTIALS_TYPE_SOLARIS_UCRED, +;; G_CREDENTIALS_TYPE_NETBSD_UNPCBID ;; } GCredentialsType; (define-enum-extended CredentialsType @@ -1225,9 +1229,9 @@ '("invalid" "G_CREDENTIALS_TYPE_INVALID" "0") '("linux-ucred" "G_CREDENTIALS_TYPE_LINUX_UCRED" "1") '("freebsd-cmsgcred" "G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED" "2") - '("netbsd-unpcbid" "G_CREDENTIALS_TYPE_NETBSD_UNPCBID" "3") - '("openbsd-sockpeercred" "G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED" "4") - '("solaris-ucred" "G_CREDENTIALS_TYPE_SOLARIS_UCRED" "5") + '("openbsd-sockpeercred" "G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED" "3") + '("solaris-ucred" "G_CREDENTIALS_TYPE_SOLARIS_UCRED" "4") + '("netbsd-unpcbid" "G_CREDENTIALS_TYPE_NETBSD_UNPCBID" "5") ) ) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index d8b3729b..1f43a3ad 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -1058,6 +1058,8 @@ '("proxy-need-auth" "G_IO_ERROR_PROXY_NEED_AUTH") '("proxy-not-allowed" "G_IO_ERROR_PROXY_NOT_ALLOWED") '("broken-pipe" "G_IO_ERROR_BROKEN_PIPE") + '("connection-closed" "G_IO_ERROR_CONNECTION_CLOSED") + '("not-connected" "G_IO_ERROR_NOT_CONNECTED") ) ) @@ -1495,9 +1497,9 @@ '("invalid" "G_CREDENTIALS_TYPE_INVALID") '("linux-ucred" "G_CREDENTIALS_TYPE_LINUX_UCRED") '("freebsd-cmsgcred" "G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED") - '("netbsd-unpcbid" "G_CREDENTIALS_TYPE_NETBSD_UNPCBID") '("openbsd-sockpeercred" "G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED") '("solaris-ucred" "G_CREDENTIALS_TYPE_SOLARIS_UCRED") + '("netbsd-unpcbid" "G_CREDENTIALS_TYPE_NETBSD_UNPCBID") ) ) @@ -9925,6 +9927,31 @@ ) ) +(define-method read_all_async + (of-object "GInputStream") + (c-name "g_input_stream_read_all_async") + (return-type "none") + (parameters + '("void*" "buffer") + '("gsize" "count") + '("int" "io_priority") + '("GCancellable*" "cancellable") + '("GAsyncReadyCallback" "callback") + '("gpointer" "user_data") + ) +) + +(define-method read_all_finish + (of-object "GInputStream") + (c-name "g_input_stream_read_all_finish") + (return-type "gboolean") + (parameters + '("GAsyncResult*" "result") + '("gsize*" "bytes_read") + '("GError**" "error") + ) +) + (define-method read_bytes_async (of-object "GInputStream") (c-name "g_input_stream_read_bytes_async") @@ -11896,6 +11923,14 @@ ) ) +(define-function g_network_address_new_loopback + (c-name "g_network_address_new_loopback") + (return-type "GSocketConnectable*") + (parameters + '("guint16" "port") + ) +) + (define-function g_network_address_parse (c-name "g_network_address_parse") (return-type "GSocketConnectable*") @@ -12477,6 +12512,31 @@ ) ) +(define-method write_all_async + (of-object "GOutputStream") + (c-name "g_output_stream_write_all_async") + (return-type "none") + (parameters + '("const-void*" "buffer") + '("gsize" "count") + '("int" "io_priority") + '("GCancellable*" "cancellable") + '("GAsyncReadyCallback" "callback") + '("gpointer" "user_data") + ) +) + +(define-method write_all_finish + (of-object "GOutputStream") + (c-name "g_output_stream_write_all_finish") + (return-type "gboolean") + (parameters + '("GAsyncResult*" "result") + '("gsize*" "bytes_written") + '("GError**" "error") + ) +) + (define-method write_bytes_async (of-object "GOutputStream") (c-name "g_output_stream_write_bytes_async") diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 6209d022..114a01f1 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -2044,7 +2044,7 @@ (define-property use-ssl3 (of-object "GTlsClientConnection") (prop-type "GParamBoolean") - (docs "Use SSL 3.0 rather than trying to use TLS 1.x") + (docs "Use fallback version of SSL/TLS rather than most recent version") (readable #t) (writable #t) (construct-only #f) -- cgit v1.2.1 From aa0525e6c7b0b519279b85aa7613a00359255b57 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 3 Dec 2014 11:11:33 +0100 Subject: Regnerate glib .defs. --- glib/src/glib_functions.defs | 24 ++++++++++++++++++++++++ glib/src/gobject_enums.defs | 6 ++++-- glib/src/gobject_functions.defs | 7 +++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index f1ed7d8f..9d5e4c3c 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -8088,6 +8088,21 @@ (return-type "gboolean") ) +(define-method set_strict_posix + (of-object "GOptionContext") + (c-name "g_option_context_set_strict_posix") + (return-type "none") + (parameters + '("gboolean" "strict_posix") + ) +) + +(define-method get_strict_posix + (of-object "GOptionContext") + (c-name "g_option_context_get_strict_posix") + (return-type "gboolean") +) + (define-method add_main_entries (of-object "GOptionContext") (c-name "g_option_context_add_main_entries") @@ -10958,6 +10973,15 @@ ) ) +(define-function g_strv_contains + (c-name "g_strv_contains") + (return-type "gboolean") + (parameters + '("const-gchar*-const*" "strv") + '("const-gchar*" "str") + ) +) + ;; From gstringchunk.h diff --git a/glib/src/gobject_enums.defs b/glib/src/gobject_enums.defs index 21190773..7b649415 100644 --- a/glib/src/gobject_enums.defs +++ b/glib/src/gobject_enums.defs @@ -141,7 +141,8 @@ ;; G_TYPE_DEBUG_NONE = 0, ;; G_TYPE_DEBUG_OBJECTS = 1 << 0, ;; G_TYPE_DEBUG_SIGNALS = 1 << 1, -;; G_TYPE_DEBUG_MASK = 0x03 +;; G_TYPE_DEBUG_INSTANCE_COUNT = 1 << 2, +;; G_TYPE_DEBUG_MASK = 0x07 ;; } GTypeDebugFlags; (define-flags-extended TypeDebugFlags @@ -151,7 +152,8 @@ '("none" "G_TYPE_DEBUG_NONE" "0x0") '("objects" "G_TYPE_DEBUG_OBJECTS" "1 << 0") '("signals" "G_TYPE_DEBUG_SIGNALS" "1 << 1") - '("mask" "G_TYPE_DEBUG_MASK" "0x03") + '("instance-count" "G_TYPE_DEBUG_INSTANCE_COUNT" "1 << 2") + '("mask" "G_TYPE_DEBUG_MASK" "0x07") ) ) diff --git a/glib/src/gobject_functions.defs b/glib/src/gobject_functions.defs index 31c500e2..7611a004 100644 --- a/glib/src/gobject_functions.defs +++ b/glib/src/gobject_functions.defs @@ -96,6 +96,7 @@ '("none" "G_TYPE_DEBUG_NONE") '("objects" "G_TYPE_DEBUG_OBJECTS") '("signals" "G_TYPE_DEBUG_SIGNALS") + '("instance-count" "G_TYPE_DEBUG_INSTANCE_COUNT") '("mask" "G_TYPE_DEBUG_MASK") ) ) @@ -3136,6 +3137,12 @@ ) ) +(define-method get_instance_count + (of-object "GType") + (c-name "g_type_get_instance_count") + (return-type "int") +) + (define-method register_static (of-object "GType") (c-name "g_type_register_static") -- cgit v1.2.1 From ff03ae310cec7be9acfa40d52df4d853770af99c Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 3 Dec 2014 11:12:20 +0100 Subject: Regenerate .docs.xml files. --- gio/src/gio_docs.xml | 337 ++++++++++++++++++++++++++++++++++++++++++++----- glib/src/glib_docs.xml | 148 ++++++++++++++++++++-- 2 files changed, 446 insertions(+), 39 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index e6a2b328..1ddcc56f 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -1915,10 +1915,6 @@ Since: 2.26 The native credentials type is a <type>struct cmsgcred</type>. - - The native credentials type is a <type>struct unpcbid</type>. - - The native credentials type is a <type>struct sockpeercred</type>. Added in 2.30. @@ -1927,6 +1923,10 @@ Since: 2.26 The native credentials type is a <type>ucred_t</type>. Added in 2.40. + + The native credentials type is a <type>struct unpcbid</type>. + + @@ -3670,7 +3670,7 @@ Error codes returned by GIO functions. Note that this domain may be extended in future GLib releases. In general, new error codes either only apply to new APIs, or else -replace #G_IO_ERROR_FAILED in cases that were not explicitly +replace %G_IO_ERROR_FAILED in cases that were not explicitly distinguished before. You should therefore avoid writing code like |[<!-- language="C" --> if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED)) @@ -3873,6 +3873,18 @@ Since 2.26 Broken pipe. Since 2.36 + + Connection closed by peer. Note that this +is the same code as %G_IO_ERROR_BROKEN_PIPE; before 2.44 some +"connection closed" errors returned %G_IO_ERROR_BROKEN_PIPE, but others +returned %G_IO_ERROR_FAILED. Now they should all return the same +value, which has this more logical name. Since 2.44. + + + + Transport endpoint is not connected. Since 2.44 + + @@ -24309,6 +24321,13 @@ Resets @cancellable to its uncancelled state. If cancellable is currently in use by any cancellable operation then the behavior of this function is undefined. +Note that it is generally not a good idea to reuse an existing +cancellable for more operations after it has been cancelled once, +as this function might tempt you to do. The recommended practice +is to drop the reference to a cancellable after cancelling it, +and let it die with the outstanding async operations. You should +create a fresh cancellable for further async operations. + @@ -24350,6 +24369,8 @@ with g_source_add_child_source() to add cancellability to it. For convenience, you can call this with a %NULL #GCancellable, in which case the source will never trigger. +The new #GSource will hold a reference to the #GCancellable. + Since: 2.28 @@ -36184,7 +36205,7 @@ Sets the file enumerator as having pending operations. -Checks equality of two given #GFiles. +Checks if the two given #GFiles refer to the same file. Note that two #GFiles that differ can still refer to the same file on the filesystem due to various forms of filename @@ -36577,6 +36598,9 @@ pathname match @prefix. Only full pathname elements are matched, so a path like /foo is not considered a prefix of /foobar, only of /foo/bar. +A #GFile is not a prefix of itself. If you want to check for +equality, use g_file_equal(). + This call does no I/O, as it works purely on names. As such it can sometimes return %FALSE even if @file is inside a @prefix (from a filesystem point of view), because the prefix of @file is an alias @@ -40196,14 +40220,14 @@ by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. -If you pass in a non-%NULL @etag value, then this value is -compared to the current entity tag of the file, and if they differ -an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means -that the file has been changed since you last read it. You can get -the new etag from g_file_output_stream_get_etag() after you've -finished writing and closed the #GFileOutputStream. When you load -a new file you can use g_file_input_stream_query_info() to get -the etag of the file. +If you pass in a non-%NULL @etag value and @file already exists, then +this value is compared to the current entity tag of the file, and if +they differ an %G_IO_ERROR_WRONG_ETAG error is returned. This +generally means that the file has been changed since you last read +it. You can get the new etag from g_file_output_stream_get_etag() +after you've finished writing and closed the #GFileOutputStream. When +you load a new file you can use g_file_input_stream_query_info() to +get the etag of the file. If @make_backup is %TRUE, this function will attempt to make a backup of the current file before overwriting it. If this fails @@ -43039,8 +43063,14 @@ stream, %TRUE is returned, and @bytes_read is set to the number of bytes read into @buffer. If there is an error during the operation %FALSE is returned and @error -is set to indicate the error status, @bytes_read is updated to contain -the number of bytes read into @buffer before the error occurred. +is set to indicate the error status. + +As a special exception to the normal conventions for functions that +use #GError, if this function returns %FALSE (and sets @error) then +@bytes_read will be set to the number of bytes that were successfully +read before the error was encountered. This functionality is only +available from C. If you need it from another language then you must +write your own loop around g_input_stream_read(). @@ -43075,6 +43105,94 @@ read data into (which should be at least count bytes long). + + +Request an asynchronous read of @count bytes from the stream into the +buffer starting at @buffer. + +This is the asynchronous equivalent of g_input_stream_read_all(). + +Call g_input_stream_read_all_finish() to collect the result. + +Any outstanding I/O request with higher priority (lower numerical +value) will be executed before an outstanding request with lower +priority. Default priority is %G_PRIORITY_DEFAULT. + +Since: 2.44 + + + + + A #GInputStream + + + + a buffer to +read data into (which should be at least count bytes long) + + + + the number of bytes that will be read from the stream + + + + the [I/O priority][io-priority] of the request + + + + optional #GCancellable object, %NULL to ignore + + + + callback to call when the request is satisfied + + + + the data to pass to callback function + + + + + + + + +Finishes an asynchronous stream read operation started with +g_input_stream_read_all_async(). + +As a special exception to the normal conventions for functions that +use #GError, if this function returns %FALSE (and sets @error) then +@bytes_read will be set to the number of bytes that were successfully +read before the error was encountered. This functionality is only +available from C. If you need it from another language then you must +write your own loop around g_input_stream_read_async(). + +Since: 2.44 + + + + + a #GInputStream + + + + a #GAsyncResult + + + + location to store the number of bytes that was read from the stream + + + + a #GError location to store the error occurring, or %NULL to ignore + + + + %TRUE on success, %FALSE if there was an error + + + + Request an asynchronous read of @count bytes from the stream into the buffer @@ -47414,6 +47532,12 @@ Since: 2.26 Creates a new #GSocketConnectable for connecting to the given @hostname and @port. +Note that depending on the configuration of the machine, a +@hostname of `localhost` may refer to the IPv4 loopback address +only, or to both IPv4 and IPv6; use +g_network_address_new_loopback() to create a #GNetworkAddress that +is guaranteed to resolve to both addresses. + Since: 2.22 @@ -47432,6 +47556,35 @@ Since: 2.22 + + +Creates a new #GSocketConnectable for connecting to the local host +over a loopback connection to the given @port. This is intended for +use in connecting to local services which may be running on IPv4 or +IPv6. + +The connectable will return IPv4 and IPv6 loopback addresses, +regardless of how the host resolves `localhost`. By contrast, +g_network_address_new() will often only return an IPv4 address when +resolving `localhost`, and an IPv6 address for `localhost6`. + +g_network_address_get_hostname() will always return `localhost` for +#GNetworkAddresses created with this constructor. + +Since: 2.44 + + + + + the port + + + + the new #GNetworkAddress + + + + Creates a new #GSocketConnectable for connecting to the given @@ -48784,8 +48937,15 @@ On a successful write of @count bytes, %TRUE is returned, and @bytes_written is set to @count. If there is an error during the operation %FALSE is returned and @error -is set to indicate the error status, @bytes_written is updated to contain -the number of bytes written into the stream before the error occurred. +is set to indicate the error status. + +As a special exception to the normal conventions for functions that +use #GError, if this function returns %FALSE (and sets @error) then +@bytes_written will be set to the number of bytes that were +successfully written before the error was encountered. This +functionality is only available from C. If you need it from another +language then you must write your own loop around +g_output_stream_write(). @@ -48820,6 +48980,99 @@ written to the stream + + +Request an asynchronous write of @count bytes from @buffer into +the stream. When the operation is finished @callback will be called. +You can then call g_output_stream_write_all_finish() to get the result of the +operation. + +This is the asynchronous version of g_output_stream_write_all(). + +Call g_output_stream_write_all_finish() to collect the result. + +Any outstanding I/O request with higher priority (lower numerical +value) will be executed before an outstanding request with lower +priority. Default priority is %G_PRIORITY_DEFAULT. + +Note that no copy of @buffer will be made, so it must stay valid +until @callback is called. + +Since: 2.44 + + + + + A #GOutputStream + + + + the buffer containing the data to write + + + + the number of bytes to write + + + + the io priority of the request + + + + optional #GCancellable object, %NULL to ignore + + + + callback to call when the request is satisfied + + + + the data to pass to callback function + + + + + + + + +Finishes an asynchronous stream write operation started with +g_output_stream_write_all_async(). + +As a special exception to the normal conventions for functions that +use #GError, if this function returns %FALSE (and sets @error) then +@bytes_written will be set to the number of bytes that were +successfully written before the error was encountered. This +functionality is only available from C. If you need it from another +language then you must write your own loop around +g_output_stream_write_async(). + +Since: 2.44 + + + + + a #GOutputStream + + + + a #GAsyncResult + + + + location to store the number of bytes that was written to the stream + + + + a #GError location to store the error occurring, or %NULL to ignore. + + + + %TRUE on success, %FALSE if there was an error + + + + Request an asynchronous write of @count bytes from @buffer into @@ -61005,7 +61258,7 @@ Since: 2.22 -This enabled graceful disconnects on close. A graceful disconnect +This enables graceful disconnects on close. A graceful disconnect means that we signal the receiving end that the connection is terminated and wait for it to close the connection before closing the connection. @@ -61561,8 +61814,17 @@ and its contents when you are done with it. -Creates a #GTlsCertificate from the PEM-encoded data in @file. If -@file cannot be read or parsed, the function will return %NULL and +Creates a #GTlsCertificate from the PEM-encoded data in @file. The +returned certificate will be the first certificate found in @file. As +of GLib 2.44, if @file contains more certificates it will try to load +a certificate chain. All certificates will be verified in the order +found (top-level certificate should be the last one in the file) and +the #GTlsCertificate:issuer property of each certificate will be set +accordingly if the verification succeeds. If any certificate in the +chain cannot be verified, the first certificate in the file will +still be returned. + +If @file cannot be read or parsed, the function will return %NULL and set @error. Otherwise, this behaves like g_tls_certificate_new_from_pem(). @@ -61587,16 +61849,27 @@ Since: 2.28 Creates a #GTlsCertificate from the PEM-encoded data in @cert_file -and @key_file. If either file cannot be read or parsed, the -function will return %NULL and set @error. Otherwise, this behaves -like g_tls_certificate_new_from_pem(). +and @key_file. The returned certificate will be the first certificate +found in @cert_file. As of GLib 2.44, if @cert_file contains more +certificates it will try to load a certificate chain. All +certificates will be verified in the order found (top-level +certificate should be the last one in the file) and the +#GTlsCertificate:issuer property of each certificate will be set +accordingly if the verification succeeds. If any certificate in the +chain cannot be verified, the first certificate in the file will +still be returned. + +If either file cannot be read or parsed, the function will return +%NULL and set @error. Otherwise, this behaves like +g_tls_certificate_new_from_pem(). Since: 2.28 - file containing a PEM-encoded certificate to import + file containing one or more PEM-encoded certificates to +import @@ -61615,14 +61888,20 @@ Since: 2.28 -Creates a new #GTlsCertificate from the PEM-encoded data in @data. -If @data includes both a certificate and a private key, then the +Creates a #GTlsCertificate from the PEM-encoded data in @data. If +@data includes both a certificate and a private key, then the returned certificate will include the private key data as well. (See the #GTlsCertificate:private-key-pem property for information about supported formats.) -If @data includes multiple certificates, only the first one will be -parsed. +The returned certificate will be the first certificate found in +@data. As of GLib 2.44, if @data contains more certificates it will +try to load a certificate chain. All certificates will be verified in +the order found (top-level certificate should be the last one in the +file) and the #GTlsCertificate:issuer property of each certificate +will be set accordingly if the verification succeeds. If any +certificate in the chain cannot be verified, the first certificate in +the file will still be returned. Since: 2.28 diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index cba1b917..e0ff2b84 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -1284,7 +1284,7 @@ your direct control. Since 2.8. Through the #GParamFlags flag values, certain aspects of parameters -can be configured. See also #G_PARAM_READWRITE and #G_PARAM_STATIC_STRINGS. +can be configured. See also #G_PARAM_STATIC_STRINGS. @@ -1305,7 +1305,7 @@ can be configured. See also #G_PARAM_READWRITE and #G_PARAM_STATIC_STRINGS. - the parameter will only be set upon object construction + the parameter can only be set upon object construction @@ -2558,6 +2558,10 @@ Deprecated: 2.36: g_type_init() is now done automatically Mask covering all debug flags + + Keep a count of instances of each type + + @@ -17686,6 +17690,13 @@ count of 1 and allows to specify functions to free the memory allocated for the key and value that get called when removing the entry from the #GHashTable. +Since version 2.42 it is permissible for destroy notify functions to +recursively remove further items from the hash table. This is only +permissible if the application still holds a reference to the hash table. +This means that you may need to ensure that the hash table is empty by +calling g_hash_table_remove_all before releasing the last reference using +g_hash_table_unref(). + @@ -28925,6 +28936,24 @@ not be modified or freed. + + +Returns whether strict POSIX code is enabled. + +See g_option_context_set_strict_posix() for more information. + +Since: 2.44 + + + + + a #GoptionContext + + + + + + Returns the summary. See g_option_context_set_summary(). @@ -29174,6 +29203,45 @@ Since: 2.6 + + +Sets strict POSIX mode. + +By default, this mode is disabled. + +In strict POSIX mode, the first non-argument parameter encountered +(eg: filename) terminates argument processing. Remaining arguments +are treated as non-options and are not attempted to be parsed. + +If strict POSIX mode is disabled then parsing is done in the GNU way +where option arguments can be freely mixed with non-options. + +As an example, consider "ls foo -l". With GNU style parsing, this +will list "foo" in long mode. In strict POSIX style, this will list +the files named "foo" and "-l". + +It may be useful to force strict POSIX mode when creating "verb +style" command line tools. For example, the "gsettings" command line +tool supports the global option "--schemadir" as well as many +subcommands ("get", "set", etc.) which each have their own set of +arguments. Using strict POSIX mode will allow parsing the global +options up to the verb name while leaving the remaining options to be +parsed by the relevant subcommand (which can be determined by +examining the verb name, which should be present in argv[1] after +parsing). + +Since: 2.44 + + + + + a #GoptionContext + + + + + + Adds a string to be displayed in `--help` output before the list @@ -31560,6 +31628,10 @@ the #GDestroyNotify for @key is not called on the old value. If @dest is %NULL, free @src; otherwise, moves @src into *@dest. The error variable @dest points to must be %NULL. +Note that @src is no longer valid after this call. If you want +to keep using the same GError*, you need to set it to %NULL +after calling this function on it. + @@ -32429,9 +32501,10 @@ Since: 2.14 -Inserts @data into @queue after @sibling +Inserts @data into @queue after @sibling. -@sibling must be part of @queue +@sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the +data at the head of the queue. Since: 2.4 @@ -32442,7 +32515,8 @@ Since: 2.4 - a #GList link that must be part of @queue + a #GList link that must be part of @queue, or %NULL to +push at the head of the queue. @@ -32457,7 +32531,8 @@ Since: 2.4 Inserts @data into @queue before @sibling. -@sibling must be part of @queue. +@sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the +data at the tail of the queue. Since: 2.4 @@ -32468,7 +32543,8 @@ Since: 2.4 - a #GList link that must be part of @queue + a #GList link that must be part of @queue, or %NULL to +push at the tail of the queue. @@ -37917,6 +37993,12 @@ and/or @data the handlers have to match. Returns whether there are any handlers connected to @instance for the given signal id and detail. +If @detail is 0 then it will only match handlers that were connected +without detail. If @detail is non-zero then it will match handlers +connected both without detail and with the given detail. This is +consistent with how a signal emitted with @detail would be delivered +to those handlers. + One example of when you might use this is when the arguments to the signal are difficult to compute. A class implementor may opt to not emit the signal if no one is attached anyway, thus saving the cost @@ -42231,8 +42313,10 @@ characters escaped. See above. -Frees a %NULL-terminated array of strings, and the array itself. -If called on a %NULL value, g_strfreev() simply returns. +Frees a %NULL-terminated array of strings, as well as each +string it contains. + +If @str_array is %NULL, this function simply returns. @@ -43775,6 +43859,28 @@ or g_utf8_strup() instead. + + +Checks if @strv contains @str. @strv must not be %NULL. + +Since: 2.44 + + + + + a %NULL-terminated array of strings + + + + a string + + + + %TRUE if @str is an element of @strv, according to g_str_equal(). + + + + Returns the length of the given %NULL-terminated @@ -45668,7 +45774,7 @@ global pool. @error can be %NULL to ignore errors, or non-%NULL to report errors. An error can only occur when @exclusive is set to %TRUE and not all @max_threads threads could be created. -See #GThreadError for possible errors that may occurr. +See #GThreadError for possible errors that may occur. Note, even in case of error a valid #GThreadPool is returned. @@ -48182,6 +48288,28 @@ or 0 if the type system ran out of fundamental type IDs + + +Returns the number of instances allocated of the particular type; +this is only available if GLib is built with debugging support and +the instance_count debug flag is set (by setting the GOBJECT_DEBUG +variable to include instance-count). + +Since: 2.44 + + + + + a #GType + + + + the number of instances allocated of the given type; +if instance counts are not available, returns 0. + + + + Returns the #GTypePlugin structure for @type. -- cgit v1.2.1 From 214f3c5bd37a72fb8fa4f163b63e9ac1f40b9aa0 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 3 Dec 2014 11:49:37 +0100 Subject: tests/giomm_tls_client: Put try/catch around Socket::connect(). Because it's currently timing out for me. --- tests/giomm_tls_client/main.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc index c76551a1..a14fe9fe 100644 --- a/tests/giomm_tls_client/main.cc +++ b/tests/giomm_tls_client/main.cc @@ -86,7 +86,17 @@ int main(int, char**) Glib::RefPtr address = Gio::InetSocketAddress::create(first_inet_address, 443); - socket->connect(address); + try + { + socket->connect(address); + } + catch(const Gio::Error& ex) + { + std::cout << "Could not connect socket to " << + address->get_address()->to_string() << ":" << address->get_port() << + ". Exception: " << ex.what() << std::endl; + return EXIT_FAILURE; + } if(!socket->is_connected()) { -- cgit v1.2.1 From 64dd48d19dca7408dfe4d11520418188c3e1ded7 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 3 Dec 2014 11:12:43 +0100 Subject: 2.43.1 --- NEWS | 25 +++++++++++++++++++++++++ configure.ac | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 652d05a4..616f7207 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,28 @@ +2.43.1 (unstable): + +gmmproc: +* Tidy up the generation of enum docs + (Kjell Ahlstedt) +* _WRAP_GERROR: Add documentation to the generated enum Code. + (Kjell Ahlstedt) +* Change messages that MS Visual Studio can misunderstand. + (Kjell Ahlstedt) +* Warn when an ignored method or signal doesn't exist. + (Marcin Kolny) Bug #737212. + +Glib: +* Add Binding. + (Kjell Ahlstedt) Bug #738663. +* Checksum::ChecksumType: Remove erroneous documentation + (Kjell Ahlstedt) +* Property: Add some documentation. + (Kjell Ahlstedt) Bug #523043. + +Gio: + Add Resource. + (Kjell Ahlstedt) + + 2.42: API additions since 2.40: diff --git a/configure.ac b/configure.ac index a8ea03ed..6a22c4e2 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.42.0], +AC_INIT([glibmm], [2.43.1], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.42.0' +glibreq='2.0 >= 2.43.1' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" -- cgit v1.2.1 From 9c8e40cc76df14c8ff5ce182f138f715b4bbd58d Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 4 Dec 2014 19:34:21 +0100 Subject: Tiny comment spelling fix. --- gio/src/file.hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/src/file.hg b/gio/src/file.hg index 7df94c3e..08e4ce8c 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -1052,7 +1052,7 @@ public: g_file_set_display_name_finish, errthrow) - //TODO: Remove the bool results from this and other methods that thrown an exception. + //TODO: Remove the bool results from this and other methods that throw an exception. /** Deletes a file. * If the file is a directory, it will only be deleted if it is empty. -- cgit v1.2.1 From 868f0db1d12d247132b3a8a40beec93d085e178e Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 11 Dec 2014 18:19:33 +0100 Subject: gmmproc: Improve the conversion of Since to @newin * tools/m4/enum.m4: Add a blank line in the enum documentation. * tools/pm/Output.pm: Don't always add a blank line in the enum documentation. * tools/pm/DocsParser.pm: Improve the rules for conversion of Since to @newin. --- tools/m4/enum.m4 | 2 ++ tools/pm/DocsParser.pm | 22 ++++++++++++++-------- tools/pm/Output.pm | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/m4/enum.m4 b/tools/m4/enum.m4 index 3ac338b2..dc988925 100644 --- a/tools/m4/enum.m4 +++ b/tools/m4/enum.m4 @@ -1,5 +1,6 @@ dnl dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `flags', `optional_refdoc_comment', 'get_type_function_name') +dnl $1 $2 $3 $4 $5 $6 $7 dnl m4_define(`_ENUM',`dnl _PUSH() @@ -20,6 +21,7 @@ m4_define(`__DOCGROUP_'__MODULE_CANONICAL__`_ENUMS__')dnl dnl dnl /** $6 + * * @ingroup __MODULE_CANONICAL__`'Enums m4_ifelse($3,Flags,`dnl * @par Bitwise operators: diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 1997945e..3ffee0ed 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -514,14 +514,20 @@ sub convert_tags_to_doxygen($) s"\n?(.*?)\n?"&DocsParser::convert_variablelist($1)"esg; # Use our Doxygen @newin alias. - # If Since is not followed by a colon, substitute @newin only if it's - # in a sentence of its own at the end of the string. - s/\bSince:\s*(\d+)\.(\d+)\.(\d+)\b\.?/\@newin{$1,$2,$3}/g; - s/\bSince:\s*(\d+)\.(\d+)\b\.?/\@newin{$1,$2}/g; - s/(\.\s+)Since\s+(\d+)\.(\d+)\.(\d+)\.?$/$1\@newin{$2,$3,$4}/; - s/(\.\s+)Since\s+(\d+)\.(\d+)\.?$/$1\@newin{$2,$3}/; - - s"\b->\b"->"g; + # Accept "Since" with or without a following colon. + # Require the Since clause to be + # - at the end of the string, + # - at the end of a line and followed by a blank line, or + # - followed by "Deprecated". + # If none of these requirements is met, "Since" may be embedded inside + # a function description, referring to only a part of the description. + # See e.g. g_date_time_format() and gdk_cursor_new_from_pixbuf(). + # Doxygen assumes that @newin is followed by a paragraph that describes + # what is new, but we don't use it that way. + my $first_part = '\bSince[:\h]\h*(\d+)\.(\d+)'; # \h == [\t ] (horizontal whitespace) + my $last_part = '\.?(\s*$|\h*\n\h*\n|\s+Deprecated)'; + s/$first_part\.(\d+)$last_part/\@newin{$1,$2,$3}$4/g; + s/$first_part$last_part/\@newin{$1,$2}$3/g; # Doxygen is too dumb to handle — s"—" \@htmlonly—\@endhtmlonly "g; diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index de13f5ea..1b12f4e6 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -679,7 +679,7 @@ sub output_wrap_enum($$$$$$$) DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", " ", \@flags); # Merge the passed in comment to the existing enum documentation. - $comment = $comment . "\n * " . $enum_docs; + $comment .= "\n * " . $enum_docs if $enum_docs ne ""; my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\')dnl\n", $cpp_type, -- cgit v1.2.1 From ad432aca41acc47e00bb137ac1b55a03a59ba05d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 11 Dec 2014 18:20:33 +0100 Subject: Add an empty line after @newin where it's missing * gio/src/action.hg: * gio/src/cancellable.hg: * gio/src/charsetconverter.hg: * gio/src/mount.hg: * gio/src/notification.hg: * gio/src/simpleaction.hg: * gio/src/socket.hg: * glib/src/datetime.hg: * glib/src/glib_docs_override.xml: * glib/src/keyfile.hg: * glib/src/variant.hg: Add an empty line after @newin where it's needed in order to avoid bad side effects in the documentation. Doxygen assumes that @newin is followed by a paragraph that describes what is new. --- gio/src/action.hg | 2 ++ gio/src/cancellable.hg | 3 +-- gio/src/charsetconverter.hg | 1 + gio/src/mount.hg | 3 +-- gio/src/notification.hg | 2 ++ gio/src/simpleaction.hg | 4 ++++ gio/src/socket.hg | 3 +-- glib/src/datetime.hg | 3 +++ glib/src/glib_docs_override.xml | 1 + glib/src/keyfile.hg | 1 + glib/src/variant.hg | 1 + 11 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gio/src/action.hg b/gio/src/action.hg index 932ab8c5..5e6dcf8d 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -119,6 +119,7 @@ public: * See get_state_hint(). * * @newin{2,38} + * * @param value The new state. */ template @@ -180,6 +181,7 @@ public: * Detailed action names can have three formats. See parse_detailed_name_variant(). * * @newin{2,40} + * * @param detailed_name A detailed action name. * @param[out] action_name The action name. * @param[out] target_value The target value. diff --git a/gio/src/cancellable.hg b/gio/src/cancellable.hg index 2fcd58bd..886dc272 100644 --- a/gio/src/cancellable.hg +++ b/gio/src/cancellable.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -75,6 +73,7 @@ public: * See Cancellable::signal_cancelled() for details on how to use this. * * @newin{2,22} + * * @param slot The slot to connect. * @return The id of the signal handler or 0 if @a cancellable has already * been cancelled. diff --git a/gio/src/charsetconverter.hg b/gio/src/charsetconverter.hg index b4808c85..d5f8d87d 100644 --- a/gio/src/charsetconverter.hg +++ b/gio/src/charsetconverter.hg @@ -43,6 +43,7 @@ public: /** Creates a new CharsetConverter. * * @newin{2,24} + * * @param to_charset Destination charset. * @param from_charset Source charset. * @return A new CharsetConverter, or 0 on error. diff --git a/gio/src/mount.hg b/gio/src/mount.hg index 18c03b00..7ca17318 100644 --- a/gio/src/mount.hg +++ b/gio/src/mount.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -217,6 +215,7 @@ public: * does not support content guessing. * * @newin{2,18} + * * @param result An AsyncResult. * @return An array of content types. * @throw Glib::Error diff --git a/gio/src/notification.hg b/gio/src/notification.hg index b2a891fa..caf5f943 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -76,6 +76,7 @@ public: * @a action will be activated with @a target as its parameter. * * @newin{2,40} + * * @param label Label of the button. * @param action An action name. * @param target @a action's parameter. @@ -96,6 +97,7 @@ public: * was sent on is activated. * * @newin{2,40} + * * @param action An action name. * @param target @a action's parameter. */ diff --git a/gio/src/simpleaction.hg b/gio/src/simpleaction.hg index 4765674d..4b5b91e0 100644 --- a/gio/src/simpleaction.hg +++ b/gio/src/simpleaction.hg @@ -88,6 +88,7 @@ public: * must have the same VariantType as the initial state. * * @newin{2,38} + * * @param name The name of the action. * @param state The initial state of the action. * @return A new SimpleAction. @@ -103,6 +104,7 @@ public: * must also be bool. * * @newin{2,38} + * * @param name The name of the action. * @param state The initial state of the action. * @return A new SimpleAction. @@ -118,6 +120,7 @@ public: /** Creates a new radio action with a string-based target value. * * @newin{2,38} + * * @param name The name of the action. * @param initial_state The initial state of the action. * @return A new SimpleAction. @@ -134,6 +137,7 @@ public: /** Creates a new radio action with an integer-based target value. * * @newin{2,38} + * * @param name The name of the action. * @param initial_state The initial state of the action. * @return A new SimpleAction. diff --git a/gio/src/socket.hg b/gio/src/socket.hg index 55236a40..530a1ab0 100644 --- a/gio/src/socket.hg +++ b/gio/src/socket.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2009 Jonathon Jongsma * * This library is free software; you can redistribute it and/or @@ -251,6 +249,7 @@ public: * Gio::signal_socket().connect() is a simpler interface to the same functionality. * * @newin{2,42} + * * @param condition A Glib::IOCondition mask to monitor. * @param cancellable A Cancellable. The default value means the source is not cancellable. * @return A newly allocated SocketSource. diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg index 601d9770..a9c42211 100644 --- a/glib/src/datetime.hg +++ b/glib/src/datetime.hg @@ -95,6 +95,7 @@ public: * TimeSpan that is returned is effectively @a *this - @a other. * * @newin{2,26} + * * @param other The other DateTime. * @return The difference between the two DateTime, as a time * span expressed in microseconds. @@ -106,6 +107,7 @@ public: * as a CompareFunc. * * @newin{2,26} + * * @param other The DateTime to compare with. * @return -1, 0 or 1 if @a *this is less than, equal to or greater * than @a other. @@ -120,6 +122,7 @@ public: * them to the same time zone. * * @newin{2,26} + * * @param other The DateTime to compare with. * @return true if @a *this and @a other are equal. */ diff --git a/glib/src/glib_docs_override.xml b/glib/src/glib_docs_override.xml index 77c4d222..9eee1064 100644 --- a/glib/src/glib_docs_override.xml +++ b/glib/src/glib_docs_override.xml @@ -46,6 +46,7 @@ Loads a key file into an empty KeyFile instance. If the file could not be loaded then a FileError or KeyFileError exception is thrown. Since: 2.6 + \throw Glib::FileError \throw Glib::KeyFileError diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg index 5f7c199f..c976a958 100644 --- a/glib/src/keyfile.hg +++ b/glib/src/keyfile.hg @@ -263,6 +263,7 @@ public: * If @a key cannot be found then it is created. * * @newin{2,12} + * * @param key A key. * @param value An double value. */ diff --git a/glib/src/variant.hg b/glib/src/variant.hg index 0cb1a827..be750d06 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -144,6 +144,7 @@ public: /** Checks if @a *this and @a other have the same type and value. * * @newin{2,24} + * * @param other The Variant to compare with. * @return true if @a *this and @a other are equal. */ -- cgit v1.2.1 From 70977dc8a4b71d27ec8969c3ad1c45c794d43bd0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 12 Dec 2014 10:58:05 +0100 Subject: gmmproc: Don't make one very long line for the enum documentation * tools/pm/DocsParser.pm: lookup_enum_documentation(): Don't replace newlines by spaces in the description of the enum constants. --- tools/pm/DocsParser.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 3ffee0ed..0e9e66fd 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -285,11 +285,11 @@ sub lookup_enum_documentation($$$$) $param =~ s/([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?/$1/g; if(length($desc) > 0) { - $desc =~ s/\n/ /g; - $desc =~ s/ $//; - $desc =~ s/^\s+//; # Chop off leading whitespace + # Chop off leading and trailing whitespace. + $desc =~ s/^\s+//; + $desc =~ s/\s+$//; $desc .= '.' unless($desc =~ /(?:^|\.)$/); - $docs .= "\@var $cpp_enum_name ${param}\n \u${desc}\n\n"; # \u = Convert next char to uppercase + $docs .= "\@var $cpp_enum_name ${param}\n\u${desc}\n\n"; # \u = Convert next char to uppercase } } -- cgit v1.2.1 From fe0e25c8f1af8c3553c14608a672a3447361e18a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 12 Dec 2014 18:48:05 +0100 Subject: Gio::UnixFDList, UnixFDMessage: Fix array lengths in steal_fds() * gio/src/unixfdlist.[hg|ccg]: Hand-code both constructors that take a Glib::ArrayHandle, and call g_unix_fd_list_new_from_array() in them. * gio/src/unixfdlist.ccg: Don't subtract 1 from the length returned by g_unix_fd_list_[peek|steal]_fds(). * gio/src/unixfdmessage.hg: get_fd_list(): Add refreturn. * gio/src/unixfdmessage.ccg: Don't subtract 1 from the length returned by g_unix_fd_message_steal_fds(). Bug #741365. --- gio/src/unixfdlist.ccg | 41 +++++++++++++++++++++++++++++++---------- gio/src/unixfdlist.hg | 7 ++----- gio/src/unixfdmessage.ccg | 7 +++---- gio/src/unixfdmessage.hg | 7 ++----- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg index 4fbed4dd..aa26c9c6 100644 --- a/gio/src/unixfdlist.ccg +++ b/gio/src/unixfdlist.ccg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -24,24 +22,47 @@ namespace Gio { UnixFDList::UnixFDList(const Glib::ArrayHandle& fds) -: _CONSTRUCT("fds", fds.data(), "n_fds", fds.size()) -{} +: + // Mark this class as non-derived to allow C++ vfuncs to be skipped. + Glib::ObjectBase(0), + // g_unix_fd_list_new_from_array() must be called. + // Its parameters don't correspond to properties. + // _CONSTRUCT() + g_unit_fd_list_append() is not an alternative. + // g_unit_fd_list_append() duplicates the file descriptor, + // but g_unix_fd_list_new_from_array() does not. + Glib::Object((GObject*)g_unix_fd_list_new_from_array(fds.data(), fds.size())) +{ +} + +UnixFDList::UnixFDList(const Glib::ArrayHandle& fds, int n_fds) +: + // Mark this class as non-derived to allow C++ vfuncs to be skipped. + Glib::ObjectBase(0), + // g_unix_fd_list_new_from_array() must be called. + // Its parameters don't correspond to properties. + // _CONSTRUCT() + g_unit_fd_list_append() is not an alternative. + // g_unit_fd_list_append() duplicates the file descriptor, + // but g_unix_fd_list_new_from_array() does not. + Glib::Object((GObject*)g_unix_fd_list_new_from_array(fds.data(), n_fds)) +{ +} const Glib::ArrayHandle UnixFDList::peek_fds() const { int length = 0; - const int* fds = g_unix_fd_list_peek_fds(const_cast(gobj()), - &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_NONE); + const int* fds = g_unix_fd_list_peek_fds(const_cast(gobj()), &length); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_list_peek_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_NONE); } Glib::ArrayHandle UnixFDList::steal_fds() { int length = 0; const int* fds = g_unix_fd_list_steal_fds(gobj(), &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_DEEP); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_list_steal_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); } } // namespace Gio diff --git a/gio/src/unixfdlist.hg b/gio/src/unixfdlist.hg index 4ff3ec4d..6525f325 100644 --- a/gio/src/unixfdlist.hg +++ b/gio/src/unixfdlist.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -26,7 +24,6 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Gio { - /** UnixFDList - An object containing a set of UNIX file descriptors. * A UnixFDList contains a list of file descriptors. It owns the file * descriptors that it contains, closing them when finalized. @@ -49,8 +46,8 @@ protected: explicit UnixFDList(const Glib::ArrayHandle& fds); -#m4 _CONVERSION(`const Glib::ArrayHandle&', `const gint*', `$3.data()') - _WRAP_CTOR(UnixFDList(const Glib::ArrayHandle& fds, int n_fds), g_unix_fd_list_new_from_array) + explicit UnixFDList(const Glib::ArrayHandle& fds, int n_fds); + _IGNORE(g_unix_fd_list_new_from_array) public: _WRAP_METHOD_DOCS_ONLY(g_unix_fd_list_new) diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg index ec38df44..d112bb65 100644 --- a/gio/src/unixfdmessage.ccg +++ b/gio/src/unixfdmessage.ccg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -28,8 +26,9 @@ Glib::ArrayHandle UnixFDMessage::steal_fds() { int length = 0; const int* fds = g_unix_fd_message_steal_fds(gobj(), &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_DEEP); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_message_steal_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); } } // namespace Gio diff --git a/gio/src/unixfdmessage.hg b/gio/src/unixfdmessage.hg index 05a1e103..d54c8e64 100644 --- a/gio/src/unixfdmessage.hg +++ b/gio/src/unixfdmessage.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -57,12 +55,11 @@ public: _WRAP_METHOD_DOCS_ONLY(g_unix_fd_message_new_with_fd_list) _WRAP_CREATE(const Glib::RefPtr& fd_list) - _WRAP_METHOD(Glib::RefPtr get_fd_list(), g_unix_fd_message_get_fd_list) - _WRAP_METHOD(Glib::RefPtr get_fd_list() const, g_unix_fd_message_get_fd_list, constversion) + _WRAP_METHOD(Glib::RefPtr get_fd_list(), g_unix_fd_message_get_fd_list, refreturn) + _WRAP_METHOD(Glib::RefPtr get_fd_list() const, g_unix_fd_message_get_fd_list, refreturn, constversion) _WRAP_METHOD(bool append_fd(int fd), g_unix_fd_message_append_fd, errthrow) - /** Returns the array of file descriptors that is contained in this object. * * After this call, the descriptors are no longer contained in message. -- cgit v1.2.1 From 6c30f7c589b54daceea6c83f53a5403d3ef09cfd Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 15 Dec 2014 09:58:34 +0100 Subject: Regenerate .defs. --- gio/src/gio_enums.defs | 19 +++++++++++++ gio/src/gio_methods.defs | 47 +++++++++++++++++++++++++++++++ gio/src/gio_signals.defs | 29 +++++++++++++++++++ tools/extra_defs_gen/generate_defs_gio.cc | 1 + 4 files changed, 96 insertions(+) diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs index 141c1b62..0e68617e 100644 --- a/gio/src/gio_enums.defs +++ b/gio/src/gio_enums.defs @@ -1573,6 +1573,25 @@ ) ) +;; Original typedef: +;; typedef enum { +;; G_NETWORK_CONNECTIVITY_LOCAL = 1, +;; G_NETWORK_CONNECTIVITY_LIMITED = 2, +;; G_NETWORK_CONNECTIVITY_PORTAL = 3, +;; G_NETWORK_CONNECTIVITY_FULL = 4 +;; } GNetworkConnectivity; + +(define-enum-extended NetworkConnectivity + (in-module "G") + (c-name "GNetworkConnectivity") + (values + '("local" "G_NETWORK_CONNECTIVITY_LOCAL" "1") + '("limited" "G_NETWORK_CONNECTIVITY_LIMITED" "2") + '("portal" "G_NETWORK_CONNECTIVITY_PORTAL" "3") + '("full" "G_NETWORK_CONNECTIVITY_FULL" "4") + ) +) + ;; From gsettings.h ;; Original typedef: diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 1f43a3ad..1170f1e0 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -370,6 +370,13 @@ (gtype-id "G_TYPE_NETWORK_MONITOR_NETLINK") ) +(define-object MonitorNM + (in-module "GNetwork") + (parent "GNetworkMonitorNetlink") + (c-name "GNetworkMonitorNM") + (gtype-id "G_TYPE_NETWORK_MONITOR_NM") +) + (define-object Service (in-module "GNetwork") (parent "GObject") @@ -1705,6 +1712,18 @@ ) ) +(define-enum Connectivity + (in-module "GNetwork") + (c-name "GNetworkConnectivity") + (gtype-id "G_TYPE_NETWORK_CONNECTIVITY") + (values + '("local" "G_NETWORK_CONNECTIVITY_LOCAL") + '("limited" "G_NETWORK_CONNECTIVITY_LIMITED") + '("portal" "G_NETWORK_CONNECTIVITY_PORTAL") + '("full" "G_NETWORK_CONNECTIVITY_FULL") + ) +) + (define-flags BindFlags (in-module "GSettings") (c-name "GSettingsBindFlags") @@ -10420,6 +10439,11 @@ (return-type "GType") ) +(define-function g_network_connectivity_get_type + (c-name "g_network_connectivity_get_type") + (return-type "GType") +) + (define-function g_settings_bind_flags_get_type (c-name "g_settings_bind_flags_get_type") (return-type "GType") @@ -12056,6 +12080,12 @@ (return-type "gboolean") ) +(define-method get_connectivity + (of-object "GNetworkMonitor") + (c-name "g_network_monitor_get_connectivity") + (return-type "GNetworkConnectivity") +) + (define-method can_reach (of-object "GNetworkMonitor") (c-name "g_network_monitor_can_reach") @@ -12095,6 +12125,10 @@ +;; From gnetworkmonitornm.h + + + ;; From gnetworkservice.h (define-function g_network_service_get_type @@ -15886,6 +15920,19 @@ ) ) +(define-method send_messages + (of-object "GSocket") + (c-name "g_socket_send_messages") + (return-type "gint") + (parameters + '("GOutputMessage*" "messages") + '("guint" "num_messages") + '("gint" "flags") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + (define-method close (of-object "GSocket") (c-name "g_socket_close") diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 114a01f1..232072fc 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -1586,6 +1586,35 @@ (construct-only #t) ) +;; From GNetworkMonitor + +(define-signal network-changed + (of-object "GNetworkMonitor") + (return-type "void") + (when "last") + (parameters + '("gboolean" "p0") + ) +) + +(define-property connectivity + (of-object "GNetworkMonitor") + (prop-type "GParamEnum") + (docs "Level of network connectivity") + (readable #t) + (writable #f) + (construct-only #f) +) + +(define-property network-available + (of-object "GNetworkMonitor") + (prop-type "GParamBoolean") + (docs "Whether the network is available") + (readable #t) + (writable #f) + (construct-only #f) +) + ;; From GNetworkService (define-property service diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index 213f52e8..7fb58f26 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -114,6 +114,7 @@ int main(int, char**) << get_defs(G_TYPE_SRV_TARGET) << get_defs(G_TYPE_RESOLVER) << get_defs(G_TYPE_NETWORK_ADDRESS) + << get_defs(G_TYPE_NETWORK_MONITOR) << get_defs(G_TYPE_NETWORK_SERVICE) << get_defs(G_TYPE_SETTINGS) << get_defs(G_TYPE_SIMPLE_PERMISSION) -- cgit v1.2.1 From 6f720366013e1887374d5736e62030c55bc15df0 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 15 Dec 2014 10:03:53 +0100 Subject: Regenerate .docs.xml --- gio/src/gio_docs.xml | 141 +++++++++++++++++++++++++++++++++++++++++++++++++ glib/src/glib_docs.xml | 27 +++++++--- 2 files changed, 161 insertions(+), 7 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 1ddcc56f..c2d54f74 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -4269,6 +4269,39 @@ file operations on the mount. + + +The host's network connectivity state, as reported by #GNetworkMonitor. + +Since: 2.44 + + + + + The host is not configured with a +route to the Internet; it may or may not be connected to a local +network. + + + + The host is connected to a network, but +does not appear to be able to reach the full Internet, perhaps +due to upstream network problems. + + + + The host is behind a captive portal and +cannot reach the full Internet. + + + + The host is connected to a network, and +appears to be able to reach the full Internet. + + + + + Emitted when the network configuration changes. If @available is @@ -47835,6 +47868,42 @@ See g_network_monitor_can_reach_async(). + + +Gets a more detailed networking state than +g_network_monitor_get_network_available(). + +If #GNetworkMonitor:network-available is %FALSE, then the +connectivity state will be %G_NETWORK_CONNECTIVITY_LOCAL. + +If #GNetworkMonitor:network-available is %TRUE, then the +connectivity state will be %G_NETWORK_CONNECTIVITY_FULL (if there +is full Internet connectivity), %G_NETWORK_CONNECTIVITY_LIMITED (if +the host has a default route, but appears to be unable to actually +reach the full Internet), or %G_NETWORK_CONNECTIVITY_PORTAL (if the +host is trapped behind a "captive portal" that requires some sort +of login or acknowledgement before allowing full Internet access). + +Note that in the case of %G_NETWORK_CONNECTIVITY_LIMITED and +%G_NETWORK_CONNECTIVITY_PORTAL, it is possible that some sites are +reachable but others are not. In this case, applications can +attempt to connect to remote servers, but should gracefully fall +back to their "offline" behavior if the connection attempt fails. + +Since: 2.44 + + + + + the #GNetworkMonitor + + + + the network connectivity state + + + + Gets the default #GNetworkMonitor for the system. @@ -58407,6 +58476,78 @@ on error + + +Send multiple data messages from @socket in one go. This is the most +complicated and fully-featured version of this call. For easier use, see +g_socket_send(), g_socket_send_to(), and g_socket_send_message(). + +@messages must point to an array of #GOutputMessage structs and +@num_messages must be the length of this array. Each #GOutputMessage +contains an address to send the data to, and a pointer to an array of +#GOutputVector structs to describe the buffers that the data to be sent +for each message will be gathered from. Using multiple #GOutputVectors is +more memory-efficient than manually copying data from multiple sources +into a single buffer, and more network-efficient than making multiple +calls to g_socket_send(). Sending multiple messages in one go avoids the +overhead of making a lot of syscalls in scenarios where a lot of data +packets need to be sent (e.g. high-bandwidth video streaming over RTP/UDP), +or where the same data needs to be sent to multiple recipients. + +@flags modify how the message is sent. The commonly available arguments +for this are available in the #GSocketMsgFlags enum, but the +values there are the same as the system values, and the flags +are passed in as-is, so you can pass in system-specific flags too. + +If the socket is in blocking mode the call will block until there is +space for all the data in the socket queue. If there is no space available +and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error +will be returned if no data was written at all, otherwise the number of +messages sent will be returned. To be notified when space is available, +wait for the %G_IO_OUT condition. Note though that you may still receive +%G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously +notified of a %G_IO_OUT condition. (On Windows in particular, this is +very common due to the way the underlying APIs work.) + +On error -1 is returned and @error is set accordingly. + +Since: 2.44 + + + + + a #GSocket + + + + an array of #GOutputMessage structs + + + + the number of elements in @messages + + + + an int containing #GSocketMsgFlags flags + + + + a %GCancellable or %NULL + + + + #GError for error reporting, or %NULL to ignore. + + + + number of messages sent, or -1 on error. Note that the number of +messages sent may be smaller than @num_messages if the socket is +non-blocking or if @num_messages was larger than UIO_MAXIOV (1024), +in which case the caller may re-try to send the remaining messages. + + + + Tries to send @size bytes from @buffer to @address. If @address is diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index e0ff2b84..3660e8f4 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -2811,7 +2811,7 @@ a value never returned from g_unichar_get_script() a mark glyph that takes its script from the -i base glyph to which it is attached +base glyph to which it is attached @@ -3314,7 +3314,10 @@ Old South Arabian. Since 2.26 Tirhuta. Since: 2.42 -@G_UNICODE_SCRIPT_WARANG_CITI Warang Citi. Since: 2.42 + + + + Warang Citi. Since: 2.42 @@ -10517,7 +10520,9 @@ Since: 2.36 - + %TRUE on success, %FALSE if there was an error. + + @@ -17158,7 +17163,9 @@ Since: 2.32 - + %TRUE if @key is in @hash_table, %FALSE otherwise. + + @@ -17357,7 +17364,7 @@ key. Use @length to determine the true length if it's possible that %NULL was used as the value for a key. Note: in the common case of a string-keyed #GHashTable, the return -value of this function can be conveniently cast to (gchar **). +value of this function can be conveniently cast to (const gchar **). You should always free the return result with g_free(). In the above-mentioned case of a string-keyed hash table, it may be @@ -28951,7 +28958,9 @@ Since: 2.44 - + %TRUE if strict POSIX is enabled, %FALSE otherwise. + + @@ -29238,6 +29247,10 @@ Since: 2.44 a #GoptionContext + + the new value + + @@ -58402,7 +58415,7 @@ Values of this type can range from #G_MINSSIZE to #G_MAXSSIZE. To print or scan values of this type, use -%G_GSIZE_MODIFIER and/or %G_GSSIZE_FORMAT. +%G_GSSIZE_MODIFIER and/or %G_GSSIZE_FORMAT. -- cgit v1.2.1 From 9cb81b496abb992f23a0ed909f8e473f79de2d44 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 15 Dec 2014 10:31:34 +0100 Subject: Gio: Added NetworkMonitor. --- gio/src/filelist.am | 1 + gio/src/networkmonitor.ccg | 38 +++++++++++++++++++++++++ gio/src/networkmonitor.hg | 69 ++++++++++++++++++++++++++++++++++++++++++++++ tools/m4/convert_gio.m4 | 5 ++++ 4 files changed, 113 insertions(+) create mode 100644 gio/src/networkmonitor.ccg create mode 100644 gio/src/networkmonitor.hg diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 8ce9dd5f..17737fb0 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -87,6 +87,7 @@ giomm_files_any_hg = \ mount.hg \ mountoperation.hg \ networkaddress.hg \ + networkmonitor.hg \ networkservice.hg \ notification.hg \ outputstream.hg \ diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg new file mode 100644 index 00000000..aaa5ee13 --- /dev/null +++ b/gio/src/networkmonitor.ccg @@ -0,0 +1,38 @@ +/* Copyright (C) 2014 The gtkmm 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. + */ + +#include +#include +#include "slot_async.h" + +namespace Gio { + +void NetworkMonitor::can_reach_async(const Glib::RefPtr& connectable, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) +{ + // 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_network_monitor_can_reach_async(gobj(), + Glib::unwrap(connectable), + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +} // namespace Gio diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg new file mode 100644 index 00000000..4c6ee89d --- /dev/null +++ b/gio/src/networkmonitor.hg @@ -0,0 +1,69 @@ +/* Copyright (C) 2014 The giomm 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. + */ + +#include +#include +#include +#include +#include + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) +_PINCLUDE(gio/gio.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + +_WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE) + + +/** TODO + * + * @newin{2,42} + */ +class NetworkMonitor : public Glib::Interface +{ + _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface) + +public: + _WRAP_METHOD(static Glib::RefPtr get_default(), g_network_monitor_get_default) + + _WRAP_METHOD(bool get_network_available() const, g_network_monitor_get_network_available) + + _WRAP_METHOD(NetworkConnectivity get_connectivity() const, g_network_monitor_get_connectivity) + + _WRAP_METHOD(bool can_reach(const Glib::RefPtr& connectable, const Glib::RefPtr& cancellable{?}), g_network_monitor_can_reach, errthrow) + + //TODO: + void can_reach_async(const Glib::RefPtr& connectable, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable); + _IGNORE(g_network_monitor_can_reach_async) + + _WRAP_METHOD(bool can_reach_finish(const Glib::RefPtr& result), g_network_monitor_can_reach_finish, errthrow) + + _WRAP_SIGNAL(void network_changed(bool available), "network-changed") + + //TODO: Wrap vfuncs? + + _WRAP_PROPERTY("network-available", bool) + _WRAP_PROPERTY("connectivity", NetworkConnectivity) +}; + +} // namespace Gio diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 3d170668..9444c32f 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -32,6 +32,7 @@ _CONV_ENUM(G,FileType) _CONV_ENUM(G,MountMountFlags) _CONV_ENUM(G,MountOperationResult) _CONV_ENUM(G,MountUnmountFlags) +_CONV_ENUM(G,NetworkConnectivity) _CONV_ENUM(G,OutputStreamSpliceFlags) _CONV_ENUM(G,PasswordSave) _CONV_ENUM(G,ResolverRecordType) @@ -240,6 +241,10 @@ _CONVERSION(`PasswordSave',`GPasswordSave',`($2)$3') #MountOperation #_CONVERSION(`GAskPasswordFlags',`AskPasswordFlags',`($2)$3') +# NetworkMonitor +_CONVERSION(`GNetworkMonitor*',`Glib::RefPtr',`Glib::wrap($3)') + + # Notification _CONVERSION(`GNotification*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr&',`GNotification*',__CONVERT_CONST_REFPTR_TO_P) -- cgit v1.2.1 From 9b13f8a2d2f14052809152c15ee70161112d2fd4 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 16 Dec 2014 12:30:09 +0100 Subject: 2.43.2 --- NEWS | 17 +++++++++++++++++ configure.ac | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 616f7207..3b75041a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,20 @@ +2.43.2 (unstable): + +Gio: +* Added NetworkMonitor. + (Murray Cumming) +* UnixFDList, UnixFDMessage: Correct array lengths in steal_fds() + (Kjell Ahlstedt) Bug #741365 (Matthew Balkam) + +gmmproc: +* Don't make one very long line for the enum documentation. + (Kjell Ahlstedt) +* Improve the conversion of Since to @newin. + (Kjell Ahlstedt) +* Add an empty line after @newin where it's missing + (Kjell Ahlstedt) + + 2.43.1 (unstable): gmmproc: diff --git a/configure.ac b/configure.ac index 6a22c4e2..547e9ed1 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.1], +AC_INIT([glibmm], [2.43.2], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From 3bd36da8786f7f9690dc4f8c2b10a413517e6ac8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 2 Jan 2015 12:49:45 +0100 Subject: Gio::Resource docs: Suppress inappropriate doxygen links * gio/src/resource.hg: Insert '%' before 'Resource' where doxygen shall not generate a link to Gio::Resource. --- gio/src/resource.hg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gio/src/resource.hg b/gio/src/resource.hg index a74c4698..dbb289ee 100644 --- a/gio/src/resource.hg +++ b/gio/src/resource.hg @@ -38,7 +38,7 @@ _WRAP_GERROR(ResourceError, GResourceError, G_RESOURCE_ERROR, NO_GTYPE) _WRAP_ENUM(ResourceFlags, GResourceFlags) _WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) -/** Resource framework. +/** %Resource framework. * * Applications and libraries often contain binary or textual data that is * really part of the application, rather than user data. For instance @@ -48,17 +48,17 @@ _WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) * * The Gio::Resource API and the glib-compile-resources program * provide a convenient and efficient alternative to this which has some nice properties. You - * maintain the files as normal files, so its easy to edit them, but during the build the files + * maintain the files as normal files, so it's easy to edit them, but during the build the files * are combined into a binary bundle that is linked into the executable. This means that loading * the resource files is efficient (as they are already in memory, shared with other instances) and * simple (no need to check for things like I/O errors or locate the files in the filesystem). It * also makes it easier to create relocatable applications. * - * Resource files can also be marked as compressed. Such files will be included in the resource bundle + * %Resource files can also be marked as compressed. Such files will be included in the resource bundle * in a compressed form, but will be automatically uncompressed when the resource is used. This * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away. * - * Resource files can also be marked to be preprocessed, by setting the value of the + * %Resource files can also be marked to be preprocessed, by setting the value of the * `preprocess` attribute to a comma-separated list of preprocessing options. * The only options currently supported are: * @@ -79,7 +79,7 @@ _WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) * abort. * * - * Resource bundles are created by the glib-compile-resources program + * %Resource bundles are created by the glib-compile-resources program * which takes an xml file that describes the bundle, and a set of files that the xml references. These * are combined into a binary resource bundle. * @@ -106,7 +106,7 @@ _WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) * path prefixes (like in the above example) to avoid conflicts. * * You can then use glib-compile-resources to compile the xml to a binary bundle - * that you can load with Gio::Resource::create_from_file(). However, its more common to use the --generate-source and + * that you can load with Gio::Resource::create_from_file(). However, it's more common to use the --generate-source and * --generate-header arguments to create a source file and header to link directly into your application. * * Once a Gio::Resource has been created and registered all the data in it can be accessed globally in the process by -- cgit v1.2.1 From 330c814b74c85d4d5c80feedf6f6aa6c7226ab1a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 11 Jan 2015 15:21:20 +0100 Subject: Add Glib::SlotSpawnChildSetup * glib/src/spawn.[hg|ccg]: Add typedef SlotSpawnChildSetup, and say in the documentation that the child_setup parameters can be empty slots. That should make it clear how to avoid having a child_setup slot called. Bug #528285. --- glib/src/spawn.ccg | 26 +++++++++++++------------- glib/src/spawn.hg | 31 ++++++++++++++++++------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg index 707d5828..8e2a2506 100644 --- a/glib/src/spawn.ccg +++ b/glib/src/spawn.ccg @@ -34,7 +34,7 @@ static void child_setup_callback(void* user_data) { try { - (*reinterpret_cast*>(user_data))(); + (*reinterpret_cast(user_data))(); } catch(...) { @@ -67,14 +67,14 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, Pid* child_pid, int* standard_input, int* standard_output, int* standard_error) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -95,14 +95,14 @@ void spawn_async_with_pipes(const std::string& working_directory, void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, Pid* child_pid, int* standard_input, int* standard_output, int* standard_error) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -123,11 +123,11 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -147,11 +147,11 @@ void spawn_async(const std::string& working_directory, void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -171,13 +171,13 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, std::string* standard_output, std::string* standard_error, int* exit_status) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; @@ -205,13 +205,13 @@ void spawn_sync(const std::string& working_directory, void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags, - const sigc::slot& child_setup, + const SlotSpawnChildSetup& child_setup, std::string* standard_output, std::string* standard_error, int* exit_status) { const bool setup_slot = !child_setup.empty(); - sigc::slot child_setup_ = child_setup; + SlotSpawnChildSetup child_setup_ = child_setup; Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg index bb53a087..f82115e8 100644 --- a/glib/src/spawn.hg +++ b/glib/src/spawn.hg @@ -35,10 +35,15 @@ _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE) * @{ */ -/** Exception class for errors occuring when spawning processes. +/** %Exception class for errors occuring when spawning processes. */ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#) +/** For instance,
+ * void on_child_setup(); + */ +typedef sigc::slot SlotSpawnChildSetup; + /** Executes a child program asynchronously (your program will not * block waiting for the child to exit). The child program is * specified by the only argument that must be provided, @a argv. @@ -175,7 +180,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#) * @param argv Child's argument vector. * @param envp Child's environment. * @param flags Flags from SpawnFlags - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param child_pid Return location for child process ID, or NULL. * @param standard_input Return location for file descriptor to write to child's stdin, or NULL. * @param standard_output Return location for file descriptor to read child's stdout, or NULL. @@ -191,7 +196,7 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), Pid* child_pid = 0, int* standard_input = 0, int* standard_output = 0, @@ -202,7 +207,7 @@ void spawn_async_with_pipes(const std::string& working_directory, * @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding. * @param argv Child's argument vector. * @param flags Flags from SpawnFlags - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param child_pid Return location for child process ID, or NULL. * @param standard_input Return location for file descriptor to write to child's stdin, or NULL. * @param standard_output Return location for file descriptor to read child's stdout, or NULL. @@ -217,7 +222,7 @@ void spawn_async_with_pipes(const std::string& working_directory, void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), Pid* child_pid = 0, int* standard_input = 0, int* standard_output = 0, @@ -236,7 +241,7 @@ void spawn_async_with_pipes(const std::string& working_directory, * @param argv Child's argument vector. * @param envp Child's environment. * @param flags Flags from SpawnFlags. - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param child_pid Return location for child process ID, or NULL * * @throws SpawnError Errors are reported even if they occur in the child (for example if the @@ -248,7 +253,7 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), Pid* child_pid = 0); /** Like the main spawn_async() method, but inheriting the parent's environment. @@ -256,7 +261,7 @@ void spawn_async(const std::string& working_directory, * @param working_directory Child's current working directory, or an empty string to inherit parent's. * @param argv Child's argument vector. * @param flags Flags from SpawnFlags. - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param child_pid Return location for child process ID, or NULL * * @throws SpawnError Errors are reported even if they occur in the child (for example if the @@ -267,7 +272,7 @@ void spawn_async(const std::string& working_directory, void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), Pid* child_pid = 0); /** Executes a child synchronously (waits for the child to exit before returning). @@ -291,7 +296,7 @@ void spawn_async(const std::string& working_directory, * @param argv Child's argument vector. * @param envp Child's environment. * @param flags Flags from SpawnFlags - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param standard_output Return location for file descriptor to read child's stdout, or NULL. * @param standard_error Return location for file descriptor to read child's stderr, or NULL. * @param exit_status Return location for child exit status, as returned by waitpid(), or NULL @@ -306,7 +311,7 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), std::string* standard_output = 0, std::string* standard_error = 0, int* exit_status = 0); @@ -316,7 +321,7 @@ void spawn_sync(const std::string& working_directory, * @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding. * @param argv Child's argument vector. * @param flags Flags from SpawnFlags - * @param child_setup Slot to run in the child just before exec(). + * @param child_setup Slot to run in the child just before exec(), or an empty slot. * @param standard_output Return location for file descriptor to read child's stdout, or NULL. * @param standard_error Return location for file descriptor to read child's stderr, or NULL. * @param exit_status Return location for child exit status, as returned by waitpid(), or NULL @@ -330,7 +335,7 @@ void spawn_sync(const std::string& working_directory, void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, - const sigc::slot& child_setup = sigc::slot(), + const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), std::string* standard_output = 0, std::string* standard_error = 0, int* exit_status = 0); -- cgit v1.2.1 From f02288579c548d29d9ce948c6057a61eb892036c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 13 Jan 2015 09:05:51 +0100 Subject: Glib::Binding: Rename and change BindingTransformSlot * glib/src/binding.[hg|ccg]: Change "typedef sigc::slot&, const GValue*, GValue*> BindingTransformSlot" to "typedef sigc::slot SlotTransform". Bug #738663. --- glib/src/binding.ccg | 31 +++++++++++++------------- glib/src/binding.hg | 62 +++++++++++++++++++++++++--------------------------- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg index c9e839b7..8362cb68 100644 --- a/glib/src/binding.ccg +++ b/glib/src/binding.ccg @@ -22,25 +22,24 @@ namespace struct BindingTransformSlots { BindingTransformSlots( - const Glib::Binding::BindingTransformSlot& transform_to, - const Glib::Binding::BindingTransformSlot& transform_from) + const Glib::Binding::SlotTransform& transform_to, + const Glib::Binding::SlotTransform& transform_from) : from_source_to_target(transform_to), from_target_to_source(transform_from) {} - Glib::Binding::BindingTransformSlot from_source_to_target; - Glib::Binding::BindingTransformSlot from_target_to_source; + Glib::Binding::SlotTransform from_source_to_target; + Glib::Binding::SlotTransform from_target_to_source; }; -gboolean Binding_transform_callback_common(GBinding* binding, +gboolean Binding_transform_callback_common( const GValue* from_value, GValue* to_value, - Glib::Binding::BindingTransformSlot& the_slot) + Glib::Binding::SlotTransform& the_slot) { bool result = false; try { - Glib::RefPtr cpp_binding = Glib::wrap(binding, true); - result = the_slot(cpp_binding, from_value, to_value); + result = the_slot(from_value, to_value); } catch (...) { @@ -49,22 +48,22 @@ gboolean Binding_transform_callback_common(GBinding* binding, return result; } -gboolean Binding_transform_to_callback(GBinding* binding, +gboolean Binding_transform_to_callback(GBinding*, const GValue* from_value, GValue* to_value, gpointer user_data) { - Glib::Binding::BindingTransformSlot& the_slot = + Glib::Binding::SlotTransform& the_slot = static_cast(user_data)->from_source_to_target; - return Binding_transform_callback_common(binding, from_value, to_value, the_slot); + return Binding_transform_callback_common(from_value, to_value, the_slot); } -gboolean Binding_transform_from_callback(GBinding* binding, +gboolean Binding_transform_from_callback(GBinding*, const GValue* from_value, GValue* to_value, gpointer user_data) { - Glib::Binding::BindingTransformSlot& the_slot = + Glib::Binding::SlotTransform& the_slot = static_cast(user_data)->from_target_to_source; - return Binding_transform_callback_common(binding, from_value, to_value, the_slot); + return Binding_transform_callback_common(from_value, to_value, the_slot); } void Binding_transform_callback_destroy(gpointer user_data) @@ -81,8 +80,8 @@ Glib::RefPtr Binding::bind_property_value( const PropertyProxy_Base& source_property, const PropertyProxy_Base& target_property, BindingFlags flags, - const BindingTransformSlot& transform_to, - const BindingTransformSlot& transform_from) + const SlotTransform& transform_to, + const SlotTransform& transform_from) { GBinding* binding = 0; if (transform_to.empty() && transform_from.empty()) diff --git a/glib/src/binding.hg b/glib/src/binding.hg index f7760376..7308f85c 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -57,10 +57,8 @@ _WRAP_ENUM(BindingFlags, GBindingFlags) * applying it; for instance, the following binding: * * @code - * bool celsius_to_fahrenheit(const Glib::RefPtr& binding, - * const double& celsius, double& fahrenheit); - * bool fahrenheit_to_celsius(const Glib::RefPtr& binding, - * const double& fahrenheit, double& celsius); + * bool celsius_to_fahrenheit(const double& celsius, double& fahrenheit); + * bool fahrenheit_to_celsius(const double& fahrenheit, double& celsius); * Glib::Binding::bind_property(adjustment1->property_value(), * adjustment2->property_value(), Glib::BINDING_BIDIRECTIONAL, * sigc::ptr_fun(celsius_to_fahrenheit), sigc::ptr_fun(fahrenheit_to_celsius)); @@ -104,11 +102,11 @@ class Binding : public Glib::Object public: /** For instance,
- * bool on_transform_to(const Glib::RefPtr& binding, const GValue* from_value, GValue* to_value); + * bool on_transform_to(const GValue* from_value, GValue* to_value); * * @return true if the transformation was successful, and false otherwise. */ - typedef sigc::slot&, const GValue*, GValue*> BindingTransformSlot; + typedef sigc::slot SlotTransform; /** Creates a binding between @a source_property and @a target_property, * allowing you to set the transformation functions to be used by the binding. @@ -143,8 +141,8 @@ public: const PropertyProxy_Base& source_property, const PropertyProxy_Base& target_property, BindingFlags flags = BINDING_DEFAULT, - const BindingTransformSlot& transform_to = BindingTransformSlot(), - const BindingTransformSlot& transform_from = BindingTransformSlot()); + const SlotTransform& transform_to = SlotTransform(), + const SlotTransform& transform_from = SlotTransform()); _IGNORE(g_object_bind_property, g_object_bind_property_full, g_object_bind_property_with_closures) @@ -185,7 +183,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot&, const T_source&, T_target&>. + * sigc::slot. * * @see bind_property_value() * @@ -198,10 +196,10 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, - slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); } /** Creates a binding between @a source_property and @a target_property, @@ -221,7 +219,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot&, const T_source&, T_target&>. + * sigc::slot. * * @see bind_property_value() * @@ -234,10 +232,10 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, - slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); } /** Creates a binding between @a source_property and @a target_property, @@ -257,7 +255,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot&, const T_source&, T_target&>. + * sigc::slot. * * @see bind_property_value() * @@ -270,10 +268,10 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, - slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); } /** Creates a binding between @a source_property and @a target_property, @@ -293,7 +291,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot&, const T_source&, T_target&>. + * sigc::slot. * * @see bind_property_value() * @@ -306,10 +304,10 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, - slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to)); + slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); } /** Creates a binding between @a source_property and @a target_property, @@ -331,10 +329,10 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot&, const T_source&, T_target&>. + * sigc::slot. * @tparam T_functor_from Type of functor that translates from the target to the source. * Must be convertible to
- * sigc::slot&, const T_target&, T_source&>. + * sigc::slot. * * @see bind_property_value() * @@ -348,12 +346,12 @@ public: const T_functor_to& transform_to, const T_functor_from& transform_from) { - sigc::slot&, const T_source&, T_target&> slot_transform_to = transform_to; - sigc::slot&, const T_target&, T_source&> slot_transform_from = transform_from; + sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_from = transform_from; return bind_property_value(source_property, target_property, flags, - slot_transform_to.empty() ? BindingTransformSlot() : TransformProp(slot_transform_to), - slot_transform_from.empty() ? BindingTransformSlot() : TransformProp(slot_transform_from)); + slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to), + slot_transform_from.empty() ? SlotTransform() : TransformProp(slot_transform_from)); } _WRAP_METHOD(Glib::RefPtr get_source(), g_binding_get_source, refreturn) @@ -390,18 +388,18 @@ public: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ private: - // The functor TransformProp can be implicitly converted to a BindingTransformSlot + // The functor TransformProp can be implicitly converted to a SlotTransform // and used in a call to bind_property_value(). template class TransformProp : public sigc::functor_base { public: typedef bool result_type; - typedef sigc::slot&, const T_from&, T_to&> TypedBindingTransformSlot; + typedef sigc::slot SlotTypedTransform; - TransformProp(const TypedBindingTransformSlot& slot) : typed_transform(slot) {} + TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {} - bool operator()(const Glib::RefPtr& binding, const GValue* from_value, GValue* to_value) + bool operator()(const GValue* from_value, GValue* to_value) { Glib::Value from_glib_value; from_glib_value.init(from_value); @@ -409,14 +407,14 @@ private: to_glib_value.init(to_value); T_to to = to_glib_value.get(); - const bool result = typed_transform(binding, from_glib_value.get(), to); + const bool result = typed_transform(from_glib_value.get(), to); to_glib_value.set(to); g_value_copy(to_glib_value.gobj(), to_value); return result; } private: - TypedBindingTransformSlot typed_transform; + SlotTypedTransform typed_transform; }; }; -- cgit v1.2.1 From d735209931eef578f46e938deaa0982eb7b660fc Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 20 Jan 2015 12:45:20 +0100 Subject: Regenerated _docs.xml files. --- gio/src/gio_docs.xml | 2 +- glib/src/glib_docs.xml | 69 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index c2d54f74..ecb60fe4 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -52998,7 +52998,7 @@ thread-default (as per g_settings_new()). If @backend is %NULL then the default backend is used. If @path is %NULL then the path from the schema is used. It is an -error f @path is %NULL and the schema has no path of its own or if +error if @path is %NULL and the schema has no path of its own or if @path is non-%NULL and not equal to the path that the schema does have. diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index 3660e8f4..a08b9967 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -14033,7 +14033,7 @@ this may mean that the week-numbering year is one greater than the calendar year (so that these days have the same week-numbering year as the Thursday occurring early in the next year). -For Friday, Saturaday and Sunday occurring near the start of the year, +For Friday, Saturday and Sunday occurring near the start of the year, this may mean that the week-numbering year is one less than the calendar year (so that these days have the same week-numbering year as the Thursday occurring late in the previous year). @@ -36854,6 +36854,52 @@ Since: 2.18 + + +Updates a #GObject pointer to refer to @new_object. It increments the +reference count of @new_object (if non-%NULL), decrements the reference +count of the current value of @object_ptr (if non-%NULL), and assigns +@new_object to @object_ptr. The assignment is not atomic. + +@object_ptr must not be %NULL. + +A macro is also included that allows this function to be used without +pointer casts. The function itself is static inline, so its address may vary +between compilation units. + +One convenient usage of this function is in implementing property setters: +|[ +void +foo_set_bar (Foo *foo, +Bar *new_bar) +{ +g_return_if_fail (IS_FOO (foo)); +g_return_if_fail (new_bar == NULL || IS_BAR (new_bar)); + +if (g_set_object (&foo->bar, new_bar)) +g_object_notify (foo, "bar"); +} +]| + +Since: 2.44 + + + + + a pointer to a #GObject reference + + + + a pointer to the new #GObject to +assign to it, or %NULL to clear the pointer + + + + %TRUE if the value of @object_ptr changed, %FALSE otherwise + + + + Sets the name of the program. This name should not be localized, @@ -43916,11 +43962,12 @@ Since: 2.6 Hook up a new test case at @testpath, similar to g_test_add_func(). -A fixture data structure with setup and teardown function may be provided -though, similar to g_test_create_case(). +A fixture data structure with setup and teardown functions may be provided, +similar to g_test_create_case(). + g_test_add() is implemented as a macro, so that the fsetup(), ftest() and -fteardown() callbacks can expect a @Fixture pointer as first argument in -a type safe manner. +fteardown() callbacks can expect a @Fixture pointer as their first argument +in a type safe manner. They otherwise have type #GTestFixtureFunc. Since: 2.16 @@ -44155,14 +44202,14 @@ Since: 2.38 Create a new #GTestCase, named @test_name, this API is fairly low level, calling g_test_add() or g_test_add_func() is preferable. When this test is executed, a fixture structure of size @data_size -will be allocated and filled with 0s. Then @data_setup is called -to initialize the fixture. After fixture setup, the actual test -function @data_test is called. Once the test run completed, the -fixture structure is torn down by calling @data_teardown and -after that the memory is released. +will be automatically allocated and filled with zeros. Then @data_setup is +called to initialize the fixture. After fixture setup, the actual test +function @data_test is called. Once the test run completes, the +fixture structure is torn down by calling @data_teardown and +after that the memory is automatically released by the test framework. Splitting up a test run into fixture setup, test function and -fixture teardown is most usful if the same fixture is used for +fixture teardown is most useful if the same fixture is used for multiple tests. In this cases, g_test_create_case() will be called with the same fixture, but varying @test_name and @data_test arguments. -- cgit v1.2.1 From e6746b18ba66f4b1ab9a3d79140ce5f11f3b82e1 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 20 Jan 2015 12:47:45 +0100 Subject: 2.43.3 --- NEWS | 13 +++++++++++++ configure.ac | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3b75041a..fe4ae23f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,16 @@ +2.34.3 (unstable): + +Glib: +* Binding: Rename and change BindingTransformSlot to SlotTransform. + (Kjell Ahlstedt) Bug #738663. +* Add SlotSpawnChildSetup. + (Kjell Ahlstedt) Bug #528285. + +Documentation: +* Resource: Suppress incorrect doxygen links. + (Kjell Ahlstedt) + + 2.43.2 (unstable): Gio: diff --git a/configure.ac b/configure.ac index 547e9ed1..90956f10 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.2], +AC_INIT([glibmm], [2.43.3], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From 10e24926a149c8dbfbc5853b2d4ff5a4cd50bc4b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 25 Jan 2015 16:23:22 +0100 Subject: Glib::Error::register_init(): Call Glib::wrap_register_init() * glib/glibmm/error.cc: Call wrap_register_init() before wrap_init(). It was not necessary, when Error::register_init() was called from Glib::init(), but Error::register_init() can be called from other places (Glib::thread_init() and Glib::Error::throw_exception()). * glib/glibmm/init.cc: Not necessary to call Glib::wrap_register_init() before calling Glib::Error::register_init(). Bug #743466 (Mike Fleetwood). --- glib/glibmm/error.cc | 6 ++---- glib/glibmm/init.cc | 10 +++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index fe01cc6f..57844142 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -1,5 +1,3 @@ -// -*- c++ -*- - /* error.cc * * Copyright 2002 The gtkmm Development Team @@ -21,6 +19,7 @@ #include #include +#include #include #include #include @@ -131,6 +130,7 @@ void Error::register_init() if(!throw_func_table) { throw_func_table = new ThrowFuncTable(); + Glib::wrap_register_init(); Glib::wrap_init(); // make sure that at least the Glib exceptions are registered } } @@ -176,6 +176,4 @@ void Error::throw_exception(GError* gobject) throw Glib::Error(gobject); } - } // namespace Glib - diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc index 0710f3f4..92555607 100644 --- a/glib/glibmm/init.cc +++ b/glib/glibmm/init.cc @@ -1,6 +1,3 @@ -// -*- c++ -*- -/* $Id$ */ - /* Copyright (C) 2003 The glibmm Development Team * * This library is free software; you can redistribute it and/or @@ -18,7 +15,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #include namespace Glib @@ -26,9 +23,8 @@ namespace Glib void init() { - Glib::wrap_register_init(); - Glib::Error::register_init(); //also calls Glib::wrap_init(); + // Also calls Glib::wrap_register_init() and Glib::wrap_init(). + Glib::Error::register_init(); } } // namespace Glib - -- cgit v1.2.1 From a3b4eeff1bb475d29f92fdfd2b2975274750e081 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Feb 2015 12:49:14 +0100 Subject: gmmproc: Put DOXYGEN_SHOULD_SKIP_THIS around *_Class prototypes. These predeclarations, such as below, seem to confuse doxygen. See bug #743918 . namespace Gtk { class Window_Class; } // namespace Gtk --- tools/m4/class_gobject.m4 | 3 +++ tools/m4/class_interface.m4 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tools/m4/class_gobject.m4 b/tools/m4/class_gobject.m4 index f097f180..14cbb22e 100644 --- a/tools/m4/class_gobject.m4 +++ b/tools/m4/class_gobject.m4 @@ -115,7 +115,10 @@ ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl _STRUCT_PROTOTYPE() ')dnl +#ifndef DOXYGEN_SHOULD_SKIP_THIS __NAMESPACE_BEGIN__ class __CPPNAME__`'_Class; __NAMESPACE_END__ +#endif //DOXYGEN_SHOULD_SKIP_THIS + _SECTION(SECTION_HEADER3) ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4 index fe4add6b..fb6d387d 100644 --- a/tools/m4/class_interface.m4 +++ b/tools/m4/class_interface.m4 @@ -117,7 +117,10 @@ define(`_END_CLASS_INTERFACE',` _SECTION(SECTION_HEADER1) _STRUCT_PROTOTYPE() +#ifndef DOXYGEN_SHOULD_SKIP_THIS __NAMESPACE_BEGIN__ class __CPPNAME__`'_Class; __NAMESPACE_END__ +#endif // DOXYGEN_SHOULD_SKIP_THIS + _SECTION(SECTION_HEADER3) ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl -- cgit v1.2.1 From 2d477f36407683b7e0d5e948939ef6ca4ffb7abf Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 4 Feb 2015 09:43:26 +0100 Subject: Regenerate _docs.xml files. --- gio/src/gio_docs.xml | 423 +++++++++++++++++++++++++++++++++++++++++++++++++ glib/src/glib_docs.xml | 216 +++++++++++++++++++++++-- 2 files changed, 626 insertions(+), 13 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index ecb60fe4..b8ea5b9e 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -3939,6 +3939,36 @@ before calling the callback.
+ + +This signal is emitted whenever items were added or removed to +@list. At @position, @removed items were removed and @added items +were added in their place. + +Since: 2.44 + + + + + the #GListModel that changed + + + + the position at which @list changed + + + + the number of items removed + + + + the number of items added + + + + + + Emitted when a change has occured to the menu. @@ -44629,6 +44659,337 @@ trouble. + + +Get the item at @position. If @position is greater than the number of +items in @list, %NULL is returned. + +%NULL is never returned for an index that is smaller than the length +of the list. See g_list_model_get_n_items(). + +Since: 2.44 + + + + + a #GListModel + + + + the position of the item to fetch + + + + the item at @position. + + + + + + +Gets the type of the items in @list. All items returned from +g_list_model_get_type() are of that type or a subtype, or are an +implementation of that interface. + +The item type of a #GListModel can not change during the life of the +model. + +Since: 2.44 + + + + + a #GListModel + + + + the #GType of the items contained in @list. + + + + + + +Gets the number of items in @list. + +Depending on the model implementation, calling this function may be +less efficient than iterating the list with increasing values for +@position until g_list_model_get_item() returns %NULL. + +Since: 2.44 + + + + + a #GListModel + + + + the number of items in @list. + + + + + + +Get the item at @position. If @position is greater than the number of +items in @list, %NULL is returned. + +%NULL is never returned for an index that is smaller than the length +of the list. See g_list_model_get_n_items(). + +Since: 2.44 + + + + + a #GListModel + + + + the position of the item to fetch + + + + the object at @position. + + + + + + +Emits the #GListModel::items-changed signal on @list. + +This function should only be called by classes implementing +#GListModel. It has to be called after the internal representation +of @list has been updated, because handlers connected to this signal +might query the new state of the list. + +Implementations must only make changes to the model (as visible to +its consumer) in places that will not cause problems for that +consumer. For models that are driven directly by a write API (such +as #GListStore), changes can be reported in response to uses of that +API. For models that represent remote data, changes should only be +made from a fresh mainloop dispatch. It is particularly not +permitted to make changes in response to a call to the #GListModel +consumer API. + +Stated another way: in general, it is assumed that code making a +series of accesses to the model via the API, without returning to the +mainloop, and without calling other code, will continue to view the +same contents of the model. + +Since: 2.44 + + + + + a #GListModel + + + + the position at which @list changed + + + + the number of items removed + + + + the number of items added + + + + + + + + +Appends @item to @store. @item must be of type #GListStore:item-type. + +This function takes a ref on @item. + +Use g_list_store_splice() to append multiple items at the same time +efficiently. + +Since: 2.44 + + + + + a #GListStore + + + + the new item + + + + + + + + +Inserts @item into @store at @position. @item must be of type +#GListStore:item-type or derived from it. @position must be smaller +than the length of the list, or equal to it to append. + +This function takes a ref on @item. + +Use g_list_store_splice() to insert multiple items at the same time +efficiently. + +Since: 2.44 + + + + + a #GListStore + + + + the position at which to insert the new item + + + + the new item + + + + + + + + +Inserts @item into @store at a position to be determined by the +@compare_func. + +The list must already be sorted before calling this function or the +result is undefined. Usually you would approach this by only ever +inserting items by way of this function. + +This function takes a ref on @item. + +Since: 2.44 + + + + + a #GListStore + + + + the new item + + + + the position at which @item was inserted + + + + + + +Creates a new #GListStore with items of type @item_type. @item_type +must be a subclass of #GObject. + +Since: 2.44 + + + + + the #GType of items in the list + + + + a new #GListStore + + + + + +Removes the item from @store that is at @position. @position must be +smaller than the current length of the list. + +Use g_list_store_splice() to remove multiple items at the same time +efficiently. + +Since: 2.44 + + + + + a #GListStore + + + + the position of the item that is to be removed + + + + + + + + +Removes all items from @store. + +Since: 2.44 + + + + + a #GListStore + + + + + + + + +Changes @store by removing @n_removals items and adding @n_additions +items to it. @additions must contain @n_additions items of type +#GListStore:item-type. %NULL is not permitted. + +This function is more efficient than g_list_store_insert() and +g_list_store_remove(), because it only emits +#GListModel::items-changed once for the change. + +This function takes a ref on each item in @additions. + +The parameters @position and @n_removals must be correct (ie: +@position + @n_removals must be less than or equal to the length of +the list at the time this function is called). + +Since: 2.44 + + + + + a #GListStore + + + + the position at which to make the change + + + + the number of items to remove + + + + the items to add + + + + the number of items to add + + + + + + Loads a loadable icon. For the asynchronous version of this function, @@ -53328,6 +53689,24 @@ Since: 2.34 + + +Gets the name of @key. + +Since: 2.44 + + + + + a #GSettingsSchemaKey + + + + the name of @key. + + + + Queries the range of a key. @@ -53489,6 +53868,27 @@ Since: 2.40 + + +Gets the list of children in @schema. + +You should free the return value with g_strfreev() when you are done +with it. + +Since: 2.44 + + + + + a #GSettingsSchema + + + + a list of the children on @settings + + + + Increase the reference count of @schema, returning a new reference. @@ -54323,6 +54723,29 @@ Since: 2.30 + + +Sets the state hint for the action. + +See g_action_get_state_hint() for more information about +action state hints. + +Since: 2.44 + + + + + a #GSimpleAction + + + + a #GVariant representing the state hint + + + + + + Reports an error in an asynchronous function in an idle function by diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index a08b9967..543c9391 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -3673,6 +3673,30 @@ Error codes returned by parsing text-format GVariants. + + +Type of Windows edition to check for at run-time. + + + + + The running system can be a workstation or a server edition of +Windows. The type of the running system is therefore not checked. + + + + The running system is a workstation edition of Windows, +such as Windows 7 Professional. + + + + The running system is a server edition of Windows, such as +Windows Server 2008 R2. + + + + + A wrapper for the POSIX access() function. This function is used to @@ -4287,7 +4311,8 @@ This function generates enough precision that converting the string back using g_ascii_strtod() gives the same machine-number (on machines with IEEE compatible 64bit doubles). It is guaranteed that the size of the resulting string will never -be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes. +be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes, including the terminating +nul character, which is always added. @@ -4316,6 +4341,8 @@ decimal point. To format the number you pass in a printf()-style format string. Allowed conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. +The returned buffer is guaranteed to be nul-terminated. + If you just want to want to serialize the value into a string, use g_ascii_dtostr(). @@ -6304,6 +6331,130 @@ Since: 2.30 + + +Helper to declare a variable with automatic cleanup. + +The variable is cleaned up in a way appropriate to its type when the +variable goes out of scope. The type must support this. + +This feature is only supported on GCC and clang. This macro is not +defined on other compilers and should not be used in programs that +are intended to be portable to those compilers. + +This is meant to be used with stack-allocated structures and +non-pointer types. For the (more commonly used) pointer version, see +g_autoptr(). + +This macro can be used to avoid having to do explicit cleanups of +local variables when exiting functions. It often vastly simplifies +handling of error conditions, removing the need for various tricks +such as 'goto out' or repeating of cleanup code. It is also helpful +for non-error cases. + +Consider the following example: + +|[ +GVariant * +my_func(void) +{ +g_auto(GQueue) queue = G_QUEUE_INIT; +g_auto(GVariantBuilder) builder; + +g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); + +... + +if (error_condition) +return NULL; + +... + +return g_variant_builder_end (&builder); +} +]| + +You must initialise the variable in some way -- either by use of an +initialiser or by ensuring that an _init function will be called on +it unconditionally before it goes out of scope. + +Since: 2.44 + + + + + a supported variable type + + + + + + + + +Helper to declare a pointer variable with automatic cleanup. + +The variable is cleaned up in a way appropriate to its type when the +variable goes out of scope. The type must support this. + +This feature is only supported on GCC and clang. This macro is not +defined on other compilers and should not be used in programs that +are intended to be portable to those compilers. + +This is meant to be used to declare pointers to types with cleanup +functions. The type of the variable is a pointer to @typename. You +must not add your own '*'. + +This macro can be used to avoid having to do explicit cleanups of +local variables when exiting functions. It often vastly simplifies +handling of error conditions, removing the need for various tricks +such as 'goto out' or repeating of cleanup code. It is also helpful +for non-error cases. + +Consider the following example: + +|[ +gboolean +check_exists(GVariant *dict) +{ +g_autoptr(GVariant) dirname; +g_autoptr(GVariant) basename = NULL; +g_autoptr(gchar) path = NULL; + +dirname = g_variant_lookup_value (dict, "dirname", G_VARIANT_TYPE_STRING); + +if (dirname == NULL) +return FALSE; + +basename = g_variant_lookup_value (dict, "basename", G_VARIANT_TYPE_STRING); + +if (basename == NULL) +return FALSE; + +path = g_build_filename (g_variant_get_string (dirname, NULL), +g_variant_get_string (basename, NULL), +NULL); + +return g_access (path, R_OK) == 0; +} +]| + +You must initialise the variable in some way -- either by use of an +initialiser or by ensuring that it is assigned to unconditionally +before it goes out of scope. + +Since: 2.44 + + + + + a supported variable type + + + + + + Decode a sequence of Base-64 encoded text into binary data. Note @@ -28136,7 +28287,7 @@ by @newval, %FALSE otherwise. Releases all references to other objects. This can be used to break reference cycles. -This functions should only be called from object system implementations. +This function should only be called from object system implementations. @@ -46076,7 +46227,7 @@ Since: 2.32 -This functions returns the #GThread corresponding to the +This function returns the #GThread corresponding to the current thread. Note that this function does not increase the reference count of the returned struct. @@ -57766,6 +57917,48 @@ Since: 2.32 + + +Returns whether the version of the Windows operating system the +code is running on is at least the specified major, minor and +service pack versions. See MSDN documentation for the Operating +System Version. Software that needs even more detailed version and +feature information should use the Win32 API VerifyVersionInfo() +directly. + +Successive calls of this function can be used for enabling or +disabling features at run-time for a range of Windows versions, +as per the VerifyVersionInfo() API documentation. + +Since: 2.44 + + + + + major version of Windows + + + + minor version of Windows + + + + Windows Service Pack Level, 0 if none + + + + Type of Windows OS + + + + %TRUE if the Windows Version is the same or greater than +the specified major, minor and service pack versions, and +whether the running Windows is a workstation or server edition +of Windows, if specifically specified. + + + + Translate a Win32 error code (as returned by GetLastError() or @@ -57976,17 +58169,14 @@ freed with g_free() when no longer needed. If something goes wrong, -Returns version information for the Windows operating system the -code is running on. See MSDN documentation for the GetVersion() -function. To summarize, the most significant bit is one on Win9x, -and zero on NT-based systems. Since version 2.14, GLib works only -on NT-based systems, so checking whether your are running on Win9x -in your own software is moot. The least significant byte is 4 on -Windows NT 4, and 5 on Windows XP. Software that needs really -detailed version and feature information should use Win32 API like -GetVersionEx() and VerifyVersionInfo(). +This function is deprecated. Use +g_win32_check_windows_version() instead. -Since: 2.6 +Deprecated: 2.44: Be aware that for Windows 8.1 and Windows Server +2012 R2 and later, this will return 62 unless the application is +manifested for Windows 8.1/Windows Server 2012 R2, for example. +MSDN stated that GetVersion(), which is used here, is subject to +further change or removal after Windows 8.1. -- cgit v1.2.1 From 40a887ca40010ad7816e120bb4d846752595635a Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 4 Feb 2015 09:43:52 +0100 Subject: Regenerate enums .defs files. --- glib/src/glib_enums.defs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/glib/src/glib_enums.defs b/glib/src/glib_enums.defs index 2630247f..399c7923 100644 --- a/glib/src/glib_enums.defs +++ b/glib/src/glib_enums.defs @@ -1981,6 +1981,26 @@ ) ) +;; From gwin32.h + +;; Original typedef: +;; typedef enum +;; { +;; G_WIN32_OS_ANY, +;; G_WIN32_OS_WORKSTATION, +;; G_WIN32_OS_SERVER, +;; } GWin32OSType; + +(define-enum-extended Win32OSType + (in-module "G") + (c-name "GWin32OSType") + (values + '("any" "G_WIN32_OS_ANY" "0") + '("workstation" "G_WIN32_OS_WORKSTATION" "1") + '("server" "G_WIN32_OS_SERVER" "2") + ) +) + ;; From gthread.h ;; Original typedef: -- cgit v1.2.1 From ee8b4a04a5b9f0bdb6743f2c06799f9d5e2353c9 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 4 Feb 2015 09:44:23 +0100 Subject: Regenerate methods .defs files. --- gio/src/gio_methods.defs | 144 +++++++++++++++++++++++++++++++++++++--- glib/src/glib_functions.defs | 15 +++++ glib/src/gobject_functions.defs | 4 ++ 3 files changed, 155 insertions(+), 8 deletions(-) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 1170f1e0..00c9d82c 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -10068,6 +10068,10 @@ +;; From gio-autocleanups.h + + + ;; From gioenums.h @@ -10834,6 +10838,117 @@ +;; From glistmodel.h + +(define-function g_list_model_get_type + (c-name "g_list_model_get_type") + (return-type "GType") +) + +(define-method get_item_type + (of-object "GListModel") + (c-name "g_list_model_get_item_type") + (return-type "GType") +) + +(define-method get_n_items + (of-object "GListModel") + (c-name "g_list_model_get_n_items") + (return-type "guint") +) + +(define-method get_item + (of-object "GListModel") + (c-name "g_list_model_get_item") + (return-type "gpointer") + (parameters + '("guint" "position") + ) +) + +(define-method get_object + (of-object "GListModel") + (c-name "g_list_model_get_object") + (return-type "GObject*") + (parameters + '("guint" "position") + ) +) + +(define-method items_changed + (of-object "GListModel") + (c-name "g_list_model_items_changed") + (return-type "none") + (parameters + '("guint" "position") + '("guint" "removed") + '("guint" "added") + ) +) + + + +;; From gliststore.h + +(define-method insert + (of-object "GListStore") + (c-name "g_list_store_insert") + (return-type "none") + (parameters + '("guint" "position") + '("gpointer" "item") + ) +) + +(define-method insert_sorted + (of-object "GListStore") + (c-name "g_list_store_insert_sorted") + (return-type "guint") + (parameters + '("gpointer" "item") + '("GCompareDataFunc" "compare_func") + '("gpointer" "user_data") + ) +) + +(define-method append + (of-object "GListStore") + (c-name "g_list_store_append") + (return-type "none") + (parameters + '("gpointer" "item") + ) +) + +(define-method remove + (of-object "GListStore") + (c-name "g_list_store_remove") + (return-type "none") + (parameters + '("guint" "position") + ) +) + +(define-method remove_all + (of-object "GListStore") + (c-name "g_list_store_remove_all") + (return-type "none") +) + +(define-method splice + (of-object "GListStore") + (c-name "g_list_store_splice") + (return-type "none") + (parameters + '("guint" "position") + '("guint" "n_removals") + '("gpointer*" "additions") + '("guint" "n_additions") + ) +) + + + ;; From gloadableicon.h (define-function g_loadable_icon_get_type @@ -14402,6 +14517,12 @@ ) ) +(define-method list_children + (of-object "GSettingsSchema") + (c-name "g_settings_schema_list_children") + (return-type "gchar**") +) + (define-function g_settings_schema_key_get_type (c-name "g_settings_schema_key_get_type") (return-type "GType") @@ -14446,6 +14567,12 @@ ) ) +(define-method get_name + (of-object "GSettingsSchemaKey") + (c-name "g_settings_schema_key_get_name") + (return-type "const-gchar*") +) + (define-method get_summary (of-object "GSettingsSchemaKey") (c-name "g_settings_schema_key_get_summary") @@ -14671,6 +14798,15 @@ ) ) +(define-method set_state_hint + (of-object "GSimpleAction") + (c-name "g_simple_action_set_state_hint") + (return-type "none") + (parameters + '("GVariant*" "state_hint") + ) +) + ;; From gsimpleasyncresult.h @@ -18231,14 +18367,6 @@ ;; From gunixmounts.h -(define-function g_unix_mount_free - (c-name "g_unix_mount_free") - (return-type "none") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - (define-method free (of-object "GUnixMountPoint") (c-name "g_unix_mount_point_free") diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index 9d5e4c3c..edebe47a 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -6063,6 +6063,10 @@ +;; From glib-autocleanups.h + + + ;; From glibconfig.h @@ -14940,6 +14944,17 @@ ) ) +(define-function g_win32_check_windows_version + (c-name "g_win32_check_windows_version") + (return-type "gboolean") + (parameters + '("const-gint" "major") + '("const-gint" "minor") + '("const-gint" "spver") + '("const-GWin32OSType" "os_type") + ) +) + ;; From valgrind.h diff --git a/glib/src/gobject_functions.defs b/glib/src/gobject_functions.defs index 7611a004..b59f0cfc 100644 --- a/glib/src/gobject_functions.defs +++ b/glib/src/gobject_functions.defs @@ -1352,6 +1352,10 @@ +;; From gobject-autocleanups.h + + + ;; From gobject.h (define-function g_initially_unowned_get_type -- cgit v1.2.1 From 09de63af427ec0b9f3968d66ac3b8a89fa42eeef Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 9 Feb 2015 09:52:41 +0100 Subject: Gio: Add TcpWrapperConnection. * tools/extra_defs_gen/genererate_defs_gio.cc: Add G_TCP_WRAPPER_CONNECTION. * gio/src/gio_signals.defs: Regenerate this to add the signals for GTcpWrapperConnection. * gio/src/filelist.am: * gio/src/tcpwrapperconnection.[hg|ccg]: Add TcpWrapperConnection. Markus Kolb noticed that this was missing. * gio/giomm.h: Include tcpwrapperconnection.h --- gio/giomm.h | 1 + gio/src/filelist.am | 1 + gio/src/gio_signals.defs | 11 ++++++++ gio/src/tcpwrapperconnection.ccg | 22 +++++++++++++++ gio/src/tcpwrapperconnection.hg | 46 +++++++++++++++++++++++++++++++ tools/extra_defs_gen/generate_defs_gio.cc | 1 + 6 files changed, 82 insertions(+) create mode 100644 gio/src/tcpwrapperconnection.ccg create mode 100644 gio/src/tcpwrapperconnection.hg diff --git a/gio/giomm.h b/gio/giomm.h index a618251a..b6d07b0c 100644 --- a/gio/giomm.h +++ b/gio/giomm.h @@ -129,6 +129,7 @@ #include #include #include +#include #include #include #include diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 17737fb0..76a587f2 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -116,6 +116,7 @@ giomm_files_any_hg = \ socketservice.hg \ srvtarget.hg \ tcpconnection.hg \ + tcpwrapperconnection.hg \ threadedsocketservice.hg \ themedicon.hg \ tlscertificate.hg \ diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 232072fc..d6ce021e 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -2001,6 +2001,17 @@ (construct-only #f) ) +;; From GTcpWrapperConnection + +(define-property base-io-stream + (of-object "GTcpWrapperConnection") + (prop-type "GParamObject") + (docs "The wrapped GIOStream") + (readable #t) + (writable #t) + (construct-only #t) +) + ;; From GTlsBackend ;; From GTlsCertificate diff --git a/gio/src/tcpwrapperconnection.ccg b/gio/src/tcpwrapperconnection.ccg new file mode 100644 index 00000000..58b9f179 --- /dev/null +++ b/gio/src/tcpwrapperconnection.ccg @@ -0,0 +1,22 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +#include + +namespace Gio +{ +} // namespace Gio diff --git a/gio/src/tcpwrapperconnection.hg b/gio/src/tcpwrapperconnection.hg new file mode 100644 index 00000000..e5e214f9 --- /dev/null +++ b/gio/src/tcpwrapperconnection.hg @@ -0,0 +1,46 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +#include + +_DEFS(giomm,gio) +_PINCLUDE(giomm/private/tcpconnection_p.h) + +namespace Gio +{ + +/** + * TODO + * + * @newin{2,34} + * @ingroup NetworkIO + */ +class TcpWrapperConnection : public Gio::TcpConnection +{ + _CLASS_GOBJECT(TcpWrapperConnection, GTcpWrapperConnection, G_TCP_WRAPPER_CONNECTION, Gio::TcpConnection, GTcpConnection) + +public: + + _WRAP_CTOR(TcpWrapperConnection(const Glib::RefPtr& base_io_stream, const Glib::RefPtr& socket), g_tcp_wrapper_connection_new) + + _WRAP_METHOD(Glib::RefPtr get_base_io_stream(), g_tcp_wrapper_connection_get_base_io_stream, refreturn) + _WRAP_METHOD(Glib::RefPtr get_base_io_stream() const, g_tcp_wrapper_connection_get_base_io_stream, constversion, refreturn) + + _WRAP_PROPERTY("base-io-stream", Glib::RefPtr) +}; + +} // namespace Gio diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index 7fb58f26..cec799af 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -122,6 +122,7 @@ int main(int, char**) << get_defs(G_TYPE_SOCKET_CLIENT) << get_defs(G_TYPE_SOCKET_CONNECTION) << get_defs(G_TYPE_TCP_CONNECTION) + << get_defs(G_TYPE_TCP_WRAPPER_CONNECTION) << get_defs(G_TYPE_TLS_BACKEND) << get_defs(G_TYPE_TLS_CERTIFICATE) << get_defs(G_TYPE_TLS_CLIENT_CONNECTION) -- cgit v1.2.1 From 0cfe1b6f779aad7f5e9416cc21c204c93bca6bff Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 9 Feb 2015 09:58:07 +0100 Subject: Gio: TcpWrapperConnection: Add documentation. Based on the C documentation. --- gio/src/tcpwrapperconnection.hg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gio/src/tcpwrapperconnection.hg b/gio/src/tcpwrapperconnection.hg index e5e214f9..1e1a943a 100644 --- a/gio/src/tcpwrapperconnection.hg +++ b/gio/src/tcpwrapperconnection.hg @@ -23,8 +23,13 @@ _PINCLUDE(giomm/private/tcpconnection_p.h) namespace Gio { -/** - * TODO +/** Wrapper for non-Gio::SocketConnection-based, Gio::Socket-based Gio::IOStreams. + * + * This can be used to wrap a Gio::Stream that is + * based on a Gio::Socket, but which is not actually a + * Gio::SocketConnection. This is used by Gio::SocketClient so that it can + * always return a Gio::SocketConnection, even when the connection it has + * actually created is not directly a Gio::SocketConnection. * * @newin{2,34} * @ingroup NetworkIO -- cgit v1.2.1 From fe4ce8e58b523935166fdd7eb074719d2f22f829 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 16 Feb 2015 11:15:06 +0100 Subject: Delete obsolete .defs files * gio/src/filelist.am: Remove gio_others.defs. * gio/src/gio_methods.defs.patch: Deleted, not used. * gio/src/gio_others.defs: Deleted, not used. * glib/src/filelist.am: Remove glib_deprecated_enums.defs and gobject.defs. * glib/src/glib.defs: Remove glib_deprecated_functions.defs and glib_deprecated_enums.defs. * glib/src/glib_deprecated_enums.defs: Deleted, not needed. * glib/src/glib_deprecated_functions.defs: Deleted, not needed. * glib/src/gobject.defs: Deleted, not used. --- gio/src/filelist.am | 1 - gio/src/gio_methods.defs.patch | 66 --------------------------------- gio/src/gio_others.defs | 44 ---------------------- glib/src/filelist.am | 2 - glib/src/glib.defs | 2 - glib/src/glib_deprecated_enums.defs | 22 ----------- glib/src/glib_deprecated_functions.defs | 50 ------------------------- glib/src/gobject.defs | 3 -- 8 files changed, 190 deletions(-) delete mode 100644 gio/src/gio_methods.defs.patch delete mode 100644 gio/src/gio_others.defs delete mode 100644 glib/src/glib_deprecated_enums.defs delete mode 100644 glib/src/glib_deprecated_functions.defs delete mode 100644 glib/src/gobject.defs diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 76a587f2..f2a18bb5 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -6,7 +6,6 @@ giomm_files_defs = \ gio_methods.defs \ gio_extra_objects.defs \ gio_unix_functions.defs \ - gio_others.defs \ gio_signals.defs \ gio_vfuncs.defs \ gio_docs.xml \ diff --git a/gio/src/gio_methods.defs.patch b/gio/src/gio_methods.defs.patch deleted file mode 100644 index 4c6711fd..00000000 --- a/gio/src/gio_methods.defs.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- gio_methods.defs 2011-06-19 18:23:06.000000000 -0400 -+++ gio_methods_new.defs 2011-06-19 18:21:21.000000000 -0400 -@@ -867,8 +867,8 @@ - (c-name "GFileQueryInfoFlags") - (gtype-id "G_TYPE_FILE_QUERY_INFO_FLAGS") - (values -- '("ne" "G_FILE_QUERY_INFO_NONE") -- '("follow-symlinks" "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS") -+ '("none" "G_FILE_QUERY_INFO_NONE") -+ '("nofollow-symlinks" "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS") - ) - ) - -@@ -888,7 +888,7 @@ - (c-name "GMountMountFlags") - (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS") - (values -- '("e" "G_MOUNT_MOUNT_NONE") -+ '("none" "G_MOUNT_MOUNT_NONE") - ) - ) - -@@ -907,7 +907,7 @@ - (c-name "GDriveStartFlags") - (gtype-id "G_TYPE_DRIVE_START_FLAGS") - (values -- '("e" "G_DRIVE_START_NONE") -+ '("none" "G_DRIVE_START_NONE") - ) - ) - -@@ -1321,8 +1321,8 @@ - (c-name "GDBusCallFlags") - (gtype-id "G_TYPE_D_BUS_CALL_FLAGS") - (values -- '("ne" "G_DBUS_CALL_FLAGS_NONE") -- '("-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START") -+ '("none" "G_DBUS_CALL_FLAGS_NONE") -+ '("no-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START") - ) - ) - -@@ -1344,9 +1344,9 @@ - (c-name "GDBusMessageFlags") - (gtype-id "G_TYPE_D_BUS_MESSAGE_FLAGS") - (values -- '("ne" "G_DBUS_MESSAGE_FLAGS_NONE") -- '("-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED") -- '("-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START") -+ '("none" "G_DBUS_MESSAGE_FLAGS_NONE") -+ '("no-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED") -+ '("no-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START") - ) - ) - -@@ -1405,8 +1405,8 @@ - (c-name "GDBusSignalFlags") - (gtype-id "G_TYPE_D_BUS_SIGNAL_FLAGS") - (values -- '("ne" "G_DBUS_SIGNAL_FLAGS_NONE") -- '("-match-rule" "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE") -+ '("none" "G_DBUS_SIGNAL_FLAGS_NONE") -+ '("no-match-rule" "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE") - ) - ) - diff --git a/gio/src/gio_others.defs b/gio/src/gio_others.defs deleted file mode 100644 index 43e27c83..00000000 --- a/gio/src/gio_others.defs +++ /dev/null @@ -1,44 +0,0 @@ -; h2defs.py does not generate this. murrayc. -(define-function g_themed_icon_get_names - (c-name "g_themed_icon_get_names") - (return-type "const-char*const*") -) - -; h2defs failed to generate this murrayc: -(define-method get_environ - (of-object "GApplicationCommandLine") - (c-name "g_application_command_line_get_environ") - (return-type "const-gchar*const*") -) - -(define-method list_schemas - (of-object "GSettingsBackend") - (c-name "g_settings_list_schemas") - (return-type "const-gchar*const*") -) - -; extra_defs does not generate these, for some reason. murrayc: -(define-signal changed - (of-object "GMount") - (return-type "void") - (when "last") -) - -(define-signal unmounted - (of-object "GMount") - (return-type "void") - (when "last") -) - -; extra_defs does not generate these, for some reason. murrayc: -(define-signal changed - (of-object "GVolume") - (return-type "void") - (when "last") -) - -(define-signal removed - (of-object "GVolume") - (return-type "void") - (when "last") -) diff --git a/glib/src/filelist.am b/glib/src/filelist.am index c66e01b0..133f6bef 100644 --- a/glib/src/filelist.am +++ b/glib/src/filelist.am @@ -3,13 +3,11 @@ glibmm_files_defs = \ glib.defs \ glib_enums.defs \ - glib_deprecated_enums.defs \ glib_functions.defs \ glib_extra_objects.defs \ glib_signals.defs \ gmodule_enums.defs \ gmodule_functions.defs \ - gobject.defs \ gobject_enums.defs \ gobject_functions.defs \ glib_docs.xml \ diff --git a/glib/src/glib.defs b/glib/src/glib.defs index e106d6b7..dd679a35 100644 --- a/glib/src/glib.defs +++ b/glib/src/glib.defs @@ -1,7 +1,5 @@ (include glib_functions.defs) -(include glib_deprecated_functions.defs) (include glib_enums.defs) -(include glib_deprecated_enums.defs) (include glib_extra_objects.defs) (include glib_signals.defs) (include gobject_enums.defs) diff --git a/glib/src/glib_deprecated_enums.defs b/glib/src/glib_deprecated_enums.defs deleted file mode 100644 index b80fc58c..00000000 --- a/glib/src/glib_deprecated_enums.defs +++ /dev/null @@ -1,22 +0,0 @@ -;; From gthread.h - -;; Original typedef: -;; typedef enum -;; { -;; G_THREAD_PRIORITY_LOW, -;; G_THREAD_PRIORITY_NORMAL, -;; G_THREAD_PRIORITY_HIGH, -;; G_THREAD_PRIORITY_URGENT -;; } GThreadPriority; - -(define-enum-extended ThreadPriority - (in-module "G") - (c-name "GThreadPriority") - (values - '("low" "G_THREAD_PRIORITY_LOW" "0") - '("normal" "G_THREAD_PRIORITY_NORMAL" "1") - '("high" "G_THREAD_PRIORITY_HIGH" "2") - '("urgent" "G_THREAD_PRIORITY_URGENT" "3") - ) -) - diff --git a/glib/src/glib_deprecated_functions.defs b/glib/src/glib_deprecated_functions.defs deleted file mode 100644 index eb230a6e..00000000 --- a/glib/src/glib_deprecated_functions.defs +++ /dev/null @@ -1,50 +0,0 @@ -;; -*- scheme -*- -; object definitions ... -;; Enumerations and flags ... - -(define-enum Priority - (in-module "GThread") - (c-name "GThreadPriority") - (gtype-id "G_TYPE_THREAD_PRIORITY") - (values - '("low" "G_THREAD_PRIORITY_LOW") - '("normal" "G_THREAD_PRIORITY_NORMAL") - '("high" "G_THREAD_PRIORITY_HIGH") - '("urgent" "G_THREAD_PRIORITY_URGENT") - ) -) - - -;; From gallocator.h - - - -;; From gcache.h - - - -;; From gcompletion.h - - - -;; From grel.h - - - -;; From gthread.h - -(define-function guint64 - (c-name "guint64") - (return-type "GLIB_VAR") - (parameters - '("*" "g_thread_gettime") - ) -) - -(define-method get_mutex_impl - (of-object "GStaticMutex") - (c-name "g_static_mutex_get_mutex_impl") - (return-type "GMutex*") -) - - diff --git a/glib/src/gobject.defs b/glib/src/gobject.defs deleted file mode 100644 index 0c9f4b99..00000000 --- a/glib/src/gobject.defs +++ /dev/null @@ -1,3 +0,0 @@ -(include gobject_functions.defs) -(include gobject_enums.defs) - -- cgit v1.2.1 From 3c03b071d1f5e1beff7def57c6eedbe2fd7d6316 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Feb 2015 12:41:47 +0100 Subject: Regenerate methods .defs and .defs.patch files * gio/src/gio_methods.defs: * glib/src/glib_functions.defs: * glib/src/glib_functions.defs.patch: * glib/src/gobject_functions.defs: Updated. --- gio/src/gio_methods.defs | 15 ++++++++++----- glib/src/glib_functions.defs | 24 ++++++++++++++++++++++++ glib/src/glib_functions.defs.patch | 14 +++++++------- glib/src/gobject_functions.defs | 5 +++++ 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 00c9d82c..ed4d2449 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -2735,6 +2735,16 @@ ) ) +(define-method bind_busy_property + (of-object "GApplication") + (c-name "g_application_bind_busy_property") + (return-type "none") + (parameters + '("gpointer" "object") + '("const-gchar*" "property") + ) +) + ;; From gapplicationimpl.h @@ -10840,11 +10850,6 @@ ;; From glistmodel.h -(define-function g_list_model_get_type - (c-name "g_list_model_get_type") - (return-type "GType") -) - (define-method get_item_type (of-object "GListModel") (c-name "g_list_model_get_item_type") diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index edebe47a..f58dee7a 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -8230,6 +8230,18 @@ (return-type "none") ) +(define-method ref + (of-object "GOptionGroup") + (c-name "g_option_group_ref") + (return-type "GOptionGroup*") +) + +(define-method unref + (of-object "GOptionGroup") + (c-name "g_option_group_unref") + (return-type "none") +) + (define-method add_entries (of-object "GOptionGroup") (c-name "g_option_group_add_entries") @@ -12097,6 +12109,18 @@ (return-type "guint") ) +(define-method locker_new + (of-object "GMutex") + (c-name "g_mutex_locker_new") + (return-type "GMutexLocker*") +) + +(define-method free + (of-object "GMutexLocker") + (c-name "g_mutex_locker_free") + (return-type "none") +) + ;; From gthreadpool.h diff --git a/glib/src/glib_functions.defs.patch b/glib/src/glib_functions.defs.patch index b36c05a6..c0437518 100644 --- a/glib/src/glib_functions.defs.patch +++ b/glib/src/glib_functions.defs.patch @@ -1,6 +1,6 @@ ---- glib_functions.defs 2012-02-28 10:09:30.000000000 -0500 -+++ glib_functions.defs.new 2012-02-28 10:08:25.000000000 -0500 -@@ -2563,7 +2563,7 @@ +--- glib_functions.defs.orig 2015-02-15 16:49:21.605101660 +0100 ++++ glib_functions.defs 2015-02-15 16:49:21.617101670 +0100 +@@ -2739,7 +2739,7 @@ ) ) @@ -9,7 +9,7 @@ (of-object "GIConv") (c-name "g_iconv") (return-type "gsize") -@@ -12346,13 +12346,9 @@ +@@ -13320,13 +13320,9 @@ (return-type "const-gchar*-const*") ) @@ -24,9 +24,9 @@ +;; has a function pointer parameter and that is not handled correctly by +;; h2def.py. - (define-function g_get_user_runtime_dir - (c-name "g_get_user_runtime_dir") -@@ -12440,13 +12436,8 @@ + (define-function g_get_system_config_dirs + (c-name "g_get_system_config_dirs") +@@ -13419,13 +13415,8 @@ ) ) diff --git a/glib/src/gobject_functions.defs b/glib/src/gobject_functions.defs index b59f0cfc..c945e7a7 100644 --- a/glib/src/gobject_functions.defs +++ b/glib/src/gobject_functions.defs @@ -747,6 +747,11 @@ (return-type "GType") ) +(define-function g_option_group_get_type + (c-name "g_option_group_get_type") + (return-type "GType") +) + (define-function g_variant_get_gtype (c-name "g_variant_get_gtype") (return-type "GType") -- cgit v1.2.1 From e8ebd092607811714b904ca0a6b1781c1ec502a2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Feb 2015 12:42:47 +0100 Subject: Glib::OptionGroup: Don't use the deprecated g_option_group_free() * glib/src/optiongroup.ccg: Replace the deprecated g_option_group_free() by g_option_group_unref(). * glib/src/optiongroup.hg: Add a TODO comment. --- glib/src/optiongroup.ccg | 2 +- glib/src/optiongroup.hg | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index 4a875646..3ddc165e 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -294,7 +294,7 @@ OptionGroup::~OptionGroup() if(has_ownership_) { - g_option_group_free(gobj()); + g_option_group_unref(gobj()); gobject_ = 0; } } diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg index 98572080..4afe9c1e 100644 --- a/glib/src/optiongroup.hg +++ b/glib/src/optiongroup.hg @@ -37,6 +37,8 @@ class OptionEntry; class OptionContext; #endif //DOXYGEN_SHOULD_SKIP_THIS +//TODO: GOptionGroup is now refcounted. See https://bugzilla.gnome.org/show_bug.cgi?id=743349 +//When we can break API/ABI, make Glib::OptionGroup refcounted. _CLASS_OPAQUE_REFCOUNTED? /** An OptionGroup defines the options in a single group. * Libraries which need to parse commandline options are expected to provide a function that allows their OptionGroups to * be added to the application's OptionContext. @@ -65,10 +67,10 @@ public: * so it is only useful with C functions that return newly-allocated GOptionGroups. */ explicit OptionGroup(GOptionGroup* castitem); - _IGNORE(g_option_group_new) + _IGNORE(g_option_group_new, g_option_group_ref) virtual ~OptionGroup(); - _IGNORE(g_option_group_free) + _IGNORE(g_option_group_free, g_option_group_unref) virtual bool on_pre_parse(OptionContext& context, OptionGroup& group); -- cgit v1.2.1 From e9f6f709ef0c5eb49c556dd1d53d0e0f5ef11ac2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 18 Feb 2015 09:37:52 +0100 Subject: Gio::Application, UnixSocketAddress: Deprecate some properties * gio/src/application.hg: Deprecate property_action_group(). * gio/src/unixsocketaddress.hg: Deprecate property_abstract(). --- gio/src/application.hg | 4 +--- gio/src/unixsocketaddress.hg | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gio/src/application.hg b/gio/src/application.hg index 48613dc2..ab2cfa29 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -347,7 +345,7 @@ public: _WRAP_METHOD(void send_notification(const Glib::ustring& id{?}, const Glib::RefPtr& notification), g_application_send_notification) _WRAP_METHOD(void withdraw_notification(const Glib::ustring& id), g_application_withdraw_notification) - _WRAP_PROPERTY("action-group", Glib::RefPtr) + _WRAP_PROPERTY("action-group", Glib::RefPtr, deprecated "Use the Gio::ActionMap interface instead.") _WRAP_PROPERTY("application-id", Glib::ustring) _WRAP_PROPERTY("flags", ApplicationFlags) _WRAP_PROPERTY("inactivity-timeout", guint) diff --git a/gio/src/unixsocketaddress.hg b/gio/src/unixsocketaddress.hg index 0f009a7e..5fe8010d 100644 --- a/gio/src/unixsocketaddress.hg +++ b/gio/src/unixsocketaddress.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -82,7 +80,7 @@ public: _WRAP_METHOD(static bool abstract_names_supported(), g_unix_socket_address_abstract_names_supported) - _WRAP_PROPERTY("abstract", bool) + _WRAP_PROPERTY("abstract", bool, deprecated "Use property_address_type() instead, which distinguishes between zero-padded and non-zero-padded abstract addresses.") _WRAP_PROPERTY("address-type", UnixSocketAddressType) _WRAP_PROPERTY("path", std::string) _WRAP_PROPERTY("path-as-array", Glib::RefPtr) -- cgit v1.2.1 From 08642d5a2fd29445cb47e6a35d2fd929a29a2933 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 18 Feb 2015 09:39:17 +0100 Subject: Gio::Notification: Add set_priority() and enum NotificationPriority * gio/src/notification.hg: Add enum NotificationPriority and set_priority(). * tools/m4/convert_gio.m4: Add conversion of GNotificationPriority. --- gio/src/notification.hg | 10 +++++++++- tools/m4/convert_gio.m4 | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gio/src/notification.hg b/gio/src/notification.hg index caf5f943..46be4303 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -21,10 +21,17 @@ _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) +#m4 _PUSH(SECTION_CC_PRE_INCLUDES) +#undef G_DISABLE_DEPRECATED +#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 +#m4 _POP() + namespace Gio { class Icon; +_WRAP_ENUM(NotificationPriority, GNotificationPriority) + /** User Notifications (pop up messages). * * Gio::Notification is a mechanism for creating a notification to be shown @@ -67,7 +74,8 @@ public: _WRAP_METHOD(void set_title(const Glib::ustring& title), g_notification_set_title) _WRAP_METHOD(void set_body(const Glib::ustring& body), g_notification_set_body) _WRAP_METHOD(void set_icon(const Glib::RefPtr& icon), g_notification_set_icon) - _WRAP_METHOD(void set_urgent(bool urgent = true), g_notification_set_urgent, deprecated "This should not be used in newly-written code.") + _WRAP_METHOD(void set_urgent(bool urgent = true), g_notification_set_urgent, deprecated "Use set_priority() instead.") + _WRAP_METHOD(void set_priority(NotificationPriority priority = NOTIFICATION_PRIORITY_NORMAL), g_notification_set_priority) _WRAP_METHOD(void add_button(const Glib::ustring& label, const Glib::ustring& detailed_action), g_notification_add_button) diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 9444c32f..d0672bac 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -33,6 +33,7 @@ _CONV_ENUM(G,MountMountFlags) _CONV_ENUM(G,MountOperationResult) _CONV_ENUM(G,MountUnmountFlags) _CONV_ENUM(G,NetworkConnectivity) +_CONV_ENUM(G,NotificationPriority) _CONV_ENUM(G,OutputStreamSpliceFlags) _CONV_ENUM(G,PasswordSave) _CONV_ENUM(G,ResolverRecordType) -- cgit v1.2.1 From 8d08e770183ce51bbec25d740c4f91096e4b3506 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 18 Feb 2015 09:41:27 +0100 Subject: Glib::Value: Deprecate Value, add Value * glib/src/value_basictypes.[cc|h].m4: Deprecate Value. Add Value. g_value_[get,set]_char() are deprecated in favour of g_value_[get,set]_schar(). G_TYPE_CHAR is a signed char even on platforms where a plain char is unsigned. --- glib/src/value_basictypes.cc.m4 | 10 +++++----- glib/src/value_basictypes.h.m4 | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/glib/src/value_basictypes.cc.m4 b/glib/src/value_basictypes.cc.m4 index 62cc5474..090b33bc 100644 --- a/glib/src/value_basictypes.cc.m4 +++ b/glib/src/value_basictypes.cc.m4 @@ -1,7 +1,5 @@ divert(-1) -dnl $Id$ - dnl Glib::Value specializations for fundamental types dnl dnl Copyright 2002 The gtkmm Development Team @@ -34,7 +32,7 @@ dnl Please ignore the format stuff. I was just tired and played a little. // static GType Value<$1>::value_type() { - return G_TYPE_[]UPPER($2); + return G_TYPE_[]UPPER(ifelse($2,schar,char,$2)); } void Value<$1>::set($1 data) @@ -49,7 +47,7 @@ $1 Value<$1>::get() const GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const { - return g_param_spec_$2( + return g_param_spec_[]ifelse($2,schar,char,$2)( name.c_str(), 0, 0,ifelse($2,pointer,,[ ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),]) GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)); @@ -57,7 +55,6 @@ GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const ]) divert[]dnl -// -*- c++ -*- // This is a generated file, do not edit. Generated from __file__ /* So we can use deprecated functions in our deprecated methods */ @@ -73,7 +70,10 @@ G_GNUC_EXTENSION typedef long long long_long; G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long; GLIB_VALUE_BASIC(bool, boolean) +#ifndef GLIBMM_DISABLE_DEPRECATED GLIB_VALUE_BASIC(char, char, -128, 127) +#endif // GLIBMM_DISABLE_DEPRECATED +GLIB_VALUE_BASIC(signed char, schar, -128, 127) GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255) GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT) GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT) diff --git a/glib/src/value_basictypes.h.m4 b/glib/src/value_basictypes.h.m4 index 11b4c6cd..f9648c09 100644 --- a/glib/src/value_basictypes.h.m4 +++ b/glib/src/value_basictypes.h.m4 @@ -1,7 +1,5 @@ divert(-1) -dnl $Id$ - dnl Glib::Value specializations for fundamental types dnl dnl Copyright 2002 The gtkmm Development Team @@ -50,7 +48,6 @@ public: ]) divert[]dnl -// -*- c++ -*- // This is a generated file, do not edit. Generated from __file__ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -68,7 +65,12 @@ divert[]dnl namespace Glib { GLIB_VALUE_BASIC(bool, boolean) +#ifndef GLIBMM_DISABLE_DEPRECATED +/// @deprecated Use Value instead. GLIB_VALUE_BASIC(char, char) +#endif // GLIBMM_DISABLE_DEPRECATED +/// @newin{2,44} +GLIB_VALUE_BASIC(signed char, int8) GLIB_VALUE_BASIC(unsigned char, uchar) GLIB_VALUE_BASIC(int, int) GLIB_VALUE_BASIC(unsigned int, uint) -- cgit v1.2.1 From 08c5ed000e70e98e8d6f154373f3387024cb1612 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 20 Feb 2015 18:17:39 +0100 Subject: h2def.py: Remove *_DEPRECATED_IN_*_*_FOR(*) prefixes with white space * tools/defs_gen/h2def.py: A *_DEPRECATED_IN_*_*_FOR(*) prefix before a function prototype may contain white space within the parenthesis. Remove such prefixes, otherwise the function prototype is not found. --- tools/defs_gen/h2def.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/defs_gen/h2def.py b/tools/defs_gen/h2def.py index d0cd5a24..1f33771f 100755 --- a/tools/defs_gen/h2def.py +++ b/tools/defs_gen/h2def.py @@ -289,11 +289,11 @@ def clean_func(buf): pat = re.compile(r"""\\\n""", re.MULTILINE) buf = pat.sub('', buf) - # Preprocess directives + # Preprocessor directives pat = re.compile(r"""^[#].*?$""", re.MULTILINE) buf = pat.sub('', buf) - #typedefs, stucts, and enums + #typedefs, structs, and enums pat = re.compile(r"""^(typedef|struct|enum)(\s|.|\n)*?;\s*""", re.MULTILINE) buf = pat.sub('', buf) @@ -307,7 +307,7 @@ def clean_func(buf): buf = pat.sub('', buf) #strip *_DEPRECATED_IN_*_FOR (*): - pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(\S*\)\S*""", re.MULTILINE) + pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(.*\)\S*""", re.MULTILINE) buf = pat.sub('', buf) #strip *_DEPRECATED* -- cgit v1.2.1 From 2e8b0e638187bdb651eb3468ab9051fa8ad7567a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 20 Feb 2015 18:31:40 +0100 Subject: Fix error messages from gmmproc * gio/src/gio_extra_objects.defs: Add NetworkMonitor, Notification and Resource. * gio/src/file.hg: * gio/src/fileinputstream.hg: * gio/src/fileoutputstream.hg: * gio/src/notification.hg: * glib/src/iochannel.hg: * glib/src/nodetree.hg: Avoid "gtkmmproc error" messages in the generated files by not _IGNORE()ing non-existent functions. Unnecessary _IGNORE()s generate error messages after the fix in bug 737212 was implemented. --- gio/src/file.hg | 4 +--- gio/src/fileinputstream.hg | 11 ----------- gio/src/fileoutputstream.hg | 16 ---------------- gio/src/gio_extra_objects.defs | 18 ++++++++++++++++++ gio/src/notification.hg | 2 +- glib/src/iochannel.hg | 1 - glib/src/nodetree.hg | 19 +++++++++++-------- 7 files changed, 31 insertions(+), 40 deletions(-) diff --git a/gio/src/file.hg b/gio/src/file.hg index 08e4ce8c..9dffa9f9 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -1472,7 +1470,7 @@ public: * @param flags Flags affecting the operation. */ void mount_enclosing_volume(MountMountFlags flags = MOUNT_MOUNT_NONE); - _IGNORE(g_file_mount_enclosing _volume) + _IGNORE(g_file_mount_enclosing_volume) _WRAP_METHOD(bool mount_enclosing_volume_finish(const Glib::RefPtr& result), g_file_mount_enclosing_volume_finish, diff --git a/gio/src/fileinputstream.hg b/gio/src/fileinputstream.hg index 476e3916..a9cca15b 100644 --- a/gio/src/fileinputstream.hg +++ b/gio/src/fileinputstream.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -102,15 +100,6 @@ public: _WRAP_METHOD(Glib::RefPtr query_info_finish(const Glib::RefPtr& result), g_file_input_stream_query_info_finish, errthrow) - - //These seem to be just C convenience functions - they are already in the Seekable base class: - //See http://bugzilla.gnome.org/show_bug.cgi?id=509990 - _IGNORE(g_file_input_stream_tell, g_file_input_stream_can_seek, g_file_input_stream_seek) -// _WRAP_METHOD(goffset tell() const, g_file_input_stream_tell) -// _WRAP_METHOD(bool can_seek() const, g_file_input_stream_can_seek) -// _WRAP_METHOD(bool seek(goffset offset, Glib::SeekType type, const Glib::RefPtr& cancellable), -// g_file_input_stream_seek, -// errthrow) }; } // namespace Gio diff --git a/gio/src/fileoutputstream.hg b/gio/src/fileoutputstream.hg index 4b24272f..a31567bd 100644 --- a/gio/src/fileoutputstream.hg +++ b/gio/src/fileoutputstream.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -138,20 +136,6 @@ public: refreturn, errthrow) _WRAP_METHOD(std::string get_etag() const, g_file_output_stream_get_etag) - - //These seem to be just C convenience functions - they are already in the Seekable base class: - //See http://bugzilla.gnome.org/show_bug.cgi?id=509990 - _IGNORE(g_file_output_stream_tell, g_file_output_stream_can_seek, g_file_output_stream_seek, - g_file_output_stream_can_truncate, g_file_output_stream_truncate) -// _WRAP_METHOD(goffset tell() const, g_file_output_stream_tell) -// _WRAP_METHOD(bool can_seek() const, g_file_output_stream_can_seek) -// _WRAP_METHOD(bool seek(goffset offset, Glib::SeekType type, const Glib::RefPtr& cancellable), -// g_file_output_stream_seek, -// errthrow) -// _WRAP_METHOD(bool can_truncate() const, g_file_output_stream_can_truncate) -// _WRAP_METHOD(bool truncate(goffset size, const Glib::RefPtr& cancellable), -// g_file_output_stream_truncate, -// errthrow) }; } // namespace Gio diff --git a/gio/src/gio_extra_objects.defs b/gio/src/gio_extra_objects.defs index acfab9a3..a47e231c 100644 --- a/gio/src/gio_extra_objects.defs +++ b/gio/src/gio_extra_objects.defs @@ -151,6 +151,18 @@ (gtype-id "G_TYPE_MENU_ITEM") ) +(define-object NetworkMonitor + (in-module "Gio") + (c-name "GNetworkMonitor") + (gtype-id "G_TYPE_NETWORK_MONITOR") +) + +(define-object Notification + (in-module "Gio") + (c-name "GNotification") + (gtype-id "G_TYPE_NOTIFICATION") +) + (define-object PollableInputStream (in-module "Gio") (c-name "GPollableInputStream") @@ -175,6 +187,12 @@ (gtype-id "G_TYPE_PROXY_RESOLVER") ) +(define-object Resource + (in-module "Gio") + (c-name "GResource") + (gtype-id "G_TYPE_RESOURCE") +) + (define-object SimpleAction (in-module "Gio") (c-name "GSimpleAction") diff --git a/gio/src/notification.hg b/gio/src/notification.hg index 46be4303..f9361923 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -117,7 +117,7 @@ public: // Ignore functions with variable-length parameter lists. _IGNORE(g_notification_add_button_with_target, g_notification_set_default_action_and_target) // Ignore private methods - _IGNORE(g_notification_get_urgent, g_notification_get_button, g_notification_get_default_action) + _IGNORE(g_notification_get_priority, g_notification_get_button, g_notification_get_default_action) _IGNORE(g_notification_get_n_buttons, g_notification_get_button_with_action, g_notification_serialize) _IGNORE(g_notification_get_icon, g_notification_get_id, g_notification_get_body, g_notification_get_title) diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg index bc0f404d..3c3d5309 100644 --- a/glib/src/iochannel.hg +++ b/glib/src/iochannel.hg @@ -413,7 +413,6 @@ public: * @return An IOSource object that can be polled from a MainContext's event loop. */ Glib::RefPtr create_watch(IOCondition condition); - _IGNORE(g_io_channel_create_watch) virtual void reference() const; virtual void unreference() const; diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg index 5a4a4b79..2866057e 100644 --- a/glib/src/nodetree.hg +++ b/glib/src/nodetree.hg @@ -185,7 +185,10 @@ public: g_node_append(gobj(), node.gobj()); return node; } - _IGNORE(g_node_append) + dnl// Some glib functions are in fact preprocessor macros. + dnl// h2def.py does not recognize them. _IGNORE()ing them produces + dnl// ugly error messages in the generated nodetree.h file. + dnl// _IGNORE(g_node_append) /** Inserts a NodeTree as the first child. * @@ -212,7 +215,7 @@ public: insert(position, *node); return node; } - _IGNORE(g_node_insert_data) + dnl// _IGNORE(g_node_insert_data) /** Inserts a new NodeTree before the given sibling. * @@ -226,7 +229,7 @@ public: insert_before(sibling, *node); return node; } - _IGNORE(g_node_insert_data_before) + dnl// _IGNORE(g_node_insert_data_before) /** Inserts a new NodeTree as the last child. * @@ -239,7 +242,7 @@ public: append(*node); return node; } - _IGNORE(g_node_append_data) + dnl// _IGNORE(g_node_append_data) /** Inserts a new NodeTree as the first child. * @@ -252,7 +255,7 @@ public: prepend(*node); return node; } - _IGNORE(g_node_prepend_data) + dnl// _IGNORE(g_node_prepend_data) /** Reverses the order of the children. */ @@ -441,7 +444,7 @@ public: { return const_cast*>(this)->first_child(); } - _IGNORE(g_node_first_child) + dnl// _IGNORE(g_node_first_child) /** Gets the last child. * @@ -515,7 +518,7 @@ public: { return const_cast*>(this)->prev_sibling(); } - _IGNORE(g_node_prev_sibling) + dnl// _IGNORE(g_node_prev_sibling) /** Gets the next sibling * @@ -534,7 +537,7 @@ public: { return const_cast*>(this)->next_sibling(); } - _IGNORE(g_node_next_sibling) + dnl// _IGNORE(g_node_next_sibling) /** Gets the last sibling. * -- cgit v1.2.1 From 76c68945df98788984d1187c80a6f334391d090e Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 25 Feb 2015 10:06:34 +0100 Subject: Glib::OptionGroup: Fix enable/disable bool option pairs * glib/src/optiongroup.ccg: add_entry_with_wrapper(): Don't allocate a new C variable, if another entry has already been added for the same C++ variable. It makes GLib::OptionContext::parse() behave like g_option_context_parse() when two or more options refer to the same variable, typically an --enable-x / --disable-x pair. Bug #744854. --- glib/src/optiongroup.ccg | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index 3ddc165e..df7f400b 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -377,29 +377,55 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar { const Glib::ustring name = entry.get_long_name(); type_map_entries::iterator iterFind = map_entries_.find(name); - if( iterFind == map_entries_.end() ) //If we have not added this entry already + if (iterFind == map_entries_.end()) //If we have not added this entry already { CppOptionEntry cppEntry; //g_option_group_add_entry() does not take its own copy, so we must keep the instance alive. cppEntry.entry_ = new OptionEntry(entry); //cppEntry.entry_ is deleted in release_c_arg(), via the destructor. - cppEntry.carg_type_ = arg_type; - cppEntry.allocate_c_arg(); - cppEntry.set_c_arg_default(cpp_arg); + // Several options can refer to the same C++ variable, + // typically a pair of --enable-x / --disable-x options. + // Only one C variable shall be allocated for them. + // See https://bugzilla.gnome.org/show_bug.cgi?id=744854. + bool is_duplicate = false; + void* carg = 0; + if (arg_type != G_OPTION_ARG_CALLBACK) + { + for (type_map_entries::iterator iter = map_entries_.begin(); + iter != map_entries_.end(); ++iter) + { + const CppOptionEntry& cpp_entry = iter->second; + if (cpp_entry.cpparg_ == cpp_arg && + cpp_entry.carg_type_ == arg_type && + cpp_entry.carg_) + { + is_duplicate = true; + carg = cpp_entry.carg_; + break; + } + } + } + cppEntry.carg_type_ = arg_type; + if (!is_duplicate) + { + cppEntry.allocate_c_arg(); + cppEntry.set_c_arg_default(cpp_arg); + carg = cppEntry.carg_; + } cppEntry.cpparg_ = cpp_arg; //Give the information to the C API: cppEntry.entry_->gobj()->arg = arg_type; - cppEntry.entry_->gobj()->arg_data = cppEntry.carg_; + cppEntry.entry_->gobj()->arg_data = carg; //Remember the C++/C mapping so that we can use it later: map_entries_[name] = cppEntry; add_entry(*(cppEntry.entry_)); } - else if( arg_type == G_OPTION_ARG_CALLBACK ) + else if (arg_type == G_OPTION_ARG_CALLBACK) { //Delete the OptionArgCallback instance that was allocated by add_entry() //or add_entry_filename(). @@ -448,7 +474,7 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() //defaults based on the C++-typed arguments. switch(carg_type_) { - case G_OPTION_ARG_STRING: //The char* will be for UTF8 strins. + case G_OPTION_ARG_STRING: //The char* will be for UTF8 strings. case G_OPTION_ARG_FILENAME: //The char* will be for strings in the current locale's encoding. { char** typed_arg = new char*; @@ -697,6 +723,9 @@ void OptionGroup::CppOptionEntry::release_c_arg() void OptionGroup::CppOptionEntry::convert_c_to_cpp() { + if (!carg_) + return; + switch(carg_type_) { case G_OPTION_ARG_STRING: -- cgit v1.2.1 From 44f61fa8209be4bd4bc52536b48271bbb813ae88 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 26 Feb 2015 13:05:31 +0100 Subject: Glib::OptionGroup: Fix memory leaks * glib/src/optiongroup.ccg: CppOptionEntry::set_c_arg_default(), convert_c_to_cpp(), release_c_arg(): Fix memory leaks for string-valued options. Bug #745173. --- glib/src/optiongroup.ccg | 110 +++++++++++++---------------------------------- 1 file changed, 30 insertions(+), 80 deletions(-) diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index df7f400b..da0f0b89 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -474,12 +474,11 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() //defaults based on the C++-typed arguments. switch(carg_type_) { - case G_OPTION_ARG_STRING: //The char* will be for UTF8 strings. - case G_OPTION_ARG_FILENAME: //The char* will be for strings in the current locale's encoding. + case G_OPTION_ARG_STRING: //The char* will be for UTF8 a string. + case G_OPTION_ARG_FILENAME: //The char* will be for a string in the current locale's encoding. { char** typed_arg = new char*; //The C code will allocate a char* and put it here, for us to g_free() later. - //Alternatively, set_c_arg_default() might allocate a char*, and the C code might or might not free and replace that. *typed_arg = 0; carg_ = typed_arg; @@ -505,12 +504,13 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() case G_OPTION_ARG_FILENAME_ARRAY: { char*** typed_arg = new char**; + //The C code will allocate a char** and put it here, for us to g_strfreev() later. *typed_arg = 0; carg_ = typed_arg; break; } - case G_OPTION_ARG_NONE: /* Actually a boolean. */ + case G_OPTION_ARG_NONE: // Actually a boolean. { gboolean* typed_arg = new gboolean; *typed_arg = 0; @@ -572,63 +572,16 @@ void OptionGroup::CppOptionEntry::set_c_arg_default(void* cpp_arg) break; } case G_OPTION_ARG_STRING: - { - Glib::ustring* typed_cpp_arg = static_cast(cpp_arg); - if(typed_cpp_arg && !typed_cpp_arg->empty()) - { - const char** typed_c_arg = static_cast(carg_); - *typed_c_arg = g_strdup(typed_cpp_arg->c_str()); //Freed in release_c_arg(). - } - break; - } case G_OPTION_ARG_FILENAME: - { - std::string* typed_cpp_arg = static_cast(cpp_arg); - if(typed_cpp_arg && !typed_cpp_arg->empty()) - { - const char** typed_c_arg = static_cast(carg_); - *typed_c_arg = g_strdup(typed_cpp_arg->c_str()); //Freed in release_c_arg(). - } - break; - } case G_OPTION_ARG_STRING_ARRAY: - { - std::vector* typed_cpp_arg = static_cast*>(cpp_arg); - if(typed_cpp_arg) - { - std::vector& vec = *typed_cpp_arg; - const char** array = static_cast( g_malloc(sizeof(gchar*) * (vec.size() + 1)) ); - - for(std::vector::size_type i = 0; i < vec.size(); ++i) - { - array[i] = g_strdup( vec[i].c_str() ); - } - - array[vec.size()] = 0; - - const char*** typed_c_arg = static_cast(carg_); - *typed_c_arg = array; - } - break; - } case G_OPTION_ARG_FILENAME_ARRAY: { - std::vector* typed_cpp_arg = static_cast*>(cpp_arg); - if(typed_cpp_arg) - { - std::vector& vec = *typed_cpp_arg; - const char** array = static_cast( g_malloc(sizeof(gchar*) * (vec.size() + 1)) ); - - for(std::vector::size_type i = 0; i < vec.size(); ++i) - { - array[i] = g_strdup( vec[i].c_str() ); - } - - array[vec.size()] = 0; - - const char*** typed_c_arg = static_cast(carg_); - *typed_c_arg = array; - } + // No need to set default values for string-valued options. + // If *carg_ is still 0, when convert_c_to_cpp() is called, just don't + // touch *cpparg_. Besides, setting default values in *carg_ can result + // in memory leaks, because glib would not free the strings before + // the char*'s are overwritten with pointers to newly allocated copies + // of the command option arguments. break; } case G_OPTION_ARG_CALLBACK: @@ -666,8 +619,8 @@ void OptionGroup::CppOptionEntry::release_c_arg() case G_OPTION_ARG_FILENAME: { char** typed_arg = static_cast(carg_); - g_free(*typed_arg); //Free the char* string at type_arg, which was allocated by the C code. - delete typed_arg; //Delete the char** that we allocated in allocate_c_arg; + g_free(*typed_arg); //Free the char* string at typed_arg, if allocated by the C code. + delete typed_arg; //Delete the char** that we allocated in allocate_c_arg(). break; } @@ -688,10 +641,13 @@ void OptionGroup::CppOptionEntry::release_c_arg() case G_OPTION_ARG_STRING_ARRAY: case G_OPTION_ARG_FILENAME_ARRAY: { - delete (char**)carg_; + char*** typed_arg = static_cast(carg_); + g_strfreev(*typed_arg); //Free the array of strings and the array at typed_arg, if allocated by the C code. + delete typed_arg; //Delete the char*** that we allocated in allocate_c_arg(). + break; } - case G_OPTION_ARG_NONE: /* Actually a boolean. */ + case G_OPTION_ARG_NONE: // Actually a boolean. { gboolean* typed_arg = static_cast(carg_); delete typed_arg; @@ -732,25 +688,21 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() { char** typed_arg = static_cast(carg_); Glib::ustring* typed_cpp_arg = static_cast(cpparg_); - if(typed_arg && typed_cpp_arg) + if(typed_arg && *typed_arg && typed_cpp_arg) { - char* pch = *typed_arg; - (*typed_cpp_arg) = Glib::convert_const_gchar_ptr_to_ustring(pch); - - break; + *typed_cpp_arg = *typed_arg; } + break; } case G_OPTION_ARG_FILENAME: { char** typed_arg = static_cast(carg_); std::string* typed_cpp_arg = static_cast(cpparg_); - if(typed_arg && typed_cpp_arg) + if(typed_arg && *typed_arg && typed_cpp_arg) { - char* pch = *typed_arg; - (*typed_cpp_arg) = Glib::convert_const_gchar_ptr_to_stdstring(pch); - - break; + *typed_cpp_arg = *typed_arg; } + break; } case G_OPTION_ARG_INT: { @@ -766,11 +718,11 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() { char*** typed_arg = static_cast(carg_); vecustrings* typed_cpp_arg = static_cast(cpparg_); - if(typed_arg && typed_cpp_arg) + if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); - //The C array seems to be null-terminated. + //The C array is null-terminated. //Glib::StringArrayHandle array_handle(*typed_arg, Glib::OWNERSHIP_NONE); //The SUN Forte compiler complains about this: @@ -794,36 +746,34 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() //So we do this: char** char_array_next = *typed_arg; - while(char_array_next && *char_array_next) + while(*char_array_next) { typed_cpp_arg->push_back(*char_array_next); ++char_array_next; } } - break; } case G_OPTION_ARG_FILENAME_ARRAY: { char*** typed_arg = static_cast(carg_); - vecustrings* typed_cpp_arg = static_cast(cpparg_); - if(typed_arg && typed_cpp_arg) + vecstrings* typed_cpp_arg = static_cast(cpparg_); + if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); //See comments above about the SUN Forte and Tru64 compilers. char** char_array_next = *typed_arg; - while(char_array_next && *char_array_next) + while(*char_array_next) { typed_cpp_arg->push_back(*char_array_next); ++char_array_next; } } - break; } - case G_OPTION_ARG_NONE: /* Actually a boolean. */ + case G_OPTION_ARG_NONE: // Actually a boolean. { *(static_cast(cpparg_)) = *(static_cast(carg_)); break; -- cgit v1.2.1 From f7c3a77ab3bc2edb95b9e1519f346421bf9e870a Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 26 Feb 2015 14:29:08 +0100 Subject: 2.43.90 --- NEWS | 39 ++++++++++++++++++++++++++++++++++++++- configure.ac | 4 ++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index fe4ae23f..095e3e8a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,41 @@ -2.34.3 (unstable): +2.43.90 (unstable): + +Glib: +* Error::register_init(): Call Glib::wrap_register_init(). + (Kjell Ahlstedt) Bug #743466 (Mike Fleetwood). +* OptionGroup: + - Fix enable/disable bool option pairs. + (Kjell Ahlstedt) Bug #744854 (Tom Schoonjans) + - Fix memory leaks + (Kjell Ahlstedt) Bug #745173. + - Don't use deprecate g_option_group_free(). + (Kjell Ahlstedt) +* Value: Deprecate Value, add Value. + Because g_value_[get,set]_char() are deprecated in favour of + g_value_[get,set]_schar(). + (Kjell Ahlstedt) + +Gio: +* Application: Deprecate property_action_group(). + (Kjell Ahlstedt) +* Notification: Add set_priority() and enum NotificationPriority. + (Kjell Ahlstedt) +* Add TcpWrapperConnection. + (Murray Cumming) +* UnixSocketAddress: Deprecate property_abstract(). + (Kjell Ahlstedt) + +gmmproc: +* Fix error messages in glib and gio by removing unnecessary _IGNORES(). + (Kjell Ahlstedt) +* h2def.py: Remove *_DEPRECATED_IN_*_*_FOR(*) prefixes with white space. + (Kjell Ahlstedt) +* Put DOXYGEN_SHOULD_SKIP_THIS around *_Class prototypes. + To workaround a doxygen bug, to fix the genereated DevHelp search index. + (Murray Cumming) Bug #743918 + + +2.43.3 (unstable): Glib: * Binding: Rename and change BindingTransformSlot to SlotTransform. diff --git a/configure.ac b/configure.ac index 90956f10..fbab5344 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.3], +AC_INIT([glibmm], [2.43.90], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.43.1' +glibreq='2.0 >= 2.43.90' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" -- cgit v1.2.1 From 30f85b9d799e45f43039ab341be97e35d1e1e785 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 08:41:28 +0100 Subject: Regenerate .defs. --- gio/src/gio_methods.defs | 111 +++++++++++++++++++++++++++++++++++++++++++ gio/src/gio_signals.defs | 9 ++++ glib/src/glib_functions.defs | 8 ++++ 3 files changed, 128 insertions(+) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index ed4d2449..43d8431f 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -2716,6 +2716,12 @@ (return-type "none") ) +(define-method get_is_busy + (of-object "GApplication") + (c-name "g_application_get_is_busy") + (return-type "gboolean") +) + (define-method send_notification (of-object "GApplication") (c-name "g_application_send_notification") @@ -2745,6 +2751,16 @@ ) ) +(define-method unbind_busy_property + (of-object "GApplication") + (c-name "g_application_unbind_busy_property") + (return-type "none") + (parameters + '("gpointer" "object") + '("const-gchar*" "property") + ) +) + ;; From gapplicationimpl.h @@ -3409,6 +3425,41 @@ +;; From gcontextspecificgroup.h + +(define-method get + (of-object "GContextSpecificGroup") + (c-name "g_context_specific_group_get") + (return-type "gpointer") + (parameters + '("GType" "type") + '("goffset" "context_offset") + '("GCallback" "start_func") + ) +) + +(define-method remove + (of-object "GContextSpecificGroup") + (c-name "g_context_specific_group_remove") + (return-type "none") + (parameters + '("GMainContext*" "context") + '("gpointer" "instance") + '("GCallback" "stop_func") + ) +) + +(define-method emit + (of-object "GContextSpecificGroup") + (c-name "g_context_specific_group_emit") + (return-type "none") + (parameters + '("guint" "signal_id") + ) +) + + + ;; From gconverter.h (define-function g_converter_get_type @@ -7212,6 +7263,18 @@ ) ) +(define-method iterate + (of-object "GFileEnumerator") + (c-name "g_file_enumerator_iterate") + (return-type "gboolean") + (parameters + '("GFileInfo**" "out_info") + '("GFile**" "out_child") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + ;; From gfile.h @@ -10680,12 +10743,24 @@ (return-type "gboolean") ) +(define-method async_close_is_via_threads + (of-object "GInputStream") + (c-name "g_input_stream_async_close_is_via_threads") + (return-type "gboolean") +) + (define-method async_write_is_via_threads (of-object "GOutputStream") (c-name "g_output_stream_async_write_is_via_threads") (return-type "gboolean") ) +(define-method async_close_is_via_threads + (of-object "GOutputStream") + (c-name "g_output_stream_async_close_is_via_threads") + (return-type "gboolean") +) + (define-method set_cached_remote_address (of-object "GSocketConnection") (c-name "g_socket_connection_set_cached_remote_address") @@ -10699,6 +10774,18 @@ ;; From gioscheduler.h +(define-function g_io_scheduler_push_job + (c-name "g_io_scheduler_push_job") + (return-type "none") + (parameters + '("GIOSchedulerJobFunc" "job_func") + '("gpointer" "user_data") + '("GDestroyNotify" "notify") + '("gint" "io_priority") + '("GCancellable*" "cancellable") + ) +) + (define-function g_io_scheduler_cancel_all_jobs (c-name "g_io_scheduler_cancel_all_jobs") (return-type "none") @@ -15061,6 +15148,25 @@ +;; From gsimpleiostream.h + +(define-function g_simple_io_stream_get_type + (c-name "g_simple_io_stream_get_type") + (return-type "GType") +) + +(define-function g_simple_io_stream_new + (c-name "g_simple_io_stream_new") + (is-constructor-of "GSimpleIoStream") + (return-type "GIOStream*") + (parameters + '("GInputStream*" "input_stream") + '("GOutputStream*" "output_stream") + ) +) + + + ;; From gsimplepermission.h (define-function g_simple_permission_get_type @@ -18588,6 +18694,11 @@ (return-type "GType") ) +(define-function g_unix_mount_monitor_get + (c-name "g_unix_mount_monitor_get") + (return-type "GUnixMountMonitor*") +) + (define-function g_unix_mount_monitor_new (c-name "g_unix_mount_monitor_new") (is-constructor-of "GUnixMountMonitor") diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index d6ce021e..71d966a4 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -199,6 +199,15 @@ (construct-only #f) ) +(define-property is-busy + (of-object "GApplication") + (prop-type "GParamBoolean") + (docs "If this application is currently marked busy") + (readable #t) + (writable #f) + (construct-only #f) +) + ;; From GAppInfoMonitor (define-signal changed diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index f58dee7a..2bbc2903 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -6065,6 +6065,14 @@ ;; From glib-autocleanups.h +(define-function g_autoptr_cleanup_generic_gfree + (c-name "g_autoptr_cleanup_generic_gfree") + (return-type "none") + (parameters + '("void*" "p") + ) +) + ;; From glibconfig.h -- cgit v1.2.1 From 4caba73704c3b07f66bd16bc423c4c15feaf2921 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 08:41:56 +0100 Subject: Regenerate *_docs.xml files. --- gio/src/gio_docs.xml | 384 ++++++++++---- glib/src/glib_docs.xml | 1375 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 1621 insertions(+), 138 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index b8ea5b9e..31853ca2 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -1456,6 +1456,67 @@ Flags used when creating a #GAppInfo. + + +Signal emitted when the app info database for changes (ie: newly installed +or removed applications). + + + + + + + + + +The ::launch-failed signal is emitted when a #GAppInfo launch +fails. The startup notification id is provided, so that the launcher +can cancel the startup notification. + +Since: 2.36 + + + + + the object emitting the signal + + + + the startup notification id for the failed launch + + + + + + + + +The ::launched signal is emitted when a #GAppInfo is successfully +launched. The @platform_data is an GVariant dictionary mapping +strings to variants (ie a{sv}), which contains additional, +platform-specific data about this launch. On UNIX, at least the +"pid" and "startup-notification-id" keys will be present. + +Since: 2.36 + + + + + the object emitting the signal + + + + the #GAppInfo that was just launched + + + + additional platform-specific data for this launch + + + + + + The ::activate signal is emitted on the primary instance when an @@ -21554,6 +21615,35 @@ Since: 2.40 + + +Marks @application as busy (see g_application_mark_busy()) while +@property on @object is %TRUE. + +The binding holds a reference to @application while it is active, but +not to @object. Instead, the binding is destroyed when @object is +finalized. + +Since: 2.44 + + + + + a #GApplication + + + + a #GObject + + + + the name of a boolean property of @object + + + + + + Creates a #GFile corresponding to a filename that was given as part @@ -22057,6 +22147,25 @@ Since: 2.28 + + +Gets the application's current busy state, as set through +g_application_mark_busy() or g_application_bind_busy_property(). + +Since: 2.44 + + + + + a #GApplication + + + + %TRUE if @application is currenty marked as busy + + + + Checks if @application is registered. @@ -22427,11 +22536,7 @@ except in the case that g_application_set_inactivity_timeout() is in use. This function sets the prgname (g_set_prgname()), if not already set, -to the basename of argv[0]. Since 2.38, if %G_APPLICATION_IS_SERVICE -is specified, the prgname is set to the application ID. The main -impact of this is is that the wmclass of windows created by Gtk+ will -be set accordingly, which helps the window manager determine which -application is showing the window. +to the basename of argv[0]. Since 2.40, applications that are not explicitly flagged as services or launchers (ie: neither %G_APPLICATION_IS_SERVICE or @@ -22694,6 +22799,32 @@ Since: 2.42 + + +Destroys a binding between @property and the busy state of +@application that was previously created with +g_application_bind_busy_property(). + +Since: 2.44 + + + + + a #GApplication + + + + a #GObject + + + + the name of a boolean property of @object + + + + + + Decreases the busy count of @application. @@ -24102,7 +24233,9 @@ This function is thread-safe. In other words, you can safely call it from a thread other than the one running the operation that was passed the @cancellable. -The convention within gio is that cancelling an asynchronous +If @cancellable is %NULL, this function returns immediately for convenience. + +The convention within GIO is that cancelling an asynchronous operation causes it to complete asynchronously. That is, if you cancel the operation from the same thread in which it is running, then the operation's #GAsyncReadyCallback will not be invoked until @@ -36133,6 +36266,76 @@ Checks if the file enumerator has been closed. + + +This is a version of g_file_enumerator_next_file() that's easier to +use correctly from C programs. With g_file_enumerator_next_file(), +the gboolean return value signifies "end of iteration or error", which +requires allocation of a temporary #GError. + +In contrast, with this function, a %FALSE return from +gs_file_enumerator_iterate() *always* means +"error". End of iteration is signaled by @out_info or @out_child being %NULL. + +Another crucial difference is that the references for @out_info and +@out_child are owned by @direnum (they are cached as hidden +properties). You must not unref them in your own code. This makes +memory management significantly easier for C code in combination +with loops. + +Finally, this function optionally allows retrieving a #GFile as +well. + +You must specify at least one of @out_info or @out_child. + +The code pattern for correctly using g_file_enumerator_iterate() from C +is: + +|[ +direnum = g_file_enumerate_children (file, ...); +while (TRUE) +{ +GFileInfo *info; +if (!g_file_enumerator_iterate (direnum, &info, NULL, cancellable, error)) +goto out; +if (!info) +break; +... do stuff with "info"; do not unref it! ... +} + +out: +g_object_unref (direnum); // Note: frees the last @info +]| + + +Since: 2.44 + + + + + an open #GFileEnumerator + + + + Output location for the next #GFileInfo, or %NULL + + + + Output location for the next #GFile, or %NULL + + + + a #GCancellable + + + + a #GError + + + + + + Returns information for the next file in the enumerated object. @@ -42888,22 +43091,6 @@ ignore. - - -Checks if an input stream's read_async function uses threads. - - - - - - input stream - - - - %TRUE if @stream's read_async function uses threads. - - - Clears the pending flag on @stream. @@ -44882,6 +45069,14 @@ Since: 2.44 the new item + + pairwise comparison function for sorting + + + + user data for @compare_func + + the position at which @item was inserted @@ -48778,22 +48973,6 @@ Since: 2.28 - - -Checks if an ouput stream's write_async function uses threads. - - - - - - a #GOutputStream. - - - - %TRUE if @stream's write_async function uses threads. - - - Clears the pending flag on @stream. @@ -50499,7 +50678,8 @@ Since: 2.38 - the object that has the property to wrap + the object that has the property +to wrap @@ -53280,9 +53460,11 @@ with it. +<!-- --> + Since: 2.28 -Deprecated:2.40: Use g_settings_schema_source_list_schemas() instead +Deprecated: 2.40: Use g_settings_schema_source_list_schemas() instead @@ -53296,9 +53478,11 @@ modified or freed. +<!-- --> + Since: 2.26 -Deprecated:2.40: Use g_settings_schema_source_list_schemas() instead. +Deprecated: 2.40: Use g_settings_schema_source_list_schemas() instead. If you used g_settings_list_schemas() to check for the presence of a particular schema, use g_settings_schema_source_lookup() instead of your whole loop. @@ -53352,7 +53536,7 @@ At the most basic level, a #GSettings object is a pure composition of backend, and a #GMainContext to which signals are dispatched. This constructor therefore gives you full control over constructing -#GSettings instances. The first 4 parameters are given directly as +#GSettings instances. The first 3 parameters are given directly as @schema, @backend and @path, and the main context is taken from the thread-default (as per g_settings_new()). @@ -55393,6 +55577,29 @@ Since: 2.28 + + +Creates a new #GSimpleIOStream wrapping @input_stream and @output_stream. +See also #GIOStream. + +Since: 2.44 + + + + + a #GInputStream. + + + + a #GOutputStream. + + + + a new #GSimpleIOStream instance. + + + + Creates a new #GPermission instance that represents an action that is @@ -65391,28 +65598,59 @@ Checks if a unix mount is a system path. + + +Gets the #GUnixMountMonitor for the current thread-default main +context. + +The mount monitor can be used to monitor for changes to the list of +mounted filesystems as well as the list of mount points (ie: fstab +entries). + +You must only call g_object_unref() on the return value from under +the same main context as you called this function. + +Since: 2.44 + + + + + the #GUnixMountMonitor. + + + + -Gets a new #GUnixMountMonitor. The default rate limit for which the -monitor will report consecutive changes for the mount and mount -point entry files is the default for a #GFileMonitor. Use -g_unix_mount_monitor_set_rate_limit() to change this. +Deprecated alias for g_unix_mount_monitor_get(). +This function was never a true constructor, which is why it was +renamed. + +Deprecated:2.44:Use g_unix_mount_monitor_get() instead. - a #GUnixMountMonitor. + a #GUnixMountMonitor. + -Sets the rate limit to which the @mount_monitor will report -consecutive change events to the mount and mount point entry files. +This function does nothing. + +Before 2.44, this was a partially-effective way of controlling the +rate at which events would be reported under some uncommon +circumstances. Since @mount_monitor is a singleton, it also meant +that calling this function would have side effects for other users of +the monitor. Since: 2.18 +Deprecated:2.44:This function does nothing. Don't call it. + @@ -66924,50 +67162,6 @@ Since: 2.26 - - - - - - - the GWinHttpFile being read - - - - handle to the HTTP connection, as from WinHttpConnect() - - - - handle to the HTTP request, as from WinHttpOpenRequest - - - - #GFileInputStream for the given request - - - - - - - - - - the GWinHttpFile being read - - - - handle to the HTTP connection, as from WinHttpConnect() - - - - handle to the HTTP request, as from WinHttpOpenRequest - - - - #GFileOutputStream for the given request - - - Returns a new #GVfs handle for a WinHttp vfs. @@ -67676,10 +67870,6 @@ port_add will associate a GSource to @f->source - - - - diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index 543c9391..aebd445e 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -6382,7 +6382,7 @@ Since: 2.44 - + a supported variable type @@ -6390,6 +6390,44 @@ Since: 2.44 + + +Macro to add an attribute to pointer variable to ensure automatic +cleanup using g_free(). + +This macro differs from g_autoptr() in that it is an attribute supplied +before the type name, rather than wrapping the type definition. Instead +of using a type-specific lookup, this macro always calls g_free() directly. + +This means it's useful for any type that is returned from +g_malloc(). + +Otherwise, this macro has similar constraints as g_autoptr() - only +supported on GCC and clang, the variable must be initialized, etc. + +|[ +gboolean +operate_on_malloc_buf (void) +{ +g_autofree guint8* membuf = NULL; + +membuf = g_malloc (8192); + +/ * Some computation on membuf * / + +/ * membuf will be automatically freed here * / +return TRUE; +} +]| + +Since: 2.44 + + + + + + + Helper to declare a pointer variable with automatic cleanup. @@ -6402,7 +6440,7 @@ defined on other compilers and should not be used in programs that are intended to be portable to those compilers. This is meant to be used to declare pointers to types with cleanup -functions. The type of the variable is a pointer to @typename. You +functions. The type of the variable is a pointer to @TypeName. You must not add your own '*'. This macro can be used to avoid having to do explicit cleanups of @@ -6447,7 +6485,7 @@ Since: 2.44 - + a supported variable type @@ -9252,6 +9290,91 @@ data structures to @func; use g_cache_key_foreach() instead + + +A #GClosureMarshal function for use with signals with handlers that +take two boxed pointers as arguments and return a boolean. If you +have such a signal, you will probably also need to use an +accumulator, such as g_signal_accumulator_true_handled(). + + + + + A #GClosure. + + + + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. + + + + The length of the @param_values array. + + + + An array of #GValues holding the arguments +on which to invoke the callback of closure. + + + + The invocation hint given as the last argument to +g_closure_invoke(). + + + + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + + + + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_BOOLEAN__BOXED_BOXED(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9289,6 +9412,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_BOOLEAN__FLAGS(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9327,6 +9493,45 @@ to g_closure_invoke() + + +An old alias for g_cclosure_marshal_BOOLEAN__BOXED_BOXED(). + + + + + A #GClosure. + + + + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. + + + + The length of the @param_values array. + + + + An array of #GValues holding the arguments +on which to invoke the callback of closure. + + + + The invocation hint given as the last argument to +g_closure_invoke(). + + + + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + + + Another name for g_cclosure_marshal_BOOLEAN__FLAGS(). @@ -9373,6 +9578,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_STRING__OBJECT_POINTER(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9409,6 +9657,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__BOOLEAN(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9445,6 +9736,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__BOXED(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9481,6 +9815,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__CHAR(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9517,6 +9894,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__DOUBLE(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9553,6 +9973,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__ENUM(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9589,6 +10052,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__FLAGS(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9625,6 +10131,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__FLOAT(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9661,6 +10210,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__INT(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9697,6 +10289,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__LONG(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9733,6 +10368,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__OBJECT(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9769,6 +10447,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__PARAM(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9805,6 +10526,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__POINTER(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9841,6 +10605,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__STRING(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9877,6 +10684,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UCHAR(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9949,6 +10799,92 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UINT_POINTER(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UINT(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -9985,6 +10921,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__ULONG(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -10023,6 +11002,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__VARIANT(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A marshaller for a #GCClosure with a callback of type @@ -10059,6 +11081,49 @@ to g_closure_invoke() + + +The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__VOID(). + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args. + + + + + + A generic marshaller function implemented via @@ -10104,6 +11169,52 @@ g_closure_set_meta_marshal() + + +A generic #GVaClosureMarshal function implemented via +[libffi](http://sourceware.org/libffi/). + +Since: 2.30 + + + + + the #GClosure to which the marshaller belongs + + + + a #GValue to store the return +value. May be %NULL if the callback of @closure doesn't return a +value. + + + + the instance on which the closure is invoked. + + + + va_list of arguments to be passed to the closure. + + + + additional data specified when +registering the marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + + + the length of the @param_types array + + + + the #GType of each argument from +@args_list. + + + + + + Creates a new closure which invokes @callback_func with @user_data as @@ -16673,7 +17784,8 @@ freed. - return location for character set name + return location for character set +name, or %NULL. @@ -22373,7 +23485,8 @@ Gets the number of elements in a #GList. This function iterates over the whole list to count its elements. Use a #GQueue instead of a GList if you regularly need the number -of items. +of items. To check whether the list is non-empty, it is faster to check +@list against %NULL. @@ -26079,6 +27192,70 @@ already been locked by the same thread results in undefined behaviour + + +Unlock @locker's mutex. See g_mutex_locker_new() for details. + +Since: 2.44 + + + + + a GMutexLocker + + + + + + + + +Lock @mutex and return a new #GMutexLocker. Unlock with +g_mutex_locker_free(). Using g_mutex_unlock() on @mutex +while a #GMutexLocker exists can lead to undefined behaviour. + +This is intended to be used with g_autoptr(). Note that g_autoptr() +is only available when using GCC or clang, so the following example +will only work with those compilers: +|[ +typedef struct +{ +... +GMutex mutex; +... +} MyObject; + +static void +my_object_do_stuff (MyObject *self) +{ +g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&self->mutex); + +// Code with mutex locked here + +if (cond) +// No need to unlock +return; + +// Optionally early unlock +g_clear_pointer (&locker, g_mutex_locker_free); + +// Code with mutex unlocked here +} +]| + +Since: 2.44 + + + + + a mutex to lock + + + + a #GMutexLocker + + + Allocates and initializes a new #GMutex. @@ -28918,10 +30095,8 @@ from open(). Adds a #GOptionGroup to the @context, so that parsing with @context -will recognize the options in the group. Note that the group will -be freed together with the context when g_option_context_free() is -called, so you must not free the group yourself after adding it -to a context. +will recognize the options in the group. Note that this will take +ownership of the @group and thus the @group should not be freed. Since: 2.6 @@ -29087,9 +30262,9 @@ Since: 2.6 - the main group of @context, or %NULL if @context doesn't -have a main group. Note that group belongs to @context and should -not be modified or freed. + the main group of @context, or %NULL if +@context doesn't have a main group. Note that group belongs to +@context and should not be modified or freed. @@ -29518,6 +30693,8 @@ which have been added to a #GOptionContext. Since: 2.6 +Deprecated: 2.44: Use g_option_group_unref() instead. + @@ -29564,7 +30741,25 @@ the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL a newly created option group. It should be added -to a #GOptionContext or freed with g_option_group_free(). +to a #GOptionContext or freed with g_option_group_unref(). + + + + + + +Increments the reference count of @group by one. + +Since: 2.44 + + + + + a #GOptionGroup + + + + a #GoptionGroup @@ -29677,24 +30872,22 @@ Since: 2.6 - + -Gets the default value of @param as a pointer to a #GValue. +Decrements the reference count of @group by one. +If the reference count drops to 0, the @group will be freed. +and all memory allocated by the @group is released. -The #GValue will remain value for the life of @param. - -Since: 2.38 +Since: 2.44 - - a #GParamSpec + + a #GOptionGroup - a pointer to a #GValue which must not be modified - - + @@ -29986,6 +31179,26 @@ Get the short description of a #GParamSpec. + + +Gets the default value of @param as a pointer to a #GValue. + +The #GValue will remain value for the life of @param. + +Since: 2.38 + + + + + a #GParamSpec + + + + a pointer to a #GValue which must not be modified + + + + Get the name of a #GParamSpec. @@ -38719,6 +39932,33 @@ g_signal_add_emission_hook() + + +Change the #GSignalCVaMarshaller used for a given signal. This is a +specialised form of the marshaller that can often be used for the +common case of a single connected signal handler and avoids the +overhead of #GValue. Its use is optional. + +Since: 2.32 + + + + + the signal id + + + + the instance type on which to set the marshaller. + + + + the marshaller to set. + + + + + + Stops a signal's current emission. @@ -39523,7 +40763,8 @@ or %NULL if the #GSList has no elements Gets the number of elements in a #GSList. This function iterates over the whole list to -count its elements. +count its elements. To check whether the list is non-empty, it is faster to +check @list against %NULL. @@ -41874,6 +43115,69 @@ Deprectated: 2.32: Use g_rw_lock_writer_unlock() instead + + +Sets @pp to %NULL, returning the value that was there before. + +Conceptually, this transfers the ownership of the pointer from the +referenced variable to the "caller" of the macro (ie: "steals" the +reference). + +The return value will be properly typed, according to the type of +@pp. + +This can be very useful when combined with g_autoptr() to prevent the +return value of a function from being automatically freed. Consider +the following example (which only works on GCC and clang): + +|[ +GObject * +create_object (void) +{ +g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); + +if (early_error_case) +return NULL; + +return g_steal_pointer (&obj); +} +]| + +It can also be used in similar ways for 'out' parameters and is +particularly useful for dealing with optional out parameters: + +|[ +gboolean +get_object (GObject **obj_out) +{ +g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); + +if (early_error_case) +return FALSE; + +if (obj_out) +*obj_out = g_steal_pointer (&obj); + +return TRUE; +} +]| + +In the above example, the object will be automatically freed in the +early error case and also in the case that %NULL was given for +@obj_out. + +Since: 2.44 + + + + + a pointer to a pointer + + + + + + Copies a nul-terminated string into the dest buffer, include the @@ -44169,15 +45473,15 @@ Since: 2.16 - /-separated test case path name for the test. + /-separated test case path name for the test. - Test data argument for the test function. + Test data argument for the test function. - The test function to invoke for this test. + The test function to invoke for this test. @@ -44229,7 +45533,7 @@ Since: 2.16 - /-separated test case path name for the test. + /-separated test case path name for the test. @@ -44382,11 +45686,11 @@ Since: 2.16 - the function to set up the fixture data + the function to set up the fixture data - the actual test function + the actual test function @@ -54544,17 +55848,6 @@ the fixed array - - -Since: 2.24 -Deprecated: 2.26 - - - - - - - Returns the 32-bit signed integer value of @value. -- cgit v1.2.1 From ccba54010c59e77d9f0a1ee6922a3658a8cd3724 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 08:45:05 +0100 Subject: Gio::Application: Add get_is_busy() and property. --- gio/src/application.hg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gio/src/application.hg b/gio/src/application.hg index ab2cfa29..11661a45 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -341,6 +341,7 @@ public: _WRAP_METHOD(void mark_busy(), g_application_mark_busy) _WRAP_METHOD(void unmark_busy(), g_application_unmark_busy) + _WRAP_METHOD(void get_is_busy() const, g_application_get_is_busy) _WRAP_METHOD(void send_notification(const Glib::ustring& id{?}, const Glib::RefPtr& notification), g_application_send_notification) _WRAP_METHOD(void withdraw_notification(const Glib::ustring& id), g_application_withdraw_notification) @@ -351,6 +352,7 @@ public: _WRAP_PROPERTY("inactivity-timeout", guint) _WRAP_PROPERTY("is-registered", bool) _WRAP_PROPERTY("is-remote", bool) + _WRAP_PROPERTY("is-busy", bool) //#m4 _CONVERSION(`const gchar*', `const Glib::ustring&', `Glib::ustring($3)') //#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)') -- cgit v1.2.1 From c4faf7c064bdc08359a11631a52254bae8de6998 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 08:47:47 +0100 Subject: Gio::Application: Add get/set/unset_resource_base_path() and property. --- gio/src/application.ccg | 5 +++++ gio/src/application.hg | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 53fc1005..1952abae 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -482,4 +482,9 @@ void Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustr g_application_add_main_option_entries(gobj(), array); } +void Application::unset_resource_base_path() +{ + g_application_set_resource_base_path(gobj(), 0 /* see the C docs. */); +} + } // namespace Gio diff --git a/gio/src/application.hg b/gio/src/application.hg index 11661a45..f2b1e662 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -160,6 +160,14 @@ public: _WRAP_METHOD(ApplicationFlags get_flags() const, g_application_get_flags) _WRAP_METHOD(void set_flags(ApplicationFlags flags), g_application_set_flags) + _WRAP_METHOD(std::string get_resource_base_path() const, g_application_get_resource_base_path) + _WRAP_METHOD(void set_resource_base_path(const std::string& resource_path), g_application_set_resource_base_path) + + /** Disable automatic resource loading functionality. + * See set_resource_base_path(). + */ + void unset_resource_base_path(); + _WRAP_METHOD(void set_action_group(const Glib::RefPtr& action_group), g_application_set_action_group, deprecated "Use the Gio::ActionMap interface instead.") @@ -352,6 +360,7 @@ public: _WRAP_PROPERTY("inactivity-timeout", guint) _WRAP_PROPERTY("is-registered", bool) _WRAP_PROPERTY("is-remote", bool) + _WRAP_PROPERTY("resource-base-path", bool) _WRAP_PROPERTY("is-busy", bool) //#m4 _CONVERSION(`const gchar*', `const Glib::ustring&', `Glib::ustring($3)') -- cgit v1.2.1 From fcd80be4a050f9ff72925ccbf3ae7ee50f862987 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 08:50:38 +0100 Subject: OptionContext: Add get/set_strict_posix(). --- glib/src/optioncontext.hg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glib/src/optioncontext.hg b/glib/src/optioncontext.hg index 60c35497..321bb66c 100644 --- a/glib/src/optioncontext.hg +++ b/glib/src/optioncontext.hg @@ -105,6 +105,9 @@ public: _WRAP_METHOD(void set_ignore_unknown_options(bool ignore_unknown = true), g_option_context_set_ignore_unknown_options) _WRAP_METHOD(bool get_ignore_unknown_options() const, g_option_context_get_ignore_unknown_options) + _WRAP_METHOD(void set_strict_posix(bool strict_posix = true), g_option_context_set_strict_posix) + _WRAP_METHOD(bool get_strict_posix() const, g_option_context_get_strict_posix) + #m4 _CONVERSION(`char**&',`gchar***',`&($3)') _WRAP_METHOD(bool parse(int& argc, char**& argv), g_option_context_parse, errthrow) -- cgit v1.2.1 From c77476e8f4ead9fcacba3b268827590613368132 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 09:03:04 +0100 Subject: Gio::DBus::InterfaceInfo: Add cache_build() and cache_release(). --- gio/src/dbusintrospection.hg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/src/dbusintrospection.hg b/gio/src/dbusintrospection.hg index 9613edf0..419c4242 100644 --- a/gio/src/dbusintrospection.hg +++ b/gio/src/dbusintrospection.hg @@ -119,6 +119,9 @@ public: _WRAP_METHOD(Glib::RefPtr lookup_property(const Glib::ustring& name), g_dbus_interface_info_lookup_property, refreturn) _WRAP_METHOD(Glib::RefPtr lookup_property(const Glib::ustring& name) const, g_dbus_interface_info_lookup_property, constversion, refreturn) + _WRAP_METHOD(void cache_build(), g_dbus_interface_info_cache_build) + _WRAP_METHOD(void cache_release(), g_dbus_interface_info_cache_release) + //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_interface_info_generate_xml) }; -- cgit v1.2.1 From 9b8258db815cee36c593b40e3cdc192f23fbbb63 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 09:15:13 +0100 Subject: Gio::File: Add replace_contents_bytes_aync(). There is no g_file_replace_content_bytes_finish() because this uses the existing g_file_replace_contents_finish(). --- gio/src/file.ccg | 46 ++++++++++++++++++++++++++++++++++++++++++++++ gio/src/file.hg | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/gio/src/file.ccg b/gio/src/file.ccg index cdd31e6b..639d4d78 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -1456,6 +1456,52 @@ void File::replace_contents_finish(const Glib::RefPtr& result) } +void +File::replace_contents_bytes_async(const SlotAsyncReady& slot, + const Glib::RefPtr& cancellable, + const Glib::RefPtr& contents, + const std::string& etag, + bool make_backup, + FileCreateFlags 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_file_replace_contents_bytes_async(gobj(), + const_cast(Glib::unwrap(contents)), + etag.empty() ? 0 : etag.c_str(), + make_backup, + static_cast(flags), + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +void +File::replace_contents_bytes_async(const SlotAsyncReady& slot, + const Glib::RefPtr& contents, + const std::string& etag, + bool make_backup, + FileCreateFlags 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_file_replace_contents_bytes_async(gobj(), + const_cast(Glib::unwrap(contents)), + etag.empty() ? 0 : etag.c_str(), + make_backup, + static_cast(flags), + 0, + &SignalProxy_async_callback, + slot_copy); +} + + Glib::RefPtr File::replace(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = 0; diff --git a/gio/src/file.hg b/gio/src/file.hg index 9dffa9f9..3618b060 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -2360,6 +2360,51 @@ public: void replace_contents_finish(const Glib::RefPtr& result); _IGNORE(g_file_replace_contents_finish) + + /** Same as replace_contents_async() but takes a Gio::Bytes input instead. + * + * When this operation has completed, @a slot will be called + * and the operation can be finalized with replace_contents_finish(). + * + * The operation can be cancelled by + * triggering the cancellable object from another thread. If the operation + * was cancelled, a Gio::Error with CANCELLED will be thrown. + * + * If @a make_backup is true, this function will attempt to + * make a backup of the file. + * + * @param slot: A callback to call when the request is satisfied. + * @param cancellable A Cancellable object. + * @param contents Bytes of contents to replace the file with. + * @param etag a new entity tag for the file. + * @param make_backup true if a backup should be created. + * @param flags A set of FileCreateFlags. + */ + void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, const Glib::RefPtr& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE); + + /** Same as replace_contents_async() but takes a Gio::Bytes input instead. + * + * When this operation has completed, @a slot will be called + * and the operation can be finalized with replace_contents_finish(). + * + * The operation can be cancelled by + * triggering the cancellable object from another thread. If the operation + * was cancelled, a Gio::Error with CANCELLED will be thrown. + * + * If @a make_backup is true, this function will attempt to + * make a backup of the file. + * + * @param slot: A callback to call when the request is satisfied. + * @param contents Bytes of contents to replace the file with. + * @param etag a new entity tag for the file. + * @param make_backup true if a backup should be created. + * @param flags A set of FileCreateFlags. + */ + void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE); + + _IGNORE(g_file_replace_contents_async) + + _WRAP_METHOD(bool supports_thread_contexts() const, g_file_supports_thread_contexts) // *** vfuncs *** -- cgit v1.2.1 From 143d7588b492edbf336f0df79716d52137b31e10 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 09:42:03 +0100 Subject: InputStream: Add read_all_async() and read_all_finish(). --- gio/src/inputstream.ccg | 36 ++++++++++++++++++++++++ gio/src/inputstream.hg | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/gio/src/inputstream.ccg b/gio/src/inputstream.ccg index d82ca182..82d0c134 100644 --- a/gio/src/inputstream.ccg +++ b/gio/src/inputstream.ccg @@ -59,6 +59,42 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, i slot_copy); } + +void +InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr& 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_all_async(gobj(), + buffer, + count, + io_priority, + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +void +InputStream::read_all_async(void* buffer, 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_all_async(gobj(), + buffer, + count, + io_priority, + 0, + &SignalProxy_async_callback, + slot_copy); +} + + void InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, int io_priority) { diff --git a/gio/src/inputstream.hg b/gio/src/inputstream.hg index 64c53c4e..446e9017 100644 --- a/gio/src/inputstream.hg +++ b/gio/src/inputstream.hg @@ -205,6 +205,80 @@ public: g_input_stream_read_finish, errthrow) + + /** Request an asynchronous read of @a count bytes from the stream into the buffer + * starting at @a buffer. This is the asynchronous equivalent of read_all(). + * + * When the operation is finished @a slot will be called. + * You can then call read_all_finish() to get the result of the + * operation. + * + * During an async request no other sync and async calls are allowed, and will + * result in Gio::Error with PENDING being thrown. + * + * A value of @a count larger than MAXSSIZE will cause a Gio::Error with INVALID_ARGUMENT to be thrown. + * + * On success, the number of bytes read into the buffer will be passed to the + * @a slot callback. It is not an error if this is not the same as the requested size, as it + * can happen e.g. near the end of a file, but generally we try to read + * as many bytes as requested. Zero is returned on end of file + * (or if @a count is zero), but never otherwise. + * + * Any outstanding i/o request with higher priority (lower numerical value) will + * be executed before an outstanding request with lower priority. Default + * priority is PRIORITY_DEFAULT. + * + * The asyncronous methods have a default fallback that uses threads to implement + * asynchronicity, so they are optional for inheriting classes. However, if you + * override one you must override all. + * + * @param buffer A buffer to read data into (which should be at least count bytes long). + * @param count The number of bytes that will be read from the stream. + * @param slot Callback to call when the request is satisfied. + * @param cancellable A Cancellable object. + * @param io_priority The I/O priority of the request. + */ + void read_all_async(void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, int io_priority = Glib::PRIORITY_DEFAULT); + + /** Request an asynchronous read of @a count bytes from the stream into the buffer + * starting at @a buffer. This is the asynchronous equivalent of read_all(). + * + * When the operation is finished @a slot will be called. + * You can then call read_all_finish() to get the result of the + * operation. + * + * During an async request no other sync and async calls are allowed, and will + * result in a Gio::Error with PENDING being thrown. + * + * A value of @a count larger than MAXSSIZE will cause a Gio::Error with INVALID_ARGUMENT to be thrown. + * + * On success, the number of bytes read into the buffer will be passed to the + * @a slot callback. It is not an error if this is not the same as the requested size, as it + * can happen e.g. near the end of a file, but generally we try to read + * as many bytes as requested. Zero is returned on end of file + * (or if @a count is zero), but never otherwise. + * + * Any outstanding i/o request with higher priority (lower numerical value) will + * be executed before an outstanding request with lower priority. Default + * priority is PRIORITY_DEFAULT. + * + * The asyncronous methods have a default fallback that uses threads to implement + * asynchronicity, so they are optional for inheriting classes. However, if you + * override one you must override all. + * + * @param buffer A buffer to read data into (which should be at least count bytes long). + * @param count The number of bytes that will be read from the stream. + * @param slot Callback to call when the request is satisfied. + * @param io_priority The I/O priority of the request. + */ + void read_all_async(void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority = Glib::PRIORITY_DEFAULT); + _IGNORE(g_input_stream_read_all_async) + + _WRAP_METHOD(bool read_all_finish(const Glib::RefPtr& result, gsize& bytes_read), + g_input_stream_read_all_finish, + errthrow) + + //TODO: Use std::size_type instead of gsize? /** Request an asynchronous skip of @a count bytes from the stream into the buffer -- cgit v1.2.1 From 7d319058dc84c340bb06b9ef59c28f2725d0102b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 09:48:08 +0100 Subject: Gio::MemoryInputStream: Add add_bytes(). --- gio/src/memoryinputstream.hg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gio/src/memoryinputstream.hg b/gio/src/memoryinputstream.hg index eee71616..3b836750 100644 --- a/gio/src/memoryinputstream.hg +++ b/gio/src/memoryinputstream.hg @@ -87,6 +87,8 @@ _DEPRECATE_IFDEF_END * @newin{2,40} */ void add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot); + + _WRAP_METHOD(void add_bytes(const Glib::RefPtr& bytes), g_memory_input_stream_add_bytes) }; } // namespace Gio -- cgit v1.2.1 From fdc374adad2d72fb693eed508170a6e2e06fa8a8 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 09:56:19 +0100 Subject: Gio::OutputStream: Add write_all_async() and write_all_finish(). --- gio/src/outputstream.ccg | 37 ++++++++++++++++++++++ gio/src/outputstream.hg | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index d991bf7f..0ed1e138 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -58,6 +58,43 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& slot_copy); } + + +void +OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr& 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_all_async(gobj(), + buffer, + count, + io_priority, + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +void +OutputStream::write_all_async(const void* buffer, 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_output_stream_write_all_async(gobj(), + buffer, + count, + io_priority, + 0, + &SignalProxy_async_callback, + slot_copy); +} + + void OutputStream::splice_async(const Glib::RefPtr& source, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, OutputStreamSpliceFlags flags, int io_priority) { diff --git a/gio/src/outputstream.hg b/gio/src/outputstream.hg index d13992f6..25c191a7 100644 --- a/gio/src/outputstream.hg +++ b/gio/src/outputstream.hg @@ -303,6 +303,86 @@ public: g_output_stream_write_finish, errthrow) + + /** Request an asynchronous write of @a count bytes from @a buffer into + * the stream. When the operation is finished @a slot will be called. + * You can then call write_all_finish() to get the result of the + * operation. + * + * This is the asynchronous version of write_all(). + * + * During an async request no other sync and async calls are allowed, + * and will result in Gio::Error with PENDING being thrown. + * + * A value of @a count larger than MAXSSIZE will cause a Gio::Error with + * INVALID_ARGUMENT to be thrown. + * + * On success, the number of bytes written will be passed to the + * callback @a slot. It is not an error if this is not the same as the + * requested size, as it can happen e.g. on a partial I/O error, + * but generally we try to write as many bytes as requested. + * + * Any outstanding I/O request with higher priority (lower numerical + * value) will be executed before an outstanding request with lower + * priority. Default priority is Glib::PRIORITY_DEFAULT. + * + * The asyncronous methods have a default fallback that uses threads + * to implement asynchronicity, so they are optional for inheriting + * classes. However, if you override one you must override all. + * + * For the synchronous, blocking version of this function, see + * write(). + * + * @param buffer The buffer containing the data to write. + * @param count The number of bytes to write + * @param slot Callback slot to call when the request is satisfied. + * @param cancellable Cancellable object. + * @param io_priority The io priority of the request. + */ + void write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, int io_priority = Glib::PRIORITY_DEFAULT); + + /** Request an asynchronous write of @a count bytes from @a buffer into + * the stream. When the operation is finished @a slot will be called. + * You can then call write_finish() to get the result of the + * operation. + * + * This is the asynchronous version of write_all(). + * + * During an async request no other sync and async calls are allowed, + * and will result in Gio::Error with PENDING being thrown. + * + * A value of @a count larger than MAXSSIZE will cause a Gio::Error with + * INVALID_ARGUMENT to be thrown. + * + * On success, the number of bytes written will be passed to the + * callback @a slot. It is not an error if this is not the same as the + * requested size, as it can happen e.g. on a partial I/O error, + * but generally we try to write as many bytes as requested. + * + * Any outstanding I/O request with higher priority (lower numerical + * value) will be executed before an outstanding request with lower + * priority. Default priority is Glib::PRIORITY_DEFAULT. + * + * The asyncronous methods have a default fallback that uses threads + * to implement asynchronicity, so they are optional for inheriting + * classes. However, if you override one you must override all. + * + * For the synchronous, blocking version of this function, see + * write(). + * + * @param buffer The buffer containing the data to write. + * @param count The number of bytes to write + * @param slot Callback slot to call when the request is satisfied. + * @param io_priority The io priority of the request. + */ + void write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority = Glib::PRIORITY_DEFAULT); + _IGNORE(g_output_stream_write_all_async) + + _WRAP_METHOD(bool write_all_finish(const Glib::RefPtr& result, gsize& bytes_written), + g_output_stream_write_all_finish, + errthrow) + + /** Splices a stream asynchronously. * When the operation is finished @a slot will be called. * You can then call splice_finish() to get the result of the -- cgit v1.2.1 From ed3503124133625407133236c58faec78f476e38 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 5 Mar 2015 15:47:34 +0100 Subject: Gio::ThemedIcon: Change parameter name to use_default_fallbacks * gio/src/themedicon.[hg|ccg]: Change parameter name use_default_callbacks to use_default_fallbacks in constructor and create(). --- gio/src/themedicon.ccg | 6 ++---- gio/src/themedicon.hg | 28 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/gio/src/themedicon.ccg b/gio/src/themedicon.ccg index 3a6d5402..af938ee9 100644 --- a/gio/src/themedicon.ccg +++ b/gio/src/themedicon.ccg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -22,9 +20,9 @@ namespace Gio { -ThemedIcon::ThemedIcon(const std::string& iconname, bool use_default_callbacks) +ThemedIcon::ThemedIcon(const std::string& iconname, bool use_default_fallbacks) : - _CONSTRUCT("name", iconname.c_str(), "use-default-fallbacks", gboolean(use_default_callbacks)) + _CONSTRUCT("name", iconname.c_str(), "use-default-fallbacks", gboolean(use_default_fallbacks)) {} } //namespace Gio diff --git a/gio/src/themedicon.hg b/gio/src/themedicon.hg index d5a0ea2a..c906b22c 100644 --- a/gio/src/themedicon.hg +++ b/gio/src/themedicon.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -28,7 +26,7 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Gio { -/** Icon theming support +/** Icon theming support. * ThemedIcon is an implementation of Gio::Icon that supports icon themes. * ThemedIcon contains a list of all of the icons present in an icon * theme, so that icons can be looked up quickly. ThemedIcon does @@ -47,21 +45,33 @@ class ThemedIcon _IMPLEMENTS_INTERFACE(Icon) protected: - /** Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters. + /** Creates a new themed icon for @a iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters. * * @param iconname A string containing an icon name. - * @param use_default_callbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters. + * @param use_default_fallbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters. */ - explicit ThemedIcon(const std::string& iconname, bool use_default_callbacks = false); + explicit ThemedIcon(const std::string& iconname, bool use_default_fallbacks = false); _IGNORE(g_themed_icon_new, g_themed_icon_new_with_default_fallbacks) public: - /** Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters. + /** Creates a new themed icon for @a iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters. + * + * For example + * @code + * Glib::RefPtr icon = Gio::ThemedIcon::create("gnome-dev-cdrom-audio", true); + * @endcode + * is equivalent to + * @code + * Glib::RefPtr icon = Gio::ThemedIcon::create("gnome-dev-cdrom-audio", false); + * icon->append_name("gnome-dev-cdrom"); + * icon->append_name("gnome-dev"); + * icon->append_name("gnome"); + * @endcode * * @param iconname A string containing an icon name. - * @param use_default_callbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters. + * @param use_default_fallbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters. */ - _WRAP_CREATE(const std::string& iconname, bool use_default_callbacks = false) + _WRAP_CREATE(const std::string& iconname, bool use_default_fallbacks = false) //TODO: GIcon *g_themed_icon_new_from_names (char **iconnames, int len); -- cgit v1.2.1 From 4bb628eb3e1b5f734dfd1a5cd0098326ccd925c6 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 3 Mar 2015 10:01:13 +0100 Subject: Gio::OutputStream: write_async(), write_all_async(): Improve docs. Add the warning about the buffer needing to stay valid because it is not copied, adding to the C API here: https://git.gnome.org/browse/glib/commit/gio/goutputstream.c?id=0f800cd1a863bc0c3e51c03592e2fb1ffbda8982 --- gio/src/outputstream.hg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gio/src/outputstream.hg b/gio/src/outputstream.hg index 25c191a7..b318d3bb 100644 --- a/gio/src/outputstream.hg +++ b/gio/src/outputstream.hg @@ -256,6 +256,11 @@ public: * For the synchronous, blocking version of this function, see * write(). * + * Note that no copy of @a buffer will be made, so it must stay valid + * until @a slot is called. See write_bytes_async() + * for a Glib::Bytes version that will automatically hold a reference to + * the contents (without copying) for the duration of the call. + * * @param buffer The buffer containing the data to write. * @param count The number of bytes to write * @param slot Callback slot to call when the request is satisfied. @@ -290,6 +295,11 @@ public: * * For the synchronous, blocking version of this function, see * write(). + + * Note that no copy of @a buffer will be made, so it must stay valid + * until @a slot is called. See write_bytes_async() + * for a Glib::Bytes version that will automatically hold a reference to + * the contents (without copying) for the duration of the call. * * @param buffer The buffer containing the data to write. * @param count The number of bytes to write @@ -333,6 +343,9 @@ public: * For the synchronous, blocking version of this function, see * write(). * + * Note that no copy of @a buffer will be made, so it must stay valid + * until @a slot is called. + * * @param buffer The buffer containing the data to write. * @param count The number of bytes to write * @param slot Callback slot to call when the request is satisfied. @@ -370,6 +383,9 @@ public: * For the synchronous, blocking version of this function, see * write(). * + * Note that no copy of @a buffer will be made, so it must stay valid + * until @a slot is called. + * * @param buffer The buffer containing the data to write. * @param count The number of bytes to write * @param slot Callback slot to call when the request is satisfied. -- cgit v1.2.1 From 5e70852f59797954327a01496e2d8b9d121f4689 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 6 Mar 2015 10:53:06 +0100 Subject: 2.43.91 --- NEWS | 26 ++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 095e3e8a..5e58ae68 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,29 @@ +2.43.91 (unstable): + +Glib: +* OptionContext: Add get/set_strict_posix(). + (Murray Cumming) + +Gio: +* Application: + - Add get/set/unset_resource_base_path() and property. + - Add get_is_busy() and property. + (Murray Cumming) +* File: Add replace_contents_bytes_aync(). + (Murray Cumming) +* InputStream: Add read_all_async() and read_all_finish(). + (Murray Cumming) +* MemoryInputStream: Add add_bytes(). + (Murray Cumming) +* OutputStream: Add write_all_async() and write_all_finish(). + (Murray Cumming) + +Gio::DBus +* InterfaceInfo: Add cache_build() and cache_release(). + (Murray Cumming) + + + 2.43.90 (unstable): Glib: diff --git a/configure.ac b/configure.ac index fbab5344..6241c53b 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.90], +AC_INIT([glibmm], [2.43.91], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From b94f5f8a23f2da68445101262bb7f1c30d1e38a2 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 16 Mar 2015 09:24:36 +0100 Subject: Regenerate .defs. --- gio/src/gio_methods.defs | 14 ++++++++++++++ glib/src/glib_functions.defs | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 43d8431f..46171945 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -9564,6 +9564,10 @@ +;; From ghttpproxy.h + + + ;; From gicon.h (define-function g_icon_get_type @@ -17233,6 +17237,12 @@ (return-type "gboolean") ) +(define-method get_completed + (of-object "GTask") + (c-name "g_task_get_completed") + (return-type "gboolean") +) + ;; From gtcpconnection.h @@ -19165,6 +19175,10 @@ +;; From gwin32networking.h + + + ;; From gwin32outputstream.h (define-function g_win32_output_stream_get_type diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index 2bbc2903..feae55c7 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -7562,6 +7562,14 @@ ) ) +(define-function g_steal_pointer + (c-name "g_steal_pointer") + (return-type "gpointer") + (parameters + '("gpointer" "pp") + ) +) + (define-function g_mem_set_vtable (c-name "g_mem_set_vtable") (return-type "none") @@ -14966,6 +14974,15 @@ (return-type "gchar**") ) +(define-function g_win32_get_package_installation_directory_utf8 + (c-name "g_win32_get_package_installation_directory_utf8") + (return-type "gchar*") + (parameters + '("const-gchar*" "package") + '("const-gchar*" "dll_name") + ) +) + (define-function g_win32_get_package_installation_subdirectory_utf8 (c-name "g_win32_get_package_installation_subdirectory_utf8") (return-type "gchar*") -- cgit v1.2.1 From aa9793638c55e1cb62935af4b6587b2078d96585 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 16 Mar 2015 09:24:53 +0100 Subject: Regenerate _docs.xml files. --- gio/src/gio_docs.xml | 36 +++++++++++--------- glib/src/glib_docs.xml | 91 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 31853ca2..864b17a9 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -29040,7 +29040,6 @@ Gets the #GDBusObject that @interface_ belongs to, if any. Since: 2.32 - @@ -51999,20 +51998,6 @@ Since: 2.32 - - - - - - - a GvdbTable - - - - a new #GResource for @table - - - Looks for a file at the specified @path in the resource and @@ -61238,6 +61223,26 @@ Since: 2.36 + + +Gets the value of #GTask:completed. This changes from %FALSE to %TRUE after +the task’s callback is invoked, and will return %FALSE if called from inside +the callback. + +Since: 2.44 + + + + + a #GTask. + + + + %TRUE if the task has completed, %FALSE otherwise. + + + + Gets the #GMainContext that @task will return its result in (that @@ -61830,6 +61835,7 @@ See #GTaskThreadFunc for more details about how @task_func is handled. Normally this is used with tasks created with a %NULL `callback`, but note that even if the task does have a callback, it will not be invoked when @task_func returns. +#GTask:completed will be set to %TRUE just before this function returns. Since: 2.36 diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index aebd445e..a91c9987 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -1169,8 +1169,8 @@ option: `--name arg` or combined in a single argument: `--name=arg`. - The option provides a callback to parse the -extra argument. + The option provides a callback (of type +#GOptionArgFunc) to parse the extra argument. @@ -17699,7 +17699,9 @@ Since: 2.2 Frees the memory pointed to by @mem. -If @mem is %NULL it simply returns. + +If @mem is %NULL it simply returns, so there is no need to check @mem +against %NULL before calling this function. @@ -18601,6 +18603,10 @@ release of GLib. It does nothing. Retrieves every key inside @hash_table. The returned data is valid until changes to the hash release those keys. +This iterates over every entry in the hash table to build its return value. +To iterate over the entries in a #GHashTable more efficiently, use a +#GHashTableIter. + Since: 2.14 @@ -18629,6 +18635,10 @@ key. Use @length to determine the true length if it's possible that Note: in the common case of a string-keyed #GHashTable, the return value of this function can be conveniently cast to (const gchar **). +This iterates over every entry in the hash table to build its return value. +To iterate over the entries in a #GHashTable more efficiently, use a +#GHashTableIter. + You should always free the return result with g_free(). In the above-mentioned case of a string-keyed hash table, it may be appropriate to use g_strfreev() if you call g_hash_table_steal_all() @@ -18658,6 +18668,10 @@ Since: 2.40 Retrieves every value inside @hash_table. The returned data is valid until @hash_table is modified. +This iterates over every entry in the hash table to build its return value. +To iterate over the entries in a #GHashTable more efficiently, use a +#GHashTableIter. + Since: 2.14 @@ -20138,8 +20152,10 @@ returns %FALSE it is automatically removed from the list of event sources and will not be called again. This internally creates a main loop source using g_idle_source_new() -and attaches it to the main loop context using g_source_attach(). -You can do these steps manually if you need greater control. +and attaches it to the global #GMainContext using g_source_attach(), so +the callback will be invoked in whichever thread is running that main +context. You can do these steps manually if you need greater control or to +use a custom main context. @@ -20164,8 +20180,10 @@ events pending. If the function returns %FALSE it is automatically removed from the list of event sources and will not be called again. This internally creates a main loop source using g_idle_source_new() -and attaches it to the main loop context using g_source_attach(). -You can do these steps manually if you need greater control. +and attaches it to the global #GMainContext using g_source_attach(), so +the callback will be invoked in whichever thread is running that main +context. You can do these steps manually if you need greater control or to +use a custom main context. @@ -23283,7 +23301,10 @@ Another name for g_list_free_1(). -Frees one #GList element. +Frees one #GList element, but does not update links from the next and +previous elements in the list, so you should not call this function on an +element that is currently part of a list. + It is usually used after g_list_remove_link(). @@ -23522,6 +23543,10 @@ Note that it is considered perfectly acceptable to access Gets the element at the given position in a #GList. +This iterates over the list until it reaches the @n-th position. If you +intend to iterate over every element, it is better to use a for-loop as +described in the #GList introduction. + @@ -23543,6 +23568,10 @@ the end of the #GList Gets the data of the element at the given position. +This iterates over the list until it reaches the @n-th position. If you +intend to iterate over every element, it is better to use a for-loop as +described in the #GList introduction. + @@ -29766,6 +29795,11 @@ It is an error to call this function when the freeze count is zero. Decreases the reference count of @object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed). +If the pointer to the #GObject may be reused in future (for example, if it is +an instance variable of another object), it is recommended to clear the +pointer to %NULL rather than retain a dangling pointer to a potentially +invalid #GObject instance. Use g_clear_object() for this. + @@ -30893,7 +30927,10 @@ Since: 2.44 Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN -property. +property. In many cases, it may be more appropriate to use an enum with +g_param_spec_enum(), both to improve code clarity by using explicitly named +values, and to allow for more values to be added in future without breaking +API. See g_param_spec_internal() for details on property names. @@ -31588,6 +31625,8 @@ See g_param_spec_internal() for details on property names. Creates a new #GParamSpecPointer instance specifying a pointer property. +Where possible, it is better to use g_param_spec_object() or +g_param_spec_boxed() to expose memory management information. See g_param_spec_internal() for details on property names. @@ -48075,8 +48114,10 @@ g_timeout_add_seconds() function; this function allows for more optimizations and more efficient system power usage. This internally creates a main loop source using g_timeout_source_new() -and attaches it to the main loop context using g_source_attach(). You can -do these steps manually if you need greater control. +and attaches it to the global #GMainContext using g_source_attach(), so +the callback will be invoked in whichever thread is running that main +context. You can do these steps manually if you need greater control or to +use a custom main context. The interval given is in terms of monotonic time, not wall clock time. See g_get_monotonic_time(). @@ -48118,8 +48159,10 @@ timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays). This internally creates a main loop source using g_timeout_source_new() -and attaches it to the main loop context using g_source_attach(). You can -do these steps manually if you need greater control. +and attaches it to the global #GMainContext using g_source_attach(), so +the callback will be invoked in whichever thread is running that main +context. You can do these steps manually if you need greater control or to +use a custom main context. The interval given in terms of monotonic time, not wall clock time. See g_get_monotonic_time(). @@ -49068,7 +49111,9 @@ Since: 2.8 Attempts to realloc @mem to a new size, @n_bytes, and returns %NULL on failure. Contrast with g_realloc(), which aborts the program -on failure. If @mem is %NULL, behaves the same as g_try_malloc(). +on failure. + +If @mem is %NULL, behaves the same as g_try_malloc(). @@ -55420,7 +55465,7 @@ Since: 2.30 Similar to g_variant_get_string() except that instead of returning a constant string, the string is duplicated. -The string will always be utf8 encoded. +The string will always be UTF-8 encoded. The return value must be freed using g_free(). @@ -55437,7 +55482,7 @@ Since: 2.24 - a newly allocated string, utf8 encoded + a newly allocated string, UTF-8 encoded @@ -56053,7 +56098,7 @@ Returns the string value of a #GVariant instance with a string type. This includes the types %G_VARIANT_TYPE_STRING, %G_VARIANT_TYPE_OBJECT_PATH and %G_VARIANT_TYPE_SIGNATURE. -The string will always be utf8 encoded. +The string will always be UTF-8 encoded. If @length is non-%NULL then the length of the string (in bytes) is returned there. For trusted values, this information is already @@ -56078,7 +56123,7 @@ to store the length - the constant string, utf8 encoded + the constant string, UTF-8 encoded @@ -57020,7 +57065,7 @@ Since: 2.24 Creates an array-of-bytes #GVariant with the contents of @string. This function is just like g_variant_new_string() except that the -string need not be valid utf8. +string need not be valid UTF-8. The nul terminator character at the end of the string is stored in the array. @@ -57540,14 +57585,14 @@ Since: 2.24 Creates a string #GVariant with the contents of @string. -@string must be valid utf8. +@string must be valid UTF-8. Since: 2.24 - a normal utf8 nul-terminated string + a normal UTF-8 nul-terminated string @@ -57585,7 +57630,7 @@ Since: 2.24 Creates a string #GVariant with the contents of @string. -@string must be valid utf8. +@string must be valid UTF-8. This function consumes @string. g_free() will be called on @string when it is no longer required. @@ -57599,7 +57644,7 @@ Since: 2.38 - a normal utf8 nul-terminated string + a normal UTF-8 nul-terminated string -- cgit v1.2.1 From d1f1eca2d3a5044d6b31c4acf49879fda5306fd8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Mar 2015 10:19:03 +0100 Subject: gmmproc: _WRAP_VFUNC: Add the keep_return parameter * glib/glibmm/utility.h: Add template function destroy_notify_delete(). * tools/pm/WrapParser.pm: * tools/pm/Output.pm: * tools/m4/vfunc.m4: Add optional parameter keep_return to _WRAP_VFUNC(). Bug #705124. --- glib/glibmm/utility.h | 11 +++++++++- tools/m4/vfunc.m4 | 54 +++++++++++++++++++++++++++++++++----------------- tools/pm/Output.pm | 6 +++++- tools/pm/WrapParser.pm | 16 +++++++++++---- 4 files changed, 63 insertions(+), 24 deletions(-) diff --git a/glib/glibmm/utility.h b/glib/glibmm/utility.h index 6e5319b8..79fecb6b 100644 --- a/glib/glibmm/utility.h +++ b/glib/glibmm/utility.h @@ -1,4 +1,3 @@ -// -*- c++ -*- #ifndef _GLIBMM_UTILITY_H #define _GLIBMM_UTILITY_H @@ -113,6 +112,16 @@ std::string convert_return_gchar_ptr_to_stdstring(char* str) // Append type_name to dest, while replacing special characters with '+'. void append_canonical_typename(std::string& dest, const char* type_name); +// Delete data referred to by a void*. +// Instantiations can be used as destroy callbacks in glib functions +// that take a GDestroyNotify parameter, such as g_object_set_qdata_full() +// and g_option_group_set_translate_func(). +template +void destroy_notify_delete(void* data) +{ + delete static_cast(data); +} + } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4 index beac4c86..156a3a4b 100644 --- a/tools/m4/vfunc.m4 +++ b/tools/m4/vfunc.m4 @@ -20,22 +20,24 @@ _POP()') dnl $1 $2 $3 $4 dnl _VFUNC_PCC(cppname,gtkname,cpprettype,crettype, -dnl $5 $6 $7 $8 $9 $10 $11 -dnl `',`',`',firstarg, refreturn_ctype, ifdef, errthrow, -dnl $12 $13 $14 $15 -dnl slot_type, c_data_param_name, return_value, exception_handler) +dnl $5 $6 $7 $8 +dnl `',`',`',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 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_(), dnl but it is not yet clear whether that would be a worthwhile performance optimization. define(`_VFUNC_PCC',`dnl _PUSH(SECTION_PCC_VFUNCS) -ifelse(`$10',,,`#ifdef $10' +ifelse(`$11',,,`#ifdef $11' )dnl $4 __CPPNAME__`'_Class::$2_vfunc_callback`'($5) { -ifelse(`$13',,,dnl -` const $12* slot = static_cast<$12*>($13); +ifelse(`$14',,,dnl +` const $13* slot = static_cast<$13*>($14); ')dnl dnl First, do a simple cast to ObjectBase. We will have to do a dynamic_cast @@ -65,26 +67,42 @@ dnl C++ vfunc on it. ifelse($4,void,`dnl obj->$1`'($7); return; -',`dnl +',`dnl not void ifelse($9,refreturn_ctype,`dnl Assume Glib::unwrap_copy() is correct if refreturn_ctype is requested. return Glib::unwrap_copy`'(`obj->$1'($7)); -',`dnl +',`dnl not refreturn_ctype +ifelse($10,keep_return,`dnl + static GQuark quark_return_value = g_quark_from_static_string("__NAMESPACE__::__CPPNAME__::$1"); + + $3* return_value = static_cast<$3*>(g_object_get_qdata(obj_base->gobj(), quark_return_value)); + if (!return_value) + { + return_value = new $3`'(); + g_object_set_qdata_full(obj_base->gobj(), quark_return_value, return_value, + &Glib::destroy_notify_delete<$3>); + } + // Keep a copy of the return value. The caller is not expected + // to free the object that the returned pointer points to. + *return_value = obj->$1`'($7); + return _CONVERT($3,$4,`(*return_value)'); +',`dnl not keep_return return _CONVERT($3,$4,`obj->$1`'($7)'); -')dnl -')dnl +')dnl end keep_return +')dnl end refreturn_ctype +')dnl end void #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { -ifelse($15, `', `dnl +ifelse($16, `', `dnl Glib::exception_handlers_invoke`'(); ', `dnl try { ifelse($9,refreturn_ctype,`dnl - return Glib::unwrap_copy`'(obj->$15`'()); + return Glib::unwrap_copy`'(obj->$16`'()); ', `dnl - return _CONVERT($3, $4, `obj->$15`'()'); + return _CONVERT($3, $4, `obj->$16`'()'); ')dnl } catch(...) @@ -109,7 +127,7 @@ dnl g_assert(base != 0); if(base && base->$2) { ifelse($4,void,,`$4 retval = ')(*base->$2)`'($6); -ifelse($11,errthrow,`dnl +ifelse($12,errthrow,`dnl if(*error) ::Glib::Error::throw_exception(*error); ')dnl @@ -118,15 +136,15 @@ ifelse($4,void,,` return retval; } ifelse($4,void,,`dnl -ifelse(`$14', `',`dnl +ifelse(`$15', `',`dnl typedef $4 RType; return RType`'(); ',`dnl - return _CONVERT($3,$4,`$14'); + return _CONVERT($3,$4,`$15'); ')dnl ')dnl } -ifelse(`$10',,,`#endif // $10 +ifelse(`$11',,,`#endif // $11 ')dnl _POP()') diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 1b12f4e6..3ae40d5a 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -205,6 +205,9 @@ sub output_wrap_vfunc_cc($$$$$$$$) my $refreturn_ctype = ""; $refreturn_ctype = "refreturn_ctype" if($$objCFunc{rettype_needs_ref}); + my $keep_return = ""; + $keep_return = "keep_return" if($$objCppfunc{keep_return}); + # Get the conversions. my $conversions = convert_args_c_to_cpp($objCFunc, $objCppfunc, $line_num); @@ -212,7 +215,7 @@ sub output_wrap_vfunc_cc($$$$$$$$) my $returnValue = $$objCppfunc{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)dnl\n", + my $str = sprintf("_VFUNC_PCC(%s,%s,%s,%s,\`%s\',\`%s\',\`%s\',%s,%s,%s,%s,%s,%s,%s,%s,%s)dnl\n", $$objCppfunc{name}, $cname, $$objCppfunc{rettype}, @@ -222,6 +225,7 @@ sub output_wrap_vfunc_cc($$$$$$$$) $conversions, ${$objCFunc->get_param_names()}[0], $refreturn_ctype, + $keep_return, $ifdef, $errthrow, $$objCppfunc{slot_type}, diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm index dc12eb47..337b4cf6 100644 --- a/tools/pm/WrapParser.pm +++ b/tools/pm/WrapParser.pm @@ -1279,6 +1279,7 @@ sub on_wrap_vfunc($) $argCName = string_unquote($argCName); my $refreturn = 0; + my $keep_return = 0; my $refreturn_ctype = 0; my $returnValue = ""; my $exceptionHandler = ""; @@ -1299,6 +1300,12 @@ sub on_wrap_vfunc($) { $refreturn = 1; } + # Must a copy of the return value be kept, because the caller does not + # get its own copy? + elsif($argRef eq "keep_return") + { + $keep_return = 1; + } elsif($argRef eq "refreturn_ctype") { $refreturn_ctype = 1; @@ -1354,7 +1361,7 @@ sub on_wrap_vfunc($) } $self->output_wrap_vfunc($argCppDecl, $argCName, $$self{filename}, $$self{line_num}, - $refreturn, $refreturn_ctype, $custom_vfunc, + $refreturn, $keep_return, $refreturn_ctype, $custom_vfunc, $custom_vfunc_callback, $ifdef, $errthrow, $slot_name, $slot_callback, $no_slot_copy, $returnValue, $exceptionHandler); } @@ -1570,12 +1577,12 @@ sub output_wrap_signal($$$$$$$$$$$$) } # void output_wrap_vfunc($CppDecl, $vfunc_name, $filename, $line_num, -# $refreturn, $refreturn_ctype, +# $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($$$$$$$$$$$$$$) +sub output_wrap_vfunc($$$$$$$$$$$$$$$$$) { - my ($self, $CppDecl, $vfunc_name, $filename, $line_num, $refreturn, $refreturn_ctype, + 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) = @_; @@ -1608,6 +1615,7 @@ sub output_wrap_vfunc($$$$$$$$$$$$$$) # These macros are defined in vfunc.m4: $$objCppVfunc{rettype_needs_ref} = $refreturn; + $$objCppVfunc{keep_return} = $keep_return; $$objCppVfunc{return_value} = $returnValue; $$objCppVfunc{exception_handler} = $exceptionHandler; $$objCppVfunc{name} .= "_vfunc"; #All vfuncs should have the "_vfunc" suffix, and a separate easily-named invoker method. -- cgit v1.2.1 From 010a2d71e4379a12849d2cda742dfdc0a868d043 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Mar 2015 10:23:37 +0100 Subject: Gio::Action etc: Add keep_return to some _WRAP_VFUNC() * gio/src/action.hg: Add keep_return to get_name_vfunc(), get_parameter_type_vfunc() and get_state_type_vfunc(). * gio/src/actiongroup.hg: Add keep_return to get_action_parameter_type_vfunc() and get_action_state_type_vfunc(). * gio/src/dbusobject.hg: Add keep_return to get_object_path_vfunc(). * gio/src/tlspassword.hg: Add keep_return to get_default_warning_vfunc(). The C code that calls these functions does not get its own copy of the returned object. The called function must store a copy. Bug #705124. --- gio/src/action.hg | 12 +++++------- gio/src/actiongroup.hg | 8 +++----- gio/src/dbusobject.hg | 4 ++-- gio/src/tlspassword.hg | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/gio/src/action.hg b/gio/src/action.hg index 5e6dcf8d..207bb93a 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2011 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -216,13 +214,13 @@ public: _WRAP_PROPERTY("state", Glib::VariantBase) _WRAP_PROPERTY("state-type", Glib::VariantType) -#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())') - _WRAP_VFUNC(Glib::ustring get_name() const, "get_name") +#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()') + _WRAP_VFUNC(Glib::ustring get_name() const, "get_name", keep_return) -#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()') +#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj()') - _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type") - _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type") + _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type", keep_return) + _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type", keep_return) #m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()') diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg index 54411cf6..a7483bac 100644 --- a/gio/src/actiongroup.hg +++ b/gio/src/actiongroup.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -150,9 +148,9 @@ public: _WRAP_VFUNC(bool get_action_enabled(const Glib::ustring& name) const, "get_action_enabled") -#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()') - _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, "get_action_parameter_type") - _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, "get_action_state_type") +#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj()') + _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, "get_action_parameter_type", keep_return) + _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, "get_action_state_type", keep_return) #m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()') _WRAP_VFUNC(Glib::VariantBase get_action_state_hint(const Glib::ustring& name) const, "get_action_state_hint") diff --git a/gio/src/dbusobject.hg b/gio/src/dbusobject.hg index 5431004a..6979d82e 100644 --- a/gio/src/dbusobject.hg +++ b/gio/src/dbusobject.hg @@ -66,8 +66,8 @@ public: _WRAP_SIGNAL(void interface_added(const Glib::RefPtr& iface), "interface_added") _WRAP_SIGNAL(void interface_removed(const Glib::RefPtr& iface), "interface_removed") -#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())') - _WRAP_VFUNC(Glib::ustring get_object_path() const, "get_object_path") +#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()') + _WRAP_VFUNC(Glib::ustring get_object_path() const, "get_object_path", keep_return) #m4 _CONVERSION(`std::vector< Glib::RefPtr >',`GList*',`g_list_copy(Glib::ListHandler< Glib::RefPtr >::vector_to_list($3).data())') _WRAP_VFUNC(std::vector< Glib::RefPtr > get_interfaces() const, "get_interfaces") diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg index 9dbd8f8e..841d11a3 100644 --- a/gio/src/tlspassword.hg +++ b/gio/src/tlspassword.hg @@ -66,8 +66,8 @@ public: //TODO? (See g_tls_password_set_value_full() comment above): _WRAP_VFUNC(void set_value(guchar* value, gssize length, GDestroyNotify destroy), "set_value") -#m4 _CONVERSION(`Glib::ustring', `const gchar*', `g_strdup($3.c_str())') - _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning") +#m4 _CONVERSION(`Glib::ustring', `const gchar*', `$3.c_str()') + _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning", keep_return) }; } // namespace Gio -- cgit v1.2.1 From b28bc49e7af2b90d23bb4ea460ca15c8eaf0cc54 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Mar 2015 10:33:18 +0100 Subject: Gio::Action, ActionGroup: Fix critical messages from vfuncs * glib/glibmm/wrap.h: Add unwrap_copy(const T& obj). * gio/src/action.hg: * gio/src/actiongroup.hg: Make vfuncs that return a GVariant* use the new Glib::unwrap_copy() overload by adding the _WRAP_VFUNC parameter refreturn_ctype. It avoids a critical message if Glib::VariantBase:: gobj() == 0, which is not an error in these functions. Bug #705124. --- gio/src/action.hg | 6 ++---- gio/src/actiongroup.hg | 5 ++--- glib/glibmm/wrap.h | 17 ++++++++++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gio/src/action.hg b/gio/src/action.hg index 207bb93a..eca98122 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -222,13 +222,11 @@ public: _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type", keep_return) _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type", keep_return) -#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()') - - _WRAP_VFUNC(Glib::VariantBase get_state_hint() const, "get_state_hint") + _WRAP_VFUNC(Glib::VariantBase get_state_hint() const, "get_state_hint", refreturn_ctype) _WRAP_VFUNC(bool get_enabled() const, "get_enabled") - _WRAP_VFUNC(Glib::VariantBase get_state() const, "get_state") + _WRAP_VFUNC(Glib::VariantBase get_state() const, "get_state", refreturn_ctype) #m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)') _WRAP_VFUNC(void change_state(const Glib::VariantBase& value), "change_state") diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg index a7483bac..71385be6 100644 --- a/gio/src/actiongroup.hg +++ b/gio/src/actiongroup.hg @@ -152,9 +152,8 @@ public: _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, "get_action_parameter_type", keep_return) _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, "get_action_state_type", keep_return) -#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()') - _WRAP_VFUNC(Glib::VariantBase get_action_state_hint(const Glib::ustring& name) const, "get_action_state_hint") - _WRAP_VFUNC(Glib::VariantBase get_action_state(const Glib::ustring& name) const, "get_action_state") + _WRAP_VFUNC(Glib::VariantBase get_action_state_hint(const Glib::ustring& name) const, "get_action_state_hint", refreturn_ctype) + _WRAP_VFUNC(Glib::VariantBase get_action_state(const Glib::ustring& name) const, "get_action_state", refreturn_ctype) _WRAP_VFUNC(void change_action_state(const Glib::ustring& name, const Glib::VariantBase& value), "change_action_state") _WRAP_VFUNC(void activate_action(const Glib::ustring& name, const Glib::VariantBase& parameter), "activate_action") diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h index 5b07395b..c4ca34e0 100644 --- a/glib/glibmm/wrap.h +++ b/glib/glibmm/wrap.h @@ -1,9 +1,6 @@ -// -*- c++ -*- #ifndef _GLIBMM_WRAP_H #define _GLIBMM_WRAP_H -/* $Id$ */ - /* Copyright (C) 1998-2002 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -143,6 +140,20 @@ const typename T::BaseObjectType* unwrap(const Glib::RefPtr& ptr) return (ptr) ? ptr->gobj() : 0; } +// This unwrap_copy() overload is intended primarily for classes wrapped as +// _CLASS_BOXEDTYPE, _CLASS_OPAQUE_COPYABLE or _CLASS_OPAQUE_REFCOUNTED, +// where the C++ objects are not stored in Glib::RefPtr<>s. They have a const +// gobj_copy() member that returns a non-const pointer to the underlying C instance. +/** Get the underlying C instance from the C++ instance and acquire a + * reference or copy. This is just like calling gobj_copy(), but it does its own + * check for a NULL pointer to the underlying C instance. + */ +template inline +typename T::BaseObjectType* unwrap_copy(const T& obj) +{ + return obj.gobj() ? obj.gobj_copy() : 0; +} + /** Get the underlying C instance from the C++ instance and acquire a * reference. This is just like calling gobj_copy(), but it does its own * check for a NULL pointer. -- cgit v1.2.1 From ffc7d974949c8ceb0273a11c649c6af947afcf18 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Mar 2015 14:27:14 +0100 Subject: Improve tests/glibmm_interface_implementation * tests/glibmm_interface_implementation/main.cc: Return EXIT_FAILURE if some test fails. Add more tests of virtual functions. Bug #705124. --- tests/glibmm_interface_implementation/main.cc | 48 ++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/tests/glibmm_interface_implementation/main.cc b/tests/glibmm_interface_implementation/main.cc index bc8253b1..ec0ea938 100644 --- a/tests/glibmm_interface_implementation/main.cc +++ b/tests/glibmm_interface_implementation/main.cc @@ -1,6 +1,12 @@ +// This program does not only test the implementation of an interface +// in a custom class. It also tests virtual functions that have leaked memory +// or printed unjustified critical messages in glibmm before version 2.44. +// See https://bugzilla.gnome.org/show_bug.cgi?id=705124. + #include #include //There are no Interfaces in glibmm, but there are in giomm. #include +#include class CustomAction : public Gio::Action, @@ -13,8 +19,10 @@ public: Glib::Property property; protected: - //Implement a vfunc: + //Implement vfuncs: virtual Glib::ustring get_name_vfunc() const; + virtual Glib::VariantType get_state_type_vfunc() const; + virtual Glib::VariantBase get_state_hint_vfunc() const; }; CustomAction::CustomAction() @@ -32,33 +40,65 @@ Glib::ustring CustomAction::get_name_vfunc() const return "custom-name"; } +Glib::VariantType CustomAction::get_state_type_vfunc() const +{ + return Glib::VariantType(G_VARIANT_TYPE_INT16); +} + +Glib::VariantBase CustomAction::get_state_hint_vfunc() const +{ + return Glib::Variant::create(42); +} int main(int, char**) { Glib::init(); CustomAction action; + bool success = true; + Glib::ustring name = action.get_name(); std::cout << "The name is '" << name << "'." << std::endl; + success &= name == "custom-name"; + std::cout << "The name property of the implemented interface is '" << action.property_name().get_value() << "'." << std::endl; + success &= action.property_name().get_value() == ""; + std::cout << "The custom string property is '" << action.property.get_value() << "'." << std::endl; + success &= action.property.get_value() == "Initial value."; action.property = "A new value."; std::cout << "The custom string property (after changing it) is '" << action.property.get_value() << "'." << std::endl; + success &= action.property.get_value() == "A new value."; gchar* prop_value = 0; g_object_set(action.gobj(), "custom_property", "Another value", NULL); g_object_get(action.gobj(), "custom_property", &prop_value, NULL); - std::cout << "The custom property after g_object_get/set() is '" + std::cout << "The custom property after g_object_set/get() is '" << prop_value << "'." << std::endl; + success &= std::strcmp(prop_value, "Another value") == 0; + g_free(prop_value); + prop_value = 0; + std::cout << "The custom property through the Glib::Property<> is '" << action.property.get_value() << "'." << std::endl; + success &= action.property.get_value() == "Another value"; + std::cout << "The name property of the implemented interface is '" << action.property_name().get_value() << "'." << std::endl; - g_assert(get_name_called); + success &= action.property_name().get_value() == ""; + success &= get_name_called; + + // Check if other vfuncs leak memory. Use valgrind! + action.get_parameter_type(); + action.get_state_type(); + action.get_state_type(); + action.get_state_hint_variant(); + action.get_state_variant(); + action.get_enabled(); - return EXIT_SUCCESS; + return success ? EXIT_SUCCESS : EXIT_FAILURE; } -- cgit v1.2.1 From 1d7dd9bb51ab1c4b1731e33c5ecbcb8cf9ef7715 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 19 Mar 2015 11:04:15 +0100 Subject: Gio::SignalSocket docs: Add an empty line after @newin * gio/giomm/socketsource.h: Add an empty line after @newin where it's needed in order to avoid bad side effects in the documentation. Doxygen assumes that @newin is followed by a paragraph that describes what is new. --- gio/giomm/socketsource.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/giomm/socketsource.h b/gio/giomm/socketsource.h index f166d753..a86ed88f 100644 --- a/gio/giomm/socketsource.h +++ b/gio/giomm/socketsource.h @@ -55,6 +55,7 @@ public: * object's MainContext runs. * * @newin{2,42} + * * @param slot A slot to call when polling @a socket results in an event that matches @a condition. * The event will be passed as a parameter to @a slot. * If io_handler() returns false the handler is disconnected. -- cgit v1.2.1 From 71a6708daebb591c0e33b23caf2b4224d04218c0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 23 Mar 2015 20:26:38 +0100 Subject: gmmproc: No #ifdef GLIBMM_*_ENABLED in generated code * gio/src/asyncinitable.ccg: Remove #ifdef GLIBMM_EXCEPTIONS_ENABLED. * tools/m4/property.m4: No #ifdef GLIBMM_PROPERTIES_ENABLED in generated code. * tools/m4/signal.m4: * tools/m4/vfunc.m4: No #ifdef GLIBMM_EXCEPTIONS_ENABLED in generated code. These preprocessor macros are always defined. --- gio/src/asyncinitable.ccg | 10 ---------- tools/m4/property.m4 | 6 ------ tools/m4/signal.m4 | 13 ------------- tools/m4/vfunc.m4 | 5 ----- 4 files changed, 34 deletions(-) diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 6a3c855a..39d3f02e 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -66,10 +64,8 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, CppObjectType *const obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try // Trap C++ exceptions which would normally be lost because this is a C callback. { - #endif //GLIBMM_EXCEPTIONS_ENABLED // Get the slot. Gio::SlotAsyncReady* the_slot = static_cast(user_data); @@ -78,13 +74,11 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, obj->init_async_vfunc(*the_slot, Glib::wrap(cancellable, true), io_priority); return; - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } - #endif //GLIBMM_EXCEPTIONS_ENABLED } } @@ -129,19 +123,15 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, CppObjectType *const obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try // Trap C++ exceptions which would normally be lost because this is a C callback. { - #endif //GLIBMM_EXCEPTIONS_ENABLED // Call the virtual member method, which derived classes might override. return static_cast(obj->init_finish_vfunc(Glib::wrap(res, true))); - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } - #endif //GLIBMM_EXCEPTIONS_ENABLED } } diff --git a/tools/m4/property.m4 b/tools/m4/property.m4 index 119f21cb..cd926b6a 100644 --- a/tools/m4/property.m4 +++ b/tools/m4/property.m4 @@ -1,5 +1,3 @@ -dnl $Id$ - dnl dnl dnl Code generation sections for properties @@ -17,7 +15,6 @@ dnl Put spaces around the template parameter if necessary. pushdef(`__PROXY_TYPE__',`dnl Glib::PropertyProxy$4< _QUOTE($3) >'dnl )dnl -#ifdef GLIBMM_PROPERTIES_ENABLED /** $6 * * You rarely need to use properties because there are get_ and set_ methods for almost all of them. @@ -26,16 +23,13 @@ ifelse($4,_ReadOnly,get,`ifelse($4,_WriteOnly,set,get or set)') the value of the * or receive notification when the value of the property changes. */ __PROXY_TYPE__ property_$2`'() ifelse($4,_ReadOnly, const,); -#endif //#GLIBMM_PROPERTIES_ENABLED _PUSH(SECTION_CC_PROPERTYPROXIES) ifelse(`$5',,,`_DEPRECATE_IFDEF_START ')dnl -#ifdef GLIBMM_PROPERTIES_ENABLED __PROXY_TYPE__ __CPPNAME__::property_$2`'() ifelse($4,_ReadOnly, const,) { return __PROXY_TYPE__`'(this, "$1"); } -#endif //GLIBMM_PROPERTIES_ENABLED ifelse(`$5',,,`_DEPRECATE_IFDEF_END ')dnl diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index d84838d9..34d0f225 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -1,4 +1,3 @@ - # # --------------------------- Signal Decl---------------------------- # @@ -58,17 +57,14 @@ static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3 // Do not try to call a signal on a disassociated wrapper. if(obj) { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try { - #endif //GLIBMM_EXCEPTIONS_ENABLED if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data)) ifelse(`$2',void,`dnl (*static_cast(slot))($7); ',`dnl else return _CONVERT($5,$2,`(*static_cast(slot))($7)'); ')dnl endif - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { @@ -85,7 +81,6 @@ ifelse($15, `', `dnl } ')dnl } - #endif //GLIBMM_EXCEPTIONS_ENABLED } ifelse($2,void,,`dnl else @@ -104,13 +99,10 @@ static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SU // Do not try to call a signal on a disassociated wrapper. if(obj) { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try { - #endif //GLIBMM_EXCEPTIONS_ENABLED if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data)) (*static_cast(slot))($7); - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { @@ -127,7 +119,6 @@ ifelse($12, `', `dnl } ')dnl } - #endif //GLIBMM_EXCEPTIONS_ENABLED } typedef $2 RType; @@ -228,10 +219,8 @@ dnl C++ vfunc on it. CppObjectType *const obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try // Trap C++ exceptions which would normally be lost because this is a C callback. { - #endif //GLIBMM_EXCEPTIONS_ENABLED // Call the virtual member method, which derived classes might override. ifelse($4,void,`dnl obj->on_$1`'($7); @@ -239,7 +228,6 @@ ifelse($4,void,`dnl ',`dnl return _CONVERT($3,$4,`obj->on_$1`'($7)'); ')dnl - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { @@ -256,7 +244,6 @@ ifelse($15, `', `dnl } ')dnl } - #endif //GLIBMM_EXCEPTIONS_ENABLED } } diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4 index 156a3a4b..8cbf9080 100644 --- a/tools/m4/vfunc.m4 +++ b/tools/m4/vfunc.m4 @@ -59,10 +59,8 @@ dnl C++ vfunc on it. CppObjectType *const obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { - #ifdef GLIBMM_EXCEPTIONS_ENABLED try // Trap C++ exceptions which would normally be lost because this is a C callback. { - #endif //GLIBMM_EXCEPTIONS_ENABLED // Call the virtual member method, which derived classes might override. ifelse($4,void,`dnl obj->$1`'($7); @@ -90,7 +88,6 @@ ifelse($10,keep_return,`dnl ')dnl end keep_return ')dnl end refreturn_ctype ')dnl end void - #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { @@ -111,7 +108,6 @@ ifelse($9,refreturn_ctype,`dnl } ')dnl } - #endif //GLIBMM_EXCEPTIONS_ENABLED } } @@ -227,4 +223,3 @@ ifelse(`$5',,,`#endif // $5 ')dnl _POP()') - -- cgit v1.2.1 From 9a8342602845078b264e897005cb5af13c21f867 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 24 Mar 2015 11:12:10 +0100 Subject: Regenerate docs.xml files. --- gio/src/gio_docs.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 864b17a9..5ac0ae3f 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -58678,6 +58678,9 @@ all properties should work. Note that the file descriptor will be set to non-blocking mode, independent on the blocking mode of the #GSocket. +On success, the returned #GSocket takes ownership of @fd. On failure, the +caller must close @fd themselves. + Since: 2.22 -- cgit v1.2.1 From 16bebc67a443a5e1155bf70694d6c0bb669a25d1 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 24 Mar 2015 11:09:19 +0100 Subject: 2.44.0 --- NEWS | 11 +++++++++++ configure.ac | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5e58ae68..7c980461 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +2.44.0 (stable): + +Gio: +* Action, ActionGroup: Avoid memory leaks in funcs. + (Kjell Ahlstedt) Bug #705124 + +gmmproc: +* _WRAP_VFUNC(): Add keep_return parameter. + (Kjell Ahlstedt) Bug #705124 + + 2.43.91 (unstable): Glib: diff --git a/configure.ac b/configure.ac index 6241c53b..1eda740b 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.91], +AC_INIT([glibmm], [2.44.0], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.43.90' +glibreq='2.0 >= 2.44.0' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" -- cgit v1.2.1 From 73eff34aef729c53d7844d508f934ca630ff0556 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 25 Mar 2015 11:39:52 +0100 Subject: NEWS: Mention API Additions since 2.42 --- NEWS | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/NEWS b/NEWS index 7c980461..6fc5c036 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,40 @@ +2.44: + +API additions since 2.42: + +Glib: +* Add Binding. + (Kjell Ahlstedt) Bug #738663. +* OptionContext: Add get/set_strict_posix(). + (Murray Cumming) + +Gio: +* Application: + - Add get/set/unset_resource_base_path() and property. + - Add get_is_busy() and property. + (Murray Cumming) +* File: Add replace_contents_bytes_aync(). + (Murray Cumming) +* InputStream: Add read_all_async() and read_all_finish(). + (Murray Cumming) +* MemoryInputStream: Add add_bytes(). + (Murray Cumming) +* Added NetworkMonitor. + (Murray Cumming) +* Notification: Add set_priority() and enum NotificationPriority. + (Kjell Ahlstedt) +* OutputStream: Add write_all_async() and write_all_finish(). + (Murray Cumming) +* Add Resource. + (Kjell Ahlstedt) +* Add TcpWrapperConnection. + (Murray Cumming) + +Gio::DBus +* InterfaceInfo: Add cache_build() and cache_release(). + (Murray Cumming) + + 2.44.0 (stable): Gio: -- cgit v1.2.1 From c4da3d8666ffaf048581f20ef92a501999841ed2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 10 Apr 2015 19:01:22 +0200 Subject: Add Gio::SimpleIOStream * gio/giomm.h: Add simpleiostream.h. * gio/src/filelist.am: Add simpleiostream.hg. * gio/src/gio_signals.defs: Regenerated. * tools/extra_defs_gen/generate_defs_gio.cc: Add G_TYPE_SIMPLE_IO_STREAM. * gio/src/simpleiostream.[hg|ccg]: New files. --- gio/giomm.h | 1 + gio/src/filelist.am | 1 + gio/src/gio_signals.defs | 20 +++++++++ gio/src/simpleiostream.ccg | 17 +++++++ gio/src/simpleiostream.hg | 75 +++++++++++++++++++++++++++++++ tools/extra_defs_gen/generate_defs_gio.cc | 1 + 6 files changed, 115 insertions(+) create mode 100644 gio/src/simpleiostream.ccg create mode 100644 gio/src/simpleiostream.hg diff --git a/gio/giomm.h b/gio/giomm.h index b6d07b0c..e778d366 100644 --- a/gio/giomm.h +++ b/gio/giomm.h @@ -116,6 +116,7 @@ #include #include #include +#include #include #include #include diff --git a/gio/src/filelist.am b/gio/src/filelist.am index f2a18bb5..71e4fe0f 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -103,6 +103,7 @@ giomm_files_any_hg = \ settings.hg \ simpleaction.hg \ simpleactiongroup.hg \ + simpleiostream.hg \ simplepermission.hg \ socket.hg \ socketaddress.hg \ diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 71d966a4..289e6766 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -1160,6 +1160,26 @@ (construct-only #f) ) +;; From GSimpleIOStream + +(define-property input-stream + (of-object "GSimpleIOStream") + (prop-type "GParamObject") + (docs "The GInputStream to read from") + (readable #t) + (writable #t) + (construct-only #t) +) + +(define-property output-stream + (of-object "GSimpleIOStream") + (prop-type "GParamObject") + (docs "The GOutputStream to write to") + (readable #t) + (writable #t) + (construct-only #t) +) + ;; From GSubprocess (define-property flags diff --git a/gio/src/simpleiostream.ccg b/gio/src/simpleiostream.ccg new file mode 100644 index 00000000..528d468d --- /dev/null +++ b/gio/src/simpleiostream.ccg @@ -0,0 +1,17 @@ +/* Copyright (C) 2015 The giomm 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, see . + */ + +#include diff --git a/gio/src/simpleiostream.hg b/gio/src/simpleiostream.hg new file mode 100644 index 00000000..a556fbb3 --- /dev/null +++ b/gio/src/simpleiostream.hg @@ -0,0 +1,75 @@ +/* Copyright (C) 2015 The giomm 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, see . + */ + +#include + +_DEFS(giomm,gio) +_PINCLUDE(giomm/private/iostream_p.h) + +namespace Gio +{ +/** A wrapper around an input and an output stream. + * + * SimpleIOStream creates an IOStream from an arbitrary InputStream and + * OutputStream. This allows any pair of input and output streams to be used + * with IOStream methods. + * + * This is useful when you obtained an InputStream and an OutputStream + * by other means, for instance creating them with platform specific methods + * such as Gio::UnixInputStream::create(), and you want + * to take advantage of the methods provided by IOStream. + * + * @ingroup Streams + * + * @newin{2,46} + */ +class SimpleIOStream : public Gio::IOStream +{ + _CLASS_GOBJECT(SimpleIOStream, GSimpleIOStream, G_SIMPLE_IO_STREAM, Gio::IOStream, GIOStream) + +protected: + /** Creates a new SimpleIOStream wrapping @a input_stream and @a output_stream. + * + * @see IOStream + * + * @newin{2,46} + * + * @param input_stream An InputStream. + * @param output_stream An OutputStream. + * @returns A new SimpleIOStream instance. + */ + _WRAP_CTOR(SimpleIOStream(const Glib::RefPtr& input_stream, const Glib::RefPtr& output_stream), g_simple_io_stream_new) + +public: + /** Creates a new SimpleIOStream wrapping @a input_stream and @a output_stream. + * + * @see IOStream + * + * @newin{2,46} + * + * @param input_stream An InputStream. + * @param output_stream An OutputStream. + * @returns A new SimpleIOStream instance. + */ + _WRAP_CREATE(const Glib::RefPtr& input_stream, const Glib::RefPtr& output_stream) + + _WRAP_PROPERTY("input-stream", Glib::RefPtr) + _WRAP_PROPERTY("output-stream", Glib::RefPtr) + + // SimpleIOStream has no methods other than create(), signals nor vfuncs. +}; + +} // namespace Gio diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index cec799af..373e3dea 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -93,6 +93,7 @@ int main(int, char**) << get_defs(G_TYPE_SETTINGS_BACKEND) << get_defs(G_TYPE_SIMPLE_ASYNC_RESULT) << get_defs(G_TYPE_SIMPLE_ACTION) + << get_defs(G_TYPE_SIMPLE_IO_STREAM) << get_defs(G_TYPE_SUBPROCESS) << get_defs(G_TYPE_SUBPROCESS_LAUNCHER) << get_defs(G_TYPE_THEMED_ICON) -- cgit v1.2.1 From 192ddfca9a17eaa5e6c78061dfb0bf48cf000377 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 13 Apr 2015 09:36:50 +0200 Subject: gmmproc: _WRAP_PROPERTY: Remove a line from the generated docs * tools/m4/property.m4: Remove the line "You rarely need to use properties..." It's becoming less true. Some new glib and gtk+ classes (GSimpleIOStream, GtkModelButton, GtkPopoverMenu) have no public set/get methods corresponding to their properties. --- tools/m4/property.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/m4/property.m4 b/tools/m4/property.m4 index cd926b6a..1709affa 100644 --- a/tools/m4/property.m4 +++ b/tools/m4/property.m4 @@ -17,7 +17,6 @@ Glib::PropertyProxy$4< _QUOTE($3) >'dnl )dnl /** $6 * - * You rarely need to use properties because there are get_ and set_ methods for almost all of them. * @return A PropertyProxy$4 that allows you to dnl ifelse($4,_ReadOnly,get,`ifelse($4,_WriteOnly,set,get or set)') the value of the property, * or receive notification when the value of the property changes. -- cgit v1.2.1 From 6641ac99f95e02c7ef9e4259f6b6b8af1dcbb3f4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 13 Apr 2015 18:57:26 +0200 Subject: Glib::Variant: Improve handling of object paths and signatures * glib/src/variant.[ccg|hg]: Add VariantBase::is_castable_to() and VariantContainerBase::get_iter(). Accept casts of complicated types containing object paths and DBus type signatures to Variant<> types containing Glib::ustring and std::string. Change some get(), get_child() and get_iter() methods similarly. * tests/glibmm_variant/main.cc: Add test_dynamic_cast_composite_types(). Bug #747508. --- glib/src/variant.ccg | 167 ++++++++++++++++++++++++++++--------------- glib/src/variant.hg | 94 +++++++++++------------- tests/glibmm_variant/main.cc | 59 +++++++++++++++ 3 files changed, 213 insertions(+), 107 deletions(-) diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index a7c53524..fe835400 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -56,6 +56,53 @@ void VariantBase::byteswap(VariantBase& result) const result.init(g_value); // g_value is already referenced. } +bool VariantBase::is_castable_to(const VariantType& supertype) const +{ + const std::string subtype_string = get_type_string(); + const std::string supertype_string = supertype.get_string(); + + // The following code is similar to g_variant_type_is_subtype_of(), with + // these differences: + // - Both types are assumed to be definite types (no indefinite types, + // no 'r', '?' or '*'). + // - VARIANT_TYPE_OBJECT_PATH (o) and VARIANT_TYPE_SIGNATURE (g) can be cast to + // VARIANT_TYPE_STRING (s), the type of Glib::ustring. + // - VARIANT_TYPE_STRING (s), VARIANT_TYPE_OBJECT_PATH (o) and + // VARIANT_TYPE_SIGNATURE (g) can be cast to + // VARIANT_TYPE_BYTESTRING (ay), the type of std::string. + + std::size_t subtype_index = 0; + std::size_t supertype_index = 0; + const std::size_t supertype_size = supertype_string.size(); + while (supertype_index < supertype_size) + { + const char supertype_char = supertype_string[supertype_index++]; + const char subtype_char = subtype_string[subtype_index++]; + + if (supertype_char == subtype_char) + continue; + + switch (supertype_char) + { + case 's': + if (!(subtype_char == 'o' || subtype_char == 'g')) + return false; + break; + + case 'a': + if (!(supertype_string[supertype_index] == 'y' && + (subtype_char == 's' || subtype_char == 'o' || subtype_char == 'g'))) + return false; + supertype_index++; + break; + + default: + return false; + } + } + return true; +} + VariantStringBase::VariantStringBase() : VariantBase() @@ -140,7 +187,7 @@ void VariantContainerBase::get_child(VariantBase& child, gsize index) const { if(index >= g_variant_n_children(gobject_)) throw std::out_of_range( - "VariantContainerBase::get(): Index out of bounds."); + "VariantContainerBase::get_child(): Index out of bounds."); GVariant* const gvariant = g_variant_get_child_value(gobject_, index); child.init(gvariant); @@ -180,6 +227,22 @@ bool VariantContainerBase::get_maybe(VariantBase& maybe) const return false; } +VariantIter VariantContainerBase::get_iter(const VariantType& container_variant_type) const +{ + // Get the GVariantIter. + // If the underlying GVariant can be cast to the type of the container, + // use the actual type (which may differ from container_variant_type, if + // the GVariant contains strings, object paths or DBus type signatures), + // otherwise let g_variant_get() report what's wrong with the type. + GVariantIter* g_iter = 0; + g_variant_get(const_cast(gobj()), + is_castable_to(container_variant_type) ? + get_type_string().c_str() : container_variant_type.get_string().c_str(), + &g_iter); + + return VariantIter(g_iter); +} + /****************** Specializations ***********************************/ VariantBase::operator const void*() const @@ -197,6 +260,7 @@ void VariantBase::init(const GVariant* cobject, bool take_a_reference) g_variant_ref(gobject_); } +/*--------------------Variant---------------------*/ Variant::Variant() : VariantContainerBase() @@ -226,6 +290,7 @@ void Variant::get(VariantBase& variant) const variant.init(gvariant); } +/*--------------------Variant---------------------*/ Variant::Variant() : VariantStringBase() @@ -281,6 +346,8 @@ throw(std::bad_cast) } } +/*--------------------Variant---------------------*/ + Variant::Variant() : VariantStringBase() { @@ -338,12 +405,14 @@ std::string Variant::get() const const char* pch = 0; if(vtype.equal(VARIANT_TYPE_BYTESTRING)) pch = g_variant_get_bytestring(gobject_); - else //g_variant_get_string() cna handle strings, object paths, and signatures. + else //g_variant_get_string() can handle strings, object paths, and signatures. pch = g_variant_get_string(gobject_, 0); return convert_const_gchar_ptr_to_stdstring(pch); } +/*--------------------Variant< std::vector >---------------------*/ + typedef std::vector type_vec_ustring; Variant::Variant() @@ -394,48 +463,42 @@ Variant::create(const type_vec_ustring& data) Glib::ustring Variant::get_child(gsize index) const { - gsize n_elements = 0; - - const gchar** array = g_variant_get_strv(const_cast(gobj()), - &n_elements); - - if(index >= n_elements) + if (index >= g_variant_n_children(const_cast(gobj()))) throw std::out_of_range( - "Variant< std::vector >::get(): Index out of bounds."); + "Variant< std::vector >::get_child(): Index out of bounds."); - Glib::ustring const result(array[index]); - g_free(array); - return result; + GVariant* gvariant = + g_variant_get_child_value(const_cast(gobj()), index); + + return Glib::Variant(gvariant).get(); } type_vec_ustring Variant::get() const { - gsize n_elements = 0; + // g_variant_get_strv() can be used only if the type is VARIANT_TYPE_STRING_ARRAY, + // but the Variant can alternatively hold an array of object paths or DBus type signatures. + type_vec_ustring result; + + gsize n_children = g_variant_n_children(const_cast(gobj())); - const gchar** array = g_variant_get_strv(const_cast(gobj()), - &n_elements); + for (gsize i = 0; i < n_children; i++) + { + GVariant* gvariant = + g_variant_get_child_value(const_cast(gobj()), i); + + result.push_back(Glib::Variant(gvariant).get()); + } - type_vec_ustring const result(array, array + n_elements); - g_free(array); return result; } VariantIter Variant::get_iter() const { - // Get the variant type of the elements. - VariantType element_variant_type = Variant::variant_type(); - - // Get the variant type of the array. - VariantType array_variant_type = Variant::variant_type(); - - // Get the GVariantIter. - GVariantIter* g_iter = 0; - g_variant_get(const_cast(gobj()), - array_variant_type.get_string().c_str(), &g_iter); - - return VariantIter(g_iter); + return VariantContainerBase::get_iter(variant_type()); } +/*--------------------Variant< std::vector >---------------------*/ + typedef std::vector type_vec_string; Variant::Variant() @@ -505,46 +568,38 @@ Variant::create_from_object_paths(const type_vec_string& data) std::string Variant::get_child(gsize index) const { - gsize n_elements = 0; - - const gchar** array = - g_variant_get_bytestring_array(const_cast(gobj()), &n_elements); - - if(index >= n_elements) + if (index >= g_variant_n_children(const_cast(gobj()))) throw std::out_of_range( - "Variant< std::vector >::get(): Index out of bounds."); + "Variant< std::vector >::get_child(): Index out of bounds."); - std::string const result(array[index]); - g_free(array); - return result; + GVariant* gvariant = + g_variant_get_child_value(const_cast(gobj()), index); + + return Glib::Variant(gvariant).get(); } type_vec_string Variant::get() const { - gsize n_elements = 0; + // g_variant_get_bytestring_array() can be used only if the type is VARIANT_TYPE_BYTESTRING_ARRAY, + // but the Variant can alternatively hold an array of strings, object paths or DBus type signatures. + type_vec_string result; - const gchar** array = - g_variant_get_bytestring_array(const_cast(gobj()), &n_elements); + gsize n_children = g_variant_n_children(const_cast(gobj())); + + for (gsize i = 0; i < n_children; i++) + { + GVariant* gvariant = + g_variant_get_child_value(const_cast(gobj()), i); + + result.push_back(Glib::Variant(gvariant).get()); + } - type_vec_string const result(array, array + n_elements); - g_free(array); return result; } VariantIter Variant::get_iter() const { - // Get the variant type of the elements. - const VariantType element_variant_type = Variant::variant_type(); - - // Get the variant type of the array. - const VariantType array_variant_type = Variant::variant_type(); - - // Get the GVariantIter. - GVariantIter* g_iter = 0; - g_variant_get(const_cast(gobj()), - array_variant_type.get_string().c_str(), &g_iter); - - return VariantIter(g_iter); + return VariantContainerBase::get_iter(variant_type()); } } // namespace Glib diff --git a/glib/src/variant.hg b/glib/src/variant.hg index be750d06..5bf3af46 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -213,6 +213,23 @@ public: _IGNORE(g_variant_dict_new) +protected: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + /** Used by cast_dynamic(). + * In addition to an exact match, the following casts are possible: + * - VARIANT_TYPE_OBJECT_PATH and VARIANT_TYPE_SIGNATURE can be cast to + * VARIANT_TYPE_STRING (Glib::ustring). + * - VARIANT_TYPE_STRING, VARIANT_TYPE_OBJECT_PATH and VARIANT_TYPE_SIGNATURE + * can be cast to VARIANT_TYPE_BYTESTRING (std::string). + * + * These casts are possible also when they are parts of a more complicated type. + * E.g. in Variant > > the map's keys + * can be VARIANT_TYPE_OBJECT_PATH and the vector's elements can be VARIANT_TYPE_SIGNATURE. + * @newin{2,46} + */ + bool is_castable_to(const VariantType& supertype) const; +#endif //DOXYGEN_SHOULD_SKIP_THIS + private: /** Relational operators are deleted to prevent invalid conversion * to const void*. @@ -243,7 +260,7 @@ throw(std::bad_cast) { return V_CastTo(); } - if(v.is_of_type(V_CastTo::variant_type())) + if(v.is_castable_to(V_CastTo::variant_type())) { return V_CastTo(const_cast(v.gobj()), true); } @@ -259,8 +276,7 @@ throw(std::bad_cast) */ class VariantStringBase : public VariantBase { - // Trick gmmproc into thinking this is derived from GVariant to wrap a - // some methods. + // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(VariantStringBase, GVariant) public: @@ -315,8 +331,7 @@ public: */ class VariantContainerBase : public VariantBase { - // Trick gmmproc into thinking this is derived from GVariant to wrap a - // some methods. + // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(VariantContainerBase, GVariant) public: @@ -380,7 +395,7 @@ public: */ /** If this is a maybe-typed instance, extract its value. If the value is - * Nothing, then this function returns 0. + * Nothing, then this function returns false. * * @param maybe A place in which to return the value (the value may be * 0). @@ -388,6 +403,14 @@ public: */ bool get_maybe(VariantBase& maybe) const; _IGNORE(g_variant_get_maybe) + +protected: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + /** Used by get_iter() in the subclasses. + * @newin{2,46} + */ + VariantIter get_iter(const VariantType& container_variant_type) const; +#endif //DOXYGEN_SHOULD_SKIP_THIS }; template<> @@ -405,10 +428,6 @@ public: typedef T CppType; }; -// Each specialization has (or should have) a variant_type() method that gets -// the type. So the C g_variant_get_type() function can be ignored. -_IGNORE(g_variant_get_type) - /****************** Specializations ***********************************/ /** Specialization of Variant containing a VariantBase. @@ -418,8 +437,7 @@ _IGNORE(g_variant_get_type) template<> class Variant : public VariantContainerBase { - // Trick gmmproc into thinking this is derived from GVariant to wrap a - // some methods. + // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant, GVariant) public: @@ -506,15 +524,14 @@ public: }; /** Specialization of Variant containing a Glib::ustring, for variants of type - * string, bytestring, object path, or signature. + * string, object path, or signature. * @newin{2,28} * @ingroup Variant */ template<> class Variant : public VariantStringBase { - // Trick gmmproc into thinking this is derived from GVariant to wrap a - // some methods. + // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant, GVariant) public: typedef char* CType; @@ -553,12 +570,13 @@ public: _IGNORE(g_variant_get_string, g_variant_dup_string) }; +//TODO: When we can break ABI, remove this template specialization. template<> Variant VariantBase::cast_dynamic< Variant >(const VariantBase& v) throw(std::bad_cast); /** Specialization of Variant containing a std::string, for variants of type - * bytestring, object path, or signature. + * bytestring, string, object path, or signature. * See also Variant for UTF-8 strings. * @newin{2,28} * @ingroup Variant @@ -566,8 +584,7 @@ throw(std::bad_cast); template<> class Variant : public VariantStringBase { - // Trick gmmproc into thinking this is derived from GVariant to wrap a - // some methods. + // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant, GVariant) public: typedef char* CType; @@ -602,6 +619,7 @@ public: _IGNORE(g_variant_get_bytestring, g_variant_dup_bytestring) }; +//TODO: When we can break ABI, remove this template specialization. template<> Variant VariantBase::cast_dynamic< Variant >(const VariantBase& v) throw(std::bad_cast); @@ -1030,11 +1048,11 @@ Variant< std::pair >::create(const std::pair& data) template std::pair Variant< std::pair >::get() const { - // Get the key (the first element of the this VariantContainerBase). + // Get the key (the first element of this VariantContainerBase). Variant key; VariantContainerBase::get_child(key, 0); - // Get the value (the second element of the this VariantContainerBase). + // Get the value (the second element of this VariantContainerBase). Variant value; VariantContainerBase::get_child(value, 1); @@ -1059,9 +1077,6 @@ template Variant< std::vector > Variant< std::vector >::create(const std::vector& data) { - // Get the variant type of the elements. - VariantType element_variant_type = Variant::variant_type(); - // Get the variant type of the array. VariantType array_variant_type = Variant< std::vector >::variant_type(); @@ -1079,7 +1094,7 @@ Variant< std::vector >::create(const std::vector& data) // Create the variant using the builder. Variant< std::vector > result = Variant< std::vector >(g_variant_new( - reinterpret_cast(array_variant_type.gobj()), builder)); + reinterpret_cast(array_variant_type.gobj()), builder)); g_variant_builder_unref(builder); @@ -1126,18 +1141,7 @@ std::vector Variant< std::vector >::get() const template VariantIter Variant< std::vector >::get_iter() const { - // Get the variant type of the elements. - VariantType element_variant_type = Variant::variant_type(); - - // Get the variant type of the array. - VariantType array_variant_type = Variant< std::vector >::variant_type(); - - // Get the GVariantIter. - GVariantIter* g_iter = 0; - g_variant_get(const_cast(gobj()), - reinterpret_cast(array_variant_type.gobj()), &g_iter); - - return VariantIter(g_iter); + return VariantContainerBase::get_iter(variant_type()); } /*---------------------Variant< std::map > --------------------*/ @@ -1166,7 +1170,7 @@ Variant< std::map >::create(const std::map& data) // Create a GVariantBuilder to build the array. GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj()); - // Add the elements of the vector into the builder. + // Add the elements of the map into the builder. for(typename std::map::const_iterator iter = data.begin(); iter != data.end(); iter++) { @@ -1178,7 +1182,7 @@ Variant< std::map >::create(const std::map& data) // Create the variant using the builder. Variant< std::map > result = Variant< std::map >(g_variant_new( - reinterpret_cast(array_variant_type.gobj()), builder)); + reinterpret_cast(array_variant_type.gobj()), builder)); g_variant_builder_unref(builder); @@ -1236,19 +1240,7 @@ std::map Variant< std::map >::get() const template VariantIter Variant< std::map >::get_iter() const { - // Get the variant type of the elements. - VariantType element_variant_type = - Variant< std::pair >::variant_type(); - - // Get the variant type of the array. - VariantType array_variant_type = Variant< std::map >::variant_type(); - - // Get the GVariantIter. - GVariantIter* g_iter = 0; - g_variant_get(const_cast(gobj()), - reinterpret_cast(array_variant_type.gobj()), &g_iter); - - return VariantIter(g_iter); + return VariantContainerBase::get_iter(variant_type()); } } // namespace Glib diff --git a/tests/glibmm_variant/main.cc b/tests/glibmm_variant/main.cc index 086719f2..484cb8f1 100644 --- a/tests/glibmm_variant/main.cc +++ b/tests/glibmm_variant/main.cc @@ -276,6 +276,64 @@ static void test_dynamic_cast_string_types() } } +// Test casting a complicated type, containing an object path and a DBus type signature. +void test_dynamic_cast_composite_types() +{ + // Build a GVaraint of type a{oag}, and cast it to + // Glib::Variant>>. + // 'o' is VARIANT_TYPE_OBJECT_PATH and 'g' is VARIANT_TYPE_SIGNATURE. + + GVariantBuilder dict_builder; + GVariantBuilder array_builder; + g_variant_builder_init(&dict_builder, G_VARIANT_TYPE("a{oag}")); + + g_variant_builder_init(&array_builder, G_VARIANT_TYPE("ag")); + g_variant_builder_add(&array_builder, "g","id"); + g_variant_builder_add(&array_builder, "g","isi"); + g_variant_builder_add(&array_builder, "g","ia{si}"); + g_variant_builder_add(&dict_builder, "{oag}", "/remote/object/path1", &array_builder); + + g_variant_builder_init(&array_builder, G_VARIANT_TYPE("ag")); + g_variant_builder_add(&array_builder, "g","i(d)"); + g_variant_builder_add(&array_builder, "g","i(si)"); + g_variant_builder_add(&dict_builder, "{oag}", "/remote/object/path2", &array_builder); + + Glib::VariantBase cppdict(g_variant_builder_end(&dict_builder)); + + try + { + typedef std::map > composite_type; + Glib::Variant derived = + Glib::VariantBase::cast_dynamic >(cppdict); + + ostr << "Cast composite type (get_type_string()=" << derived.get_type_string() + << ", variant_type().get_string()=" << derived.variant_type().get_string() << "): "; + composite_type var = derived.get(); + for (composite_type::const_iterator iter1 = var.begin(); iter1 != var.end(); ++iter1) + { + ostr << "\n " << iter1->first << ":"; + const std::vector& vec = iter1->second; + for (std::vector::const_iterator iter2 = vec.begin(); iter2 != vec.end(); ++iter2) + ostr << " " << *iter2; + } + ostr << std::endl; + } + catch (const std::bad_cast& e) + { + g_assert_not_reached(); + } + + try + { + Glib::Variant > derived = + Glib::VariantBase::cast_dynamic > >(cppdict); + g_assert_not_reached(); + } + catch (const std::bad_cast& e) + { + } +} + static void test_dynamic_cast() { Glib::Variant v1 = Glib::Variant::create(10); @@ -359,6 +417,7 @@ static void test_dynamic_cast() test_dynamic_cast_ustring_types(); test_dynamic_cast_string_types(); + test_dynamic_cast_composite_types(); } static GLogLevelFlags -- cgit v1.2.1 From 78d99915f1c2bd11d89c165188cb74c354db52c7 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 15 Apr 2015 16:44:37 +0200 Subject: Add Glib::format_size() * .gitignore: Ignore glib/glibmm/miscutils.[h|cc]. * glib/src/filelist.am: Add miscutils.hg. * glib/glibmm/filelist.am: Remove miscutils.[h|cc]. * glib/glibmm/miscutils.[h|cc]: Move to glib/src and rename to miscutils.[hg|ccg]. * glib/src/miscutils.[hg|ccg]: New files. Move from glib/glibmm and rename. Add _WRAP_ENUM(FormatSizeFlags,...). Add Glib::format_size(). Bug #747311. --- .gitignore | 2 + glib/glibmm/filelist.am | 2 - glib/glibmm/miscutils.cc | 269 -------------------------- glib/glibmm/miscutils.h | 467 ---------------------------------------------- glib/src/filelist.am | 1 + glib/src/miscutils.ccg | 271 +++++++++++++++++++++++++++ glib/src/miscutils.hg | 477 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 751 insertions(+), 738 deletions(-) delete mode 100644 glib/glibmm/miscutils.cc delete mode 100644 glib/glibmm/miscutils.h create mode 100644 glib/src/miscutils.ccg create mode 100644 glib/src/miscutils.hg diff --git a/.gitignore b/.gitignore index dc64b965..c3aa740e 100644 --- a/.gitignore +++ b/.gitignore @@ -119,6 +119,8 @@ giommconfig.h /glib/glibmm/keyfile.h /glib/glibmm/markup.cc /glib/glibmm/markup.h +/glib/glibmm/miscutils.cc +/glib/glibmm/miscutils.h /glib/glibmm/module.cc /glib/glibmm/module.h /glib/glibmm/nodetree.cc diff --git a/glib/glibmm/filelist.am b/glib/glibmm/filelist.am index 97170ce0..909ef6d5 100644 --- a/glib/glibmm/filelist.am +++ b/glib/glibmm/filelist.am @@ -17,7 +17,6 @@ glibmm_files_extra_cc = \ init.cc \ interface.cc \ main.cc \ - miscutils.cc \ object.cc \ objectbase.cc \ pattern.cc \ @@ -59,7 +58,6 @@ glibmm_files_extra_h = \ interface.h \ listhandle.h \ main.h \ - miscutils.h \ object.h \ objectbase.h \ pattern.h \ diff --git a/glib/glibmm/miscutils.cc b/glib/glibmm/miscutils.cc deleted file mode 100644 index 95226b8f..00000000 --- a/glib/glibmm/miscutils.cc +++ /dev/null @@ -1,269 +0,0 @@ -// -*- c++ -*- -/* $Id$ */ - -/* Copyright (C) 2002 The gtkmm 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. - */ - -#include -#include - -#include -#include -#include - - -namespace Glib -{ - -Glib::ustring get_application_name() -{ - return convert_const_gchar_ptr_to_ustring (g_get_application_name()); -} - -void set_application_name(const Glib::ustring& application_name) -{ - g_set_application_name(application_name.c_str()); -} - -std::string get_prgname() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_prgname()); -} - -void set_prgname(const std::string& prgname) -{ - g_set_prgname(prgname.c_str()); -} - -std::string getenv(const std::string& variable, bool& found) -{ - const char *const value = g_getenv(variable.c_str()); - found = (value != 0); - return convert_const_gchar_ptr_to_stdstring(value); -} - -std::string getenv(const std::string& variable) -{ - return convert_const_gchar_ptr_to_stdstring(g_getenv(variable.c_str())); -} - -bool setenv(const std::string& variable, const std::string& value, bool overwrite) -{ - return g_setenv(variable.c_str(), value.c_str(), overwrite); -} - -void unsetenv(const std::string& variable) -{ - g_unsetenv(variable.c_str()); -} - -Glib::ArrayHandle listenv() -{ - char **value = g_listenv(); - char **end = value; - while(*end){ - ++end; - } - return Glib::ArrayHandle(value, end-value, Glib::OWNERSHIP_DEEP); -} - -std::string get_user_name() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_user_name()); -} - -std::string get_real_name() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_real_name()); -} - -std::string get_home_dir() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_home_dir()); -} - -std::string get_tmp_dir() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_tmp_dir()); -} - -std::string get_current_dir() -{ - return convert_return_gchar_ptr_to_stdstring(g_get_current_dir()); -} - -std::string get_user_special_dir(GUserDirectory directory) -{ - return convert_const_gchar_ptr_to_stdstring(g_get_user_special_dir(directory)); -} - -std::string get_user_data_dir() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_user_data_dir()); -} - -std::string get_user_config_dir() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_user_config_dir()); -} - -std::vector get_system_data_dirs() -{ - //TODO: Use a utility function: - std::vector result; - const char* const * cresult = g_get_system_data_dirs(); - if(!cresult) - return result; - - for(const gchar* const * iter = cresult; *iter != 0; ++iter) - { - result.push_back( - convert_const_gchar_ptr_to_stdstring(*iter)); - } - - return result; -} - -std::vector get_system_config_dirs() -{ - //TODO: Use a utility function: - std::vector result; - const char* const * cresult = g_get_system_config_dirs(); - if(!cresult) - return result; - - for(const gchar* const * iter = cresult; *iter != 0; ++iter) - { - result.push_back( - convert_const_gchar_ptr_to_stdstring(*iter)); - } - - return result; -} - -std::string get_user_cache_dir() -{ - return convert_const_gchar_ptr_to_stdstring(g_get_user_cache_dir()); -} - -bool path_is_absolute(const std::string& filename) -{ - return (g_path_is_absolute(filename.c_str()) != 0); -} - -std::string path_skip_root(const std::string& filename) -{ - // g_path_skip_root() returns a pointer _into_ the argument string, - // or NULL if there was no root component. - return convert_const_gchar_ptr_to_stdstring(g_path_skip_root(filename.c_str())); -} - -std::string path_get_basename(const std::string& filename) -{ - return convert_return_gchar_ptr_to_stdstring(g_path_get_basename(filename.c_str())); -} - -std::string path_get_dirname(const std::string& filename) -{ - return convert_return_gchar_ptr_to_stdstring(g_path_get_dirname(filename.c_str())); -} - -std::string build_filename(const Glib::ArrayHandle& elements) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filenamev(const_cast(elements.data()))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), - static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), - static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), - elem7.c_str(), static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7, const std::string& elem8) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), - elem7.c_str(), elem8.c_str(), static_cast(0))); -} - -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7, const std::string& elem8, - const std::string& elem9) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), - elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), - elem7.c_str(), elem8.c_str(), elem9.c_str(), static_cast(0))); -} - -std::string build_path(const std::string& separator, const Glib::ArrayHandle& elements) -{ - return convert_return_gchar_ptr_to_stdstring(g_build_pathv(separator.c_str(), const_cast(elements.data()))); -} - -std::string find_program_in_path(const std::string& program) -{ - return convert_return_gchar_ptr_to_stdstring(g_find_program_in_path(program.c_str())); -} - -} // namespace Glib diff --git a/glib/glibmm/miscutils.h b/glib/glibmm/miscutils.h deleted file mode 100644 index 12c9677b..00000000 --- a/glib/glibmm/miscutils.h +++ /dev/null @@ -1,467 +0,0 @@ -// -*- c++ -*- -#ifndef _GLIBMM_MISCUTILS_H -#define _GLIBMM_MISCUTILS_H - -/* $Id$ */ - -/* Copyright (C) 2002 The gtkmm 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. - */ - -#include -#include - - -namespace Glib -{ - -/** @defgroup MiscUtils Miscellaneous Utility Functions - * Miscellaneous Utility Functions -- a selection of portable utility functions. - * @{ - */ - -/** Gets a human-readable name for the application, - * as set by Glib::set_application_name(). - * This name should be localized if possible, and is intended for display to - * the user. Contrast with Glib::get_prgname(), which gets a non-localized - * name. If Glib::set_application_name() has not been called, returns the - * result of Glib::get_prgname() (which may be empty if Glib::set_prgname() - * has also not been called). - * - * @return Human-readable application name. May return "". - */ -Glib::ustring get_application_name(); - -/** Sets a human-readable name for the application. - * This name should be localized if possible, and is intended for display to - * the user. Contrast with Glib::set_prgname(), which sets a non-localized - * name. Glib::set_prgname() will be called automatically by - * gtk_init(), but Glib::set_application_name() will not. - * - * Note that for thread safety reasons, this function can only be called once. - * - * The application name will be used in contexts such as error messages, - * or when displaying an application's name in the task list. - * - * @param application_name Localized name of the application. - */ -void set_application_name(const Glib::ustring& application_name); - -/** Gets the name of the program. - * If you are using GDK or GTK+ the program name is set in gdk_init(), - * which is called by gtk_init(). The program name is found by taking - * the last component of argv[0]. - * @return The name of the program. - */ -std::string get_prgname(); - -/** Sets the name of the program. - * @param prgname The name of the program. - */ -void set_prgname(const std::string& prgname); - -/** Returns the value of an environment variable. The name and value - * are in the GLib file name encoding. On Unix, this means the actual - * bytes which might or might not be in some consistent character set - * and encoding. On Windows, it is in UTF-8. On Windows, in case the - * environment variable's value contains references to other - * environment variables, they are expanded. - * - * @param variable The environment variable to get. - * @retval found true Whether the environment variable has been found. - * @return The value of the environment variable, or "" if not found. - */ -std::string getenv(const std::string& variable, bool& found); - -/** Returns the value of an environment variable. The name and value - * are in the GLib file name encoding. On Unix, this means the actual - * bytes which might or might not be in some consistent character set - * and encoding. On Windows, it is in UTF-8. On Windows, in case the - * environment variable's value contains references to other - * environment variables, they are expanded. - * - * @param variable The environment variable to get. - * @return The value of the environment variable, or "" if not found. - */ -std::string getenv(const std::string& variable); - - -/** Sets an environment variable. Both the variable's name and value - * should be in the GLib file name encoding. On Unix, this means that - * they can be any sequence of bytes. On Windows, they should be in - * UTF-8. - * - * Note that on some systems, when variables are overwritten, the memory - * used for the previous variables and its value isn't reclaimed. - * - * @param variable The environment variable to set. It must not contain '='. - * @param value The value to which the variable should be set. - * @param overwrite Whether to change the variable if it already exists. - * @result false if the environment variable couldn't be set. - */ -bool setenv(const std::string& variable, const std::string& value, bool overwrite = true); - -/** Removes an environment variable from the environment. - * - * Note that on some systems, when variables are overwritten, the memory - * used for the previous variables and its value isn't reclaimed. - * Furthermore, this function can't be guaranteed to operate in a - * threadsafe way. - * - * @param variable: the environment variable to remove. It must not contain '='. - **/ -void unsetenv(const std::string& variable); - -/** Gets the names of all variables set in the environment. - * - * Programs that want to be portable to Windows should typically use this - * function and getenv() instead of using the environ array from the C library - * directly. On Windows, the strings in the environ array are in system - * codepage encoding, while in most of the typical use cases for environment - * variables in GLib-using programs you want the UTF-8 encoding that this - * function and getenv() provide. - * - * @return Array of environment names (The generic ArrayHandle will be - * implicitly converted to any STL compatible container type). - */ -Glib::ArrayHandle listenv(); - -/** Gets the user name of the current user. - * @return The name of the current user. - */ -std::string get_user_name(); - -/** Gets the real name of the user. - * This usually comes from the user's entry in the passwd file. - * @return The user's real name. - */ -std::string get_real_name(); - -/** Gets the current user's home directory. - * @return The current user's home directory or an empty string if not defined. - */ -std::string get_home_dir(); - -/** Gets the directory to use for temporary files. - * This is found from inspecting the environment variables TMPDIR, - * TMP, and TEMP in that order. If none of those are defined - * "/tmp" is returned on UNIX and "C:\\" on Windows. - * @return The directory to use for temporary files. - */ -std::string get_tmp_dir(); - -/** Gets the current directory. - * @return The current directory. - */ -std::string get_current_dir(); - -//TODO: We could create a C++ enum to wrap the C GUserDirectory enum, -//but we would have to either be very careful, or define the enum -//values in terms of the C enums anyway. -/** Returns the full path of a special directory using its logical id. - * - * On Unix this is done using the XDG special user directories. - * - * Depending on the platform, the user might be able to change the path - * of the special directory without requiring the session to restart; GLib - * will not reflect any change once the special directories are loaded. - * - * Return value: the path to the specified special directory. - * @param directory Te logical id of special directory - * - * @newin{2,14} - */ -std::string get_user_special_dir(GUserDirectory directory); - -/** Returns a base directory in which to access application data such as icons - * that is customized for a particular user. - * - * On UNIX platforms this is determined using the mechanisms described in the - * XDG Base Directory Specification - * - * @newin{2,14} - */ -std::string get_user_data_dir(); - -/** Returns a base directory in which to store user-specific application - * configuration information such as user preferences and settings. - * - * On UNIX platforms this is determined using the mechanisms described in the - * XDG Base Directory Specification - * - * @newin{2,14} - */ -std::string get_user_config_dir(); - -/** Returns an ordered list of base directories in which to access system-wide application data. - * On Unix platforms this is determined using the mechanisms described in the XDG Base Directory Specification. - * - * @newin{2,18} - */ -std::vector get_system_data_dirs(); - -/** Returns an ordered list of base directories in which to access system-wide configuration information. - * On Unix platforms this is determined using the mechanisms described in the XDG Base Directory Specification. - * - * @newin{2,18} - */ -std::vector get_system_config_dirs(); - -/** Returns a base directory in which to store non-essential, cached data - * specific to particular user. - * - * On UNIX platforms this is determined using the mechanisms described in the - * XDG Base Directory Specification - * - * @newin{2,14} - */ -std::string get_user_cache_dir(); - -/** Returns @c true if the given @a filename is an absolute file name, i.e.\ it - * contains a full path from the root directory such as "/usr/local" - * on UNIX or "C:\\windows" on Windows systems. - * @param filename A file name. - * @return Whether @a filename is an absolute path. - */ -bool path_is_absolute(const std::string& filename); - -/** Returns the remaining part of @a filename after the root component, - * i.e.\ after the "/" on UNIX or "C:\\" on Windows. - * If @a filename is not an absolute path, "" will be returned. - * @param filename A file name. - * @return The file name without the root component, or "". - */ -std::string path_skip_root(const std::string& filename); - -/** Gets the name of the file without any leading directory components. - * @param filename The name of the file. - * @return The name of the file without any leading directory components. - */ -std::string path_get_basename(const std::string& filename); - -/** Gets the directory components of a file name. - * If the file name has no directory components "." is returned. - * @param filename The name of the file. - * @return The directory components of the file. - */ -std::string path_get_dirname(const std::string& filename); - -/** Creates a filename from a series of elements using the correct - * separator for filenames. - * This function behaves identically to Glib::build_path(G_DIR_SEPARATOR_S, - * elements). No attempt is made to force the resulting filename to be an - * absolute path. If the first element is a relative path, the result will - * be a relative path. - * @param elements A container holding the elements of the path to build. - * Any STL compatible container type is accepted. - * @return The resulting path. - */ -std::string build_filename(const Glib::ArrayHandle& elements); - -/** Creates a filename from two elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @return The resulting path. - */ -std::string build_filename(const std::string& elem1, const std::string& elem2); - -/** Creates a filename from three elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3); - - -/** Creates a filename from four elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4); - -/** Creates a filename from five elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @param elem5 Fifth path element. - * @return The resulting path. - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5); - -/** Creates a filename from six elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @param elem5 Fifth path element. - * @param elem6 Sixth path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6); - -/** Creates a filename from seven elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @param elem5 Fifth path element. - * @param elem6 Sixth path element. - * @param elem7 Seventh path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7); - -/** Creates a filename from eight elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @param elem5 Fifth path element. - * @param elem6 Sixth path element. - * @param elem7 Seventh path element. - * @param elem8 Eighth path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7, const std::string& elem8); - -/** Creates a filename from nine elements using the correct separator for filenames. - * No attempt is made to force the resulting filename to be an absolute path. - * If the first element is a relative path, the result will be a relative path. - * @param elem1 First path element. - * @param elem2 Second path element. - * @param elem3 Third path element. - * @param elem4 Fourth path element. - * @param elem5 Fifth path element. - * @param elem6 Sixth path element. - * @param elem7 Seventh path element. - * @param elem8 Eighth path element. - * @param elem9 Ninth path element. - * @return The resulting path. - * - * @newin{2,28} - */ -std::string build_filename(const std::string& elem1, const std::string& elem2, - const std::string& elem3, const std::string& elem4, - const std::string& elem5, const std::string& elem6, - const std::string& elem7, const std::string& elem8, - const std::string& elem9); - -/** Creates a path from a series of elements using @a separator as the - * separator between elements. - * - * At the boundary between two elements, any trailing occurrences of - * @a separator in the first element, or leading occurrences of @a separator - * in the second element are removed and exactly one copy of the separator is - * inserted. - * - * Empty elements are ignored. - * - * The number of leading copies of the separator on the result is - * the same as the number of leading copies of the separator on - * the first non-empty element. - * - * The number of trailing copies of the separator on the result is the same - * as the number of trailing copies of the separator on the last non-empty - * element. (Determination of the number of trailing copies is done without - * stripping leading copies, so if the separator is "ABA", - * "ABABA" has 1 trailing copy.) - * - * However, if there is only a single non-empty element, and there - * are no characters in that element not part of the leading or - * trailing separators, then the result is exactly the original value - * of that element. - * - * Other than for determination of the number of leading and trailing - * copies of the separator, elements consisting only of copies - * of the separator are ignored. - * - * @param separator A string used to separate the elements of the path. - * @param elements A container holding the elements of the path to build. - * Any STL compatible container type is accepted. - * @return The resulting path. - */ -std::string build_path(const std::string& separator, - const Glib::ArrayHandle& elements); - -/** Locates the first executable named @a program in the user's path, in the - * same way that execvp() would locate it. - * Returns a string with the absolute path name, or "" if the program - * is not found in the path. If @a program is already an absolute path, - * returns a copy of @a program if @a program exists and is executable, and - * "" otherwise. - * - * On Windows, if @a program does not have a file type suffix, tries to append - * the suffixes in the PATHEXT environment variable (if that doesn't - * exist, the suffixes .com, .exe, and .bat) in turn, and then look for the - * resulting file name in the same way as CreateProcess() would. This means - * first in the directory where the program was loaded from, then in the - * current directory, then in the Windows 32-bit system directory, then in the - * Windows directory, and finally in the directories in the PATH - * environment variable. If the program is found, the return value contains - * the full name including the type suffix. - * - * @param program A program name. - * @return An absolute path, or "". - */ -std::string find_program_in_path(const std::string& program); - -/** @} group MiscUtils */ - -} // namespace Glib - - -#endif /* _GLIBMM_FILEUTILS_H */ diff --git a/glib/src/filelist.am b/glib/src/filelist.am index 133f6bef..94341328 100644 --- a/glib/src/filelist.am +++ b/glib/src/filelist.am @@ -26,6 +26,7 @@ glibmm_files_any_hg = \ iochannel.hg \ keyfile.hg \ markup.hg \ + miscutils.hg \ module.hg \ nodetree.hg \ optioncontext.hg \ diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg new file mode 100644 index 00000000..d87936d9 --- /dev/null +++ b/glib/src/miscutils.ccg @@ -0,0 +1,271 @@ +/* Copyright (C) 2002 The gtkmm 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. + */ + +#include +#include + +#include +#include +#include + + +namespace Glib +{ + +Glib::ustring get_application_name() +{ + return convert_const_gchar_ptr_to_ustring (g_get_application_name()); +} + +void set_application_name(const Glib::ustring& application_name) +{ + g_set_application_name(application_name.c_str()); +} + +std::string get_prgname() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_prgname()); +} + +void set_prgname(const std::string& prgname) +{ + g_set_prgname(prgname.c_str()); +} + +std::string getenv(const std::string& variable, bool& found) +{ + const char *const value = g_getenv(variable.c_str()); + found = (value != 0); + return convert_const_gchar_ptr_to_stdstring(value); +} + +std::string getenv(const std::string& variable) +{ + return convert_const_gchar_ptr_to_stdstring(g_getenv(variable.c_str())); +} + +bool setenv(const std::string& variable, const std::string& value, bool overwrite) +{ + return g_setenv(variable.c_str(), value.c_str(), overwrite); +} + +void unsetenv(const std::string& variable) +{ + g_unsetenv(variable.c_str()); +} + +Glib::ArrayHandle listenv() +{ + char **value = g_listenv(); + char **end = value; + while(*end){ + ++end; + } + return Glib::ArrayHandle(value, end-value, Glib::OWNERSHIP_DEEP); +} + +std::string get_user_name() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_name()); +} + +std::string get_real_name() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_real_name()); +} + +std::string get_home_dir() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_home_dir()); +} + +std::string get_tmp_dir() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_tmp_dir()); +} + +std::string get_current_dir() +{ + return convert_return_gchar_ptr_to_stdstring(g_get_current_dir()); +} + +std::string get_user_special_dir(GUserDirectory directory) +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_special_dir(directory)); +} + +std::string get_user_data_dir() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_data_dir()); +} + +std::string get_user_config_dir() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_config_dir()); +} + +std::vector get_system_data_dirs() +{ + //TODO: Use a utility function: + std::vector result; + const char* const * cresult = g_get_system_data_dirs(); + if(!cresult) + return result; + + for(const gchar* const * iter = cresult; *iter != 0; ++iter) + { + result.push_back( + convert_const_gchar_ptr_to_stdstring(*iter)); + } + + return result; +} + +std::vector get_system_config_dirs() +{ + //TODO: Use a utility function: + std::vector result; + const char* const * cresult = g_get_system_config_dirs(); + if(!cresult) + return result; + + for(const gchar* const * iter = cresult; *iter != 0; ++iter) + { + result.push_back( + convert_const_gchar_ptr_to_stdstring(*iter)); + } + + return result; +} + +std::string get_user_cache_dir() +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_cache_dir()); +} + +bool path_is_absolute(const std::string& filename) +{ + return (g_path_is_absolute(filename.c_str()) != 0); +} + +std::string path_skip_root(const std::string& filename) +{ + // g_path_skip_root() returns a pointer _into_ the argument string, + // or NULL if there was no root component. + return convert_const_gchar_ptr_to_stdstring(g_path_skip_root(filename.c_str())); +} + +std::string path_get_basename(const std::string& filename) +{ + return convert_return_gchar_ptr_to_stdstring(g_path_get_basename(filename.c_str())); +} + +std::string path_get_dirname(const std::string& filename) +{ + return convert_return_gchar_ptr_to_stdstring(g_path_get_dirname(filename.c_str())); +} + +std::string build_filename(const Glib::ArrayHandle& elements) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filenamev(const_cast(elements.data()))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), + static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), + static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), + elem7.c_str(), static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7, const std::string& elem8) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), + elem7.c_str(), elem8.c_str(), static_cast(0))); +} + +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7, const std::string& elem8, + const std::string& elem9) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_filename(elem1.c_str(), + elem2.c_str(), elem3.c_str(), elem4.c_str(), elem5.c_str(), elem6.c_str(), + elem7.c_str(), elem8.c_str(), elem9.c_str(), static_cast(0))); +} + +std::string build_path(const std::string& separator, const Glib::ArrayHandle& elements) +{ + return convert_return_gchar_ptr_to_stdstring(g_build_pathv(separator.c_str(), const_cast(elements.data()))); +} + +std::string find_program_in_path(const std::string& program) +{ + return convert_return_gchar_ptr_to_stdstring(g_find_program_in_path(program.c_str())); +} + +Glib::ustring format_size(guint64 size, FormatSizeFlags flags) +{ + return convert_return_gchar_ptr_to_ustring(g_format_size_full(size, (GFormatSizeFlags)flags)); +} + +} // namespace Glib diff --git a/glib/src/miscutils.hg b/glib/src/miscutils.hg new file mode 100644 index 00000000..9f3fecfd --- /dev/null +++ b/glib/src/miscutils.hg @@ -0,0 +1,477 @@ +/* Copyright (C) 2002 The gtkmm 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 +#include + +namespace Glib +{ +_WRAP_ENUM(FormatSizeFlags, GFormatSizeFlags, NO_GTYPE) + +/** @defgroup MiscUtils Miscellaneous Utility Functions + * Miscellaneous Utility Functions -- a selection of portable utility functions. + * @{ + */ + +/** Gets a human-readable name for the application, + * as set by Glib::set_application_name(). + * This name should be localized if possible, and is intended for display to + * the user. Contrast with Glib::get_prgname(), which gets a non-localized + * name. If Glib::set_application_name() has not been called, returns the + * result of Glib::get_prgname() (which may be empty if Glib::set_prgname() + * has also not been called). + * + * @return Human-readable application name. May return "". + */ +Glib::ustring get_application_name(); + +/** Sets a human-readable name for the application. + * This name should be localized if possible, and is intended for display to + * the user. Contrast with Glib::set_prgname(), which sets a non-localized + * name. Glib::set_prgname() will be called automatically by + * gtk_init(), but Glib::set_application_name() will not. + * + * Note that for thread safety reasons, this function can only be called once. + * + * The application name will be used in contexts such as error messages, + * or when displaying an application's name in the task list. + * + * @param application_name Localized name of the application. + */ +void set_application_name(const Glib::ustring& application_name); + +/** Gets the name of the program. + * If you are using GDK or GTK+ the program name is set in gdk_init(), + * which is called by gtk_init(). The program name is found by taking + * the last component of argv[0]. + * @return The name of the program. + */ +std::string get_prgname(); + +/** Sets the name of the program. + * @param prgname The name of the program. + */ +void set_prgname(const std::string& prgname); + +/** Returns the value of an environment variable. The name and value + * are in the GLib file name encoding. On Unix, this means the actual + * bytes which might or might not be in some consistent character set + * and encoding. On Windows, it is in UTF-8. On Windows, in case the + * environment variable's value contains references to other + * environment variables, they are expanded. + * + * @param variable The environment variable to get. + * @param[out] found Whether the environment variable has been found. + * @return The value of the environment variable, or "" if not found. + */ +std::string getenv(const std::string& variable, bool& found); + +/** Returns the value of an environment variable. The name and value + * are in the GLib file name encoding. On Unix, this means the actual + * bytes which might or might not be in some consistent character set + * and encoding. On Windows, it is in UTF-8. On Windows, in case the + * environment variable's value contains references to other + * environment variables, they are expanded. + * + * @param variable The environment variable to get. + * @return The value of the environment variable, or "" if not found. + */ +std::string getenv(const std::string& variable); + + +/** Sets an environment variable. Both the variable's name and value + * should be in the GLib file name encoding. On Unix, this means that + * they can be any sequence of bytes. On Windows, they should be in + * UTF-8. + * + * Note that on some systems, when variables are overwritten, the memory + * used for the previous variables and its value isn't reclaimed. + * + * @param variable The environment variable to set. It must not contain '='. + * @param value The value to which the variable should be set. + * @param overwrite Whether to change the variable if it already exists. + * @result false if the environment variable couldn't be set. + */ +bool setenv(const std::string& variable, const std::string& value, bool overwrite = true); + +/** Removes an environment variable from the environment. + * + * Note that on some systems, when variables are overwritten, the memory + * used for the previous variables and its value isn't reclaimed. + * Furthermore, this function can't be guaranteed to operate in a + * threadsafe way. + * + * @param variable: the environment variable to remove. It must not contain '='. + **/ +void unsetenv(const std::string& variable); + +/** Gets the names of all variables set in the environment. + * + * Programs that want to be portable to Windows should typically use this + * function and getenv() instead of using the environ array from the C library + * directly. On Windows, the strings in the environ array are in system + * codepage encoding, while in most of the typical use cases for environment + * variables in GLib-using programs you want the UTF-8 encoding that this + * function and getenv() provide. + * + * @return Array of environment names (The generic ArrayHandle will be + * implicitly converted to any STL compatible container type). + */ +Glib::ArrayHandle listenv(); + +/** Gets the user name of the current user. + * @return The name of the current user. + */ +std::string get_user_name(); + +/** Gets the real name of the user. + * This usually comes from the user's entry in the passwd file. + * @return The user's real name. + */ +std::string get_real_name(); + +/** Gets the current user's home directory. + * @return The current user's home directory or an empty string if not defined. + */ +std::string get_home_dir(); + +/** Gets the directory to use for temporary files. + * This is found from inspecting the environment variables TMPDIR, + * TMP, and TEMP in that order. If none of those are defined + * "/tmp" is returned on UNIX and "C:\\" on Windows. + * @return The directory to use for temporary files. + */ +std::string get_tmp_dir(); + +/** Gets the current directory. + * @return The current directory. + */ +std::string get_current_dir(); + +//TODO: We could create a C++ enum to wrap the C GUserDirectory enum, +//but we would have to either be very careful, or define the enum +//values in terms of the C enums anyway. +/** Returns the full path of a special directory using its logical id. + * + * On Unix this is done using the XDG special user directories. + * + * Depending on the platform, the user might be able to change the path + * of the special directory without requiring the session to restart; GLib + * will not reflect any change once the special directories are loaded. + * + * Return value: the path to the specified special directory. + * @param directory Te logical id of special directory + * + * @newin{2,14} + */ +std::string get_user_special_dir(GUserDirectory directory); + +/** Returns a base directory in which to access application data such as icons + * that is customized for a particular user. + * + * On UNIX platforms this is determined using the mechanisms described in the + * XDG Base Directory Specification + * + * @newin{2,14} + */ +std::string get_user_data_dir(); + +/** Returns a base directory in which to store user-specific application + * configuration information such as user preferences and settings. + * + * On UNIX platforms this is determined using the mechanisms described in the + * XDG Base Directory Specification + * + * @newin{2,14} + */ +std::string get_user_config_dir(); + +/** Returns an ordered list of base directories in which to access system-wide application data. + * On Unix platforms this is determined using the mechanisms described in the XDG Base Directory Specification. + * + * @newin{2,18} + */ +std::vector get_system_data_dirs(); + +/** Returns an ordered list of base directories in which to access system-wide configuration information. + * On Unix platforms this is determined using the mechanisms described in the XDG Base Directory Specification. + * + * @newin{2,18} + */ +std::vector get_system_config_dirs(); + +/** Returns a base directory in which to store non-essential, cached data + * specific to particular user. + * + * On UNIX platforms this is determined using the mechanisms described in the + * XDG Base Directory Specification + * + * @newin{2,14} + */ +std::string get_user_cache_dir(); + +/** Returns @c true if the given @a filename is an absolute file name, i.e.\ it + * contains a full path from the root directory such as "/usr/local" + * on UNIX or "C:\\windows" on Windows systems. + * @param filename A file name. + * @return Whether @a filename is an absolute path. + */ +bool path_is_absolute(const std::string& filename); + +/** Returns the remaining part of @a filename after the root component, + * i.e.\ after the "/" on UNIX or "C:\\" on Windows. + * If @a filename is not an absolute path, "" will be returned. + * @param filename A file name. + * @return The file name without the root component, or "". + */ +std::string path_skip_root(const std::string& filename); + +/** Gets the name of the file without any leading directory components. + * @param filename The name of the file. + * @return The name of the file without any leading directory components. + */ +std::string path_get_basename(const std::string& filename); + +/** Gets the directory components of a file name. + * If the file name has no directory components "." is returned. + * @param filename The name of the file. + * @return The directory components of the file. + */ +std::string path_get_dirname(const std::string& filename); + +/** Creates a filename from a series of elements using the correct + * separator for filenames. + * This function behaves identically to Glib::build_path(G_DIR_SEPARATOR_S, + * elements). No attempt is made to force the resulting filename to be an + * absolute path. If the first element is a relative path, the result will + * be a relative path. + * @param elements A container holding the elements of the path to build. + * Any STL compatible container type is accepted. + * @return The resulting path. + */ +std::string build_filename(const Glib::ArrayHandle& elements); + +/** Creates a filename from two elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @return The resulting path. + */ +std::string build_filename(const std::string& elem1, const std::string& elem2); + +/** Creates a filename from three elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3); + + +/** Creates a filename from four elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4); + +/** Creates a filename from five elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @param elem5 Fifth path element. + * @return The resulting path. + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5); + +/** Creates a filename from six elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @param elem5 Fifth path element. + * @param elem6 Sixth path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6); + +/** Creates a filename from seven elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @param elem5 Fifth path element. + * @param elem6 Sixth path element. + * @param elem7 Seventh path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7); + +/** Creates a filename from eight elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @param elem5 Fifth path element. + * @param elem6 Sixth path element. + * @param elem7 Seventh path element. + * @param elem8 Eighth path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7, const std::string& elem8); + +/** Creates a filename from nine elements using the correct separator for filenames. + * No attempt is made to force the resulting filename to be an absolute path. + * If the first element is a relative path, the result will be a relative path. + * @param elem1 First path element. + * @param elem2 Second path element. + * @param elem3 Third path element. + * @param elem4 Fourth path element. + * @param elem5 Fifth path element. + * @param elem6 Sixth path element. + * @param elem7 Seventh path element. + * @param elem8 Eighth path element. + * @param elem9 Ninth path element. + * @return The resulting path. + * + * @newin{2,28} + */ +std::string build_filename(const std::string& elem1, const std::string& elem2, + const std::string& elem3, const std::string& elem4, + const std::string& elem5, const std::string& elem6, + const std::string& elem7, const std::string& elem8, + const std::string& elem9); + +/** Creates a path from a series of elements using @a separator as the + * separator between elements. + * + * At the boundary between two elements, any trailing occurrences of + * @a separator in the first element, or leading occurrences of @a separator + * in the second element are removed and exactly one copy of the separator is + * inserted. + * + * Empty elements are ignored. + * + * The number of leading copies of the separator on the result is + * the same as the number of leading copies of the separator on + * the first non-empty element. + * + * The number of trailing copies of the separator on the result is the same + * as the number of trailing copies of the separator on the last non-empty + * element. (Determination of the number of trailing copies is done without + * stripping leading copies, so if the separator is "ABA", + * "ABABA" has 1 trailing copy.) + * + * However, if there is only a single non-empty element, and there + * are no characters in that element not part of the leading or + * trailing separators, then the result is exactly the original value + * of that element. + * + * Other than for determination of the number of leading and trailing + * copies of the separator, elements consisting only of copies + * of the separator are ignored. + * + * @param separator A string used to separate the elements of the path. + * @param elements A container holding the elements of the path to build. + * Any STL compatible container type is accepted. + * @return The resulting path. + */ +std::string build_path(const std::string& separator, + const Glib::ArrayHandle& elements); + +/** Locates the first executable named @a program in the user's path, in the + * same way that execvp() would locate it. + * Returns a string with the absolute path name, or "" if the program + * is not found in the path. If @a program is already an absolute path, + * returns a copy of @a program if @a program exists and is executable, and + * "" otherwise. + * + * On Windows, if @a program does not have a file type suffix, tries to append + * the suffixes in the PATHEXT environment variable (if that doesn't + * exist, the suffixes .com, .exe, and .bat) in turn, and then look for the + * resulting file name in the same way as CreateProcess() would. This means + * first in the directory where the program was loaded from, then in the + * current directory, then in the Windows 32-bit system directory, then in the + * Windows directory, and finally in the directories in the PATH + * environment variable. If the program is found, the return value contains + * the full name including the type suffix. + * + * @param program A program name. + * @return An absolute path, or "". + */ +std::string find_program_in_path(const std::string& program); + +/** Formats a size (for example the size of a file) into a human readable string. + * + * Sizes are rounded to the nearest size prefix (kB, MB, GB) + * and are displayed rounded to the nearest tenth. E.g. the file size + * 3292528 bytes will be converted into the string "3.2 MB". + * + * The prefix units base is 1000 (i.e. 1 kB is 1000 bytes), unless the + * Glib::FORMAT_SIZE_IEC_UNITS flag is set. + * + * @param size A size in bytes. + * @param flags Flags to modify the output. + * @return A formatted string containing a human readable file size. + * + * @newin{2,46} + */ +Glib::ustring format_size(guint64 size, FormatSizeFlags flags = FORMAT_SIZE_DEFAULT); + +/** @} group MiscUtils */ + +} // namespace Glib -- cgit v1.2.1 From 6df99849edfc372edad25b102fe20458cc0b36cb Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 15 Apr 2015 17:03:21 +0200 Subject: Add Glib::get_user_special_dir(UserDirectory) * glib/src/miscutils.[hg|ccg]: Add _WRAP_ENUM(UserDirectory,...) and Glib::get_user_special_dir(UserDirectory directory). Deprecate get_user_special_dir(GUserDirectory directory). Bug #747311. --- glib/src/miscutils.ccg | 7 +++++++ glib/src/miscutils.hg | 34 +++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg index d87936d9..3beabc9e 100644 --- a/glib/src/miscutils.ccg +++ b/glib/src/miscutils.ccg @@ -103,10 +103,17 @@ std::string get_current_dir() return convert_return_gchar_ptr_to_stdstring(g_get_current_dir()); } +#ifndef GLIBMM_DISABLE_DEPRECATED std::string get_user_special_dir(GUserDirectory directory) { return convert_const_gchar_ptr_to_stdstring(g_get_user_special_dir(directory)); } +#endif // GLIBMM_DISABLE_DEPRECATED + +std::string get_user_special_dir(UserDirectory directory) +{ + return convert_const_gchar_ptr_to_stdstring(g_get_user_special_dir((GUserDirectory)directory)); +} std::string get_user_data_dir() { diff --git a/glib/src/miscutils.hg b/glib/src/miscutils.hg index 9f3fecfd..f4833f56 100644 --- a/glib/src/miscutils.hg +++ b/glib/src/miscutils.hg @@ -22,6 +22,7 @@ _DEFS(glibmm,glib) namespace Glib { +_WRAP_ENUM(UserDirectory, GUserDirectory, NO_GTYPE) _WRAP_ENUM(FormatSizeFlags, GFormatSizeFlags, NO_GTYPE) /** @defgroup MiscUtils Miscellaneous Utility Functions @@ -164,23 +165,46 @@ std::string get_tmp_dir(); */ std::string get_current_dir(); -//TODO: We could create a C++ enum to wrap the C GUserDirectory enum, -//but we would have to either be very careful, or define the enum -//values in terms of the C enums anyway. +#ifndef GLIBMM_DISABLE_DEPRECATED /** Returns the full path of a special directory using its logical id. * * On Unix this is done using the XDG special user directories. + * For compatibility with existing practise, G_USER_DIRECTORY_DESKTOP + * falls back to `$HOME/Desktop` when XDG special user directories have + * not been set up. * * Depending on the platform, the user might be able to change the path * of the special directory without requiring the session to restart; GLib * will not reflect any change once the special directories are loaded. * - * Return value: the path to the specified special directory. - * @param directory Te logical id of special directory + * @param directory The logical id of special directory. + * @return The path to the specified special directory, or an empty string + * if the logical id was not found. * * @newin{2,14} + * @deprecated Use get_user_special_dir(Glib::UserDirectory directory) instead. */ std::string get_user_special_dir(GUserDirectory directory); +#endif // GLIBMM_DISABLE_DEPRECATED + +/** Returns the full path of a special directory using its logical id. + * + * On Unix this is done using the XDG special user directories. + * For compatibility with existing practise, Glib::USER_DIRECTORY_DESKTOP + * falls back to `$HOME/Desktop` when XDG special user directories have + * not been set up. + * + * Depending on the platform, the user might be able to change the path + * of the special directory without requiring the session to restart; GLib + * will not reflect any change once the special directories are loaded. + * + * @param directory The logical id of special directory. + * @return The path to the specified special directory, or an empty string + * if the logical id was not found. + * + * @newin{2,46} + */ +std::string get_user_special_dir(UserDirectory directory); /** Returns a base directory in which to access application data such as icons * that is customized for a particular user. -- cgit v1.2.1 From edcd9742851215c09affdb527c54a2f2636d574a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 21 Apr 2015 16:37:11 +0200 Subject: gmmproc: Add _IGNORE_PROPERTY() and _IGNORE_CHILD_PROPERTY() macros tools/pm/WrapParser.pm: Add code for _IGNORE_PROPERTY() and _IGNORE_CHILD_PROPERTY(), similar to _IGNORE_SIGNAL(). --- tools/pm/WrapParser.pm | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm index 337b4cf6..2e29d4da 100644 --- a/tools/pm/WrapParser.pm +++ b/tools/pm/WrapParser.pm @@ -111,6 +111,8 @@ sub parse_and_build_output($) if ($token eq "_DEFS") { $self->on_defs(); next;} #Read the defs file. if ($token eq "_IGNORE") { $self->on_ignore(); next;} #Ignore a function. if ($token eq "_IGNORE_SIGNAL") { $self->on_ignore_signal(); next;} #Ignore a signal. + if ($token eq "_IGNORE_PROPERTY") { $self->on_ignore_property(); next;} #Ignore a property. + if ($token eq "_IGNORE_CHILD_PROPERTY") { $self->on_ignore_child_property(); next;} #Ignore a child property. if ($token eq "_WRAP_METHOD") { $self->on_wrap_method(); next;} if ($token eq "_WRAP_METHOD_DOCS_ONLY") { $self->on_wrap_method_docs_only(); next;} if ($token eq "_WRAP_CORBA_METHOD") { $self->on_wrap_corba_method(); next;} #Used in libbonobo*mm. @@ -471,25 +473,42 @@ sub on_ignore($) } } -sub on_ignore_signal($) +# void on_ignore_signal_or_property(\&lookup_function, $type) +sub on_ignore_signal_or_property($$$) { - my ($self) = @_; - my $objOutputter = $$self{objOutputter}; + my ($self, $lookup_function, $type) = @_; my $str = $self->extract_bracketed_text(); - $str = string_trim($str); - $str = string_unquote($str); my @args = split(/\s+|,/,$str); foreach (@args) { - next if ($_ eq ""); - my $objCsignal = GtkDefs::lookup_signal($$self{c_class}, $_); #Pretend that we've used it. - if(!$objCsignal) + my $name = string_unquote($_); + next if ($name eq ""); + my $objCentity = $lookup_function->($$self{c_class}, $name); #Pretend that we've used it. + if (!$objCentity) { - $objOutputter->output_wrap_failed($_, "ignored signal defs lookup failed"); + $$self{objOutputter}->output_wrap_failed($name, "ignored $type defs lookup failed"); } } } +sub on_ignore_signal($) +{ + my ($self) = @_; + $self->on_ignore_signal_or_property(\&GtkDefs::lookup_signal, "signal"); +} + +sub on_ignore_property($) +{ + my ($self) = @_; + $self->on_ignore_signal_or_property(\&GtkDefs::lookup_property, "property"); +} + +sub on_ignore_child_property($) +{ + my ($self) = @_; + $self->on_ignore_signal_or_property(\&GtkDefs::lookup_child_property, "child property"); +} + ######################################## ### we have certain macros we need to insert at end of statements # void on_class($, $strClassCommand) -- cgit v1.2.1 From f23d78236a236ec8206236d5e43a250ac828116a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 27 Apr 2015 09:35:22 +0200 Subject: Gio::InetAddress, MemoryOutputStream: Add some _IGNORE * gio/src/inetaddress.hg: Ignore g_inet_address_mask_new(). gmmproc does not understand that it belongs to GInetAddressMask. * gio/src/memoryoutputstream.hg: Ignore the destroy-function and realloc-function properties. --- gio/src/inetaddress.hg | 3 +-- gio/src/memoryoutputstream.hg | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gio/src/inetaddress.hg b/gio/src/inetaddress.hg index 10a66e7a..6dd44671 100644 --- a/gio/src/inetaddress.hg +++ b/gio/src/inetaddress.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2009 jonathon jongsma * * This library is free software; you can redistribute it and/or @@ -47,6 +45,7 @@ class InetAddress protected: _WRAP_CTOR(InetAddress(const guint8 *bytes, SocketFamily family), g_inet_address_new_from_bytes) + _IGNORE(g_inet_address_mask_new)dnl// Belongs to GInetAddressMask. public: static Glib::RefPtr create(const Glib::ustring& string); diff --git a/gio/src/memoryoutputstream.hg b/gio/src/memoryoutputstream.hg index bb6cccbb..8f08c030 100644 --- a/gio/src/memoryoutputstream.hg +++ b/gio/src/memoryoutputstream.hg @@ -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 @@ -70,10 +68,9 @@ public: _WRAP_PROPERTY("data", void*) _WRAP_PROPERTY("data-size", gulong) - //Too C-like: _WRAP_PROPERTY("destroy-function", void*) - //Too C-like: _WRAP_PROPERTY("realloc-function" gpointer : Read / Write / Construct Only _WRAP_PROPERTY("size", gulong) + _IGNORE_PROPERTY(destroy-function, realloc-function)dnl// Too C-like }; } // namespace Gio -- cgit v1.2.1 From e89b9ab99416ec328e81668c1e097c63394462f1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 27 Apr 2015 09:37:25 +0200 Subject: Glib::Variant: Wrap handles, add get_data_as_bytes() * glib/src/variant.[hg|ccg]: VariantBase::is_castable_to(): Accept casts of handles to Variant. Add VariantBase::get_data_as_bytes(). Deprecate the non-const get_data() and add a const one. * glib/src/variant_basictypes.[h|cc].m4: Add Variant::create_handle(). --- glib/src/variant.ccg | 13 ++++++++++--- glib/src/variant.hg | 18 ++++++++++++------ glib/src/variant_basictypes.cc.m4 | 30 +++++++++++++++++++++++------- glib/src/variant_basictypes.h.m4 | 24 ++++++++++++++++-------- 4 files changed, 61 insertions(+), 24 deletions(-) diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index fe835400..fd47549c 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -66,10 +66,12 @@ bool VariantBase::is_castable_to(const VariantType& supertype) const // - Both types are assumed to be definite types (no indefinite types, // no 'r', '?' or '*'). // - VARIANT_TYPE_OBJECT_PATH (o) and VARIANT_TYPE_SIGNATURE (g) can be cast to - // VARIANT_TYPE_STRING (s), the type of Glib::ustring. + // VARIANT_TYPE_STRING (s), (Variant::variant_type()). // - VARIANT_TYPE_STRING (s), VARIANT_TYPE_OBJECT_PATH (o) and - // VARIANT_TYPE_SIGNATURE (g) can be cast to - // VARIANT_TYPE_BYTESTRING (ay), the type of std::string. + // VARIANT_TYPE_SIGNATURE (g) can be cast to VARIANT_TYPE_BYTESTRING (ay), + // (Variant::variant_type()). + // - VARIANT_TYPE_HANDLE (h) can be cast to VARIANT_TYPE_INT32 (i), + // (Variant::variant_type()). std::size_t subtype_index = 0; std::size_t supertype_index = 0; @@ -96,6 +98,11 @@ bool VariantBase::is_castable_to(const VariantType& supertype) const supertype_index++; break; + case 'i': + if (!(subtype_char == 'h')) + return false; + break; + default: return false; } diff --git a/glib/src/variant.hg b/glib/src/variant.hg index 5bf3af46..604b195f 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -20,6 +20,7 @@ _DEFS(glibmm,glib) #include #include #include +#include #include #include #include @@ -30,6 +31,7 @@ _DEFS(glibmm,glib) namespace Glib { +class Bytes; /** @defgroup Variant Variant Data Types * @@ -38,7 +40,7 @@ namespace Glib * information about the type of that value. The range of possible * values is determined by the type. The type system used is VariantType. * - * See the VariantBase class and it's derived types, such as VariantContainerBase, + * See the VariantBase class and its derived types, such as VariantContainerBase, * and the Variant<> template type. * * Variant instances always have a type and a value (which are given @@ -58,14 +60,14 @@ namespace Glib * * There is a Python-inspired text language for describing Variant * values. Variant includes a printer for this language and a parser - * with type inferencing.. + * with type inferencing. */ //Note: We wrap this because it is thrown by GtkBuilder's functions. // See https://bugzilla.gnome.org/show_bug.cgi?id=708206 // It would also be thrown by parse() if we wrap g_variant_parse(). // Now (2014-01-30) it's also thrown by Gio::Action::parse_detailed_name(). -/** Exception class for Variant parse errors. +/** %Exception class for Variant parse errors. */ _WRAP_GERROR(VariantParseError, GVariantParseError, G_VARIANT_PARSE_ERROR, NO_GTYPE) @@ -132,7 +134,9 @@ public: _WRAP_METHOD(GVariantClass classify() const, g_variant_classify) _WRAP_METHOD(gsize get_size() const, g_variant_get_size) - _WRAP_METHOD(gconstpointer get_data(), g_variant_get_data) + _WRAP_METHOD(gconstpointer get_data(), g_variant_get_data, deprecated "Use the const version instead.") + _WRAP_METHOD(gconstpointer get_data() const, g_variant_get_data) + _WRAP_METHOD(Glib::RefPtr get_data_as_bytes() const, g_variant_get_data_as_bytes) _WRAP_METHOD(void store(gpointer data) const, g_variant_store) _WRAP_METHOD(Glib::ustring print(bool type_annotate = false) const, g_variant_print) @@ -221,6 +225,7 @@ protected: * VARIANT_TYPE_STRING (Glib::ustring). * - VARIANT_TYPE_STRING, VARIANT_TYPE_OBJECT_PATH and VARIANT_TYPE_SIGNATURE * can be cast to VARIANT_TYPE_BYTESTRING (std::string). + * - VARIANT_TYPE_HANDLE can be cast to VARIANT_TYPE_INT32. * * These casts are possible also when they are parts of a more complicated type. * E.g. in Variant > > the map's keys @@ -964,11 +969,12 @@ public: _IGNORE( g_variant_get_boolean, g_variant_get_byte, + g_variant_get_int16, g_variant_get_uint16, - g_variant_get_int64, g_variant_get_int32, - g_variant_get_int16, + g_variant_get_handle, g_variant_get_uint32, + g_variant_get_int64, g_variant_get_uint64, g_variant_get_double, g_variant_iter_new diff --git a/glib/src/variant_basictypes.cc.m4 b/glib/src/variant_basictypes.cc.m4 index ba79a204..92e50a30 100644 --- a/glib/src/variant_basictypes.cc.m4 +++ b/glib/src/variant_basictypes.cc.m4 @@ -23,11 +23,14 @@ dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include(template.macros.m4) dnl -dnl For instance, GLIB_VARIANT_BASIC(c++ type, c type, c type name) -dnl parameters: -dnl c++ type: The C++ type for the specialization, such as bool -dnl c type: The C type used by the C API, such as gboolean. -dnl c type name: The text used in the C API functions and macros, such as boolean, in g_variant_get_boolean() and G_VARIANT_TYPE_BOOLEAN. +dnl For instance, GLIB_VARIANT_BASIC(C++ type, C type, C type name [,C type name 2]) +dnl Parameters: +dnl C++ type: The C++ type for the specialization, such as bool. +dnl C type: The C type used by the C API, such as gboolean. +dnl C type name: The text used in the C API functions and macros, such as boolean +dnl in g_variant_get_boolean() and G_VARIANT_TYPE_BOOLEAN. +dnl C type name 2: Optional second text, such as handle in g_variant_get_handle() +dnl and G_VARIANT_TYPE_HANDLE. dnl define([GLIB_VARIANT_BASIC],[dnl LINE(]__line__[)dnl @@ -47,10 +50,24 @@ Variant<$1> Variant<$1>::create($1 data) Variant<$1> result = Variant<$1>(g_variant_new_$3(data)); return result; } +ifelse($4,,,[ +Variant<$1> Variant<$1>::create_$4($1 data) +{ + Variant<$1> result = Variant<$1>(g_variant_new_$4(data)); + return result; +} +])dnl $1 Variant<$1>::get() const { +ifelse($4,,[dnl return g_variant_get_$3(gobject_); +],[dnl + if (get_type().equal(VARIANT_TYPE_[]UPPER($3))) + return g_variant_get_$3(gobject_); + else + return g_variant_get_$4(gobject_); +])dnl } ]) @@ -66,11 +83,10 @@ GLIB_VARIANT_BASIC(bool, gboolean, boolean) GLIB_VARIANT_BASIC(unsigned char, guchar, byte) GLIB_VARIANT_BASIC(gint16, gint16, int16) GLIB_VARIANT_BASIC(guint16, guint16, uint16) -GLIB_VARIANT_BASIC(gint32, gint32, int32) +GLIB_VARIANT_BASIC(gint32, gint32, int32, handle) GLIB_VARIANT_BASIC(guint32, guint32, uint32) GLIB_VARIANT_BASIC(gint64, gint64, int64) GLIB_VARIANT_BASIC(guint64, guint64, uint64) -dnl This would redeclare the GLIB_VARIANT_BASIC(gint32, guint32, handle) GLIB_VARIANT_BASIC(double, gdouble, double) } // namespace Glib diff --git a/glib/src/variant_basictypes.h.m4 b/glib/src/variant_basictypes.h.m4 index 2f11a521..a6b6ec06 100644 --- a/glib/src/variant_basictypes.h.m4 +++ b/glib/src/variant_basictypes.h.m4 @@ -23,11 +23,14 @@ dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include(template.macros.m4) dnl -dnl For instance, GLIB_VARIANT_BASIC(c++ type, c type, c type name) -dnl parameters: -dnl c++ type: The C++ type for the specialization, such as bool -dnl c type: The C type used by the C API, such as gboolean. -dnl c type name: The text used in the C API functions and macros, such as boolean, in g_variant_get_boolean() and G_VARIANT_TYPE_BOOLEAN. +dnl For instance, GLIB_VARIANT_BASIC(C++ type, C type, C type name [,C type name 2]) +dnl Parameters: +dnl C++ type: The C++ type for the specialization, such as bool. +dnl C type: The C type used by the C API, such as gboolean. +dnl C type name: The text used in the C API functions and macros, such as boolean +dnl in g_variant_get_boolean() and G_VARIANT_TYPE_BOOLEAN. +dnl C type name 2: Optional second text, such as handle in g_variant_get_handle() +dnl and G_VARIANT_TYPE_HANDLE. dnl define([GLIB_VARIANT_BASIC],[dnl LINE(]__line__[)dnl @@ -67,7 +70,13 @@ public: * @return The new Glib::Variant<$1>. */ static Variant<$1> create($1 data); - +ifelse($4,,,[ + /** Creates a new Glib::Variant<$1> of type VARIANT_TYPE_[]UPPER($4). + * @param data The value of the new Glib::Variant<$1>. + * @return The new Glib::Variant<$1>. + */ + static Variant<$1> create_$4($1 data); +]) /** Gets the value of the Glib::Variant<$1>. * @return The $1 value of the Glib::Variant<$1>. */ @@ -90,10 +99,9 @@ GLIB_VARIANT_BASIC(bool, gboolean, boolean) GLIB_VARIANT_BASIC(unsigned char, guchar, byte) GLIB_VARIANT_BASIC(gint16, gint16, int16) GLIB_VARIANT_BASIC(guint16, guint16, uint16) -GLIB_VARIANT_BASIC(gint32, gint32, int32) +GLIB_VARIANT_BASIC(gint32, gint32, int32, handle) GLIB_VARIANT_BASIC(guint32, guint32, uint32) GLIB_VARIANT_BASIC(gint64, gint64, int64) GLIB_VARIANT_BASIC(guint64, guint64, uint64) -dnl This would redeclare the specialization: GLIB_VARIANT_BASIC(gint32, guint32, handle) GLIB_VARIANT_BASIC(double, gdouble, double) } // namespace Glib -- cgit v1.2.1 From 67e8f2694cad16dedd8b6c45f3d18e4231defb2b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 29 Apr 2015 15:38:44 +0200 Subject: Glib::Threads::Thread: Don't use GThread, only GThread pointer * glib/src/threads.[hg|ccg]: Skip the member data GThread gobject_ in Thread. Use the same technique as in classes wrapped with _CLASS_OPAQUE_REFCOUNTED, i.e. let Glib::Threads::Thread be a class without member data and convert both ways between GThread* and Thread* with reinterpret_cast. Bug #746533. --- glib/src/threads.ccg | 61 ++++++++++++++--------- glib/src/threads.hg | 137 ++++++++++++++++++++++++++------------------------- 2 files changed, 109 insertions(+), 89 deletions(-) diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg index d417a982..05fc76c4 100644 --- a/glib/src/threads.ccg +++ b/glib/src/threads.ccg @@ -18,6 +18,19 @@ #include #include +/* Why reinterpret_cast(gobject) is needed: + * + * A Thread instance is in fact always a GThread instance. + * Unfortunately, GThread cannot be a member of Thread, + * because it is an opaque struct. Also, the C interface does not provide + * any hooks to install a destroy notification handler, thus we cannot + * wrap it dynamically either. + * + * The cast works because Thread does not have any member data, and + * it is impossible to derive from it. This is ensured by not implementing + * the (private) default constructor. + * This trick is used also in classes declared as _CLASS_OPAQUE_REFCOUNTED. + */ namespace { @@ -31,15 +44,15 @@ static void* call_thread_entry_slot(void* data) try { - // Recreate the specific slot, and drop the reference obtained by create(). + // Recreate the specific slot. (*static_cast*>(slot))(); } - catch(Glib::Threads::Thread::Exit&) + catch (Glib::Threads::Thread::Exit&) { // Just exit from the thread. The Threads::Thread::Exit exception // is our sane C++ replacement of g_thread_exit(). } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -59,30 +72,27 @@ namespace Glib namespace Threads { -/**** Glib::Thread *********************************************************/ +/**** Glib::Threads::Thread ************************************************/ // static Thread* Thread::create(const sigc::slot& slot, const std::string& name) { - // Make a copy of slot on the heap + // Make a copy of slot on the heap. sigc::slot_base *const slot_copy = new sigc::slot(slot); GError* error = 0; - GThread* thread; - - if (name.size() > 0) - thread = g_thread_try_new(name.c_str(), &call_thread_entry_slot, - slot_copy, &error); - else - thread = g_thread_try_new(NULL, &call_thread_entry_slot, - slot_copy, &error); + GThread* thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), + &call_thread_entry_slot, slot_copy, &error); - if(error) + if (error) { delete slot_copy; Glib::Error::throw_exception(error); } - + if (!thread) + { + delete slot_copy; + } return reinterpret_cast(thread); } @@ -100,7 +110,7 @@ Thread* Thread::self() void Thread::join() { - g_thread_join(&gobject_); + g_thread_join(reinterpret_cast(this)); } // static @@ -109,6 +119,15 @@ void Thread::yield() g_thread_yield(); } +GThread* Thread::gobj() +{ + return reinterpret_cast(this); +} + +const GThread* Thread::gobj() const +{ + return reinterpret_cast(this); +} Thread* wrap(GThread* gobject) { @@ -116,7 +135,7 @@ Thread* wrap(GThread* gobject) } -/**** Glib::Mutex **********************************************************/ +/**** Glib::Threads::Mutex *************************************************/ Mutex::Mutex() { @@ -148,7 +167,7 @@ Mutex* wrap(GMutex* gobject) return reinterpret_cast(gobject); } -/**** Glib::RecMutex *******************************************************/ +/**** Glib::Threads::RecMutex **********************************************/ RecMutex::RecMutex() { @@ -180,7 +199,7 @@ RecMutex* wrap(GRecMutex* gobject) return reinterpret_cast(gobject); } -/**** Glib::RWLock ***************************************************/ +/**** Glib::Threads::RWLock ************************************************/ void RWLock::reader_lock() { @@ -212,8 +231,6 @@ void RWLock::writer_unlock() g_rw_lock_writer_unlock(&gobject_); } -/**** Glib::RWLock *********************************************************/ - RWLock::RWLock() { g_rw_lock_init(&gobject_); @@ -225,7 +242,7 @@ RWLock::~RWLock() } -/**** Glib::Cond ***********************************************************/ +/**** Glib::Threads::Cond **************************************************/ Cond::Cond() { diff --git a/glib/src/threads.hg b/glib/src/threads.hg index 52bb4b41..5fa559c6 100644 --- a/glib/src/threads.hg +++ b/glib/src/threads.hg @@ -18,39 +18,17 @@ _DEFS(glibmm,glib) _CONFIGINCLUDE(glibmmconfig.h) - -// We use the (now deprecated) GThread definition in the API, -// and we cannot stop that without breaking ABI. -// (see the comment below), -// so we must temporarily undef G_DISABLE_DEPRECATED when -// including glib.h. - -// Temporarily undef G_DISABLE_DEPRECATED, redefining it later if appropriate. -#if defined(G_DISABLE_DEPRECATED) && !defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED) - -//Stop the deprecation ifdef guards around the API declarations: -#undef G_DISABLE_DEPRECATED - -//Stop the compiler warnings about using the deprecated API; -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 - -#define GLIBMM_G_DISABLE_DEPRECATED_UNDEFED 1 - -#endif +#m4 _PUSH(SECTION_CC_PRE_INCLUDES) +// Don't let glibmm.h include thread.h. Pretend that it's already included. +// glib.h can then be included with G_DISABLE_DEPRECATED defined, and +// the compiler can react if deprecated glib functions are used. +#define _GLIBMM_THREAD_H +#m4 _POP() #include - -// Redefine G_DISABLE_DEPRECATED if it was defined before we temporarily undefed it: -#if defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED) -#define G_DISABLE_DEPRECATED 1 -#undef GLIB_DISABLE_DEPRECATION_WARNINGS -#undef GLIBMM_G_DISABLE_DEPRECATED_UNDEFED -#endif - - #include #include - +#include #include namespace Glib @@ -62,7 +40,7 @@ namespace Threads _GMMPROC_EXTRA_NAMESPACE(Threads) /** @defgroup Threads Threads - * Thread abstraction; including threads, different mutexes, + * %Thread abstraction; including threads, different mutexes, * conditions and thread private data. * @{ */ @@ -74,7 +52,7 @@ class Mutex; class RecMutex; class RWLock; -/** Exception class for thread-related errors. +/** %Exception class for thread-related errors. */ _WRAP_GERROR(ThreadError, GThreadError, G_THREAD_ERROR, NO_GTYPE) @@ -90,8 +68,8 @@ _WRAP_GERROR(ThreadError, GThreadError, G_THREAD_ERROR, NO_GTYPE) * a Threads::Thread::Exit exception, which will be caught by the internal thread * entry function. * - * @note You might have noticed that the thread entry slot doesn't have the - * usual void* return value. If you want to return any data from your thread + * @note The thread entry slot doesn't have the void* return value that a + * GThreadFunc has. If you want to return any data from your thread, * you can pass an additional output argument to the thread's entry slot. */ class Thread @@ -169,12 +147,10 @@ public: */ static void yield(); - GThread* gobj() { return &gobject_; } - const GThread* gobj() const { return &gobject_; } + GThread* gobj(); + const GThread* gobj() const; private: - GThread gobject_; - // Glib::Thread can neither be constructed nor deleted. Thread(); void operator delete(void*, std::size_t); @@ -195,7 +171,13 @@ private: class Thread::Exit {}; -/** @relates Glib::Threads::Thread */ +/** A C++ wrapper for the C object. + * + * @param gobject The C instance. + * @return The C++ wrapper. + * + * @relates Glib::Threads::Thread + */ Thread* wrap(GThread* gobject); /** Represents a mutex (mutual exclusion). @@ -203,8 +185,8 @@ Thread* wrap(GThread* gobject); * Mutex::Lock instead of calling lock() and unlock() directly -- * it will make your life much easier. * - * @note Glib::Mutex is not recursive, i.e. a thread will deadlock, if it - * already has locked the mutex while calling lock(). Use Glib::RecMutex + * @note Glib::Threads::Mutex is not recursive, i.e. a thread will deadlock, if it + * already has locked the mutex while calling lock(). Use Glib::Threads::RecMutex * instead, if you need recursive mutexes. */ class Mutex @@ -251,12 +233,12 @@ private: * @par Usage example: * @code * { - * Glib::Mutex::Lock lock (mutex); // calls mutex.lock() + * Glib::Threads::Mutex::Lock lock(mutex); // calls mutex.lock() * do_something(); * } // the destructor calls mutex.unlock() * @endcode * As you can see, the compiler takes care of the unlocking. This is not - * only exception safe but also much less error-prone. You could even + * only exception-safe but also much less error-prone. You could even * return while still holding the lock and it will be released * properly. */ @@ -319,10 +301,7 @@ private: RecMutex(const RecMutex&); RecMutex& operator=(const RecMutex&); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - // Must be public to allow initialization at compile time. GRecMutex gobject_; -#endif }; /** Utility class for exception-safe locking of recursive mutexes. @@ -396,10 +375,7 @@ private: RWLock(const RWLock&); RWLock& operator=(const RWLock&); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - // Must be public to allow initialization at compile time. GRWLock gobject_; -#endif }; /** Utility class for exception-safe locking of read/write locks. @@ -456,13 +432,13 @@ private: * they can signal the @a Cond, such that the waiting thread is woken up. * @par Usage example: * @code - * Glib::Cond data_cond; - * Glib::Mutex data_mutex; + * Glib::Threads::Cond data_cond; + * Glib::Threads::Mutex data_mutex; * void* current_data = 0; * * void push_data(void* data) * { - * Glib::Mutex::Lock lock (data_mutex); + * Glib::Threads::Mutex::Lock lock(data_mutex); * * current_data = data; * data_cond.signal(); @@ -470,18 +446,18 @@ private: * * void* pop_data() * { - * Glib::Mutex::Lock lock (data_mutex); + * Glib::Threads::Mutex::Lock lock(data_mutex); * * while (!current_data) * data_cond.wait(data_mutex); * - * void *const data = current_data; + * void* const data = current_data; * current_data = 0; * * return data; * } * @endcode -*/ + */ class Cond { public: @@ -491,12 +467,11 @@ public: /** If threads are waiting for this @a Cond, exactly one of them is woken up. * It is good practice to hold the same lock as the waiting thread, while calling * this method, though not required. - * */ void signal(); /** If threads are waiting for this @a Cond, all of them are woken up. - * It is good practice to hold the same lock as the waiting thread, while calling + * It is good practice to hold the same lock as the waiting threads, while calling * this method, though not required. */ void broadcast(); @@ -504,7 +479,7 @@ public: /** Waits until this thread is woken up on this @a Cond. * The mutex is unlocked before falling asleep and locked again before resuming. * - * @param mutex a @a Mutex that is currently locked. + * @param mutex A @a Mutex that is currently locked. * * @note It is important to use the @a wait() and @a wait_until() methods * only inside a loop, which checks for the condition to be true as it is not @@ -515,11 +490,40 @@ public: */ void wait(Mutex& mutex); - /** Waits until this thread is woken up on this @a Cond, but not longer than until the time, that is specified by @a end_time. + /** Waits until this thread is woken up on this @a Cond, but not longer + * than until the time specified by @a end_time. * The mutex is unlocked before falling asleep and locked again before resuming. * - * @param mutex a @a Mutex that is currently locked. - * @param end_time a max time to wait. + * @par Usage example: + * Extending the example presented in the documentation of class Cond. + * @code + * void* pop_data_timed() + * { + * Glib::Threads::Mutex::Lock lock(data_mutex); + * + * // Wait at most 5 seconds. + * const gint64 end_time = g_get_monotonic_time() + 5 * G_TIME_SPAN_SECOND; + * while (!current_data) + * if (!data_cond.wait_until(data_mutex, end_time) + * return 0; // timeout + * + * void* const data = current_data; + * current_data = 0; + * + * return data; + * } + * @endcode + * The end time is calculated once, before entering the loop, and reused. + * This is the motivation behind the use of absolute time. If a relative time + * of 5 seconds were passed directly to the call and a spurious wakeup + * occurred, the program would have to start over waiting again, which would + * lead to a total wait time of more than 5 seconds. + * + * @param mutex A @a Mutex that is currently locked. + * @param end_time The monotonic time to wait until, in microseconds. + * See g_get_monotonic_time(). + * @return true if the condition variable was signalled (or in the case + * of a spurious wakeup), false if @a end_time has passed. * * @note It is important to use the @a wait() and @a wait_until() methods * only inside a loop, which checks for the condition to be true as it is not @@ -544,7 +548,7 @@ private: * * It is recommended that all instances of this class are statically allocated. * The first time an instance is used (get(), set() or replace() is called) - * gtk+ allocates a scarce OS resource that cannot be deallocated. + * glib allocates a scarce OS resource that cannot be deallocated. */ template class Private @@ -606,8 +610,7 @@ private: /* inline implementation */ /***************************************************************************/ - -/**** Glib::Mutex::Lock ****************************************************/ +/**** Glib::Threads::Mutex::Lock *******************************************/ inline Mutex::Lock::Lock(Mutex& mutex) @@ -667,7 +670,7 @@ bool Mutex::Lock::locked() const } -/**** Glib::RecMutex::Lock *************************************************/ +/**** Glib::Threads::RecMutex::Lock ****************************************/ inline RecMutex::Lock::Lock(RecMutex& mutex) @@ -727,7 +730,7 @@ bool RecMutex::Lock::locked() const } -/**** Glib::RWLock::ReaderLock *********************************************/ +/**** Glib::Threads::RWLock::ReaderLock ************************************/ inline RWLock::ReaderLock::ReaderLock(RWLock& rwlock) @@ -787,7 +790,7 @@ bool RWLock::ReaderLock::locked() const } -/**** Glib::RWLock::WriterLock *********************************************/ +/**** Glib::Threads::RWLock::WriterLock ************************************/ inline RWLock::WriterLock::WriterLock(RWLock& rwlock) @@ -846,7 +849,7 @@ bool RWLock::WriterLock::locked() const return locked_; } -/**** Glib::Private ********************************************************/ +/**** Glib::Threads::Private ********************************************/ // static template -- cgit v1.2.1 From 0b8237dd0b77a1e2d031256bacd97e13193039bb Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 3 May 2015 09:58:37 +0200 Subject: Glib::ObjectBase: Don't use std::auto_ptr * glib/glibmm/objectbase.[h|cc]: Use a plain pointer instead of std::auto_ptr. auto_ptr is deprecated in C++11, and can cause compilation warnings. Bug #748630. --- glib/glibmm/objectbase.cc | 5 +---- glib/glibmm/objectbase.h | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc index 140816a4..c7add7fe 100644 --- a/glib/glibmm/objectbase.cc +++ b/glib/glibmm/objectbase.cc @@ -1,6 +1,3 @@ -// -*- c++ -*- -/* $Id$ */ - /* Copyright 2002 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -46,7 +43,7 @@ namespace Glib // static data members ObjectBase::extra_object_base_data_type ObjectBase::extra_object_base_data; -std::auto_ptr ObjectBase::extra_object_base_data_mutex(new Threads::Mutex()); +Threads::Mutex* ObjectBase::extra_object_base_data_mutex = new Threads::Mutex(); ObjectBase::ObjectBase() : diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index a3afd834..fe501dfc 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -29,7 +29,7 @@ #include #include #include // Needed until the next ABI break. -#include // auto_ptr, needed until the next ABI break. +#include // Not used by ObjectBase any more, but user code may rely on it being here. #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GObject GObject; } @@ -209,10 +209,10 @@ typedef std::map extra_object_base_data_ static extra_object_base_data_type extra_object_base_data; // ObjectBase instances may be used in different threads. // Accesses to extra_object_base_data must be thread-safe. -// auto_ptr, because we don't want to include glibmm/threads.h in objectbase.h. +// Threads::Mutex*, because we don't want to include glibmm/threads.h in objectbase.h. // threads.h must be the first included file that includes glib.h. That could cause // problems in files that directly or indirectly include objectbase.h. -static std::auto_ptr extra_object_base_data_mutex; +static Threads::Mutex* extra_object_base_data_mutex; public: // is_derived_() must be public, so that overridden vfuncs and signal handlers can call it via ObjectBase. -- cgit v1.2.1 From 46fcd11eeae90247914499cfd58acdf295679849 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 6 May 2015 09:40:14 +0200 Subject: Gio::Settings: Add connect_changed(). This wraps the strange "somekeyname::changed" signal in GSettings, so we can get notification when a specific key has changed. I would welcome any suggestion to improve this API. --- gio/src/settings.ccg | 15 +++++++++++++++ gio/src/settings.hg | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index d800aa90..8fa08607 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -18,6 +18,7 @@ #include #include #include +#include //For PropertyProxyConnectionNode namespace Gio { @@ -70,4 +71,18 @@ std::vector Settings::list_schemas() } _DEPRECATE_IFDEF_END +sigc::connection Settings::connect_changed(const Glib::ustring& key, const SlotChanged& slot) +{ + // Create a proxy to hold our connection info + // This will be deleted by destroy_notify_handler. + Glib::PropertyProxyConnectionNode* pConnectionNode = new Glib::PropertyProxyConnectionNode(slot, G_OBJECT(gobj())); + + const Glib::ustring signal_name = "changed::" + key; + g_signal_connect_data(gobj(), + signal_name.c_str(), (GCallback)(&Glib::PropertyProxyConnectionNode::callback), pConnectionNode, + &Glib::PropertyProxyConnectionNode::destroy_notify_handler, + G_CONNECT_AFTER); + return sigc::connection(pConnectionNode->slot_); +} + } diff --git a/gio/src/settings.hg b/gio/src/settings.hg index 75407d57..abb50e9c 100644 --- a/gio/src/settings.hg +++ b/gio/src/settings.hg @@ -201,6 +201,19 @@ _DEPRECATE_IFDEF_END //TODO?: _WRAP_PROPERTY("backend", Glib::RefPtr) + /** See connect_changed(). + * @newin{2,46} + */ + typedef sigc::slot SlotChanged; + + /** Connect a callback @a slot to the "changed" signal for the @a key. + * This will be emitted whenever the the value for that key has been changed. + * @result A sigc::connection + * + * @newin{2,46} + */ + sigc::connection connect_changed(const Glib::ustring& key, const SlotChanged& slot); + _WRAP_PROPERTY("delay-apply", bool) _WRAP_PROPERTY("has-unapplied", bool) _WRAP_PROPERTY("path", std::string) -- cgit v1.2.1 From bf404d05281b95083705e073d8fb63e513506dd8 Mon Sep 17 00:00:00 2001 From: Mikhail Titov Date: Wed, 6 May 2015 19:16:15 +0200 Subject: Missing GLIBMM_API for Interface It is used by Gtk::CellLayout and Gtk::TreeViewColumn. Bug #748719. --- glib/glibmm/interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/glibmm/interface.h b/glib/glibmm/interface.h index 06390441..7b453a00 100644 --- a/glib/glibmm/interface.h +++ b/glib/glibmm/interface.h @@ -32,7 +32,7 @@ class Interface_Class; #endif // There is no base GInterface struct in Glib, though there is G_TYPE_INTERFACE enum value. -class Interface : virtual public Glib::ObjectBase +class GLIBMM_API Interface : virtual public Glib::ObjectBase { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS -- cgit v1.2.1 From 2cb905a8d49986ac8e0393f77a76978a07188e90 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 8 May 2015 16:50:04 +0200 Subject: gmmproc: Add support for 'newin "n,m"' in some _WRAP macros * tools/pm/DocsParser.pm: * tools/pm/Enum.pm: * tools/pm/Output.pm: * tools/pm/WrapParser.pm: Add support for the optional 'newin "n,m"' parameter in _WRAP_METHOD, _WRAP_METHOD_DOCS_ONLY, _WRAP_SIGNAL, _WRAP_ENUM, _WRAP_ENUM_DOCS_ONLY and _WRAP_GERRROR. Bug #748856. --- tools/pm/DocsParser.pm | 41 +++++++++++++++++++++++++++++++++-------- tools/pm/Enum.pm | 2 +- tools/pm/Output.pm | 17 ++++++++++------- tools/pm/WrapParser.pm | 46 +++++++++++++++++++++++++++++++--------------- 4 files changed, 75 insertions(+), 31 deletions(-) diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 0e9e66fd..3cfac2d3 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -25,7 +25,7 @@ use XML::Parser; use strict; use warnings; -# use Util; +use Util; use Function; use GtkDefs; use Object; @@ -239,8 +239,9 @@ sub lookup_enum_documentation($$$$) my @subst_in = []; my @subst_out = []; + my $newin = ""; - # Get the substitutions. + # Get the substitutions, and recognize some flags too. foreach(@$ref_flags) { if(/^\s*s#([^#]+)#([^#]*)#\s*$/) @@ -248,6 +249,10 @@ sub lookup_enum_documentation($$$$) push(@subst_in, $1); push(@subst_out, $2); } + elsif(/^\s*newin(.*)/) #If newin is at the start. + { + $newin = string_unquote(string_trim($1)); + } } my $objFunction = $DocsParser::hasharrayFunctions{$c_enum_name}; @@ -293,11 +298,15 @@ sub lookup_enum_documentation($$$$) } } - # Append the enum description docs. - $docs .= "\@enum $cpp_enum_name\n"; - $docs .= $$objFunction{description}; + # Replace @newin in the enum description, but don't in the element descriptions. + my $description = "\@enum $cpp_enum_name\n"; + $description .= $$objFunction{description}; + DocsParser::convert_docs_to_cpp($objFunction, \$description); + DocsParser::replace_or_add_newin(\$description, $newin); + # Append the enum description docs. DocsParser::convert_docs_to_cpp($objFunction, \$docs); + $docs .= "\n\n$description"; DocsParser::add_m4_quotes(\$docs); # Escape the space after "i.e." or "e.g." in the brief description. @@ -312,13 +321,13 @@ sub lookup_enum_documentation($$$$) return $docs; } -# $strCommentBlock lookup_documentation($strFunctionName, $deprecation_docs, $objCppfunc) +# $strCommentBlock lookup_documentation($strFunctionName, $deprecation_docs, $newin, $objCppfunc) # The final objCppfunc parameter is optional. If passed, it is used to # decide if the final C parameter should be omitted if the C++ method # has a slot parameter. -sub lookup_documentation($$;$) +sub lookup_documentation($$$;$) { - my ($functionName, $deprecation_docs, $objCppfunc) = @_; + my ($functionName, $deprecation_docs, $newin, $objCppfunc) = @_; my $objFunction = $DocsParser::hasharrayFunctions{$functionName}; if(!$objFunction) @@ -335,6 +344,7 @@ sub lookup_documentation($$;$) } DocsParser::convert_docs_to_cpp($objFunction, \$text); + DocsParser::replace_or_add_newin(\$text, $newin); # A blank line, marking the end of a paragraph, is needed after @newin. # Most @newins are at the end of a function description. $text .= "\n"; @@ -547,6 +557,21 @@ sub convert_tags_to_doxygen($) } } +# void replace_or_add_newin(\$text, $newin) +# If $newin is not empty, replace the version numbers in an existing @newin +# Doxygen alias, or add one if there is none. +sub replace_or_add_newin($$) +{ + my ($text, $newin) = @_; + + return if ($newin eq ""); + + if (!($$text =~ s/\@newin\{[\d,]+\}/\@newin{$newin}/)) + { + $$text .= "\n\n\@newin{$newin}"; + } +} + # Convert tags to a list of newline-separated elements. sub convert_simplelist($) { diff --git a/tools/pm/Enum.pm b/tools/pm/Enum.pm index 8d0ce774..61840771 100644 --- a/tools/pm/Enum.pm +++ b/tools/pm/Enum.pm @@ -300,7 +300,7 @@ sub build_element_list($$$$) push(@subst_in, $1); push(@subst_out, $2); } - elsif($_ !~ /^\s*$/) + elsif($_ !~ /^\s*(?:newin.*)?$/) # newin or only white space { return undef; } diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 3ae40d5a..dc1fe83f 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -583,11 +583,14 @@ sub output_wrap_create($$$) } } -# void output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppfunc, $signal_name, $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, $exceptionHandler) -# custom_signalproxy_name is "" when no type conversion is required - a normal templates SignalProxy will be used instead. -sub output_wrap_sig_decl($$$$$$$$$$$) +# void output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppfunc, $signal_name, +# $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, +# $newin, $exceptionHandler) +sub output_wrap_sig_decl($$$$$$$$$$$$) { - my ($self, $filename, $line_num, $objCSignal, $objCppfunc, $signal_name, $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, $exceptionHandler) = @_; + my ($self, $filename, $line_num, $objCSignal, $objCppfunc, $signal_name, + $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, + $newin, $exceptionHandler) = @_; # _SIGNAL_PROXY(c_signal_name, c_return_type, `', # cpp_signal_name, cpp_return_type, `',`', @@ -599,8 +602,8 @@ sub output_wrap_sig_decl($$$$$$$$$$$) $underscored_signal_name =~ s/-/_/g; # Get the existing signal documentation from the parsed docs. - my $documentation = - DocsParser::lookup_documentation("$$objCSignal{class}::$underscored_signal_name", $deprecation_docs); + my $documentation = DocsParser::lookup_documentation( + "$$objCSignal{class}::$underscored_signal_name", $deprecation_docs, $newin); # Create a merged Doxygen comment block for the signal from the looked up # docs (the block will also contain a prototype of the slot as an example). @@ -713,7 +716,7 @@ sub output_wrap_enum_docs_only($$$$$$$) } # Include the enum docs in the module's enum docs group. - $enum_docs .= "\n * \@ingroup ${module_canonical}Enums\n"; + $enum_docs .= "\n *\n * \@ingroup ${module_canonical}Enums"; # Merge the passed in comment to the existing enum documentation. $comment = "/** " . $comment . "\n * " . $enum_docs . "\n */\n"; diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm index 2e29d4da..56dbf458 100644 --- a/tools/pm/WrapParser.pm +++ b/tools/pm/WrapParser.pm @@ -702,11 +702,12 @@ sub extract_bracketed_text($) ######################################## ### breaks up a string by commas (smart) -# @strings string_split_commas($string) -sub string_split_commas($) +# @strings string_split_commas($string [, $ignore_quotes]) +sub string_split_commas($;$) { - my ($in) = @_; + my ($in, $ignore_quotes) = @_; + $ignore_quotes = 2 unless defined $ignore_quotes; my @out; my $level = 0; my $in_braces = 0; @@ -720,10 +721,10 @@ sub string_split_commas($) next if ($t eq ""); - # TODO: Delete the test for scalar(@out) >= 2 when we can stop accepting + # TODO: Delete the test for scalar(@out) >= $ignore_quotes when we can stop accepting # .hg files with unpaired quotes, such as _WRAP_PROPERTY("text_column, int). # See also TODO in extract_bracketed_text(). - $in_quotes = !$in_quotes if ($t eq '"' and scalar(@out) >= 2); + $in_quotes = !$in_quotes if ($t eq '"' and scalar(@out) >= $ignore_quotes); if (!$in_quotes) { $in_braces++ if ($t eq "{"); @@ -950,6 +951,7 @@ sub on_wrap_method($) $$objCfunc{constversion} = 0; $$objCfunc{deprecated} = ""; my $deprecation_docs = ""; + my $newin = ""; my $ifdef; while($#args >= 2) # If the optional ref/err/deprecated arguments are there. { @@ -976,6 +978,10 @@ sub on_wrap_method($) $deprecation_docs = string_unquote(string_trim($1)); } } + elsif($argRef =~ /^newin(.*)/) #If newin is at the start. + { + $newin = string_unquote(string_trim($1)); + } elsif($argRef =~ /^ifdef(.*)/) #If ifdef is at the start. { $ifdef = $1; @@ -1008,7 +1014,7 @@ sub on_wrap_method($) else { $commentblock = DocsParser::lookup_documentation($argCFunctionName, - $deprecation_docs, $objCppfunc); + $deprecation_docs, $newin, $objCppfunc); } $objOutputter->output_wrap_meth($filename, $line_num, $objCppfunc, $objCfunc, $argCppMethodDecl, $commentblock, $ifdef); @@ -1026,7 +1032,7 @@ sub on_wrap_method_docs_only($) my $line_num = $$self{line_num}; my $str = $self->extract_bracketed_text(); - my @args = string_split_commas($str); + my @args = string_split_commas($str, 1); my $entity_type = "method"; @@ -1057,8 +1063,8 @@ sub on_wrap_method_docs_only($) } } - # Extra ref needed? $$objCfunc{throw_any_errors} = 0; + my $newin = ""; while($#args >= 1) # If the optional ref/err arguments are there. { my $argRef = string_trim(pop @args); @@ -1066,11 +1072,14 @@ sub on_wrap_method_docs_only($) { $$objCfunc{throw_any_errors} = 1; } + elsif($argRef =~ /^newin(.*)/) #If newin is at the start. + { + $newin = string_unquote(string_trim($1)); + } } my $commentblock = ""; - $commentblock = DocsParser::lookup_documentation($argCFunctionName, ""); - + $commentblock = DocsParser::lookup_documentation($argCFunctionName, "", $newin); $objOutputter->output_wrap_meth_docs_only($filename, $line_num, $commentblock); } @@ -1227,6 +1236,7 @@ sub on_wrap_signal($$) my $ifdef; my $argDeprecated = ""; my $deprecation_docs = ""; + my $newin = ""; my $exceptionHandler = ""; while($#args >= 2) # If optional arguments are there. @@ -1262,6 +1272,11 @@ sub on_wrap_signal($$) } } + elsif($argRef =~ /^newin(.*)/) #If newin is at the start. + { + $newin = string_unquote(string_trim($1)); + } + elsif($argRef =~ /^ifdef(.*)/) #If ifdef is at the start. { $ifdef = $1; @@ -1275,7 +1290,8 @@ sub on_wrap_signal($$) $self->output_wrap_signal($argCppDecl, $argCName, $$self{filename}, $$self{line_num}, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, - $bRefreturn, $ifdef, $commentblock, $argDeprecated, $deprecation_docs, $exceptionHandler); + $bRefreturn, $ifdef, $commentblock, $argDeprecated, $deprecation_docs, + $newin, $exceptionHandler); } # void on_wrap_vfunc() @@ -1541,12 +1557,12 @@ sub output_wrap_check($$$$$$) # void output_wrap($CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, # $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, -# $commentblock, $deprecated, $deprecation_docs, $exceptionHandler) -sub output_wrap_signal($$$$$$$$$$$$) +# $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler) +sub output_wrap_signal($$$$$$$$$$$$$$) { my ($self, $CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, - $commentblock, $deprecated, $deprecation_docs, $exceptionHandler) = @_; + $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler) = @_; #Some checks: return if ($self->output_wrap_check($CppDecl, $signal_name, @@ -1580,7 +1596,7 @@ sub output_wrap_signal($$$$$$$$$$$$) $objOutputter->output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppSignal, $signal_name, $bCustomCCallback, $ifdef, $commentblock, - $deprecated, $deprecation_docs, $exceptionHandler); + $deprecated, $deprecation_docs, $newin, $exceptionHandler); if($bNoDefaultHandler eq 0) { -- cgit v1.2.1 From a8efa7b87439692568c93e82ae086fa78f63a896 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 8 May 2015 16:50:55 +0200 Subject: Fix the version numbers in some @newin Doxygen commands * gio/src/application.hg: * gio/src/dbusintrospection.hg: * gio/src/memoryinputstream.hg: * gio/src/networkmonitor.hg: * gio/src/notification.hg: * gio/src/resource.hg: * gio/src/tcpwrapperconnection.hg: * glib/src/binding.hg: * glib/src/variant.hg: Correct the version numbers in some @newin commands by adding 'newin "2,n"' parameters to _WRAP_xxx macros. Bug #748856. --- gio/src/application.hg | 5 +++-- gio/src/dbusintrospection.hg | 6 ++---- gio/src/memoryinputstream.hg | 4 +--- gio/src/networkmonitor.hg | 12 ++++++------ gio/src/notification.hg | 4 ++-- gio/src/resource.hg | 26 +++++++++++++------------- gio/src/tcpwrapperconnection.hg | 2 +- glib/src/binding.hg | 16 ++++++++-------- glib/src/variant.hg | 4 ++-- 9 files changed, 38 insertions(+), 41 deletions(-) diff --git a/gio/src/application.hg b/gio/src/application.hg index f2b1e662..9cccc2e5 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -160,11 +160,12 @@ public: _WRAP_METHOD(ApplicationFlags get_flags() const, g_application_get_flags) _WRAP_METHOD(void set_flags(ApplicationFlags flags), g_application_set_flags) - _WRAP_METHOD(std::string get_resource_base_path() const, g_application_get_resource_base_path) - _WRAP_METHOD(void set_resource_base_path(const std::string& resource_path), g_application_set_resource_base_path) + _WRAP_METHOD(std::string get_resource_base_path() const, g_application_get_resource_base_path, newin "2,44") + _WRAP_METHOD(void set_resource_base_path(const std::string& resource_path), g_application_set_resource_base_path, newin "2,44") /** Disable automatic resource loading functionality. * See set_resource_base_path(). + * @newin{2,44} */ void unset_resource_base_path(); diff --git a/gio/src/dbusintrospection.hg b/gio/src/dbusintrospection.hg index 419c4242..442415a7 100644 --- a/gio/src/dbusintrospection.hg +++ b/gio/src/dbusintrospection.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -119,8 +117,8 @@ public: _WRAP_METHOD(Glib::RefPtr lookup_property(const Glib::ustring& name), g_dbus_interface_info_lookup_property, refreturn) _WRAP_METHOD(Glib::RefPtr lookup_property(const Glib::ustring& name) const, g_dbus_interface_info_lookup_property, constversion, refreturn) - _WRAP_METHOD(void cache_build(), g_dbus_interface_info_cache_build) - _WRAP_METHOD(void cache_release(), g_dbus_interface_info_cache_release) + _WRAP_METHOD(void cache_build(), g_dbus_interface_info_cache_build, newin "2,44") + _WRAP_METHOD(void cache_release(), g_dbus_interface_info_cache_release, newin "2,44") //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_interface_info_generate_xml) }; diff --git a/gio/src/memoryinputstream.hg b/gio/src/memoryinputstream.hg index 3b836750..0d519599 100644 --- a/gio/src/memoryinputstream.hg +++ b/gio/src/memoryinputstream.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -88,7 +86,7 @@ _DEPRECATE_IFDEF_END */ void add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot); - _WRAP_METHOD(void add_bytes(const Glib::RefPtr& bytes), g_memory_input_stream_add_bytes) + _WRAP_METHOD(void add_bytes(const Glib::RefPtr& bytes), g_memory_input_stream_add_bytes, newin "2,44") }; } // namespace Gio diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg index 4c6ee89d..8441f8ea 100644 --- a/gio/src/networkmonitor.hg +++ b/gio/src/networkmonitor.hg @@ -37,28 +37,28 @@ _WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE) /** TODO * - * @newin{2,42} + * @newin{2,44} */ class NetworkMonitor : public Glib::Interface { _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface) public: - _WRAP_METHOD(static Glib::RefPtr get_default(), g_network_monitor_get_default) + _WRAP_METHOD(static Glib::RefPtr get_default(), g_network_monitor_get_default, newin "2,44") - _WRAP_METHOD(bool get_network_available() const, g_network_monitor_get_network_available) + _WRAP_METHOD(bool get_network_available() const, g_network_monitor_get_network_available, newin "2,44") _WRAP_METHOD(NetworkConnectivity get_connectivity() const, g_network_monitor_get_connectivity) - _WRAP_METHOD(bool can_reach(const Glib::RefPtr& connectable, const Glib::RefPtr& cancellable{?}), g_network_monitor_can_reach, errthrow) + _WRAP_METHOD(bool can_reach(const Glib::RefPtr& connectable, const Glib::RefPtr& cancellable{?}), g_network_monitor_can_reach, errthrow, newin "2,44") //TODO: void can_reach_async(const Glib::RefPtr& connectable, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable); _IGNORE(g_network_monitor_can_reach_async) - _WRAP_METHOD(bool can_reach_finish(const Glib::RefPtr& result), g_network_monitor_can_reach_finish, errthrow) + _WRAP_METHOD(bool can_reach_finish(const Glib::RefPtr& result), g_network_monitor_can_reach_finish, errthrow, newin "2,44") - _WRAP_SIGNAL(void network_changed(bool available), "network-changed") + _WRAP_SIGNAL(void network_changed(bool available), "network-changed", newin "2,44") //TODO: Wrap vfuncs? diff --git a/gio/src/notification.hg b/gio/src/notification.hg index f9361923..cd5ec921 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -30,7 +30,7 @@ namespace Gio { class Icon; -_WRAP_ENUM(NotificationPriority, GNotificationPriority) +_WRAP_ENUM(NotificationPriority, GNotificationPriority, newin "2,44") /** User Notifications (pop up messages). * @@ -75,7 +75,7 @@ public: _WRAP_METHOD(void set_body(const Glib::ustring& body), g_notification_set_body) _WRAP_METHOD(void set_icon(const Glib::RefPtr& icon), g_notification_set_icon) _WRAP_METHOD(void set_urgent(bool urgent = true), g_notification_set_urgent, deprecated "Use set_priority() instead.") - _WRAP_METHOD(void set_priority(NotificationPriority priority = NOTIFICATION_PRIORITY_NORMAL), g_notification_set_priority) + _WRAP_METHOD(void set_priority(NotificationPriority priority = NOTIFICATION_PRIORITY_NORMAL), g_notification_set_priority, newin "2,44") _WRAP_METHOD(void add_button(const Glib::ustring& label, const Glib::ustring& detailed_action), g_notification_add_button) diff --git a/gio/src/resource.hg b/gio/src/resource.hg index dbb289ee..730e221d 100644 --- a/gio/src/resource.hg +++ b/gio/src/resource.hg @@ -33,10 +33,10 @@ namespace Gio /** Exception class for resource file handling errors. */ -_WRAP_GERROR(ResourceError, GResourceError, G_RESOURCE_ERROR, NO_GTYPE) +_WRAP_GERROR(ResourceError, GResourceError, G_RESOURCE_ERROR, NO_GTYPE, newin "2,34") -_WRAP_ENUM(ResourceFlags, GResourceFlags) -_WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags) +_WRAP_ENUM(ResourceFlags, GResourceFlags, newin "2,44") +_WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags, newin "2,44") /** %Resource framework. * @@ -134,13 +134,13 @@ class Resource _IGNORE(g_resource_ref, g_resource_unref) public: - _WRAP_METHOD(static Glib::RefPtr create_from_data(const Glib::RefPtr& data), g_resource_new_from_data, errthrow) - _WRAP_METHOD(static Glib::RefPtr create_from_file(const std::string& filename), g_resource_load, errthrow) - _WRAP_METHOD(Glib::RefPtr open_stream(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_open_stream, errthrow) - _WRAP_METHOD(Glib::RefPtr lookup_data(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow) + _WRAP_METHOD(static Glib::RefPtr create_from_data(const Glib::RefPtr& data), g_resource_new_from_data, errthrow, newin "2,44") + _WRAP_METHOD(static Glib::RefPtr create_from_file(const std::string& filename), g_resource_load, errthrow, newin "2,44") + _WRAP_METHOD(Glib::RefPtr open_stream(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_open_stream, errthrow, newin "2,44") + _WRAP_METHOD(Glib::RefPtr lookup_data(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow, newin "2,44") #m4 _CONVERSION(`char**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') - _WRAP_METHOD(std::vector enumerate_children(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow) + _WRAP_METHOD(std::vector enumerate_children(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow, newin "2,44") /** Looks for a file at the specified @a path in the resource and * if found returns information about it. @@ -184,11 +184,11 @@ public: bool get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const; // 'register' is a keyword. Can't be the name of a method. - _WRAP_METHOD(void register_global(), g_resources_register) - _WRAP_METHOD(void unregister_global(), g_resources_unregister) - _WRAP_METHOD(static Glib::RefPtr open_stream_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_open_stream, errthrow) - _WRAP_METHOD(static Glib::RefPtr lookup_data_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_lookup_data, errthrow) - _WRAP_METHOD(static std::vector enumerate_children_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow) + _WRAP_METHOD(void register_global(), g_resources_register, newin "2,44") + _WRAP_METHOD(void unregister_global(), g_resources_unregister, newin "2,44") + _WRAP_METHOD(static Glib::RefPtr open_stream_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_open_stream, errthrow, newin "2,44") + _WRAP_METHOD(static Glib::RefPtr lookup_data_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_lookup_data, errthrow, newin "2,44") + _WRAP_METHOD(static std::vector enumerate_children_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow, newin "2,44") /** Looks for a file at the specified @a path in the set of * globally registered resources and if found returns information about it. diff --git a/gio/src/tcpwrapperconnection.hg b/gio/src/tcpwrapperconnection.hg index 1e1a943a..9a9a8fd8 100644 --- a/gio/src/tcpwrapperconnection.hg +++ b/gio/src/tcpwrapperconnection.hg @@ -31,7 +31,7 @@ namespace Gio * always return a Gio::SocketConnection, even when the connection it has * actually created is not directly a Gio::SocketConnection. * - * @newin{2,34} + * @newin{2,44} * @ingroup NetworkIO */ class TcpWrapperConnection : public Gio::TcpConnection diff --git a/glib/src/binding.hg b/glib/src/binding.hg index 7308f85c..4a7eb2a0 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -24,7 +24,7 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Glib { -_WRAP_ENUM(BindingFlags, GBindingFlags) +_WRAP_ENUM(BindingFlags, GBindingFlags, newin "2,44") /** Bind two object properties. * @@ -354,13 +354,13 @@ public: slot_transform_from.empty() ? SlotTransform() : TransformProp(slot_transform_from)); } - _WRAP_METHOD(Glib::RefPtr get_source(), g_binding_get_source, refreturn) - _WRAP_METHOD(Glib::RefPtr get_source() const, g_binding_get_source, refreturn, constversion) - _WRAP_METHOD(Glib::ustring get_source_property() const, g_binding_get_source_property) - _WRAP_METHOD(Glib::RefPtr get_target(), g_binding_get_target, refreturn) - _WRAP_METHOD(Glib::RefPtr get_target() const, g_binding_get_target, refreturn, constversion) - _WRAP_METHOD(Glib::ustring get_target_property() const, g_binding_get_target_property) - _WRAP_METHOD(BindingFlags get_flags() const, g_binding_get_flags) + _WRAP_METHOD(Glib::RefPtr get_source(), g_binding_get_source, refreturn, newin "2,44") + _WRAP_METHOD(Glib::RefPtr get_source() const, g_binding_get_source, refreturn, constversion, newin "2,44") + _WRAP_METHOD(Glib::ustring get_source_property() const, g_binding_get_source_property, newin "2,44") + _WRAP_METHOD(Glib::RefPtr get_target(), g_binding_get_target, refreturn, newin "2,44") + _WRAP_METHOD(Glib::RefPtr get_target() const, g_binding_get_target, refreturn, constversion, newin "2,44") + _WRAP_METHOD(Glib::ustring get_target_property() const, g_binding_get_target_property, newin "2,44") + _WRAP_METHOD(BindingFlags get_flags() const, g_binding_get_flags, newin "2,44") /** Explicitly releases the binding between the source and the target * property expressed by this Binding instance. diff --git a/glib/src/variant.hg b/glib/src/variant.hg index 604b195f..b92d825a 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -135,8 +135,8 @@ public: _WRAP_METHOD(gsize get_size() const, g_variant_get_size) _WRAP_METHOD(gconstpointer get_data(), g_variant_get_data, deprecated "Use the const version instead.") - _WRAP_METHOD(gconstpointer get_data() const, g_variant_get_data) - _WRAP_METHOD(Glib::RefPtr get_data_as_bytes() const, g_variant_get_data_as_bytes) + _WRAP_METHOD(gconstpointer get_data() const, g_variant_get_data, newin "2,46") + _WRAP_METHOD(Glib::RefPtr get_data_as_bytes() const, g_variant_get_data_as_bytes, newin "2,46") _WRAP_METHOD(void store(gpointer data) const, g_variant_store) _WRAP_METHOD(Glib::ustring print(bool type_annotate = false) const, g_variant_print) -- cgit v1.2.1 From cdefbff0c3f61e45e9a25a81341d979f7956bf65 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 21 May 2015 08:29:04 +0200 Subject: gmmproc: _WRAP_SIGNAL: Fix the exception_handler parameter * tools/m4/signal.m4: Fix the exception_handler parameter. It was added as a result of bug #735132, but the code was enough changed after it was copied from vfunc.m4. --- tools/m4/signal.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index 34d0f225..1e0ddb0e 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -68,7 +68,7 @@ ifelse(`$2',void,`dnl } catch(...) { -ifelse($15, `', `dnl +ifelse($12, `', `dnl Glib::exception_handlers_invoke`'(); ', `dnl try @@ -231,12 +231,12 @@ ifelse($4,void,`dnl } catch(...) { -ifelse($15, `', `dnl +ifelse($11, `', `dnl Glib::exception_handlers_invoke`'(); ', `dnl try { - return _CONVERT($3, $4, `obj->$15`'()'); + return _CONVERT($3, $4, `obj->$11`'()'); } catch(...) { -- cgit v1.2.1 From 79a172fc184cbc167d58197a3e8eaf3641614ef2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 23 May 2015 08:18:20 +0200 Subject: Add Glib::SignalProxyDetailed * glib/glibmm/signalproxy.cc: * glib/src/signalproxy.h.m4: Add SignalProxyDetailed and SignalProxyDetailed[0-6]. Bug #749034. --- glib/glibmm/signalproxy.cc | 43 ++++++++++++++++--- glib/src/signalproxy.h.m4 | 103 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 118 insertions(+), 28 deletions(-) diff --git a/glib/glibmm/signalproxy.cc b/glib/glibmm/signalproxy.cc index e218ba9a..41ee5f70 100644 --- a/glib/glibmm/signalproxy.cc +++ b/glib/glibmm/signalproxy.cc @@ -1,7 +1,3 @@ -// -*- c++ -*- - -/* $Id$ */ - /* signalproxy.cc * * Copyright (C) 2002 The gtkmm Development Team @@ -101,5 +97,42 @@ void SignalProxyNormal::slot0_void_callback(GObject* self, void* data) } } -} // namespace Glib +// SignalProxyDetailed implementation: + +SignalProxyDetailed::SignalProxyDetailed(Glib::ObjectBase* obj, + const SignalProxyInfo* info, const Glib::ustring& detail_name) +: + SignalProxyBase (obj), + info_ (info), + detailed_name_ (Glib::ustring(info->signal_name) + + (detail_name.empty() ? Glib::ustring() : ("::" + detail_name))) +{} + +SignalProxyDetailed::~SignalProxyDetailed() +{} + +sigc::slot_base& +SignalProxyDetailed::connect_impl_(bool notify, const sigc::slot_base& slot, bool after) +{ + // create a proxy to hold our connection info + SignalProxyConnectionNode *const pConnectionNode = + new SignalProxyConnectionNode(slot, obj_->gobj()); + + // connect it to glib + // pConnectionNode will be passed in the data argument to the callback. + pConnectionNode->connection_id_ = g_signal_connect_data( + obj_->gobj(), detailed_name_.c_str(), + notify ? info_->notify_callback : info_->callback, + pConnectionNode, &SignalProxyConnectionNode::destroy_notify_handler, + static_cast(after ? G_CONNECT_AFTER : 0)); + + return pConnectionNode->slot_; +} + +void SignalProxyDetailed::emission_stop() +{ + g_signal_stop_emission_by_name(obj_->gobj(), detailed_name_.c_str()); +} + +} // namespace Glib diff --git a/glib/src/signalproxy.h.m4 b/glib/src/signalproxy.h.m4 index 69db201d..a95d5974 100644 --- a/glib/src/signalproxy.h.m4 +++ b/glib/src/signalproxy.h.m4 @@ -1,5 +1,3 @@ -// -*- c++ -*- -dnl dnl Glib SignalProxy Templates dnl dnl Copyright 2001 Free Software Foundation @@ -19,7 +17,6 @@ dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl -dnl Ignore the next line /* This is a generated file, do not edit. Generated from __file__ */ include(template.macros.m4) #ifndef __header__ @@ -33,7 +30,7 @@ extern "C" #include #include - +#include namespace Glib { @@ -52,7 +49,7 @@ struct SignalProxyInfo #endif //DOXYGEN_SHOULD_SKIP_THIS -// This base class is used by SignalProxyNormal and SignalProxyProperty. +// This base class is used by SignalProxyNormal, SignalProxyDetailed and SignalProxyProperty. class SignalProxyBase { public: @@ -76,7 +73,7 @@ private: }; -// shared portion of a Signal +// Shared portion of a Signal without detail /** The SignalProxy provides an API similar to sigc::signal that can be used to * connect sigc::slots to glib signals. * @@ -84,6 +81,8 @@ private: * which might emit it. Actually, proxies are controlled by * the template derivatives, which serve as gatekeepers for the * types allowed on a particular signal. + * + * For signals with a detailed name (signal_name::detail_name) see SignalProxyDetailed. */ class SignalProxyNormal : public SignalProxyBase { @@ -136,27 +135,77 @@ private: SignalProxyNormal& operator=(const SignalProxyNormal&); }; +// Shared portion of a Signal with detail +/** The SignalProxy provides an API similar to sigc::signal that can be used to + * connect sigc::slots to glib signals. + * + * This holds the name of the glib signal, including the detail name if any, + * and the object which might emit it. Actually, proxies are controlled by + * the template derivatives, which serve as gatekeepers for the + * types allowed on a particular signal. + */ +class SignalProxyDetailed : public SignalProxyBase +{ +public: + ~SignalProxyDetailed(); + + /// Stops the current signal emission (not in libsigc++) + void emission_stop(); + +protected: + + /** Creates a proxy for a signal that can be emitted by @a obj. + * @param obj The object that can emit the signal. + * @param info Information about the signal, including its name + * and the C callbacks that should be called by glib. + * @param detail_name The detail name, if any. + */ + SignalProxyDetailed(Glib::ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name); + + /** Connects a signal handler to a signal. + * This is called by connect() and connect_notify() in derived SignalProxy classes. + * + * @param notify Whether this method is called by connect_notify() or by connect(). + * @param slot The signal handler, usually created with sigc::mem_fun() or sigc::ptr_fun(). + * @param after Whether this signal handler should be called before or after the default signal handler. + */ + sigc::slot_base& connect_impl_(bool notify, const sigc::slot_base& slot, bool after); + +private: + const SignalProxyInfo* info_; // Pointer to statically allocated structure. + const Glib::ustring detailed_name_; // signal_name[[::detail_name]]dnl one pair of [] in the generated .h file + + + // no copy assignment + SignalProxyDetailed& operator=(const SignalProxyDetailed&); +}; + dnl -dnl GLIB_SIGNAL_PROXY([P1, P2, ...],return type) +dnl GLIB_SIGNAL_PROXY([P1, P2, ...], Normal or Detailed) dnl define([GLIB_SIGNAL_PROXY],[dnl LINE(]__line__[)dnl -/**** Glib::[SignalProxy]NUM($1) ***************************************************/ +/**** Glib::[SignalProxy]ifelse($2,Normal,,$2)[]NUM($1) ***************************************************/ -/** Proxy for signals with NUM($1) arguments. +/** Proxy for signals with NUM($1) arguments[]ifelse($2,Normal,,[ and possibly a detailed name]). * Use the connect() or connect_notify() method, with sigc::mem_fun() or sigc::ptr_fun() * to connect signal handlers to signals. */ template -class [SignalProxy]NUM($1) : public SignalProxyNormal +class [SignalProxy]ifelse($2,Normal,,$2)[]NUM($1) : public SignalProxy$2 { public: typedef sigc::slot SlotType; typedef sigc::slot VoidSlotType; - [SignalProxy]NUM($1)(ObjectBase* obj, const SignalProxyInfo* info) +ifelse($2,Normal,dnl + [SignalProxy]NUM($1)[(ObjectBase* obj, const SignalProxyInfo* info) : SignalProxyNormal(obj, info) {} +],dnl Detailed + [SignalProxyDetailed]NUM($1)[(ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name) + : SignalProxyDetailed(obj, info, detail_name) {} +])dnl /** Connects a signal handler to a signal. * @@ -166,7 +215,7 @@ public: * @param after Whether this signal handler should be called before or after the default signal handler. */ sigc::connection connect(const SlotType& slot, bool after = true) - { return sigc::connection(connect_(slot, after)); } + { return sigc::connection(ifelse($2,Normal,[connect_(slot, after)],[connect_impl_(false, slot, after)])); } /** Connects a signal handler without a return value to a signal. * By default, the signal handler will be called before the default signal handler. @@ -190,20 +239,28 @@ public: * @param after Whether this signal handler should be called before or after the default signal handler. */ sigc::connection connect_notify(const VoidSlotType& slot, bool after = false) - { return sigc::connection(connect_notify_(slot, after)); } + { return sigc::connection(ifelse($2,Normal,[connect_notify_(slot, after)],[connect_impl_(true, slot, after)])); } }; ])dnl - +dnl dnl Template forms of SignalProxy - -GLIB_SIGNAL_PROXY(ARGS(P,0)) -GLIB_SIGNAL_PROXY(ARGS(P,1)) -GLIB_SIGNAL_PROXY(ARGS(P,2)) -GLIB_SIGNAL_PROXY(ARGS(P,3)) -GLIB_SIGNAL_PROXY(ARGS(P,4)) -GLIB_SIGNAL_PROXY(ARGS(P,5)) -GLIB_SIGNAL_PROXY(ARGS(P,6)) - +dnl +GLIB_SIGNAL_PROXY(ARGS(P,0), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,1), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,2), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,3), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,4), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,5), Normal) +GLIB_SIGNAL_PROXY(ARGS(P,6), Normal) +dnl +GLIB_SIGNAL_PROXY(ARGS(P,0), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,1), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,2), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,3), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,4), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,5), Detailed) +GLIB_SIGNAL_PROXY(ARGS(P,6), Detailed) +dnl } // namespace Glib #endif /* __header__ */ -- cgit v1.2.1 From 47897b6ea1804cc0cf2235cefa44a3cdbf23ab03 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 23 May 2015 08:19:47 +0200 Subject: gmmproc: _WRAP_SIGNAL: Add support for detail_name * tools/m4/signal.m4: * tools/pm/Output.pm: * tools/pm/WrapParser.pm: Add support for optional 'detail_name $name' and 'two_signal_methods' parameter in _WRAP_SIGNAL. Bug #749034. --- tools/m4/signal.m4 | 34 +++++++++++++++++++++++++++++++++- tools/pm/Output.pm | 12 +++++++----- tools/pm/WrapParser.pm | 46 ++++++++++++++++++++++++++++------------------ 3 files changed, 68 insertions(+), 24 deletions(-) diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index 1e0ddb0e..cb8cdf0b 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -13,15 +13,29 @@ dnl $8 = `custom_c_callback (boolean)', dnl $9 = `deprecated' (boolean), dnl $10 = `refdoc_comment', dnl $11 = ifdef, -dnl $12 = exceptionHandler) +dnl $12 = exceptionHandler, +dnl $13 = detail_name, +dnl $14 = two_signal_methods (boolean)) define(`_SIGNAL_PROXY',` ifelse(`$11',,,`#ifdef $11' )dnl ifelse(`$9',,,`_DEPRECATE_IFDEF_START ')dnl +ifelse($13,,`dnl no detail_name $10 Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > signal_$4`'(); +',dnl detail_name +$14,0,`dnl +$10 + Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13 = Glib::ustring()); +',`dnl detail_name and two_signal_methods +$10 + Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > signal_$4`'(); + +$10 + Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13); +')dnl end detail_name ifelse(`$9',,,`_DEPRECATE_IFDEF_END ')dnl ifelse(`$11',,,`#endif // $11 @@ -146,10 +160,28 @@ ifelse(`$11',,,`#ifdef $11' )dnl ifelse(`$9',,,`_DEPRECATE_IFDEF_START ')dnl +ifelse($13,,`dnl no detail_name +Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'() +{ + return Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info); +} +',dnl detail_name +$14,0,`dnl +Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13) +{ + return Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13); +} +',`dnl detail_name and two_signal_methods Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'() { return Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info); } + +Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13) +{ + return Glib::SignalProxyDetailed`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13); +} +')dnl end detail_name ifelse(`$9',,,`_DEPRECATE_IFDEF_END ')dnl ifelse(`$11',,,`#endif // $11 diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index dc1fe83f..e145489b 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -585,12 +585,12 @@ sub output_wrap_create($$$) # void output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppfunc, $signal_name, # $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, -# $newin, $exceptionHandler) -sub output_wrap_sig_decl($$$$$$$$$$$$) +# $newin, $exceptionHandler, $detail_name, $bTwoSignalMethods) +sub output_wrap_sig_decl($$$$$$$$$$$$$$) { my ($self, $filename, $line_num, $objCSignal, $objCppfunc, $signal_name, $bCustomCCallback, $ifdef, $commentblock, $deprecated, $deprecation_docs, - $newin, $exceptionHandler) = @_; + $newin, $exceptionHandler, $detail_name, $bTwoSignalMethods) = @_; # _SIGNAL_PROXY(c_signal_name, c_return_type, `', # cpp_signal_name, cpp_return_type, `',`', @@ -637,7 +637,7 @@ sub output_wrap_sig_decl($$$$$$$$$$$$) my $conversions = convert_args_c_to_cpp($objCSignal, $objCppfunc, $line_num); - my $str = sprintf("_SIGNAL_PROXY(%s,%s,\`%s\',%s,%s,\`%s\',\`%s\',\`%s\',%s,\`%s\',%s,%s)dnl\n", + my $str = sprintf("_SIGNAL_PROXY(%s,%s,\`%s\',%s,%s,\`%s\',\`%s\',\`%s\',%s,\`%s\',%s,%s,%s,%s)dnl\n", $signal_name, $$objCSignal{rettype}, $objCSignal->args_types_and_names_without_object(), @@ -649,7 +649,9 @@ sub output_wrap_sig_decl($$$$$$$$$$$$) $deprecated, $doxycomment, $ifdef, - $exceptionHandler + $exceptionHandler, + $detail_name, # If a detailed name is supported (signal_name::detail_name) + $bTwoSignalMethods # If separate signal_xxx() methods for detailed and general name. ); $self->append($str); diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm index 56dbf458..f14ad575 100644 --- a/tools/pm/WrapParser.pm +++ b/tools/pm/WrapParser.pm @@ -1233,11 +1233,13 @@ sub on_wrap_signal($$) my $bNoDefaultHandler = 0; my $bCustomCCallback = 0; my $bRefreturn = 0; - my $ifdef; + my $ifdef = ""; my $argDeprecated = ""; my $deprecation_docs = ""; my $newin = ""; my $exceptionHandler = ""; + my $detail_name = ""; + my $bTwoSignalMethods = 0; while($#args >= 2) # If optional arguments are there. { @@ -1246,23 +1248,19 @@ sub on_wrap_signal($$) { $bCustomDefaultHandler = 1; } - - if($argRef eq "no_default_handler") + elsif($argRef eq "no_default_handler") { $bNoDefaultHandler = 1; } - - if($argRef eq "custom_c_callback") + elsif($argRef eq "custom_c_callback") { $bCustomCCallback = 1; } - - if($argRef eq "refreturn") + elsif($argRef eq "refreturn") { $bRefreturn = 1; } - - if($argRef =~ /^deprecated(.*)/) #If deprecated is at the start. + elsif($argRef =~ /^deprecated(.*)/) #If deprecated is at the start. { $argDeprecated = "deprecated"; @@ -1271,27 +1269,36 @@ sub on_wrap_signal($$) $deprecation_docs = string_unquote(string_trim($1)); } } - elsif($argRef =~ /^newin(.*)/) #If newin is at the start. { $newin = string_unquote(string_trim($1)); } - elsif($argRef =~ /^ifdef(.*)/) #If ifdef is at the start. { $ifdef = $1; } - elsif($argRef =~ /^exception_handler\s+(.*)/) #If exception_handler at the start. { - $exceptionHandler = $1; + $exceptionHandler = $1; + } + elsif($argRef =~ /^detail_name\s+(.+)/) #If detail_name at the start. + { + $detail_name = $1; + } + elsif($argRef eq "two_signal_methods") + { + $bTwoSignalMethods = 1; + } + else + { + $self->error("_WRAP_SIGNAL: Invalid option '$argRef'.\n"); } } $self->output_wrap_signal($argCppDecl, $argCName, $$self{filename}, $$self{line_num}, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, $commentblock, $argDeprecated, $deprecation_docs, - $newin, $exceptionHandler); + $newin, $exceptionHandler, $detail_name, $bTwoSignalMethods); } # void on_wrap_vfunc() @@ -1557,12 +1564,14 @@ sub output_wrap_check($$$$$$) # void output_wrap($CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, # $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, -# $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler) -sub output_wrap_signal($$$$$$$$$$$$$$) +# $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler, +# $detail_name, $bTwoSignalMethods) +sub output_wrap_signal($$$$$$$$$$$$$$$$$) { my ($self, $CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, - $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler) = @_; + $commentblock, $deprecated, $deprecation_docs, $newin, $exceptionHandler, + $detail_name, $bTwoSignalMethods) = @_; #Some checks: return if ($self->output_wrap_check($CppDecl, $signal_name, @@ -1596,7 +1605,8 @@ sub output_wrap_signal($$$$$$$$$$$$$$) $objOutputter->output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppSignal, $signal_name, $bCustomCCallback, $ifdef, $commentblock, - $deprecated, $deprecation_docs, $newin, $exceptionHandler); + $deprecated, $deprecation_docs, $newin, $exceptionHandler, + $detail_name, $bTwoSignalMethods); if($bNoDefaultHandler eq 0) { -- cgit v1.2.1 From d2a6547a99b8d63d7d20e16fb268910fab4e69b8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 23 May 2015 08:52:42 +0200 Subject: Gio::Settings: Replace connect_changed() by signal_changed(key) * gio/src/settings.[hg|ccg]: Add signal_changed(key). Remove connect_changed(). * examples/settings/settings.cc: Test signal_changed(key). Bug #749034. --- examples/settings/settings.cc | 14 ++++++++++++++ gio/src/settings.ccg | 15 --------------- gio/src/settings.hg | 16 ++-------------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/examples/settings/settings.cc b/examples/settings/settings.cc index b7ce0ca5..bbf1c19c 100644 --- a/examples/settings/settings.cc +++ b/examples/settings/settings.cc @@ -50,6 +50,18 @@ static void on_key_changed(const Glib::ustring& key, const Glib::RefPtrsignal_changed().connect(sigc::bind(sigc::ptr_fun(&on_key_changed), settings)); + settings->signal_changed("").connect(sigc::ptr_fun(&on_key_changed_all)); + settings->signal_changed(INT_KEY).connect(sigc::ptr_fun(&on_key_changed_int)); std::cout << Glib::ustring::compose("Initial value of '%1': '%2'\n", STRING_KEY, settings->get_string(STRING_KEY)); diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index 8fa08607..d800aa90 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -18,7 +18,6 @@ #include #include #include -#include //For PropertyProxyConnectionNode namespace Gio { @@ -71,18 +70,4 @@ std::vector Settings::list_schemas() } _DEPRECATE_IFDEF_END -sigc::connection Settings::connect_changed(const Glib::ustring& key, const SlotChanged& slot) -{ - // Create a proxy to hold our connection info - // This will be deleted by destroy_notify_handler. - Glib::PropertyProxyConnectionNode* pConnectionNode = new Glib::PropertyProxyConnectionNode(slot, G_OBJECT(gobj())); - - const Glib::ustring signal_name = "changed::" + key; - g_signal_connect_data(gobj(), - signal_name.c_str(), (GCallback)(&Glib::PropertyProxyConnectionNode::callback), pConnectionNode, - &Glib::PropertyProxyConnectionNode::destroy_notify_handler, - G_CONNECT_AFTER); - return sigc::connection(pConnectionNode->slot_); -} - } diff --git a/gio/src/settings.hg b/gio/src/settings.hg index abb50e9c..43036192 100644 --- a/gio/src/settings.hg +++ b/gio/src/settings.hg @@ -201,19 +201,6 @@ _DEPRECATE_IFDEF_END //TODO?: _WRAP_PROPERTY("backend", Glib::RefPtr) - /** See connect_changed(). - * @newin{2,46} - */ - typedef sigc::slot SlotChanged; - - /** Connect a callback @a slot to the "changed" signal for the @a key. - * This will be emitted whenever the the value for that key has been changed. - * @result A sigc::connection - * - * @newin{2,46} - */ - sigc::connection connect_changed(const Glib::ustring& key, const SlotChanged& slot); - _WRAP_PROPERTY("delay-apply", bool) _WRAP_PROPERTY("has-unapplied", bool) _WRAP_PROPERTY("path", std::string) @@ -224,8 +211,9 @@ _DEPRECATE_IFDEF_END //TODO?: _WRAP_SIGNAL(bool change_event(const Glib::ArrayHandle& keys, int n_keys), "change-event") + //TODO: Remove two_signal_methods when we can break ABI. #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING) - _WRAP_SIGNAL(void changed(const Glib::ustring& key), "changed") + _WRAP_SIGNAL(void changed(const Glib::ustring& key), "changed", detail_name key, two_signal_methods) _WRAP_SIGNAL(bool writable_change_event(guint key), "writable-change-event") _WRAP_SIGNAL(void writable_changed(const Glib::ustring& key), writable_changed) -- cgit v1.2.1 From b3ef51a00d009cfa38e53c96f4023e7712e5206f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 23 May 2015 09:05:09 +0200 Subject: Gio::Settings: Don't use the deprecated "schema" property * gio/src/settings.[hg|ccg]: Replace the deprecated "schema" property by "schema_id" in constructors. --- gio/src/settings.hg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gio/src/settings.hg b/gio/src/settings.hg index 43036192..e87c0b3a 100644 --- a/gio/src/settings.hg +++ b/gio/src/settings.hg @@ -47,16 +47,16 @@ class Settings : public Glib::Object _CLASS_GOBJECT(Settings, GSettings, G_SETTINGS, Glib::Object, GObject) protected: - _WRAP_CTOR(Settings(const Glib::ustring& schema), g_settings_new) - _WRAP_CTOR(Settings(const Glib::ustring& schema, const Glib::ustring& path), g_settings_new_with_path) - //TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::ustring& schema, const Glib::RefPtr& backend), g_settings_new_with_backend) - //TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::ustring& schema, const Glib::RefPtr& backend, const Glib::ustring& path), g_settings_new_with_backend_and_path) + _WRAP_CTOR(Settings(const Glib::ustring& schema_id), g_settings_new) + _WRAP_CTOR(Settings(const Glib::ustring& schema_id, const Glib::ustring& path), g_settings_new_with_path) + //TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::ustring& schema_id, const Glib::RefPtr& backend), g_settings_new_with_backend) + //TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::ustring& schema_id, const Glib::RefPtr& backend, const Glib::ustring& path), g_settings_new_with_backend_and_path) public: - _WRAP_CREATE(const Glib::ustring& schema) - _WRAP_CREATE(const Glib::ustring& schema, const Glib::ustring& path) - //TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema, const Glib::RefPtr& backend) - //TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema, const Glib::RefPtr& backend, const Glib::ustring& path) + _WRAP_CREATE(const Glib::ustring& schema_id) + _WRAP_CREATE(const Glib::ustring& schema_id, const Glib::ustring& path) + //TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema_id, const Glib::RefPtr& backend) + //TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema_id, const Glib::RefPtr& backend, const Glib::ustring& path) //TODO: Rename these to get/set_*_value_variant() and add templated get/set_*_value() methods as elsewhere? _WRAP_METHOD(bool set_value(const Glib::ustring& key, const Glib::VariantBase& value), g_settings_set_value) -- cgit v1.2.1 From 139edfe4ed773f127b7e271f2b1f2d614ad1f916 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 09:17:42 +0200 Subject: docextract_to_xml.py: Distinguish sections from properties * tools/defs_gen/docextract.py: * tools/defs_gen/docextract_to_xml.py: Don't treat sections as properties. Add the --with-sections command-line option. Generate
tags. --- tools/defs_gen/docextract.py | 13 ++++++++++--- tools/defs_gen/docextract_to_xml.py | 26 ++++++++++++++++---------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/tools/defs_gen/docextract.py b/tools/defs_gen/docextract.py index 7bf49119..f794ef8c 100644 --- a/tools/defs_gen/docextract.py +++ b/tools/defs_gen/docextract.py @@ -65,6 +65,7 @@ function_name_pattern = re.compile(r'^([a-z]\w*)\s*:?(\s*\(.*\)\s*){0,2}\s*$') signal_name_pattern = re.compile(r'^([A-Z]\w+::[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') property_name_pattern = re.compile(r'^([A-Z]\w+:[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') enum_name_pattern = re.compile(r'^([A-Z]\w+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') +section_name_pattern = re.compile(r'^SECTION:([a-z0-9_-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') return_pattern = re.compile(r'^@?(returns:|return\s+value:)(.*\n?)$', re.IGNORECASE) deprecated_pattern = re.compile(r'^(deprecated\s*:\s*.*\n?)$', re.IGNORECASE) rename_to_pattern = re.compile(r'^(rename\s+to)\s*:\s*(.*\n?)$', re.IGNORECASE) @@ -77,9 +78,13 @@ annotation_lead_pattern = re.compile(r'^\s*\(\s*(.*?)\s*\)\s*') # These patterns determine the identifier of the current comment block. They # are grouped in a list for easy determination of block identifiers (in -# skip_to_identifier). The function_name_pattern should be tested for last -# because it always matches signal and property identifiers. -identifier_patterns = [ signal_name_pattern, property_name_pattern, enum_name_pattern, function_name_pattern ] +# skip_to_identifier). +# The function_name_pattern shall be tested for last, because it always matches +# signal and property identifiers. +# The property_name_pattern shall be tested for after the section_name_pattern, +# because the property_name_pattern matches most section identifiers. +identifier_patterns = [ signal_name_pattern, section_name_pattern, + property_name_pattern, enum_name_pattern, function_name_pattern ] # This pattern is to match return sections that forget to have a colon (':') # after the initial 'Return' phrase. It is not included by default in the list @@ -195,6 +200,8 @@ def skip_to_identifier(fp, line, cur_doc): # Set the GtkDoc type. if pattern == signal_name_pattern: cur_doc.set_type('signal') + elif pattern == section_name_pattern: + cur_doc.set_type('section') elif pattern == property_name_pattern: cur_doc.set_type('property') elif pattern == enum_name_pattern: diff --git a/tools/defs_gen/docextract_to_xml.py b/tools/defs_gen/docextract_to_xml.py index 4222250a..00c4f8ce 100755 --- a/tools/defs_gen/docextract_to_xml.py +++ b/tools/defs_gen/docextract_to_xml.py @@ -14,8 +14,8 @@ import docextract def usage(): sys.stderr.write('usage: docextract_to_xml.py ' + - '[-s /src/dir | --source-dir=/src/dir] ' + - '[-a | --with-annotations] [-p | --with-properties] ' + + '[-s /src/dir | --source-dir=/src/dir] [-a | --with-annotations] ' + + '[-p | --with-properties] [-c | --with-sections] ' + '[-n | --no-since] [-i | --no-signals ] [-e | --no-enums ]\n') sys.exit(1) @@ -61,10 +61,10 @@ def print_annotations(annotations): if __name__ == '__main__': try: - opts, args = getopt.getopt(sys.argv[1:], "d:s:o:apnie", + opts, args = getopt.getopt(sys.argv[1:], "d:s:o:apcnie", ["source-dir=", "with-annotations", - "with-properties", "no-since", - "no-signals", "no-enums"]) + "with-properties", "with-sections", + "no-since", "no-signals", "no-enums"]) except getopt.error as e: sys.stderr.write('docextract_to_xml.py: %s\n' % e) usage() @@ -72,6 +72,7 @@ if __name__ == '__main__': with_annotations = False with_signals = True with_properties = False + with_sections = False with_enums = True for opt, arg in opts: if opt in ('-s', '--source-dir'): @@ -80,6 +81,8 @@ if __name__ == '__main__': with_annotations = True if opt in ('-p', '--with-properties'): with_properties = True + if opt in ('-c', '--with-sections'): + with_sections = True if opt in ('-n', '--no-since'): docextract.no_since = True if opt in ('-i', '--no-signals'): @@ -99,8 +102,8 @@ if __name__ == '__main__': print("") for name, value in sorted(docs.items()): - # Get the type of comment block ('function', 'signal' or - # 'property') (the value is a GtkDoc). + # Get the type of comment block ('function', 'signal', + # 'property', 'section' or 'enum') (the value is a GtkDoc). block_type = value.get_type() # Skip signals if the option was not specified. @@ -109,6 +112,9 @@ if __name__ == '__main__': # Likewise for properties. elif block_type == 'property' and not with_properties: continue + # Likewise for sections. + elif block_type == 'section' and not with_sections: + continue # Likewise for enums. elif block_type == 'enum' and not with_enums: continue @@ -133,9 +139,9 @@ if __name__ == '__main__': print("") - if block_type != 'property' and block_type != 'enum': - # Show the return-type (also if not dealing with a property or - # enum): + if block_type not in ('property', 'section', 'enum'): + # Show the return-type if not dealing with a property, section + # or enum: if with_annotations: print("") print("" + escape_text(value.ret[0]) + \ -- cgit v1.2.1 From 46e2b79fc1fbcb724b1633988e6e976105218523 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 09:19:24 +0200 Subject: gmmproc: Fetch property docs from the docs.xml file, if available there * tools/pm/DocsParser.pm: Read info from tags. * tools/pm/Output.pm: output_wrap_any_property(): Handle 'newin' option. Read documentation from DocsParser, if available there, else (like before) from the Property object. * tools/pm/Property.pm: get_docs(): Handle 'newin' option. * tools/pm/WrapParser.pm: on_wrap_any_property(): Add support for the 'newin "m,n"' option in _WRAP_PROPERTY and _WRAP_CHILD_PROPERTY. --- tools/pm/DocsParser.pm | 18 ++++++++++------ tools/pm/Output.pm | 56 ++++++++++++++++++++++++++++++++++++++++++-------- tools/pm/Property.pm | 10 +++++++-- tools/pm/WrapParser.pm | 20 +++++++++++++----- 4 files changed, 83 insertions(+), 21 deletions(-) diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 3cfac2d3..726ada2f 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -112,18 +112,19 @@ sub parse_on_start($$%) $tag = lc($tag); - if($tag eq "function" or $tag eq "signal" or $tag eq "enum") + if($tag eq "function" or $tag eq "signal" or $tag eq "property" or $tag eq "enum") { if(defined $DocsParser::objCurrentFunction) { $objParser->xpcroak( - "\nClose a function, signal or enum tag before you open another one."); + "\nClose a function, signal, property or enum tag before you open another one."); } my $functionName = $attr{name}; - # Change signal name from Class::a-signal-name to Class::a_signal_name. - $functionName =~ s/-/_/g if($tag eq "signal"); + # Change signal name from Class::a-signal-name to Class::a_signal_name + # and property name from Class:a-property-name to Class:a_property_name + $functionName =~ s/-/_/g if ($tag eq "signal" or $tag eq "property"); #Reuse existing Function, if it exists: #(For instance, if this is the override parse) @@ -195,7 +196,7 @@ sub parse_on_end($$) $tag = lc($tag); - if($tag eq "function" or $tag eq "signal" or $tag eq "enum") + if($tag eq "function" or $tag eq "signal" or $tag eq "property" or $tag eq "enum") { # Store the Function structure in the array: my $functionName = $$DocsParser::objCurrentFunction{name}; @@ -349,7 +350,8 @@ sub lookup_documentation($$$;$) # Most @newins are at the end of a function description. $text .= "\n"; - #Add note about deprecation if we have specified that in our _WRAP_METHOD() call: + # Add note about deprecation if we have specified that in our _WRAP_METHOD(), + # _WRAP_SIGNAL(), _WRAP_PROPERTY() or _WRAP_CHILD_PROPERTY() call: if($deprecation_docs ne "") { $text .= "\n\@deprecated $deprecation_docs\n"; @@ -357,6 +359,10 @@ sub lookup_documentation($$$;$) DocsParser::append_parameter_docs($objFunction, \$text, $objCppfunc); DocsParser::append_return_docs($objFunction, \$text); + + # Remove leading and trailing white space. + $text = string_trim($text); + DocsParser::add_m4_quotes(\$text); # Escape the space after "i.e." or "e.g." in the brief description. diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index e145489b..099a1e46 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -778,7 +778,8 @@ sub output_wrap_gerror($$$$$$$) # void output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs, $objProperty, $proxy_macro) sub output_wrap_any_property($$$$$$$$$$) { - my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs, $objProperty, $proxy_macro) = @_; + my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, + $deprecation_docs, $newin, $objProperty, $proxy_macro) = @_; my $objDefsParser = $$self{objDefsParser}; @@ -810,9 +811,44 @@ sub output_wrap_any_property($$$$$$$$$$) my $name_underscored = $name; $name_underscored =~ tr/-/_/; - # Get the property documentation, if any, and add m4 quotes. - my $documentation = $objProperty->get_docs($deprecation_docs); - add_m4_quotes(\$documentation) if ($documentation ne ""); + # Get the existing property documentation, if any, from the parsed docs. + my $documentation = DocsParser::lookup_documentation( + "$$objProperty{class}:$name_underscored", $deprecation_docs, $newin); + + if ($documentation ne "") + { + # Remove leading "/**" and trailing "*/". They will be added by the m4 macro. + $documentation =~ s/^\s*\/\*\*\s*//; + $documentation =~ s/\s*\*\/\s*$//; + } + + if ($documentation =~ /^`?[*\s]* + (?: + \@newin\{[\d,]+\} + |[Ss]ince[:\h]+\d+\.\d+ + |\@deprecated\s + |[Dd]eprecated[:\s] + )/x) + { + # The documentation begins with a "@newin", "Since", "@deprecated" or + # "Deprecated" line. Get documentation also from the Property object, + # but don't add another @newin or @deprecated. + my $objdoc = $objProperty->get_docs("", ""); + if ($objdoc ne "") + { + add_m4_quotes(\$objdoc); + $documentation = "$objdoc\n *\n * $documentation"; + } + } + elsif ($documentation eq "") + { + # Try to get the (usually short) documentation from the Property object. + $documentation = $objProperty->get_docs($deprecation_docs, $newin); + if ($documentation ne "") + { + add_m4_quotes(\$documentation); + } + } #Declaration: if($deprecated ne "") @@ -856,7 +892,8 @@ sub output_wrap_any_property($$$$$$$$$$) # void output_wrap_property($filename, $line_num, $name, $cpp_type, $deprecated, $deprecation_docs) sub output_wrap_property($$$$$$$$) { - my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs) = @_; + my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, + $deprecation_docs, $newin) = @_; my $objProperty = GtkDefs::lookup_property($c_class, $name); if($objProperty eq 0) #If the lookup failed: @@ -865,7 +902,8 @@ sub output_wrap_property($$$$$$$$) } else { - $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs, $objProperty, "_PROPERTY_PROXY"); + $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class, + $deprecated, $deprecation_docs, $newin, $objProperty, "_PROPERTY_PROXY"); } } @@ -873,7 +911,8 @@ sub output_wrap_property($$$$$$$$) # void output_wrap_child_property($filename, $line_num, $name, $cpp_type, $deprecated, $deprecation_docs) sub output_wrap_child_property($$$$$$$$) { - my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs) = @_; + my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated, + $deprecation_docs, $newin) = @_; my $objChildProperty = GtkDefs::lookup_child_property($c_class, $name); if($objChildProperty eq 0) #If the lookup failed: @@ -882,7 +921,8 @@ sub output_wrap_child_property($$$$$$$$) } else { - $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class, $deprecated, $deprecation_docs, $objChildProperty, "_CHILD_PROPERTY_PROXY"); + $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class, + $deprecated, $deprecation_docs, $newin, $objChildProperty, "_CHILD_PROPERTY_PROXY"); } } diff --git a/tools/pm/Property.pm b/tools/pm/Property.pm index f89140ea..8e2a131f 100644 --- a/tools/pm/Property.pm +++ b/tools/pm/Property.pm @@ -112,15 +112,21 @@ sub get_writable($) sub get_docs($$) { - my ($self, $deprecation_docs) = @_; + my ($self, $deprecation_docs, $newin) = @_; my $text = $$self{docs}; - #Add note about deprecation if we have specified that in our _WRAP_METHOD() call: + #Add note about deprecation if we have specified that in our _WRAP_PROPERTY() + #or_WRAP_CHILD_PROPERTY() call: if($deprecation_docs ne "") { $text .= "\n * \@deprecated $deprecation_docs"; } + if ($newin ne "") + { + $text .= "\n *\n * \@newin{$newin}"; + } + return $text; } diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm index f14ad575..b33ecb13 100644 --- a/tools/pm/WrapParser.pm +++ b/tools/pm/WrapParser.pm @@ -1501,6 +1501,7 @@ sub on_wrap_any_property($) #TODO: Reduce duplication with on_wrap_method(): my $argDeprecated = ""; my $deprecation_docs = ""; + my $newin = ""; while($#args >= 2) # If the optional arguments are there. { my $argRef = string_trim(pop @args); @@ -1514,9 +1515,14 @@ sub on_wrap_any_property($) $deprecation_docs = string_unquote(string_trim($1)); } } + elsif($argRef =~ /^newin(.*)/) #If newin is at the start. + { + $newin = string_unquote(string_trim($1)); + } } - return ($filename, $line_num, $argPropertyName, $argCppType, $argDeprecated, $deprecation_docs); + return ($filename, $line_num, $argPropertyName, $argCppType, + $argDeprecated, $deprecation_docs, $newin); } sub on_wrap_property($) @@ -1526,9 +1532,11 @@ sub on_wrap_property($) return unless ($self->check_for_eof()); - my ($filename, $line_num, $argPropertyName, $argCppType, $argDeprecated, $deprecation_docs) = $self->on_wrap_any_property(); + my ($filename, $line_num, $argPropertyName, $argCppType, $argDeprecated, + $deprecation_docs, $newin) = $self->on_wrap_any_property(); - $objOutputter->output_wrap_property($filename, $line_num, $argPropertyName, $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs); + $objOutputter->output_wrap_property($filename, $line_num, $argPropertyName, + $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs, $newin); } sub on_wrap_child_property($) @@ -1538,9 +1546,11 @@ sub on_wrap_child_property($) return unless ($self->check_for_eof()); - my ($filename, $line_num, $argPropertyName, $argCppType, $argDeprecated, $deprecation_docs) = $self->on_wrap_any_property(); + my ($filename, $line_num, $argPropertyName, $argCppType, $argDeprecated, + $deprecation_docs, $newin) = $self->on_wrap_any_property(); - $objOutputter->output_wrap_child_property($filename, $line_num, $argPropertyName, $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs); + $objOutputter->output_wrap_child_property($filename, $line_num, $argPropertyName, + $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs, $newin); } sub output_wrap_check($$$$$$) -- cgit v1.2.1 From 328e06fc54c63351b3ca6ec9859fe0e16927aa22 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 09:21:35 +0200 Subject: Regenerate docs.xml files, including property documentation * tools/gen_scripts/gio_generate_docs.sh: * tools/gen_scripts/glib_generate_docs.sh: Add the --with-properties option to the call to docextract_to_xml.py. * gio/src/gio_docs.xml: * gio/src/glib_docs.xml: Regenerate with property documentation. --- gio/src/gio_docs.xml | 2552 +++++++++++++++++++++++++++++-- glib/src/glib_docs.xml | 560 ++++--- tools/gen_scripts/gio_generate_docs.sh | 1 + tools/gen_scripts/glib_generate_docs.sh | 1 + 4 files changed, 2825 insertions(+), 289 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 5ac0ae3f..6bf2b38a 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -53,6 +53,59 @@ Since: 2.30 + + +Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Bar">"Bar"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + +Since: 2.36 + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Foo">"Foo"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + +Since: 2.30 + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Mood">"Mood"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + +Since: 2.30 + + + + + + +The #ExampleAnimal instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + +Since: 2.30 + + + + + + +The #ExampleCat instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method. @@ -413,6 +466,276 @@ On the service-side, this signal can be used with e.g. g_signal_emit_by_name() t + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.aay">"aay"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ag">"ag"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ao">"ao"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.as">"as"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ay">"ay"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.b">"b"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.d">"d"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.FinallyNormalName">"FinallyNormalName"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.g">"g"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.i">"i"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.n">"n"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.o">"o"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.q">"q"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ReadonlyProperty">"ReadonlyProperty"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.s">"s"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.t">"t"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.u">"u"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ag">"unset_ag"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ao">"unset_ao"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_as">"unset_as"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ay">"unset_ay"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_d">"unset_d"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_g">"unset_g"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_i">"unset_i"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_o">"unset_o"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_s">"unset_s"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_struct">"unset_struct"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.WriteonlyProperty">"WriteonlyProperty"</link>. + +Since the D-Bus property for this #GObject property is writable but not readable, it is meaningful to write to it on both the client- and service-side. It is only meaningful, however, to read from it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.x">"x"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.y">"y"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar-Frobnicator.RandomMethod">RandomMethod()</link> D-Bus method. @@ -505,6 +828,42 @@ If a signal handler returns %TRUE, it means the signal handler will handle the i + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_ay">"force_ay"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_i">"force_i"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_s">"force_s"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_struct">"force_struct"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.AddedSignalIn10">"AddedSignalIn10"</link> is received. @@ -1055,6 +1414,15 @@ On the service-side, this signal can be used with e.g. g_signal_emit_by_name() t + + +Represents the D-Bus property <link linkend="gdbus-property-com-acme-Coyote.Mood">"Mood"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-FDPassing.HelloFD">HelloFD()</link> D-Bus method. @@ -1161,6 +1529,60 @@ If a signal handler returns %TRUE, it means the signal handler will handle the i + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.BazProperty">"BazProperty"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.FancyProperty">"FancyProperty"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property2">"Property2"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property3">"Property3"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property4">"Property4"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property5">"Property5"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-MethodThreads.GetSelf">GetSelf()</link> D-Bus method. @@ -1183,6 +1605,170 @@ If a signal handler returns %TRUE, it means the signal handler will handle the i + + +Represents the D-Bus property <link linkend="gdbus-property-Naming.Type">"Type"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +The #FooiGenAuthorize instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenBar instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenBarFrobnicator instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenBat instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenBaz instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenChangingInterfaceV1 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenChangingInterfaceV10 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenChangingInterfaceV2 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenComAcmeCoyote instance corresponding to the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenFDPassing instance corresponding to the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenInlineDocs instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenMethodThreads instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenNaming instance corresponding to the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenOldieInterface instance corresponding to the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + +Deprecated: The D-Bus interface has been deprecated. + + + + + + +The #FooiGenRocket123 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenTesTuglyCASEInterface instance corresponding to the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + + + +The #FooiGenUnknownXmlTags instance corresponding to the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link>, if any. + +Connect to the #GObject::notify signal to get informed of property changes. + + + + On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-OldieInterface.Bar">"Bar"</link> is received. @@ -1225,6 +1811,17 @@ Deprecated: The D-Bus method has been deprecated. + + +Represents the D-Bus property <link linkend="gdbus-property-OldieInterface.Bat">"Bat"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + +Deprecated: The D-Bus property has been deprecated. + + + + On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-acme-Rocket.Exploded">"Exploded"</link> is received. @@ -1263,6 +1860,33 @@ If a signal handler returns %TRUE, it means the signal handler will handle the i + + +Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Direction">"Direction"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Speed">"Speed"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + + + +Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Type">"Type"</link>. + +Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-TestUglyCaseInterface.GetiSCSIServers">GetiSCSIServers()</link> D-Bus method. @@ -1301,6 +1925,15 @@ On the service-side, this signal can be used with e.g. g_signal_emit_by_name() t + + +Represents the D-Bus property <link linkend="gdbus-property-TestUglyCaseInterface.UGLYNAME">"UGLYNAME"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-UnknownXmlTags.CanSetTimezone">CanSetTimezone()</link> D-Bus method. @@ -1339,6 +1972,67 @@ On the service-side, this signal can be used with e.g. g_signal_emit_by_name() t + + +Represents the D-Bus property <link linkend="gdbus-property-UnknownXmlTags.SomeProperty">"SomeProperty"</link>. + +Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. + + + + + + +If @action is currently enabled. + +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. + +Since: 2.28 + + + + + + +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GActionGroup. It is immutable. + +Since: 2.28 + + + + + + +The type of the parameter that must be given when activating the +action. This is immutable, and may be %NULL if no parameter is needed when +activating the action. + +Since: 2.28 + + + + + + +The state of the action, or %NULL if the action is stateless. + +Since: 2.28 + + + + + + +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. This is immutable. + +Since: 2.28 + + + + Signals that a new action was just added to the group. @@ -1678,6 +2372,16 @@ after registration. See g_application_register(). + + +Whether the application is currently marked as busy through +g_application_mark_busy() or g_application_bind_busy_property(). + +Since: 2.44 + + + + Flags used to define the behaviour of a #GApplication. @@ -1842,6 +2546,13 @@ Since: 2.26 + + +The bytes containing the icon. + + + + Emitted when the operation has been cancelled. @@ -1991,6 +2702,17 @@ Since: 2.26 + + +If authenticating as a server, this property contains the +received credentials, if any. + +If authenticating as a client, the property contains the +credentials that were sent, if any. + + + + Emitted to check if @mechanism is allowed to be used. @@ -2121,6 +2843,123 @@ remote peer closed its end of the connection + + +A D-Bus address specifying potential endpoints that can be used +when establishing the connection. + +Since: 2.26 + + + + + + +A #GDBusAuthObserver object to assist in the authentication process or %NULL. + +Since: 2.26 + + + + + + +Flags from the #GDBusCapabilityFlags enumeration +representing connection features negotiated with the other peer. + +Since: 2.26 + + + + + + +A boolean specifying whether the connection has been closed. + +Since: 2.26 + + + + + + +A boolean specifying whether the process will be terminated (by +calling `raise(SIGTERM)`) if the connection is closed by the +remote peer. + +Note that #GDBusConnection objects returned by g_bus_get_finish() +and g_bus_get_sync() will (usually) have this property set to %TRUE. + +Since: 2.26 + + + + + + +Flags from the #GDBusConnectionFlags enumeration. + +Since: 2.26 + + + + + + +The GUID of the peer performing the role of server when +authenticating. + +If you are constructing a #GDBusConnection and pass +%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the +#GDBusConnection:flags property then you MUST also set this +property to a valid guid. + +If you are constructing a #GDBusConnection and pass +%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the +#GDBusConnection:flags property you will be able to read the GUID +of the other peer here after the connection has been successfully +initialized. + +Since: 2.26 + + + + + + +A boolean specifying whether the message is locked. + +Since: 2.26 + + + + + + +The underlying #GIOStream used for I/O. + +If this is passed on construction and is a #GSocketConnection, +then the corresponding #GSocket will be put into non-blocking mode. + +While the #GDBusConnection is active, it will interact with this +stream from a worker thread, so it is not safe to interact with +the stream directly. + +Since: 2.26 + + + + + + +The unique name as assigned by the message bus or %NULL if the +connection is not open or not a message bus connection. + +Since: 2.26 + + + + Flags used when creating a new #GDBusConnection. @@ -2460,6 +3299,15 @@ Since: 2.30 + + +Flags from the #GDBusInterfaceSkeletonFlags enumeration. + +Since: 2.30 + + + + Flags describing the behavior of a #GDBusInterfaceSkeleton instance. @@ -2826,6 +3674,93 @@ Since: 2.30 + + +If this property is not %G_BUS_TYPE_NONE, then +#GDBusObjectManagerClient:connection must be %NULL and will be set to the +#GDBusConnection obtained by calling g_bus_get() with the value +of this property. + +Since: 2.30 + + + + + + +The #GDBusConnection to use. + +Since: 2.30 + + + + + + +Flags from the #GDBusObjectManagerClientFlags enumeration. + +Since: 2.30 + + + + + + +A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data. + +Since: 2.30 + + + + + + +The #GDBusProxyTypeFunc to use when determining what #GType to +use for interface proxies or %NULL. + +Since: 2.30 + + + + + + +The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func. + +Since: 2.30 + + + + + + +The well-known name or unique name that the manager is for. + +Since: 2.30 + + + + + + +The unique name that owns #GDBusObjectManagerClient:name or %NULL if +no-one is currently owning the name. Connect to the +#GObject::notify signal to track changes to this property. + +Since: 2.30 + + + + + + +The object path the manager is for. + +Since: 2.30 + + + + Flags used when constructing a #GDBusObjectManagerClient. @@ -2848,6 +3783,42 @@ be used in managers for well-known names. + + +The #GDBusConnection to export objects on. + +Since: 2.30 + + + + + + +The object path to register the manager object at. + +Since: 2.30 + + + + + + +The connection of the proxy. + +Since: 2.30 + + + + + + +The object path of the proxy. + +Since: 2.30 + + + + Emitted when a method is invoked by a remote caller and used to @@ -2881,6 +3852,15 @@ Since: 2.30 + + +The object path where the object is exported. + +Since: 2.30 + + + + Flags describing the access control of a D-Bus property. @@ -2967,6 +3947,122 @@ Since: 2.26 + + +If this property is not %G_BUS_TYPE_NONE, then +#GDBusProxy:g-connection must be %NULL and will be set to the +#GDBusConnection obtained by calling g_bus_get() with the value +of this property. + +Since: 2.26 + + + + + + +The #GDBusConnection the proxy is for. + +Since: 2.26 + + + + + + +The timeout to use if -1 (specifying default timeout) is passed +as @timeout_msec in the g_dbus_proxy_call() and +g_dbus_proxy_call_sync() functions. + +This allows applications to set a proxy-wide timeout for all +remote method invocations on the proxy. If this property is -1, +the default timeout (typically 25 seconds) is used. If set to +%G_MAXINT, then no timeout is used. + +Since: 2.26 + + + + + + +Flags from the #GDBusProxyFlags enumeration. + +Since: 2.26 + + + + + + +Ensure that interactions with this proxy conform to the given +interface. This is mainly to ensure that malformed data received +from the other peer is ignored. The given #GDBusInterfaceInfo is +said to be the "expected interface". + +The checks performed are: +- When completing a method call, if the type signature of +the reply message isn't what's expected, the reply is +discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT. + +- Received signals that have a type signature mismatch are dropped and +a warning is logged via g_warning(). + +- Properties received via the initial `GetAll()` call or via the +`::PropertiesChanged` signal (on the +[org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties) +interface) or set using g_dbus_proxy_set_cached_property() +with a type signature mismatch are ignored and a warning is +logged via g_warning(). + +Note that these checks are never done on methods, signals and +properties that are not referenced in the given +#GDBusInterfaceInfo, since extending a D-Bus interface on the +service-side is not considered an ABI break. + +Since: 2.26 + + + + + + +The D-Bus interface name the proxy is for. + +Since: 2.26 + + + + + + +The well-known or unique name that the proxy is for. + +Since: 2.26 + + + + + + +The unique name that owns #GDBusProxy:g-name or %NULL if no-one +currently owns that name. You may connect to #GObject::notify signal to +track changes to this property. + +Since: 2.26 + + + + + + +The object path the proxy is for. + +Since: 2.26 + + + + Flags used when constructing an instance of a #GDBusProxy derived class. @@ -3071,6 +4167,60 @@ run. + + +Whether the server is currently active. + +Since: 2.26 + + + + + + +The D-Bus address to listen on. + +Since: 2.26 + + + + + + +A #GDBusAuthObserver object to assist in the authentication process or %NULL. + +Since: 2.26 + + + + + + +The D-Bus address that clients can use. + +Since: 2.26 + + + + + + +Flags from the #GDBusServerFlags enumeration. + +Since: 2.26 + + + + + + +The guid of the server. + +Since: 2.26 + + + + Flags used when creating a #GDBusServer. @@ -3150,6 +4300,31 @@ to dynamically spawn objects in the subtree. + + +Determines the byte ordering that is used when writing +multi-byte entities (such as integers) to the stream. + + + + + + +The ::byte-order property determines the byte ordering that +is used when reading multi-byte entities (such as integers) +from the stream. + + + + + + +The :newline-type property determines what is considered +as a line ending when reading complete lines from the stream. + + + + #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources @@ -3198,6 +4373,13 @@ across various machine architectures. + + +The origin filename of this #GDesktopAppInfo + + + + Emitted when the drive's state has changed. @@ -3500,6 +4682,13 @@ be exactly like that. Since 2.20 + + +The file containing the icon. + + + + Flags that can be used with g_file_measure_disk_usage(). @@ -3537,7 +4726,28 @@ Compare with `du -x`. Emitted when @file has been changed. -If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is +If using %G_FILE_MONITOR_WATCH_RENAMES on a directory monitor, and +the information is available (and if supported by the backend), +@event_type may be %G_FILE_MONITOR_EVENT_RENAMED, +%G_FILE_MONITOR_EVENT_MOVED_IN or %G_FILE_MONITOR_EVENT_MOVED_OUT. + +In all cases @file will be a child of the monitored directory. For +renames, @file will be the old name and @other_file is the new +name. For "moved in" events, @file is the name of the file that +appeared and @other_file is the old name that it was moved from (in +another directory). For "moved out" events, @file is the name of +the file that used to be in this directory and @other_file is the +name of the file at its new location. + +It makes sense to treat %G_FILE_MONITOR_EVENT_MOVED_IN as +equivalent to %G_FILE_MONITOR_EVENT_CREATED and +%G_FILE_MONITOR_EVENT_MOVED_OUT as equivalent to +%G_FILE_MONITOR_EVENT_DELETED, with extra information. +%G_FILE_MONITOR_EVENT_RENAMED is equivalent to a delete/create +pair. This is exactly how the events will be reported in the case +that the %G_FILE_MONITOR_WATCH_RENAMES flag is not in use. + +If using the deprecated flag %G_FILE_MONITOR_SEND_MOVED flag and @event_type is #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the old path, and @other_file will be set to a #GFile containing the new path. @@ -3600,7 +4810,26 @@ Specifies what type of event a monitor event is. - the file was moved. + the file was moved -- only sent if the +(deprecated) %G_FILE_MONITOR_SEND_MOVED flag is set + + + + the file was renamed within the +current directory -- only sent if the %G_FILE_MONITOR_WATCH_MOVES +flag is set. Since: 2.44. + + + + the file was moved into the +monitored directory from another location -- only sent if the +%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44. + + + + the file was moved out of the +monitored directory to another location -- only sent if the +%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44 @@ -3625,7 +4854,8 @@ Flags used to set what a #GFileMonitor will watch for. by file renames (moves) and send a single G_FILE_MONITOR_EVENT_MOVED event instead (NB: not supported on all backends; the default behaviour -without specifying this flag- is to send single DELETED -and CREATED events). +and CREATED events). Deprecated since 2.44: use +%G_FILE_MONITOR_WATCH_MOVES instead. @@ -3633,6 +4863,13 @@ and CREATED events). via another hard link. Since 2.36. + + Watch for rename operations on a +monitored directory. This causes %G_FILE_MONITOR_EVENT_RENAMED, +%G_FILE_MONITOR_EVENT_MOVED_IN and %G_FILE_MONITOR_EVENT_MOVED_OUT +events to be emitted when possible. Since: 2.44. + + @@ -4000,6 +5237,115 @@ before calling the callback. + + +Whether this is the "any" address for its family. +See g_inet_address_get_is_any(). + +Since: 2.22 + + + + + + +Whether this is a link-local address. +See g_inet_address_get_is_link_local(). + +Since: 2.22 + + + + + + +Whether this is the loopback address for its family. +See g_inet_address_get_is_loopback(). + +Since: 2.22 + + + + + + +Whether this is a global multicast address. +See g_inet_address_get_is_mc_global(). + +Since: 2.22 + + + + + + +Whether this is a link-local multicast address. +See g_inet_address_get_is_mc_link_local(). + +Since: 2.22 + + + + + + +Whether this is a node-local multicast address. +See g_inet_address_get_is_mc_node_local(). + +Since: 2.22 + + + + + + +Whether this is an organization-local multicast address. +See g_inet_address_get_is_mc_org_local(). + +Since: 2.22 + + + + + + +Whether this is a site-local multicast address. +See g_inet_address_get_is_mc_site_local(). + +Since: 2.22 + + + + + + +Whether this is a multicast address. +See g_inet_address_get_is_multicast(). + +Since: 2.22 + + + + + + +Whether this is a site-local address. +See g_inet_address_get_is_loopback(). + +Since: 2.22 + + + + + + +The `sin6_flowinfo` field, for IPv6 addresses. + +Since: 2.32 + + + + This signal is emitted whenever items were added or removed to @@ -4030,6 +5376,61 @@ Since: 2.44 + + +The type of items contained in this list store. Items must be +subclasses of #GObject. + +Since: 2.44 + + + + + + +Pointer to buffer where data will be written. + +Since: 2.24 + + + + + + +Size of data written to the buffer. + +Since: 2.24 + + + + + + +Function called with the buffer as argument when the stream is destroyed. + +Since: 2.24 + + + + + + +Function with realloc semantics called to enlarge the buffer. + +Since: 2.24 + + + + + + +Current size of the data buffer. + +Since: 2.24 + + + + Emitted when a change has occured to the menu. @@ -4317,6 +5718,51 @@ is completed + + +Whether to use an anonymous user when authenticating. + + + + + + +The index of the user's choice when a question is asked during the +mount operation. See the #GMountOperation::ask-question signal. + + + + + + +The domain to use for the mount operation. + + + + + + +The password that is used for authentication when carrying out +the mount operation. + + + + + + +Determines if and how the password information should be saved. + + + + + + +The user name that is used for authentication when carrying out +the mount operation. + + + + #GMountOperationResult is returned as a result when a request for @@ -4417,6 +5863,42 @@ Since: 2.32 + + +More detailed information about the host's network connectivity. +See g_network_monitor_get_connectivity() and +#GNetworkConnectivity for more details. + +Since: 2.44 + + + + + + +Whether the network is considered available. That is, whether the +system has a default route for at least one of IPv4 or IPv6. + +Real-world networks are of course much more complicated than +this; the machine may be connected to a wifi hotspot that +requires payment before allowing traffic through, or may be +connected to a functioning router that has lost its own upstream +connectivity. Some hosts might only be accessible when a VPN is +active. Other hosts might only be accessible when the VPN is +not active. Thus, it is best to use g_network_monitor_can_reach() +or g_network_monitor_can_reach_async() to test for reachability +on a host-by-host basis. (On the other hand, when the property is +%FALSE, the application can reasonably expect that no remote +hosts at all are reachable, and should indicate this to the user +in its UI.) + +See also #GNetworkMonitor::network-changed. + +Since: 2.32 + + + + Priority levels for #GNotifications. @@ -4499,6 +5981,143 @@ to, and later retrieves it again from there. + + +%TRUE if the caller currently has permission to perform the action that +@permission represents the permission to perform. + + + + + + +%TRUE if it is generally possible to acquire the permission by calling +g_permission_acquire(). + + + + + + +%TRUE if it is generally possible to release the permission by calling +g_permission_release(). + + + + + + +If @action is currently enabled. + +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. + +Since: 2.38 + + + + + + +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GActionMap. + +Since: 2.38 + + + + + + +The object to wrap a property on. + +The object must be a non-%NULL #GObject with properties. + +Since: 2.38 + + + + + + +The type of the parameter that must be given when activating the +action. + +Since: 2.38 + + + + + + +The name of the property to wrap on the object. + +The property must exist on the passed-in object and it must be +readable and writable (and not construct-only). + +Since: 2.38 + + + + + + +The state of the action, or %NULL if the action is stateless. + +Since: 2.38 + + + + + + +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. + +Since: 2.38 + + + + + + +The protocol being spoke to the destination host, or %NULL if +the #GProxyAddress doesn't know. + +Since: 2.34 + + + + + + +The URI string that the proxy was constructed from (or %NULL +if the creator didn't specify this). + +Since: 2.34 + + + + + + +The default port to use if #GProxyAddressEnumerator:uri does not +specify one. + +Since: 2.38 + + + + + + +The proxy resolver to use. + +Since: 2.36 + + + + Emitted when the resolver notices that the system resolver @@ -4775,6 +6394,77 @@ callbacks when the writability of "x" changes. + + +The name of the context that the settings are stored in. + + + + + + +Whether the #GSettings object is in 'delay-apply' mode. See +g_settings_delay() for details. + +Since: 2.28 + + + + + + +If this property is %TRUE, the #GSettings object has outstanding +changes that will be applied when g_settings_apply() is called. + + + + + + +The path within the backend where the settings are stored. + + + + + + +The name of the schema that describes the types of keys +for this #GSettings object. + +The type of this property is *not* #GSettingsSchema. +#GSettingsSchema has only existed since version 2.32 and +unfortunately this name was used in previous versions to refer to +the schema ID rather than the schema itself. Take care to use the +'settings-schema' property if you wish to pass in a +#GSettingsSchema. + +Deprecated:2.32:Use the 'schema-id' property instead. In a future +version, this property may instead refer to a #GSettingsSchema. + + + + + + +The name of the schema that describes the types of keys +for this #GSettings object. + + + + + + +The #GSettingsSchema describing the types of keys for this +#GSettings object. + +Ideally, this property would be called 'schema'. #GSettingsSchema +has only existed since version 2.32, however, and before then the +'schema' property was used to refer to the ID of the schema rather +than the schema itself. Take care. + + + + Flags used when creating a binding. These flags determine in which @@ -4896,6 +6586,169 @@ Since: 2.30 + + +If @action is currently enabled. + +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. + +Since: 2.28 + + + + + + +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GSimpleActionGroup. + +Since: 2.28 + + + + + + +The type of the parameter that must be given when activating the +action. + +Since: 2.28 + + + + + + +The state of the action, or %NULL if the action is stateless. + +Since: 2.28 + + + + + + +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. + +Since: 2.28 + + + + + + +Since: 2.44 + + + + + + +Since: 2.44 + + + + + + +The default proxy URI that will be used for any URI that doesn't +match #GSimpleProxyResolver:ignore-hosts, and doesn't match any +of the schemes set with g_simple_proxy_resolver_set_uri_proxy(). + +Note that as a special case, if this URI starts with +"socks://", #GSimpleProxyResolver will treat it as referring +to all three of the socks5, socks4a, and socks4 proxy types. + + + + + + +A list of hostnames and IP addresses that the resolver should +allow direct connections to. + +Entries can be in one of 4 formats: + +- A hostname, such as "example.com", ".example.com", or +"*.example.com", any of which match "example.com" or +any subdomain of it. + +- An IPv4 or IPv6 address, such as "192.168.1.1", +which matches only that address. + +- A hostname or IP address followed by a port, such as +"example.com:80", which matches whatever the hostname or IP +address would match, but only for URLs with the (explicitly) +indicated port. In the case of an IPv6 address, the address +part must appear in brackets: "[::1]:443" + +- An IP address range, given by a base address and prefix length, +such as "fe80::/10", which matches any address in that range. + +Note that when dealing with Unicode hostnames, the matching is +done against the ASCII form of the name. + +Also note that hostname exclusions apply only to connections made +to hosts identified by name, and IP address exclusions apply only +to connections made to hosts identified by address. That is, if +example.com has an address of 192.168.1.1, and the :ignore-hosts list +contains only "192.168.1.1", then a connection to "example.com" +(eg, via a #GNetworkAddress) will use the proxy, and a connection to +"192.168.1.1" (eg, via a #GInetSocketAddress) will not. + +These rules match the "ignore-hosts"/"noproxy" rules most +commonly used by other applications. + + + + + + +Whether the socket should allow sending to broadcast addresses. + +Since: 2.32 + + + + + + +Whether outgoing multicast packets loop back to the local host. + +Since: 2.32 + + + + + + +Time-to-live out outgoing multicast packets + +Since: 2.32 + + + + + + +The timeout in seconds on socket I/O + +Since: 2.26 + + + + + + +Time-to-live for outgoing unicast packets + +Since: 2.32 + + + + Emitted when @client's activity on @connectable changes state. @@ -4972,6 +6825,15 @@ Since: 2.32 + + +The proxy resolver to use + +Since: 2.36 + + + + Describes an event occurring on a #GSocketClient. See the @@ -5058,6 +6920,65 @@ Since: 2.22 + + +Emitted when @listener's activity on @socket changes state. +Note that when @listener is used to listen on both IPv4 and +IPv6, a separate set of signals will be emitted for each, and +the order they happen in is undefined. + +Since: 2.46 + + + + + the #GSocketListener + + + + the event that is occurring + + + + the #GSocket the event is occurring on + + + + + + + + +Describes an event occurring on a #GSocketListener. See the +#GSocketListener::event signal for more details. + +Additional values may be added to this type in the future. + +Since: 2.46 + + + + + The listener is about to bind a socket. + + + + The listener has bound a socket. + + + + The listener is about to start +listening on this socket. + + + + The listener is now listening on +this socket. + + + + + Flags used in g_socket_receive_message() and g_socket_send_message(). @@ -5260,6 +7181,32 @@ over the "standard" file descriptors (stdin, stdout, stderr). + + +Whether the task has completed, meaning its callback (if set) has been +invoked. This can only happen after g_task_return_pointer(), +g_task_return_error() or one of the other return functions have been called +on the task. + +This property is guaranteed to change from %FALSE to %TRUE exactly once. + +The #GObject::notify signal for this change is emitted in the same main +context as the task’s callback, immediately after that callback is invoked. + +Since: 2.44 + + + + + + +#GTestDBusFlags specifying the behaviour of the D-Bus session. + +Since: 2.34 + + + + Flags to define future #GTestDBus behaviour. @@ -5275,6 +7222,41 @@ Since: 2.34 + + +The icon name. + + + + + + +A %NULL-terminated array of icon names. + + + + + + +Whether to use the default fallbacks found by shortening the icon name +at '-' characters. If the "names" array has more than one element, +ignores any past the first. + +For example, if the icon name was "gnome-dev-cdrom-audio", the array +would become +|[<!-- language="C" --> +{ +"gnome-dev-cdrom-audio", +"gnome-dev-cdrom", +"gnome-dev", +"gnome", +NULL +}; +]| + + + + The ::run signal is emitted in a worker thread in response to an @@ -5325,6 +7307,75 @@ Since: 2.28 + + +The DER (binary) encoded representation of the certificate. +This property and the #GTlsCertificate:certificate-pem property +represent the same data, just in different forms. + +Since: 2.28 + + + + + + +The PEM (ASCII) encoded representation of the certificate. +This property and the #GTlsCertificate:certificate +property represent the same data, just in different forms. + +Since: 2.28 + + + + + + +A #GTlsCertificate representing the entity that issued this +certificate. If %NULL, this means that the certificate is either +self-signed, or else the certificate of the issuer is not +available. + +Since: 2.28 + + + + + + +The DER (binary) encoded representation of the certificate's +private key, in either PKCS#1 format or unencrypted PKCS#8 +format. This property (or the #GTlsCertificate:private-key-pem +property) can be set when constructing a key (eg, from a file), +but cannot be read. + +PKCS#8 format is supported since 2.32; earlier releases only +support PKCS#1. You can use the `openssl rsa` +tool to convert PKCS#8 keys to PKCS#1. + +Since: 2.28 + + + + + + +The PEM (ASCII) encoded representation of the certificate's +private key in either PKCS#1 format ("`BEGIN RSA PRIVATE +KEY`") or unencrypted PKCS#8 format ("`BEGIN +PRIVATE KEY`"). This property (or the +#GTlsCertificate:private-key property) can be set when +constructing a key (eg, from a file), but cannot be read. + +PKCS#8 format is supported since 2.32; earlier releases only +support PKCS#1. You can use the `openssl rsa` +tool to convert PKCS#8 keys to PKCS#1. + +Since: 2.28 + + + + A set of flags describing TLS certification validation. This can be @@ -5396,6 +7447,73 @@ Since: 2.40 + + +A list of the distinguished names of the Certificate Authorities +that the server will accept client certificates signed by. If the +server requests a client certificate during the handshake, then +this property will be set after the handshake completes. + +Each item in the list is a #GByteArray which contains the complete +subject DN of the certificate authority. + +Since: 2.28 + + + + + + +A #GSocketConnectable describing the identity of the server that +is expected on the other end of the connection. + +If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in +#GTlsClientConnection:validation-flags, this object will be used +to determine the expected identify of the remote end of the +connection; if #GTlsClientConnection:server-identity is not set, +or does not match the identity presented by the server, then the +%G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail. + +In addition to its use in verifying the server certificate, +this is also used to give a hint to the server about what +certificate we expect, which is useful for servers that serve +virtual hosts. + +Since: 2.28 + + + + + + +If %TRUE, tells the connection to use a fallback version of TLS +or SSL, rather than trying to negotiate the best version of TLS +to use. This can be used when talking to servers that don't +implement version negotiation correctly and therefore refuse to +handshake at all with a "modern" TLS handshake. + +Despite the property name, the fallback version is not +necessarily SSL 3.0; if SSL 3.0 has been disabled, the +#GTlsClientConnection will use the next highest available version +(normally TLS 1.0) as the fallback version. + +Since: 2.28 + + + + + + +What steps to perform when validating a certificate received from +a server. Server certificates that fail to validate in all of the +ways indicated here will be rejected unless the application +overrides the default via #GTlsConnection::accept-certificate. + +Since: 2.28 + + + + Emitted during the TLS handshake after the peer certificate has @@ -5457,6 +7575,107 @@ no one else overrides it. + + +The #GIOStream that the connection wraps + +Since: 2.28 + + + + + + +The connection's certificate; see +g_tls_connection_set_certificate(). + +Since: 2.28 + + + + + + +The certificate database to use when verifying this TLS connection. +If no cerificate database is set, then the default database will be +used. See g_tls_backend_get_default_database(). + +Since: 2.30 + + + + + + +A #GTlsInteraction object to be used when the connection or certificate +database need to interact with the user. This will be used to prompt the +user for passwords where necessary. + +Since: 2.30 + + + + + + +The connection's peer's certificate, after the TLS handshake has +completed and the certificate has been accepted. Note in +particular that this is not yet set during the emission of +#GTlsConnection::accept-certificate. + +(You can watch for a #GObject::notify signal on this property to +detect when a handshake has occurred.) + +Since: 2.28 + + + + + + +The errors noticed-and-ignored while verifying +#GTlsConnection:peer-certificate. Normally this should be 0, but +it may not be if #GTlsClientConnection:validation-flags is not +%G_TLS_CERTIFICATE_VALIDATE_ALL, or if +#GTlsConnection::accept-certificate overrode the default +behavior. + +Since: 2.28 + + + + + + +The rehandshaking mode. See +g_tls_connection_set_rehandshake_mode(). + +Since: 2.28 + + + + + + +Whether or not proper TLS close notification is required. +See g_tls_connection_set_require_close_notify(). + +Since: 2.28 + + + + + + +Whether or not the system certificate database will be used to +verify peer certificates. See +g_tls_connection_set_use_system_certdb(). + +Deprecated: 2.30: Use GTlsConnection:database instead + + + + Flags for g_tls_database_lookup_certificate_handle(), @@ -5540,6 +7759,18 @@ g_tls_connection_set_require_close_notify(). + + +The path to a file containing PEM encoded certificate authority +root anchors. The certificates in this file will be treated as +root authorities for the purpose of verifying other certificates +via the g_tls_database_verify_chain() operation. + +Since: 2.30 + + + + #GTlsInteractionResult is returned by various functions in #GTlsInteraction @@ -5620,6 +7851,44 @@ Since: 2.28 + + +The #GTlsAuthenticationMode for the server. This can be changed +before calling g_tls_connection_handshake() if you want to +rehandshake with a different mode from the initial handshake. + +Since: 2.28 + + + + + + +The credentials stored in the message. + +Since: 2.26 + + + + + + +Whether to close the file descriptor when the stream is closed. + +Since: 2.20 + + + + + + +The file descriptor that the stream reads from. + +Since: 2.20 + + + + Emitted when the unix mount points have changed. @@ -5709,6 +7978,35 @@ Types of UNIX mounts. + + +Whether to close the file descriptor when the stream is closed. + +Since: 2.20 + + + + + + +The file descriptor that the stream writes to. + +Since: 2.20 + + + + + + +Whether or not this is an abstract address + +Deprecated: Use #GUnixSocketAddress:address-type, which +distinguishes between zero-padded and non-zero-padded +abstract addresses. + + + + The type of name used by a #GUnixSocketAddress. @@ -5995,6 +8293,53 @@ Emitted when a mountable volume is removed from the system. + + +Whether to close the file handle when the stream is closed. + +Since: 2.26 + + + + + + +The handle that the stream reads from. + +Since: 2.26 + + + + + + +Whether to close the file handle when the stream is closed. + +Since: 2.26 + + + + + + +The file handle that the stream writes to. + +Since: 2.26 + + + + + + +If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is +%G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name +and modification time from the file info to the GZIP header. + +Since: 2.26 + + + + Used to select the type of data format to use for #GZlibDecompressor @@ -6019,6 +8364,18 @@ Since: 2.24 + + +A #GFileInfo containing the information found in the GZIP header +of the data stream processed, or %NULL if the header was not yet +fully processed, is not present at all, or the compressor's +#GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP. + +Since: 2.26 + + + + Translates kqueue filter flags into GIO event flags. @@ -7276,28 +9633,6 @@ Sets the #ExampleCat instance for the D-Bus interface <link linkend="gdb - - -Won't hold a ref, we have a timout callback to clean unused node_t. -If there is no value for a key, add it and return it; else return the old -one. - - - - - - - - - -FEN subsystem initializing. - - - - - - - Asynchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method on @proxy. @@ -39084,7 +41419,7 @@ Cancels a file monitor. - %TRUE if monitor was cancelled. + always %TRUE @@ -39131,37 +41466,6 @@ Free the returned object with g_object_unref(). - - -Emits the #GFileMonitor::changed signal if a change -has taken place. Should be called from file monitor -implementations only. - -The signal will be emitted from an idle handler (in the -[thread-default main context][g-main-context-push-thread-default]). - - - - - a #GFileMonitor. - - - - a #GFile. - - - - a #GFile. - - - - a set of #GFileMonitorEvent flags. - - - - - - Obtains a file monitor for the given file. If no file notification @@ -48214,7 +50518,8 @@ Since: 2.22 - the new #GNetworkAddress, or %NULL on error + the new +#GNetworkAddress, or %NULL on error @@ -48245,7 +50550,8 @@ Since: 2.26 - the new #GNetworkAddress, or %NULL on error + the new +#GNetworkAddress, or %NULL on error @@ -54921,6 +57227,8 @@ Reports an error in an asynchronous function in an idle function by directly setting the contents of the #GAsyncResult with the given error information. +Deprecated: 2.46: Use g_task_report_error(). + @@ -54961,6 +57269,8 @@ Reports an error in an idle function. Similar to g_simple_async_report_error_in_idle(), but takes a #GError rather than building a new one. +Deprecated: 2.46: Use g_task_report_error(). + @@ -54991,6 +57301,8 @@ ownership of @error, so the caller does not have to free it any more. Since: 2.28 +Deprecated: 2.46: Use g_task_report_error(). + @@ -55023,6 +57335,8 @@ g_simple_async_result_complete_in_idle(). Calling this function takes a reference to @simple for as long as is needed to complete the call. +Deprecated: 2.46: Use #GTask instead. + @@ -55043,6 +57357,8 @@ of the thread that @simple was initially created in Calling this function takes a reference to @simple for as long as is needed to complete the call. +Deprecated: 2.46: Use #GTask instead. + @@ -55057,6 +57373,7 @@ is needed to complete the call. Gets the operation result boolean from within the asynchronous result. +Deprecated: 2.46: Use #GTask and g_task_propagate_boolean() instead. @@ -55067,6 +57384,7 @@ Gets the operation result boolean from within the asynchronous result. %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE. + @@ -55074,6 +57392,7 @@ if the operation's result was %FALSE. Gets a pointer result as returned by the asynchronous function. +Deprecated: 2.46: Use #GTask and g_task_propagate_pointer() instead. @@ -55083,6 +57402,7 @@ Gets a pointer result as returned by the asynchronous function. a pointer from the result. + @@ -55090,6 +57410,7 @@ Gets a pointer result as returned by the asynchronous function. Gets a gssize from the asynchronous result. +Deprecated: 2.46: Use #GTask and g_task_propagate_int() instead. @@ -55099,6 +57420,7 @@ Gets a gssize from the asynchronous result. a gssize returned from the asynchronous function. + @@ -55106,6 +57428,7 @@ Gets a gssize from the asynchronous result. Gets the source tag for the #GSimpleAsyncResult. +Deprecated: 2.46. Use #GTask and g_task_get_source_tag() instead. @@ -55115,6 +57438,7 @@ Gets the source tag for the #GSimpleAsyncResult. a #gpointer to the source object for the #GSimpleAsyncResult. + @@ -55135,6 +57459,8 @@ check is skipped.) Since: 2.20 +Deprecated: 2.46: Use #GTask and g_task_is_valid() instead. + @@ -55168,6 +57494,7 @@ probably should) then you should provide the user's cancellable to g_simple_async_result_set_check_cancellable() immediately after this function returns. +Deprecated: 2.46: Use g_task_new() instead. @@ -55189,6 +57516,7 @@ this function returns. a #GSimpleAsyncResult. + @@ -55196,6 +57524,7 @@ this function returns. Creates a new #GSimpleAsyncResult with a set error. +Deprecated: 2.46: Use g_task_new() and g_task_return_new_error() instead. @@ -55229,6 +57558,7 @@ Creates a new #GSimpleAsyncResult with a set error. a #GSimpleAsyncResult. + @@ -55236,6 +57566,7 @@ Creates a new #GSimpleAsyncResult with a set error. Creates a #GSimpleAsyncResult from an error condition. +Deprecated: 2.46: Use g_task_new() and g_task_return_error() instead. @@ -55257,6 +57588,7 @@ Creates a #GSimpleAsyncResult from an error condition. a #GSimpleAsyncResult. + @@ -55267,6 +57599,8 @@ caller's ownership of @error, so the caller does not need to free it anymore. Since: 2.28 +Deprecated: 2.46: Use g_task_new() and g_task_return_error() instead. + @@ -55300,6 +57634,7 @@ If the #GCancellable given to a prior call to g_simple_async_result_set_check_cancellable() is cancelled then this function will return %TRUE with @dest set appropriately. +Deprecated: 2.46: Use #GTask instead. @@ -55313,6 +57648,7 @@ function will return %TRUE with @dest set appropriately. %TRUE if the error was propagated to @dest. %FALSE otherwise. + @@ -55325,6 +57661,8 @@ the result to the appropriate main loop. Calling this function takes a reference to @simple for as long as is needed to run the job and report its completion. +Deprecated: 2.46: Use #GTask and g_task_run_in_thread() instead. + @@ -55367,6 +57705,8 @@ unrelated g_simple_async_result_set_handle_cancellation() function. Since: 2.32 +Deprecated: 2.46: Use #GTask instead. + @@ -55385,6 +57725,8 @@ Since: 2.32 Sets an error within the asynchronous result without a #GError. +Deprecated: 2.46: Use #GTask and g_task_return_new_error() instead. + @@ -55416,6 +57758,8 @@ Sets an error within the asynchronous result without a #GError. Sets an error within the asynchronous result without a #GError. Unless writing a binding, see g_simple_async_result_set_error(). +Deprecated: 2.46: Use #GTask and g_task_return_error() instead. + @@ -55446,6 +57790,8 @@ Unless writing a binding, see g_simple_async_result_set_error(). Sets the result from a #GError. +Deprecated: 2.46: Use #GTask and g_task_return_error() instead. + @@ -55468,6 +57814,8 @@ This function has nothing to do with g_simple_async_result_set_check_cancellable(). It only refers to the #GCancellable passed to g_simple_async_result_run_in_thread(). +Deprecated: 2.46 + @@ -55486,6 +57834,8 @@ g_simple_async_result_set_check_cancellable(). It only refers to the Sets the operation result to a boolean within the asynchronous result. +Deprecated: 2.46: Use #GTask and g_task_return_boolean() instead. + @@ -55504,6 +57854,8 @@ Sets the operation result to a boolean within the asynchronous result. Sets the operation result within the asynchronous result to a pointer. +Deprecated: 2.46: Use #GTask and g_task_return_pointer() instead. + @@ -55527,6 +57879,8 @@ Sets the operation result within the asynchronous result to a pointer. Sets the operation result within the asynchronous result to the given @op_res. +Deprecated: 2.46: Use #GTask and g_task_return_int() instead. + @@ -55548,6 +57902,8 @@ of @error, so the caller does not need to free it any more. Since: 2.28 +Deprecated: 2.46: Use #GTask and g_task_return_error() instead. + @@ -57459,7 +59815,7 @@ Since: 2.22 - a #GSocketAddress or %NULL on error. + a #GSocket or %NULL on error. @@ -61811,6 +64167,12 @@ This takes a ref on @task until the task completes. See #GTaskThreadFunc for more details about how @task_func is handled. +Although GLib currently rate-limits the tasks queued via +g_task_run_in_thread(), you should not assume that it will always +do this. If you have a very large number of tasks to run, but don't +want them to all run at once, you should only queue a limited +number of them at a time. + Since: 2.36 @@ -61840,6 +64202,12 @@ Normally this is used with tasks created with a %NULL have a callback, it will not be invoked when @task_func returns. #GTask:completed will be set to %TRUE just before this function returns. +Although GLib currently rate-limits the tasks queued via +g_task_run_in_thread_sync(), you should not assume that it will +always do this. If you have a very large number of tasks to run, +but don't want them to all run at once, you should only queue a +limited number of them at a time. + Since: 2.36 @@ -62749,6 +65117,31 @@ Since: 2.28 + + +Copies session state from one connection to another. This is +not normally needed, but may be used when the same session +needs to be used between different endpoints as is required +by some protocols such as FTP over TLS. @source should have +already completed a handshake, and @conn should not have +completed a handshake. + +Since: 2.46 + + + + + a #GTlsClientConnection + + + + a #GTlsClientConnection + + + + + + Gets the list of distinguished names of the Certificate Authorities @@ -67684,7 +70077,7 @@ produces G_FILE_MONITOR_EVENT_DELETED event for a deleted file. A callback function for the directory diff calculation routine, -produces G_FILE_MONITOR_EVENT_MOVED event on a move. +produces G_FILE_MONITOR_EVENT_RENAMED event on a move. @@ -67826,20 +70219,17 @@ has appeared. -Represents a pool of (struct kevent) objects. +Represents an event occured on a file descriptor. Used for marshalling from +kqueue thread to its subscribers. - - a pointer to the allocated memory - - - - the number of used items + + file descriptor, on which an activity has occured. - - the number of allocated items + + kqueue event flags, see man kevent(2). @@ -67872,28 +70262,6 @@ Represents a subscription on a file or directory. - - -Unsafe, need lock fen_lock. -port_add will associate a GSource to @f->source - - - - - - - - - -< private > -Unsafe, need lock fen_lock. - - - - - - - Processes notifications, coming from the kqueue thread. diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index a91c9987..14472083 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -1,4 +1,51 @@ + + +Flags to be used to control the #GBinding + +Since: 2.26 + + + + + + +The #GObject that should be used as the source of the binding + +Since: 2.26 + + + + + + +The name of the property of #GBinding:source that should be used +as the source of the binding + +Since: 2.26 + + + + + + +The #GObject that should be used as the target of the binding + +Since: 2.26 + + + + + + +The name of the property of #GBinding:target that should be used +as the target of the binding + +Since: 2.26 + + + + Flags to be passed to g_object_bind_property() or @@ -9377,35 +9424,40 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter -denotes a flags type. +A #GClosureMarshal function for use with signals with handlers that +take a flags type as an argument and return a boolean. If you have +such a signal, you will probably also need to use an accumulator, +such as g_signal_accumulator_true_handled(). - the #GClosure to which the marshaller belongs + A #GClosure. - a #GValue which can store the returned #gboolean + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding instance and arg1 + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9534,44 +9586,78 @@ g_closure_set_meta_marshal() -Another name for g_cclosure_marshal_BOOLEAN__FLAGS(). +An old alias for g_cclosure_marshal_BOOLEAN__FLAGS(). + + A #GClosure. + + + + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. + + + + The length of the @param_values array. + + + + An array of #GValues holding the arguments +on which to invoke the callback of closure. + + + + The invocation hint given as the last argument to +g_closure_invoke(). + + + + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() + + -A marshaller for a #GCClosure with a callback of type -`gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`. +A #GClosureMarshal function for use with signals with handlers that +take a #GObject and a pointer and produce a string. It is highly +unlikely that your signal handler fits this description. - the #GClosure to which the marshaller belongs + A #GClosure. - a #GValue, which can store the returned string + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 3 + The length of the @param_values array. - a #GValue array holding instance, arg1 and arg2 + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9623,34 +9709,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +boolean argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gboolean parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9702,34 +9792,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +argument which is any boxed pointer type. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #GBoxed* parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9781,34 +9875,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +character argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gchar parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9860,34 +9958,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with one +double-precision floating point argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gdouble parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -9939,34 +10041,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type.. +A #GClosureMarshal function for use with signals with a single +argument with an enumerated type. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the enumeration parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10018,34 +10124,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type. +A #GClosureMarshal function for use with signals with a single +argument with a flags types. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the flags parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10097,34 +10207,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with one +single-precision floating point argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gfloat parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10176,34 +10290,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gint arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +integer argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gint parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10255,34 +10373,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, glong arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with with a single +long integer argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #glong parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10334,34 +10456,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +#GObject argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #GObject* parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10413,34 +10539,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +argument of type #GParamSpec. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #GParamSpec* parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10492,34 +10622,42 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single raw +pointer argument type. + +If it is possible, it is better to use one of the more specific +functions such as g_cclosure_marshal_VOID__OBJECT() or +g_cclosure_marshal_VOID__OBJECT(). - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gpointer parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10571,34 +10709,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single string +argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gchar* parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10650,34 +10792,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +unsigned character argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #guchar parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10729,34 +10875,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, guint arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with with a single +unsigned integer argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #guint parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10765,34 +10915,38 @@ to g_closure_invoke() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a unsigned int +and a pointer as arguments. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 3 + The length of the @param_values array. - a #GValue array holding instance, arg1 and arg2 + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10887,34 +11041,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`. +A #GClosureMarshal function for use with signals with a single +unsigned long integer argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #gulong parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -10966,36 +11124,38 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`. - -Since: 2.26 +A #GClosureMarshal function for use with signals with a single +#GVariant argument. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 2 + The length of the @param_values array. - a #GValue array holding the instance and the #GVariant* parameter + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -11047,34 +11207,37 @@ g_closure_set_meta_marshal() -A marshaller for a #GCClosure with a callback of type -`void (*callback) (gpointer instance, gpointer user_data)`. +A #GClosureMarshal function for use with signals with no arguments. - the #GClosure to which the marshaller belongs + A #GClosure. - ignored + A #GValue to store the return value. May be %NULL +if the callback of closure doesn't return a value. - 1 + The length of the @param_values array. - a #GValue array holding only the instance + An array of #GValues holding the arguments +on which to invoke the callback of closure. - the invocation hint given as the last argument -to g_closure_invoke() + The invocation hint given as the last argument to +g_closure_invoke(). - additional data specified when registering the marshaller + Additional data specified when registering the +marshaller, see g_closure_set_marshal() and +g_closure_set_meta_marshal() @@ -14966,7 +15129,7 @@ The following format specifiers are supported: - \%A: the full weekday name according to the current locale - \%b: the abbreviated month name according to the current locale - \%B: the full month name according to the current locale -- \%c: the preferred date and time rpresentation for the current locale +- \%c: the preferred date and time representation for the current locale - \%C: the century number (year/100) as a 2-digit integer (00-99) - \%d: the day of the month as a decimal number (range 01 to 31) - \%e: the day of the month as a decimal number (range 1 to 31) @@ -39031,7 +39194,9 @@ is being emitted on. The rest are any arguments to be passed to the signal. - Location to store the return value of the signal emission. + Location to +store the return value of the signal emission. This must be provided if the +specified signal returns a value, but may be ignored otherwise. @@ -57846,7 +58011,8 @@ errors (in the case that the type would have been ambiguous, such as with empty arrays). In the event that the parsing is successful, the resulting #GVariant -is returned. +is returned. It is never floating, and must be freed with +g_variant_unref(). In case of any error, %NULL will be returned. If @error is non-%NULL then it will be set to reflect the error that occurred. @@ -57878,7 +58044,7 @@ produced by g_variant_print()". - a reference to a #GVariant, or %NULL + a non-floating reference to a #GVariant, or %NULL diff --git a/tools/gen_scripts/gio_generate_docs.sh b/tools/gen_scripts/gio_generate_docs.sh index 7c815021..2b0364a5 100755 --- a/tools/gen_scripts/gio_generate_docs.sh +++ b/tools/gen_scripts/gio_generate_docs.sh @@ -13,6 +13,7 @@ PREFIX="$JHBUILD_SOURCES" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/gio/src" +PARAMS="--with-properties" for dir in "$PREFIX"/glib/gio; do PARAMS="$PARAMS -s $dir" done diff --git a/tools/gen_scripts/glib_generate_docs.sh b/tools/gen_scripts/glib_generate_docs.sh index a77c04a7..654814fb 100755 --- a/tools/gen_scripts/glib_generate_docs.sh +++ b/tools/gen_scripts/glib_generate_docs.sh @@ -13,6 +13,7 @@ PREFIX="$JHBUILD_SOURCES" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" +PARAMS="--with-properties" for dir in "$PREFIX"/glib/{glib,gmodule,gobject,gthread}; do PARAMS="$PARAMS -s $dir" done -- cgit v1.2.1 From ef4cdb97ddf0fd2b20072dad526841a810934489 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 09:22:15 +0200 Subject: Fix the version numbers in some @newin Doxygen commands * gio/src/appinfo.hg: Change @newin{3,2} to @newin{2,30}. * gio/src/application.hg: * gio/src/networkmonitor.hg: * gio/src/simpleiostream.hg: * gio/src/tcpwrapperconnection.hg: * glib/src/binding.hg: Add 'newin 2,n"' to some _WRAP_PROPERTY(). --- gio/src/appinfo.hg | 10 ++++------ gio/src/application.hg | 2 +- gio/src/networkmonitor.hg | 2 +- gio/src/simpleiostream.hg | 4 ++-- gio/src/tcpwrapperconnection.hg | 2 +- glib/src/binding.hg | 10 +++++----- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/gio/src/appinfo.hg b/gio/src/appinfo.hg index 40457575..330e2a23 100644 --- a/gio/src/appinfo.hg +++ b/gio/src/appinfo.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -114,7 +112,7 @@ public: * @param launch_context An AppLaunchContext. * @return true on successful launch, false otherwise. * - * @newin{3,2} + * @newin{2,30} */ bool launch(const Glib::RefPtr& file, const Glib::RefPtr& launch_context); @@ -142,7 +140,7 @@ public: * @param file A File object. * @return true on successful launch, false otherwise. * - * @newin{3,2} + * @newin{2,30} */ bool launch(const Glib::RefPtr& file); @@ -178,13 +176,13 @@ public: * @param launch_context An AppLaunchContext. * @return true on successful launch, false otherwise. * - * @newin{3,2} + * @newin{2,30} */ bool launch_uri(const std::string& uris, const Glib::RefPtr& launch_context); /** A launch_uri() convenience overload. * - * @newin{3,2} + * @newin{2,30} */ bool launch_uri(const std::string& uris); diff --git a/gio/src/application.hg b/gio/src/application.hg index 9cccc2e5..24b0167c 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -361,7 +361,7 @@ public: _WRAP_PROPERTY("inactivity-timeout", guint) _WRAP_PROPERTY("is-registered", bool) _WRAP_PROPERTY("is-remote", bool) - _WRAP_PROPERTY("resource-base-path", bool) + _WRAP_PROPERTY("resource-base-path", bool, newin "2,44") _WRAP_PROPERTY("is-busy", bool) //#m4 _CONVERSION(`const gchar*', `const Glib::ustring&', `Glib::ustring($3)') diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg index 8441f8ea..562c3d9a 100644 --- a/gio/src/networkmonitor.hg +++ b/gio/src/networkmonitor.hg @@ -62,7 +62,7 @@ public: //TODO: Wrap vfuncs? - _WRAP_PROPERTY("network-available", bool) + _WRAP_PROPERTY("network-available", bool, newin "2,44") _WRAP_PROPERTY("connectivity", NetworkConnectivity) }; diff --git a/gio/src/simpleiostream.hg b/gio/src/simpleiostream.hg index a556fbb3..e510649d 100644 --- a/gio/src/simpleiostream.hg +++ b/gio/src/simpleiostream.hg @@ -66,8 +66,8 @@ public: */ _WRAP_CREATE(const Glib::RefPtr& input_stream, const Glib::RefPtr& output_stream) - _WRAP_PROPERTY("input-stream", Glib::RefPtr) - _WRAP_PROPERTY("output-stream", Glib::RefPtr) + _WRAP_PROPERTY("input-stream", Glib::RefPtr, newin "2,46") + _WRAP_PROPERTY("output-stream", Glib::RefPtr, newin "2,46") // SimpleIOStream has no methods other than create(), signals nor vfuncs. }; diff --git a/gio/src/tcpwrapperconnection.hg b/gio/src/tcpwrapperconnection.hg index 9a9a8fd8..a4690077 100644 --- a/gio/src/tcpwrapperconnection.hg +++ b/gio/src/tcpwrapperconnection.hg @@ -45,7 +45,7 @@ public: _WRAP_METHOD(Glib::RefPtr get_base_io_stream(), g_tcp_wrapper_connection_get_base_io_stream, refreturn) _WRAP_METHOD(Glib::RefPtr get_base_io_stream() const, g_tcp_wrapper_connection_get_base_io_stream, constversion, refreturn) - _WRAP_PROPERTY("base-io-stream", Glib::RefPtr) + _WRAP_PROPERTY("base-io-stream", Glib::RefPtr, newin "2,44") }; } // namespace Gio diff --git a/glib/src/binding.hg b/glib/src/binding.hg index 4a7eb2a0..7464f5d2 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -374,11 +374,11 @@ public: void unbind(); _IGNORE(g_binding_unbind) - _WRAP_PROPERTY("flags", Glib::BindingFlags) - _WRAP_PROPERTY("source", Glib::RefPtr) - _WRAP_PROPERTY("source-property", Glib::ustring) - _WRAP_PROPERTY("target", Glib::RefPtr) - _WRAP_PROPERTY("target-property", Glib::ustring) + _WRAP_PROPERTY("flags", Glib::BindingFlags, newin "2,44") + _WRAP_PROPERTY("source", Glib::RefPtr, newin "2,44") + _WRAP_PROPERTY("source-property", Glib::ustring, newin "2,44") + _WRAP_PROPERTY("target", Glib::RefPtr, newin "2,44") + _WRAP_PROPERTY("target-property", Glib::ustring, newin "2,44") #ifndef DOXYGEN_SHOULD_SKIP_THIS /** Decrement the reference count for this object. -- cgit v1.2.1 From 920cf7938bc98bcf9ef5e0dc446117b881fc6655 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 18:48:05 +0200 Subject: docextract_to_xml.py: Add support for the --no-recursion option * tools/defs_gen/docextract.py: * tools/defs_gen/docextract_to_xml.py: Add support for the --no-recursion command-line option, meaning that only the specified directories shall be traversed, but not their subdirectories. --- tools/defs_gen/docextract.py | 14 ++++++++++---- tools/defs_gen/docextract_to_xml.py | 9 ++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tools/defs_gen/docextract.py b/tools/defs_gen/docextract.py index f794ef8c..7ee2ef5b 100644 --- a/tools/defs_gen/docextract.py +++ b/tools/defs_gen/docextract.py @@ -12,12 +12,17 @@ import sys, os, re # option being specified. no_since = False +# Used to tell if extract() shall collect information from subdirectories. +# This variable is modified from docextract_to_xml based on the --no-recursion +# option being specified. +no_recursion = False + __all__ = ['extract'] class GtkDoc: def __init__(self): self.name = None - # The block type ('function', 'signal', property', 'enum') + # The block type ('function', 'signal', property', 'section', 'enum') self.block_type = '' self.params = [] self.annotations = [] @@ -457,8 +462,9 @@ def parse_dir(dir, doc_dict): if file in ('.', '..'): continue path = os.path.join(dir, file) if os.path.isdir(path): - parse_dir(path, doc_dict) - if len(file) > 2 and (file[-2:] == '.c' or file[-2:] == '.h'): + if not no_recursion: + parse_dir(path, doc_dict) + elif len(file) > 2 and file[-2:] in ('.c', '.h'): sys.stderr.write("Processing " + path + '\n') parse_file(open(path, 'r'), doc_dict) @@ -511,6 +517,6 @@ def extract_tmpl(dirs, doc_dict=None): path = os.path.join(dir, file) if os.path.isdir(path): continue - if len(file) > 2 and file[-2:] == '.sgml': + if len(file) > 5 and file[-5:] == '.sgml': parse_tmpl(open(path, 'r'), doc_dict) return doc_dict diff --git a/tools/defs_gen/docextract_to_xml.py b/tools/defs_gen/docextract_to_xml.py index 00c4f8ce..3bf75c64 100755 --- a/tools/defs_gen/docextract_to_xml.py +++ b/tools/defs_gen/docextract_to_xml.py @@ -15,7 +15,7 @@ import docextract def usage(): sys.stderr.write('usage: docextract_to_xml.py ' + '[-s /src/dir | --source-dir=/src/dir] [-a | --with-annotations] ' + - '[-p | --with-properties] [-c | --with-sections] ' + + '[-p | --with-properties] [-c | --with-sections] [-r | --no-recursion] ' + '[-n | --no-since] [-i | --no-signals ] [-e | --no-enums ]\n') sys.exit(1) @@ -61,10 +61,11 @@ def print_annotations(annotations): if __name__ == '__main__': try: - opts, args = getopt.getopt(sys.argv[1:], "d:s:o:apcnie", + opts, args = getopt.getopt(sys.argv[1:], "d:s:o:apcrnie", ["source-dir=", "with-annotations", "with-properties", "with-sections", - "no-since", "no-signals", "no-enums"]) + "no-recursion", "no-since", + "no-signals", "no-enums"]) except getopt.error as e: sys.stderr.write('docextract_to_xml.py: %s\n' % e) usage() @@ -83,6 +84,8 @@ if __name__ == '__main__': with_properties = True if opt in ('-c', '--with-sections'): with_sections = True + if opt in ('-r', '--no-recursion'): + docextract.no_recursion = True if opt in ('-n', '--no-since'): docextract.no_since = True if opt in ('-i', '--no-signals'): -- cgit v1.2.1 From ffd766254a22aaeae364c011f85fb6ee90900e17 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 2 Jun 2015 18:48:48 +0200 Subject: Regenerate docs.xml files, excluding some subdirectories * tools/gen_scripts/gio_generate_docs.sh: * tools/gen_scripts/glib_generate_docs.sh: Add the --no-recursion option to the call to docextract_to_xml.py. * gio/src/gio_docs.xml: Regenerate without traversing uninteresting subdirectories. --- gio/src/gio_docs.xml | 24074 +++++------------------------- tools/gen_scripts/gio_generate_docs.sh | 2 +- tools/gen_scripts/glib_generate_docs.sh | 4 +- 3 files changed, 3903 insertions(+), 20177 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 6bf2b38a..d7c3a4ec 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -1,1170 +1,1310 @@ - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gtk-GDBus-Example-ObjectManager-Animal.Poke">Poke()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call example_animal_complete_poke() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - A #GDBusMethodInvocation. - - - - Argument passed by remote caller. - - - - Argument passed by remote caller. - - - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-gtk-GDBus-Example-ObjectManager-Animal.Jumped">"Jumped"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - Argument. - - - - - - - + -Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Bar">"Bar"</link>. +If @action is currently enabled. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. -Since: 2.36 +Since: 2.28 - + -Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Foo">"Foo"</link>. - -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GActionGroup. It is immutable. -Since: 2.30 +Since: 2.28 - + -Represents the D-Bus property <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Mood">"Mood"</link>. - -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +The type of the parameter that must be given when activating the +action. This is immutable, and may be %NULL if no parameter is needed when +activating the action. -Since: 2.30 +Since: 2.28 - + -The #ExampleAnimal instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link>, if any. - -Connect to the #GObject::notify signal to get informed of property changes. +The state of the action, or %NULL if the action is stateless. -Since: 2.30 +Since: 2.28 - + -The #ExampleCat instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link>, if any. +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. This is immutable. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.28 - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_authorize_complete_check_authorized() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Signals that a new action was just added to the group. +This signal is emitted after the action has been added +and is now visible. +Since: 2.28 - - A #FooiGenAuthorize. + + the #GActionGroup that changed - - A #GDBusMethodInvocation. + + the name of the action in @action_group - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorized">CheckNotAuthorized()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_authorize_complete_check_not_authorized() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Signals that the enabled status of the named action has changed. +Since: 2.28 - - A #FooiGenAuthorize. + + the #GActionGroup that changed - - A #GDBusMethodInvocation. + + the name of the action in @action_group + + + + whether the action is enabled or not - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorizedFromObject">CheckNotAuthorizedFromObject()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_authorize_complete_check_not_authorized_from_object() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Signals that an action is just about to be removed from the group. +This signal is emitted before the action is removed, so the action +is still visible and can be queried from the signal handler. +Since: 2.28 - - A #FooiGenAuthorize. + + the #GActionGroup that changed - - A #GDBusMethodInvocation. + + the name of the action in @action_group - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-project-Bar.AnotherSignal">"AnotherSignal"</link> is received. +Signals that the state of the named action has changed. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.28 - - A #FooiGenBar. + + the #GActionGroup that changed - - Argument. + + the name of the action in @action_group + + + + the new value of the state - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.HelloWorld">HelloWorld()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_hello_world() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - +Flags used when creating a #GAppInfo. - - A #FooiGenBar. + + No flags. - - A #GDBusMethodInvocation. + + Application opens in a terminal window. + + + + Application supports URI arguments. - - Argument passed by remote caller. + + Application supports startup notification. Since 2.26 - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.PropertyCancellation">PropertyCancellation()</link> D-Bus method. +Signal emitted when the app info database for changes (ie: newly installed +or removed applications). + + + + + + -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_property_cancellation() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + + +The ::launch-failed signal is emitted when a #GAppInfo launch +fails. The startup notification id is provided, so that the launcher +can cancel the startup notification. +Since: 2.36 - - A #FooiGenBar. + + the object emitting the signal - - A #GDBusMethodInvocation. + + the startup notification id for the failed launch - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.RequestMultiPropertyMods">RequestMultiPropertyMods()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_request_multi_property_mods() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +The ::launched signal is emitted when a #GAppInfo is successfully +launched. The @platform_data is an GVariant dictionary mapping +strings to variants (ie a{sv}), which contains additional, +platform-specific data about this launch. On UNIX, at least the +"pid" and "startup-notification-id" keys will be present. +Since: 2.36 - - A #FooiGenBar. + + the object emitting the signal - - A #GDBusMethodInvocation. + + the #GAppInfo that was just launched + + + + additional platform-specific data for this launch - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.RequestSignalEmission">RequestSignalEmission()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_request_signal_emission() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - +The ::activate signal is emitted on the primary instance when an +activation occurs. See g_application_activate(). - - A #FooiGenBar. + + the application - - A #GDBusMethodInvocation. + + + + + + +The ::command-line signal is emitted on the primary instance when +a commandline is not handled locally. See g_application_run() and +the #GApplicationCommandLine documentation for more information. + + + + + + the application - - Argument passed by remote caller. + + a #GApplicationCommandLine representing the +passed commandline - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + An integer that is set as the exit status for the calling +process. See g_application_command_line_set_exit_status(). - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.TestNonPrimitiveTypes">TestNonPrimitiveTypes()</link> D-Bus method. +The ::handle-local-options signal is emitted on the local instance +after the parsing of the commandline options has occurred. + +You can add options to be recognised during commandline option +parsing using g_application_add_main_option_entries() and +g_application_add_option_group(). + +Signal handlers can inspect @options (along with values pointed to +from the @arg_data of an installed #GOptionEntrys) in order to +decide to perform certain actions, including direct local handling +(which may be useful for options like --version). + +In the event that the application is marked +%G_APPLICATION_HANDLES_COMMAND_LINE the "normal processing" will +send the @option dictionary to the primary instance where it can be +read with g_application_command_line_get_options(). The signal +handler can modify the dictionary before returning, and the +modified dictionary will be sent. + +In the event that %G_APPLICATION_HANDLES_COMMAND_LINE is not set, +"normal processing" will treat the remaining uncollected command +line arguments as filenames or URIs. If there are no arguments, +the application is activated by g_application_activate(). One or +more arguments results in a call to g_application_open(). + +If you want to handle the local commandline arguments for yourself +by converting them to calls to g_application_open() or +g_action_group_activate_action() then you must be sure to register +the application first. You should probably not call +g_application_activate() for yourself, however: just return -1 and +allow the default handler to do it for you. This will ensure that +the `--gapplication-service` switch works properly (i.e. no activation +in that case). + +Note that this signal is emitted from the default implementation of +local_command_line(). If you override that function and don't +chain up then this signal will never be emitted. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_test_non_primitive_types() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +You can override local_command_line() if you need more powerful +capabilities than what is provided here, but this should not +normally be required. +Since: 2.40 - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. + + the application - - Argument passed by remote caller. + + the options dictionary - - Argument passed by remote caller. + + an exit code. If you have handled your options and want +to exit the process, return a non-negative option, 0 for success, +and a positive value for failure. To continue, return -1 to let +the default option processing continue. + + + + + + +The ::open signal is emitted on the primary instance when there are +files to open. See g_application_open() for more information. + + + + + the application - - Argument passed by remote caller. + + an array of #GFiles - - Argument passed by remote caller. + + the length of @files - - Argument passed by remote caller. + + a hint provided by the calling instance - - Argument passed by remote caller. + + + + + + +The ::shutdown signal is emitted only on the registered primary instance +immediately after the main loop terminates. + + + + + the application - - Argument passed by remote caller. + + + + + + +The ::startup signal is emitted on the primary instance immediately +after registration. See g_application_register(). + + + + + the application - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.TestPrimitiveTypes">TestPrimitiveTypes()</link> D-Bus method. +Whether the application is currently marked as busy through +g_application_mark_busy() or g_application_bind_busy_property(). + +Since: 2.44 + + + -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_test_primitive_types() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + + +Flags used to define the behaviour of a #GApplication. +Since: 2.28 - - A #FooiGenBar. + + Default - - A #GDBusMethodInvocation. + + Run as a service. In this mode, registration +fails if the service is already running, and the application +will initially wait up to 10 seconds for an initial activation +message to arrive. - - Argument passed by remote caller. + + Don't try to become the primary instance. - - Argument passed by remote caller. + + This application handles opening files (in +the primary instance). Note that this flag only affects the default +implementation of local_command_line(), and has no effect if +%G_APPLICATION_HANDLES_COMMAND_LINE is given. +See g_application_run() for details. - - Argument passed by remote caller. + + This application handles command line +arguments (in the primary instance). Note that this flag only affect +the default implementation of local_command_line(). +See g_application_run() for details. - - Argument passed by remote caller. + + Send the environment of the +launching process to the primary instance. Set this flag if your +application is expected to behave differently depending on certain +environment variables. For instance, an editor might be expected +to use the <envar>GIT_COMMITTER_NAME</envar> environment variable +when editing a git commit message. The environment is available +to the #GApplication::command-line signal handler, via +g_application_command_line_getenv(). - - Argument passed by remote caller. + + Make no attempts to do any of the typical +single-instance application negotiation, even if the application +ID is given. The application neither attempts to become the +owner of the application ID nor does it check if an existing +owner already exists. Everything occurs in the local process. +Since: 2.30. - - Argument passed by remote caller. + + + + + +#GAskPasswordFlags are used to request specific information from the +user, or to notify the user of their choices in an authentication +situation. + + + + + operation requires a password. - - Argument passed by remote caller. + + operation requires a username. - - Argument passed by remote caller. + + operation requires a domain. - - Argument passed by remote caller. + + operation supports saving settings. - - Argument passed by remote caller. + + operation supports anonymous users. - - Argument passed by remote caller. + + + + + +Flags used in g_bus_own_name(). + +Since: 2.26 + + + + + No flags set. - - Argument passed by remote caller. + + Allow another message bus connection to claim the name. - - Argument passed by remote caller. + + If another message bus connection owns the name and have +specified #G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar.UnimplementedMethod">UnimplementedMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_complete_unimplemented_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Flags used in g_bus_watch_name(). +Since: 2.26 - - A #FooiGenBar. + + No flags set. - - A #GDBusMethodInvocation. + + If no-one owns the name when +beginning to watch the name, ask the bus to launch an owner for the +name. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-project-Bar.TestSignal">"TestSignal"</link> is received. +An enumeration for well-known message buses. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.26 - - A #FooiGenBar. - - - - Argument. + + An alias for the message bus that activated the process, if any. - - Argument. + + Not a message bus. - - Argument. + + The system-wide message bus. - - Argument. + + The login session message bus. - - + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.aay">"aay"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +The bytes containing the icon. - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ag">"ag"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - +Emitted when the operation has been cancelled. - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ao">"ao"</link>. +Can be used by implementations of cancellable operations. If the +operation is cancelled from another thread, the signal will be +emitted in the thread that cancelled the operation, not the +thread that is running the operation. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Note that disconnecting from this signal (or any signal) in a +multi-threaded program is prone to race conditions. For instance +it is possible that a signal handler may be invoked even after +a call to g_signal_handler_disconnect() for that handler has +already returned. - - +There is also a problem when cancellation happens right before +connecting to the signal. If this happens the signal will +unexpectedly not be emitted, and checking before connecting to +the signal leaves a race condition where this is still happening. - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.as">"as"</link>. +In order to make it safe and easy to connect handlers there +are two helper functions: g_cancellable_connect() and +g_cancellable_disconnect() which protect against problems +like this. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +An example of how to us this: +|[<!-- language="C" --> +// Make sure we don't do unnecessary work if already cancelled +if (g_cancellable_set_error_if_cancelled (cancellable, error)) +return; - - +// Set up all the data needed to be able to handle cancellation +// of the operation +my_data = my_data_new (...); - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ay">"ay"</link>. +id = 0; +if (cancellable) +id = g_cancellable_connect (cancellable, +G_CALLBACK (cancelled_handler) +data, NULL); -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +// cancellable operation here... - - +g_cancellable_disconnect (cancellable, id); - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.b">"b"</link>. +// cancelled_handler is never called after this, it is now safe +// to free the data +my_data_free (my_data); +]| -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Note that the cancelled signal is emitted in the thread that +the user cancelled from, which may be the main thread. So, the +cancellable signal should not do something that can block. - - - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.d">"d"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - + + + a #GCancellable. + + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.FinallyNormalName">"FinallyNormalName"</link>. +Flags used when calling a g_converter_convert(). -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.24 - + + + No flags. + + + + At end of input data + + + + Flush data + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.g">"g"</link>. +Results returned from g_converter_convert(). -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.24 - + + + There was an error during conversion. + + + + Some data was consumed or produced + + + + The conversion is finished + + + + Flushing is finished + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.i">"i"</link>. +Enumeration describing different kinds of native credential types. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + + + Indicates an invalid native credential type. + + + + The native credentials type is a <type>struct ucred</type>. + + + + The native credentials type is a <type>struct cmsgcred</type>. + + + + The native credentials type is a <type>struct sockpeercred</type>. Added in 2.30. + + + + The native credentials type is a <type>ucred_t</type>. Added in 2.40. + + + + The native credentials type is a <type>struct unpcbid</type>. + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.n">"n"</link>. +If authenticating as a server, this property contains the +received credentials, if any. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +If authenticating as a client, the property contains the +credentials that were sent, if any. - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.o">"o"</link>. +Emitted to check if @mechanism is allowed to be used. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.34 - + + + The #GDBusAuthObserver emitting the signal. + + + + The name of the mechanism, e.g. `DBUS_COOKIE_SHA1`. + + + + %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not. - + + + + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.q">"q"</link>. +Emitted to check if a peer that is successfully authenticated +is authorized. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + + + The #GDBusAuthObserver emitting the signal. + + + + A #GIOStream for the #GDBusConnection. + + + + Credentials received from the peer or %NULL. + + + + %TRUE if the peer is authorized, %FALSE if not. + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.ReadonlyProperty">"ReadonlyProperty"</link>. +Flags used in g_dbus_connection_call() and similar APIs. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.26 - + + + No flags set. + + + + The bus must not launch +an owner for the destination name in response to this method +invocation. + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.s">"s"</link>. +Capabilities negotiated with the remote peer. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + + + No flags set. + + + + The connection +supports exchanging UNIX file descriptors with the remote peer. + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.t">"t"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Emitted when the connection is closed. - - +The cause of this event can be - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.u">"u"</link>. +- If g_dbus_connection_close() is called. In this case +@remote_peer_vanished is set to %FALSE and @error is %NULL. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +- If the remote peer closes the connection. In this case +@remote_peer_vanished is set to %TRUE and @error is set. - - +- If the remote peer sends invalid or malformed data. In this +case @remote_peer_vanished is set to %FALSE and @error is set. - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ag">"unset_ag"</link>. +Upon receiving this signal, you should give up your reference to +@connection. You are guaranteed that this signal is emitted only +once. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + + + the #GDBusConnection emitting the signal + + + + %TRUE if @connection is closed because the +remote peer closed its end of the connection + + + + a #GError with more details about the event or %NULL + + + + + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ao">"unset_ao"</link>. +A D-Bus address specifying potential endpoints that can be used +when establishing the connection. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_as">"unset_as"</link>. +A #GDBusAuthObserver object to assist in the authentication process or %NULL. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_ay">"unset_ay"</link>. +Flags from the #GDBusCapabilityFlags enumeration +representing connection features negotiated with the other peer. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_d">"unset_d"</link>. +A boolean specifying whether the connection has been closed. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_g">"unset_g"</link>. +A boolean specifying whether the process will be terminated (by +calling `raise(SIGTERM)`) if the connection is closed by the +remote peer. + +Note that #GDBusConnection objects returned by g_bus_get_finish() +and g_bus_get_sync() will (usually) have this property set to %TRUE. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_i">"unset_i"</link>. +Flags from the #GDBusConnectionFlags enumeration. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_o">"unset_o"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +The GUID of the peer performing the role of server when +authenticating. - - +If you are constructing a #GDBusConnection and pass +%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the +#GDBusConnection:flags property then you MUST also set this +property to a valid guid. - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_s">"unset_s"</link>. +If you are constructing a #GDBusConnection and pass +%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the +#GDBusConnection:flags property you will be able to read the GUID +of the other peer here after the connection has been successfully +initialized. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.unset_struct">"unset_struct"</link>. +A boolean specifying whether the message is locked. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.WriteonlyProperty">"WriteonlyProperty"</link>. - -Since the D-Bus property for this #GObject property is writable but not readable, it is meaningful to write to it on both the client- and service-side. It is only meaningful, however, to read from it on the service-side. +The underlying #GIOStream used for I/O. - - +If this is passed on construction and is a #GSocketConnection, +then the corresponding #GSocket will be put into non-blocking mode. - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.x">"x"</link>. +While the #GDBusConnection is active, it will interact with this +stream from a worker thread, so it is not safe to interact with +the stream directly. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bar.y">"y"</link>. +The unique name as assigned by the message bus or %NULL if the +connection is not open or not a message bus connection. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bar-Frobnicator.RandomMethod">RandomMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bar_frobnicator_complete_random_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Flags used when creating a new #GDBusConnection. +Since: 2.26 - - A #FooiGenBarFrobnicator. - - - - A #GDBusMethodInvocation. + + No flags set. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-project-Bat.ForceSignal">"ForceSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenBat. + + Perform authentication against server. - - Argument. + + Perform authentication against client. - - Argument. + + When +authenticating as a server, allow the anonymous authentication +method. - - Argument. + + Pass this flag if connecting to a peer that is a +message bus. This means that the Hello() method will be invoked as part of the connection setup. - - Argument. + + If set, processing of D-Bus messages is +delayed until g_dbus_connection_start_message_processing() is called. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-Bat.ForceMethod">ForceMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_bat_complete_force_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Error codes for the %G_DBUS_ERROR error domain. +Since: 2.26 - - A #FooiGenBat. + + +A generic error; "something went wrong" - see the error message for +more. - - A #GDBusMethodInvocation. + + +There was not enough memory to complete an operation. - - Argument passed by remote caller. + + +The bus doesn't know how to launch a service to supply the bus name +you wanted. - - Argument passed by remote caller. + + +The bus name you referenced doesn't exist (i.e. no application owns +it). - - Argument passed by remote caller. + + +No reply to a message expecting one, usually means a timeout occurred. - - Argument passed by remote caller. + + +Something went wrong reading or writing to a socket, for example. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_ay">"force_ay"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - - - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_i">"force_i"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - - - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_s">"force_s"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - - - - -Represents the D-Bus property <link linkend="gdbus-property-org-project-Bat.force_struct">"force_struct"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.AddedSignalIn10">"AddedSignalIn10"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10. + + +A D-Bus bus address was malformed. - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.BarSignal">"BarSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. + + +Requested operation isn't supported (like ENOSYS on UNIX). - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.BazSignal">"BazSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. + + +Some limited resource is exhausted. - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.FooSignal">"FooSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. + + +Security restrictions don't allow doing what you're trying to do. - - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV10.AddedMethodIn10">AddedMethodIn10()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v10_complete_added_method_in10() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10. + + +Authentication didn't work. - - A #GDBusMethodInvocation. + + +Unable to connect to server (probably caused by ECONNREFUSED on a +socket). - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV10.BarMethod">BarMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v10_complete_bar_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenChangingInterfaceV10. + + +Certain timeout errors, possibly ETIMEDOUT on a socket. Note that +%G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning: +this is confusingly-named given that %G_DBUS_ERROR_TIMED_OUT also +exists. We can't fix it for compatibility reasons so just be +careful. - - A #GDBusMethodInvocation. + + +No network access (probably ENETUNREACH on a socket). - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV10.BazMethod">BazMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v10_complete_baz_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenChangingInterfaceV10. + + +Can't bind a socket since its address is in use (i.e. EADDRINUSE). - - A #GDBusMethodInvocation. + + +The connection is disconnected and you're trying to use it. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV10.FooMethod">FooMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v10_complete_foo_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenChangingInterfaceV10. + + +Invalid arguments passed to a method call. - - A #GDBusMethodInvocation. + + +Missing file. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV10.NewMethodIn2">NewMethodIn2()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v10_complete_new_method_in2() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10. + + +Existing file and the operation you're using does not silently overwrite. - - A #GDBusMethodInvocation. + + +Method name you invoked isn't known by the object you invoked it on. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV10.NewSignalIn2">"NewSignalIn2"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10. + + +Object you invoked a method on isn't known. Since 2.42 - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV1.BarSignal">"BarSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. + + +Interface you invoked a method on isn't known by the object. Since 2.42 - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV1.BazSignal">"BazSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. + + +Property you tried to access isn't known by the object. Since 2.42 - - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV1.FooSignal">"FooSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. + + +Property you tried to set is read-only. Since 2.42 - - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV1.BarMethod">BarMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v1_complete_bar_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenChangingInterfaceV1. + + +Certain timeout errors, e.g. while starting a service. Warning: this is +confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We +can't fix it for compatibility reasons so just be careful. - - A #GDBusMethodInvocation. + + +Tried to remove or modify a match rule that didn't exist. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV1.BazMethod">BazMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v1_complete_baz_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenChangingInterfaceV1. + + +The match rule isn't syntactically valid. - - A #GDBusMethodInvocation. + + +While starting a new process, the exec() call failed. + + + + +While starting a new process, the fork() call failed. + + + + +While starting a new process, the child exited with a status code. + + + + +While starting a new process, the child exited on a signal. + + + + +While starting a new process, something went wrong. + + + + +We failed to setup the environment correctly. + + + + +We failed to setup the config parser correctly. + + + + +Bus name was not valid. + + + + +Service file not found in system-services directory. + + + + +Permissions are incorrect on the setuid helper. + + + + +Service file invalid (Name, User or Exec missing). + + + + +Tried to get a UNIX process ID and it wasn't available. + + + + +Tried to get a UNIX process ID and it wasn't available. + + + + +A type signature is not valid. + + + + +A file contains invalid syntax or is otherwise broken. + + + + +Asked for SELinux security context and it wasn't available. + + + + +Asked for ADT audit data and it wasn't available. + + + + +There's already an object with the requested object path. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV1.FooMethod">FooMethod()</link> D-Bus method. +Emitted when a method is invoked by a remote caller and used to +determine if the method call is authorized. + +Note that this signal is emitted in a thread dedicated to +handling the method call so handlers are allowed to perform +blocking IO. This means that it is appropriate to call e.g. +[polkit_authority_check_authorization_sync()](http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync) +with the +[POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION](http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS) +flag set. + +If %FALSE is returned then no further handlers are run and the +signal handler must take a reference to @invocation and finish +handling the call (e.g. return an error via +g_dbus_method_invocation_return_error()). -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v1_complete_foo_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Otherwise, if %TRUE is returned, signal emission continues. If no +handlers return %FALSE, then the method is dispatched. If +@interface has an enclosing #GDBusObjectSkeleton, then the +#GDBusObjectSkeleton::authorize-method signal handlers run before +the handlers for this signal. + +The default class handler just returns %TRUE. + +Please note that the common case is optimized: if no signals +handlers are connected and the default class handler isn't +overridden (for both @interface and the enclosing +#GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does +not have the +%G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD +flags set, no dedicated thread is ever used and the call will be +handled in the same thread as the object that @interface belongs +to was exported in. +Since: 2.30 - - A #FooiGenChangingInterfaceV1. + + The #GDBusInterfaceSkeleton emitting the signal. @@ -1172,20817 +1312,5087 @@ If a signal handler returns %TRUE, it means the signal handler will handle the i - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + %TRUE if the call is authorized, %FALSE otherwise. + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV2.BarSignal">"BarSignal"</link> is received. +Flags from the #GDBusInterfaceSkeletonFlags enumeration. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.30 - - - A #FooiGenChangingInterfaceV2. - - - - - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV2.BazSignal">"BazSignal"</link> is received. +Flags describing the behavior of a #GDBusInterfaceSkeleton instance. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.30 - - A #FooiGenChangingInterfaceV2. + + No flags set. + + + + Each method invocation is handled in +a thread dedicated to the invocation. This means that the method implementation can use blocking IO +without blocking any other part of the process. It also means that the method implementation must +use locking to access data structures used by other threads. - - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV2.FooSignal">"FooSignal"</link> is received. +Enumeration used to describe the byte order of a D-Bus message. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.26 - - A #FooiGenChangingInterfaceV2. + + The byte order is big endian. + + + + The byte order is little endian. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV2.BarMethod">BarMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v2_complete_bar_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Message flags used in #GDBusMessage. +Since: 2.26 - - A #FooiGenChangingInterfaceV2. + + No flags set. - - A #GDBusMethodInvocation. + + A reply is not expected. + + + + The bus must not launch an +owner for the destination name in response to this message. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV2.BazMethod">BazMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v2_complete_baz_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Header fields used in #GDBusMessage. +Since: 2.26 - - A #FooiGenChangingInterfaceV2. + + Not a valid header field. - - A #GDBusMethodInvocation. + + The object path. + + + + The interface name. + + + + The method or signal name. + + + + The name of the error that occurred. + + + + The serial number the message is a reply to. + + + + The name the message is intended for. + + + + Unique name of the sender of the message (filled in by the bus). + + + + The signature of the message body. + + + + The number of UNIX file descriptors that accompany the message. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV2.FooMethod">FooMethod()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v2_complete_foo_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Message types used in #GDBusMessage. +Since: 2.26 - - A #FooiGenChangingInterfaceV2. + + Message is of invalid type. - - A #GDBusMethodInvocation. + + Method call. + + + + Method reply. + + + + Error reply. + + + + Signal emission. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-ChangingInterfaceV2.NewMethodIn2">NewMethodIn2()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_changing_interface_v2_complete_new_method_in2() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Emitted when @interface is added to @object. -Since: 2.0 +Since: 2.30 - A #FooiGenChangingInterfaceV2. + The #GDBusObject emitting the signal. - - A #GDBusMethodInvocation. + + The #GDBusInterface that was added. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-ChangingInterfaceV2.NewSignalIn2">"NewSignalIn2"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Emitted when @interface is removed from @object. -Since: 2.0 +Since: 2.30 - A #FooiGenChangingInterfaceV2. + The #GDBusObject emitting the signal. + + + + The #GDBusInterface that was removed. - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-acme-Coyote.Attack">Attack()</link> D-Bus method. +Emitted when @interface is added to @object. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_com_acme_coyote_complete_attack() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +This signal exists purely as a convenience to avoid having to +connect signals to all objects managed by @manager. +Since: 2.30 + + The #GDBusObjectManager emitting the signal. + + - A #FooiGenComAcmeCoyote. + The #GDBusObject on which an interface was added. - - A #GDBusMethodInvocation. + + The #GDBusInterface that was added. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-acme-Coyote.Run">Run()</link> D-Bus method. +Emitted when @interface has been removed from @object. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_com_acme_coyote_complete_run() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +This signal exists purely as a convenience to avoid having to +connect signals to all objects managed by @manager. +Since: 2.30 + + The #GDBusObjectManager emitting the signal. + + - A #FooiGenComAcmeCoyote. + The #GDBusObject on which an interface was removed. - - A #GDBusMethodInvocation. + + The #GDBusInterface that was removed. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-acme-Coyote.Sleep">Sleep()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_com_acme_coyote_complete_sleep() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Emitted when @object is added to @manager. +Since: 2.30 - - A #FooiGenComAcmeCoyote. + + The #GDBusObjectManager emitting the signal. - - A #GDBusMethodInvocation. + + The #GDBusObject that was added. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-acme-Coyote.Surprised">"Surprised"</link> is received. +Emitted when @object is removed from @manager. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.30 + + The #GDBusObjectManager emitting the signal. + + - A #FooiGenComAcmeCoyote. + The #GDBusObject that was removed. - + -Represents the D-Bus property <link linkend="gdbus-property-com-acme-Coyote.Mood">"Mood"</link>. - -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - - - +Emitted when one or more D-Bus properties on proxy changes. The +local cache has already been updated when this signal fires. Note +that both @changed_properties and @invalidated_properties are +guaranteed to never be %NULL (either may be empty though). - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-FDPassing.HelloFD">HelloFD()</link> D-Bus method. +This signal exists purely as a convenience to avoid having to +connect signals to all interface proxies managed by @manager. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_fdpassing_complete_hello_fd() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +This signal is emitted in the +[thread-default main context][g-main-context-push-thread-default] +that @manager was constructed in. +Since: 2.30 - - A #FooiGenFDPassing. - - - - A #GDBusMethodInvocation. - - - - A #GUnixFDList or %NULL. + + The #GDBusObjectManagerClient emitting the signal. - - Argument passed by remote caller. + + The #GDBusObjectProxy on which an interface has properties that are changing. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-project-InlineDocs.BarSignal">"BarSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - - - - - A #FooiGenInlineDocs. + + The #GDBusProxy that has properties that are changing. - - Argument. + + A #GVariant containing the properties that changed. - - Argument. + + A %NULL terminated array of properties that was invalidated. - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-InlineDocs.FooMethod">FooMethod()</link> D-Bus method. +Emitted when a D-Bus signal is received on @interface_proxy. + +This signal exists purely as a convenience to avoid having to +connect signals to all interface proxies managed by @manager. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_inline_docs_complete_foo_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +This signal is emitted in the +[thread-default main context][g-main-context-push-thread-default] +that @manager was constructed in. +Since: 2.30 - - A #FooiGenInlineDocs. + + The #GDBusObjectManagerClient emitting the signal. - - A #GDBusMethodInvocation. + + The #GDBusObjectProxy on which an interface is emitting a D-Bus signal. - - Argument passed by remote caller. + + The #GDBusProxy that is emitting a D-Bus signal. - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-InlineDocs.Method2">Method2()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_inline_docs_complete_method2() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenInlineDocs. + + The sender of the signal or NULL if the connection is not a bus connection. - - A #GDBusMethodInvocation. + + The signal name. - - Argument passed by remote caller. + + A #GVariant tuple with parameters for the signal. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - + - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.BazProperty">"BazProperty"</link>. +If this property is not %G_BUS_TYPE_NONE, then +#GDBusObjectManagerClient:connection must be %NULL and will be set to the +#GDBusConnection obtained by calling g_bus_get() with the value +of this property. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.FancyProperty">"FancyProperty"</link>. +The #GDBusConnection to use. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property2">"Property2"</link>. +Flags from the #GDBusObjectManagerClientFlags enumeration. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property3">"Property3"</link>. +A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property4">"Property4"</link>. +The #GDBusProxyTypeFunc to use when determining what #GType to +use for interface proxies or %NULL. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - + -Represents the D-Bus property <link linkend="gdbus-property-org-project-InlineDocs.Property5">"Property5"</link>. +The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.30 - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-project-MethodThreads.GetSelf">GetSelf()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_method_threads_complete_get_self() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - - - - - - A #FooiGenMethodThreads. - - - - A #GDBusMethodInvocation. - - - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - + -Represents the D-Bus property <link linkend="gdbus-property-Naming.Type">"Type"</link>. +The well-known name or unique name that the manager is for. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.30 - + -The #FooiGenAuthorize instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link>, if any. +The unique name that owns #GDBusObjectManagerClient:name or %NULL if +no-one is currently owning the name. Connect to the +#GObject::notify signal to track changes to this property. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenBar instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link>, if any. +The object path the manager is for. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenBarFrobnicator instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link>, if any. +Flags used when constructing a #GDBusObjectManagerClient. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + + + No flags set. + + + + If not set and the +manager is for a well-known name, then request the bus to launch +an owner for the name if no-one owns the name. This flag can only +be used in managers for well-known names. + + + + - + -The #FooiGenBat instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link>, if any. +The #GDBusConnection to export objects on. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenBaz instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link>, if any. +The object path to register the manager object at. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenChangingInterfaceV1 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link>, if any. +The connection of the proxy. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenChangingInterfaceV10 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link>, if any. +The object path of the proxy. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenChangingInterfaceV2 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link>, if any. - -Connect to the #GObject::notify signal to get informed of property changes. +Emitted when a method is invoked by a remote caller and used to +determine if the method call is authorized. - - +This signal is like #GDBusInterfaceSkeleton's +#GDBusInterfaceSkeleton::g-authorize-method signal, +except that it is for the enclosing object. - - -The #FooiGenComAcmeCoyote instance corresponding to the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link>, if any. +The default class handler just returns %TRUE. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - - - - -The #FooiGenFDPassing instance corresponding to the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link>, if any. - -Connect to the #GObject::notify signal to get informed of property changes. + + + The #GDBusObjectSkeleton emitting the signal. + + + + The #GDBusInterfaceSkeleton that @invocation is for. + + + + A #GDBusMethodInvocation. + + + + %TRUE if the call is authorized, %FALSE otherwise. - - + + - + -The #FooiGenInlineDocs instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link>, if any. +The object path where the object is exported. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.30 - + -The #FooiGenMethodThreads instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link>, if any. +Flags describing the access control of a D-Bus property. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.26 - + + + No flags set. + + + + Property is readable. + + + + Property is writable. + + + + - + -The #FooiGenNaming instance corresponding to the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link>, if any. - -Connect to the #GObject::notify signal to get informed of property changes. - - - +Emitted when one or more D-Bus properties on @proxy changes. The +local cache has already been updated when this signal fires. Note +that both @changed_properties and @invalidated_properties are +guaranteed to never be %NULL (either may be empty though). - - -The #FooiGenOldieInterface instance corresponding to the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link>, if any. +If the proxy has the flag +%G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then +@invalidated_properties will always be empty. -Connect to the #GObject::notify signal to get informed of property changes. +This signal corresponds to the +`PropertiesChanged` D-Bus signal on the +`org.freedesktop.DBus.Properties` interface. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.26 - + + + The #GDBusProxy emitting the signal. + + + + A #GVariant containing the properties that changed + + + + A %NULL terminated array of properties that was invalidated + + + + + - + -The #FooiGenRocket123 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link>, if any. +Emitted when a signal from the remote object and interface that @proxy is for, has been received. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.26 - + + + The #GDBusProxy emitting the signal. + + + + The sender of the signal or %NULL if the connection is not a bus connection. + + + + The name of the signal. + + + + A #GVariant tuple with parameters for the signal. + + + + + - + -The #FooiGenTesTuglyCASEInterface instance corresponding to the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link>, if any. +If this property is not %G_BUS_TYPE_NONE, then +#GDBusProxy:g-connection must be %NULL and will be set to the +#GDBusConnection obtained by calling g_bus_get() with the value +of this property. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.26 - + -The #FooiGenUnknownXmlTags instance corresponding to the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link>, if any. +The #GDBusConnection the proxy is for. -Connect to the #GObject::notify signal to get informed of property changes. +Since: 2.26 - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-OldieInterface.Bar">"Bar"</link> is received. +The timeout to use if -1 (specifying default timeout) is passed +as @timeout_msec in the g_dbus_proxy_call() and +g_dbus_proxy_call_sync() functions. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +This allows applications to set a proxy-wide timeout for all +remote method invocations on the proxy. If this property is -1, +the default timeout (typically 25 seconds) is used. If set to +%G_MAXINT, then no timeout is used. -Deprecated: The D-Bus signal has been deprecated. +Since: 2.26 - - - A #FooiGenOldieInterface. - - - - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-OldieInterface.Foo">Foo()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_oldie_interface_complete_foo() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Flags from the #GDBusProxyFlags enumeration. -Deprecated: The D-Bus method has been deprecated. +Since: 2.26 - - - A #FooiGenOldieInterface. - - - - A #GDBusMethodInvocation. - - - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - + - + -Represents the D-Bus property <link linkend="gdbus-property-OldieInterface.Bat">"Bat"</link>. +Ensure that interactions with this proxy conform to the given +interface. This is mainly to ensure that malformed data received +from the other peer is ignored. The given #GDBusInterfaceInfo is +said to be the "expected interface". -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +The checks performed are: +- When completing a method call, if the type signature of +the reply message isn't what's expected, the reply is +discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT. -Deprecated: The D-Bus property has been deprecated. +- Received signals that have a type signature mismatch are dropped and +a warning is logged via g_warning(). - - +- Properties received via the initial `GetAll()` call or via the +`::PropertiesChanged` signal (on the +[org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties) +interface) or set using g_dbus_proxy_set_cached_property() +with a type signature mismatch are ignored and a warning is +logged via g_warning(). - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-com-acme-Rocket.Exploded">"Exploded"</link> is received. +Note that these checks are never done on methods, signals and +properties that are not referenced in the given +#GDBusInterfaceInfo, since extending a D-Bus interface on the +service-side is not considered an ABI break. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.26 - - - A #FooiGenRocket123. - - - - - + - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-com-acme-Rocket.Ignite">Ignite()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_rocket123_complete_ignite_xyz() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +The D-Bus interface name the proxy is for. +Since: 2.26 - - - A #FooiGenRocket123. - - - - A #GDBusMethodInvocation. - - - - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Direction">"Direction"</link>. +The well-known or unique name that the proxy is for. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Speed">"Speed"</link>. +The unique name that owns #GDBusProxy:g-name or %NULL if no-one +currently owns that name. You may connect to #GObject::notify signal to +track changes to this property. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.26 - + -Represents the D-Bus property <link linkend="gdbus-property-com-acme-Rocket.Type">"Type"</link>. +The object path the proxy is for. -Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. +Since: 2.26 - + -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-TestUglyCaseInterface.GetiSCSIServers">GetiSCSIServers()</link> D-Bus method. - -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_test_ugly_case_interface_complete_get_iscsi_servers() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +Flags used when constructing an instance of a #GDBusProxy derived class. +Since: 2.26 - - A #FooiGenTesTuglyCASEInterface. + + No flags set. - - A #GDBusMethodInvocation. + + Don't load properties. + + + + Don't connect to signals on the remote object. + + + + If not set and the proxy if for a well-known name, +then request the bus to launch an owner for the name if no-one owns the name. This flag can +only be used in proxies for well-known names. + + + + If set, the property value for any <emphasis>invalidated property</emphasis> will be (asynchronously) retrieved upon receiving the <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">PropertiesChanged</ulink> D-Bus signal and the property will not cause emission of the #GDBusProxy::g-properties-changed signal. When the value is received the #GDBusProxy::g-properties-changed signal is emitted for the property along with the retrieved value. Since 2.32. + + + + If the proxy is for a well-known name, +do not ask the bus to launch an owner during proxy initialization, but allow it to be +autostarted by a method call. This flag is only meaningful in proxies for well-known names, +and only if %G_DBUS_PROXY_FLAGS_DO_NOT_AUTOSTART is not also specified. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - + - + -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-TestUglyCaseInterface.serversUPDATEDNOW">"serversUPDATEDNOW"</link> is received. +Flags used when sending #GDBusMessages on a #GDBusConnection. -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. +Since: 2.26 - - A #FooiGenTesTuglyCASEInterface. + + No flags set. + + + + Do not automatically +assign a serial number from the #GDBusConnection object when +sending a message. - - + - + -Represents the D-Bus property <link linkend="gdbus-property-TestUglyCaseInterface.UGLYNAME">"UGLYNAME"</link>. - -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Emitted when a new authenticated connection has been made. Use +g_dbus_connection_get_peer_credentials() to figure out what +identity (if any), was authenticated. - - +If you want to accept the connection, take a reference to the +@connection object and return %TRUE. When you are done with the +connection call g_dbus_connection_close() and give up your +reference. Note that the other peer may disconnect at any time - +a typical thing to do when accepting a connection is to listen to +the #GDBusConnection::closed signal. - - -Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-UnknownXmlTags.CanSetTimezone">CanSetTimezone()</link> D-Bus method. +If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD +then the signal is emitted in a new thread dedicated to the +connection. Otherwise the signal is emitted in the +[thread-default main context][g-main-context-push-thread-default] +of the thread that @server was constructed in. -If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call foo_igen_unknown_xml_tags_complete_can_set_timezone() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. +You are guaranteed that signal handlers for this signal runs +before incoming messages on @connection are processed. This means +that it's suitable to call g_dbus_connection_register_object() or +similar from the signal handler. +Since: 2.26 - - A #FooiGenUnknownXmlTags. + + The #GDBusServer emitting the signal. - - A #GDBusMethodInvocation. + + A #GDBusConnection for the new connection. - %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - - - - - -On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-UnknownXmlTags.SomeSignal">"SomeSignal"</link> is received. - -On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + %TRUE to claim @connection, %FALSE to let other handlers +run. - - - - A #FooiGenUnknownXmlTags. - - - - + - + -Represents the D-Bus property <link linkend="gdbus-property-UnknownXmlTags.SomeProperty">"SomeProperty"</link>. +Whether the server is currently active. -Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. +Since: 2.26 - + -If @action is currently enabled. - -If the action is disabled then calls to g_action_activate() and -g_action_change_state() have no effect. +The D-Bus address to listen on. -Since: 2.28 +Since: 2.26 - + -The name of the action. This is mostly meaningful for identifying -the action once it has been added to a #GActionGroup. It is immutable. +A #GDBusAuthObserver object to assist in the authentication process or %NULL. -Since: 2.28 +Since: 2.26 - + -The type of the parameter that must be given when activating the -action. This is immutable, and may be %NULL if no parameter is needed when -activating the action. +The D-Bus address that clients can use. -Since: 2.28 +Since: 2.26 - + -The state of the action, or %NULL if the action is stateless. +Flags from the #GDBusServerFlags enumeration. -Since: 2.28 +Since: 2.26 - + -The #GVariantType of the state that the action has, or %NULL if the -action is stateless. This is immutable. +The guid of the server. -Since: 2.28 +Since: 2.26 - + -Signals that a new action was just added to the group. -This signal is emitted after the action has been added -and is now visible. +Flags used when creating a #GDBusServer. -Since: 2.28 +Since: 2.26 - - the #GActionGroup that changed + + No flags set. - - the name of the action in @action_group + + All #GDBusServer::new-connection +signals will run in separated dedicated threads (see signal for +details). + + + + Allow the anonymous +authentication method. - - + - + -Signals that the enabled status of the named action has changed. +Flags used when subscribing to signals via g_dbus_connection_signal_subscribe(). -Since: 2.28 +Since: 2.26 - - the #GActionGroup that changed + + No flags set. - - the name of the action in @action_group + + Don't actually send the AddMatch +D-Bus call for this signal subscription. This gives you more control +over which match rules you add (but you must add them manually). - - whether the action is enabled or not + + Match first arguments that +contain a bus or interface name with the given namespace. + + + + Match first arguments that +contain an object path that is either equivalent to the given path, +or one of the paths is a subpath of the other. - - + - + -Signals that an action is just about to be removed from the group. -This signal is emitted before the action is removed, so the action -is still visible and can be queried from the signal handler. +Flags passed to g_dbus_connection_register_subtree(). -Since: 2.28 +Since: 2.26 - - the #GActionGroup that changed + + No flags set. - - the name of the action in @action_group + + Method calls to objects not in the enumerated range +will still be dispatched. This is useful if you want +to dynamically spawn objects in the subtree. - - + - + -Signals that the state of the named action has changed. - -Since: 2.28 +Determines the byte ordering that is used when writing +multi-byte entities (such as integers) to the stream. - - - the #GActionGroup that changed + + + + +The ::byte-order property determines the byte ordering that +is used when reading multi-byte entities (such as integers) +from the stream. + + + + + + +The :newline-type property determines what is considered +as a line ending when reading complete lines from the stream. + + + + + + +#GDataStreamByteOrder is used to ensure proper endianness of streaming data sources +across various machine architectures. + + + + + + Selects Big Endian byte order. - - the name of the action in @action_group + + Selects Little Endian byte order. - - the new value of the state + + Selects endianness based on host machine's architecture. - - + - + -Flags used when creating a #GAppInfo. +#GDataStreamNewlineType is used when checking for or setting the line endings for a given file. - - No flags. + + Selects "LF" line endings, common on most modern UNIX platforms. - - Application opens in a terminal window. + + Selects "CR" line endings. - - Application supports URI arguments. + + Selects "CR, LF" line ending, common on Microsoft Windows. - - Application supports startup notification. Since 2.26 + + Automatically try to handle any line ending type. - + -Signal emitted when the app info database for changes (ie: newly installed -or removed applications). +The origin filename of this #GDesktopAppInfo - - - - + - + -The ::launch-failed signal is emitted when a #GAppInfo launch -fails. The startup notification id is provided, so that the launcher -can cancel the startup notification. - -Since: 2.36 +Emitted when the drive's state has changed. - - the object emitting the signal - - - - the startup notification id for the failed launch + + a #GDrive. - + -The ::launched signal is emitted when a #GAppInfo is successfully -launched. The @platform_data is an GVariant dictionary mapping -strings to variants (ie a{sv}), which contains additional, -platform-specific data about this launch. On UNIX, at least the -"pid" and "startup-notification-id" keys will be present. - -Since: 2.36 +This signal is emitted when the #GDrive have been +disconnected. If the recipient is holding references to the +object they should release them so the object can be +finalized. - - the object emitting the signal - - - - the #GAppInfo that was just launched - - - - additional platform-specific data for this launch + + a #GDrive. - + -The ::activate signal is emitted on the primary instance when an -activation occurs. See g_application_activate(). +Emitted when the physical eject button (if any) of a drive has +been pressed. - - the application + + a #GDrive. - + -The ::command-line signal is emitted on the primary instance when -a commandline is not handled locally. See g_application_run() and -the #GApplicationCommandLine documentation for more information. +Emitted when the physical stop button (if any) of a drive has +been pressed. +Since: 2.22 - - the application - - - - a #GApplicationCommandLine representing the -passed commandline + + a #GDrive. - An integer that is set as the exit status for the calling -process. See g_application_command_line_set_exit_status(). - + - + -The ::handle-local-options signal is emitted on the local instance -after the parsing of the commandline options has occurred. - -You can add options to be recognised during commandline option -parsing using g_application_add_main_option_entries() and -g_application_add_option_group(). - -Signal handlers can inspect @options (along with values pointed to -from the @arg_data of an installed #GOptionEntrys) in order to -decide to perform certain actions, including direct local handling -(which may be useful for options like --version). - -In the event that the application is marked -%G_APPLICATION_HANDLES_COMMAND_LINE the "normal processing" will -send the @option dictionary to the primary instance where it can be -read with g_application_command_line_get_options(). The signal -handler can modify the dictionary before returning, and the -modified dictionary will be sent. - -In the event that %G_APPLICATION_HANDLES_COMMAND_LINE is not set, -"normal processing" will treat the remaining uncollected command -line arguments as filenames or URIs. If there are no arguments, -the application is activated by g_application_activate(). One or -more arguments results in a call to g_application_open(). +Flags used when starting a drive. -If you want to handle the local commandline arguments for yourself -by converting them to calls to g_application_open() or -g_action_group_activate_action() then you must be sure to register -the application first. You should probably not call -g_application_activate() for yourself, however: just return -1 and -allow the default handler to do it for you. This will ensure that -the `--gapplication-service` switch works properly (i.e. no activation -in that case). +Since: 2.22 -Note that this signal is emitted from the default implementation of -local_command_line(). If you override that function and don't -chain up then this signal will never be emitted. + + + + No flags set. + + + + -You can override local_command_line() if you need more powerful -capabilities than what is provided here, but this should not -normally be required. + + +Enumeration describing how a drive can be started/stopped. -Since: 2.40 +Since: 2.22 - - the application + + Unknown or drive doesn't support +start/stop. - - the options dictionary + + The stop method will physically +shut down the drive and e.g. power down the port the drive is +attached to. + + + + The start/stop methods are used +for connecting/disconnect to the drive over the network. + + + + The start/stop methods will +assemble/disassemble a virtual drive from several physical +drives. + + + + The start/stop methods will +unlock/lock the disk (for example using the ATA <quote>SECURITY +UNLOCK DEVICE</quote> command) - an exit code. If you have handled your options and want -to exit the process, return a non-negative option, 0 for success, -and a positive value for failure. To continue, return -1 to let -the default option processing continue. - - - + - + -The ::open signal is emitted on the primary instance when there are -files to open. See g_application_open() for more information. +GEmblemOrigin is used to add information about the origin of the emblem +to #GEmblem. + +Since: 2.18 - - the application + + Emblem of unknown origin - - an array of #GFiles + + Emblem adds device-specific information - - the length of @files + + Emblem depicts live metadata, such as "readonly" - - a hint provided by the calling instance + + Emblem comes from a user-defined tag, e.g. set by nautilus (in the future) - - + - + -The ::shutdown signal is emitted only on the registered primary instance -immediately after the main loop terminates. +Flags specifying the behaviour of an attribute. - - the application + + no flags set. + + + + copy the attribute values when the file is copied. + + + + copy the attribute values when the file is moved. - - + - + -The ::startup signal is emitted on the primary instance immediately -after registration. See g_application_register(). +Used by g_file_set_attributes_from_info() when setting file attributes. - - the application + + Attribute value is unset (empty). + + + + Attribute value is set. + + + + Indicates an error in setting the value. - - - - - -Whether the application is currently marked as busy through -g_application_mark_busy() or g_application_bind_busy_property(). - -Since: 2.44 - - - + - + -Flags used to define the behaviour of a #GApplication. - -Since: 2.28 +The data types for file attributes. - - Default + + indicates an invalid or uninitalized type. - - Run as a service. In this mode, registration -fails if the service is already running, and the application -will initially wait up to 10 seconds for an initial activation -message to arrive. + + a null terminated UTF8 string. - - Don't try to become the primary instance. + + a zero terminated string of non-zero bytes. - - This application handles opening files (in -the primary instance). Note that this flag only affects the default -implementation of local_command_line(), and has no effect if -%G_APPLICATION_HANDLES_COMMAND_LINE is given. -See g_application_run() for details. + + a boolean value. - - This application handles command line -arguments (in the primary instance). Note that this flag only affect -the default implementation of local_command_line(). -See g_application_run() for details. + + an unsigned 4-byte/32-bit integer. - - Send the environment of the -launching process to the primary instance. Set this flag if your -application is expected to behave differently depending on certain -environment variables. For instance, an editor might be expected -to use the <envar>GIT_COMMITTER_NAME</envar> environment variable -when editing a git commit message. The environment is available -to the #GApplication::command-line signal handler, via -g_application_command_line_getenv(). + + a signed 4-byte/32-bit integer. - - Make no attempts to do any of the typical -single-instance application negotiation, even if the application -ID is given. The application neither attempts to become the -owner of the application ID nor does it check if an existing -owner already exists. Everything occurs in the local process. -Since: 2.30. + + an unsigned 8-byte/64-bit integer. + + + + a signed 8-byte/64-bit integer. + + + + a #GObject. + + + + a %NULL terminated char **. Since 2.22 - + -#GAskPasswordFlags are used to request specific information from the -user, or to notify the user of their choices in an authentication -situation. +Flags used when copying or moving files. - - operation requires a password. + + No flags set. - - operation requires a username. + + Overwrite any existing files - - operation requires a domain. + + Make a backup of any existing files. - - operation supports saving settings. + + Don't follow symlinks. - - operation supports anonymous users. + + Copy all file metadata instead of just default set used for copy (see #GFileInfo). + + + + Don't use copy and delete fallback if native move not supported. + + + + Leaves target file with default perms, instead of setting the source file perms. - + -Flags used in g_bus_own_name(). - -Since: 2.26 +Flags used when an operation may create a file. - + No flags set. - - Allow another message bus connection to claim the name. + + Create a file that can only be +accessed by the current user. - - If another message bus connection owns the name and have -specified #G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection. + + Replace the destination +as if it didn't exist before. Don't try to keep any old +permissions, replace instead of following links. This +is generally useful if you're doing a "copy over" +rather than a "save new version of" replace operation. +You can think of it as "unlink destination" before +writing to it, although the implementation may not +be exactly like that. Since 2.20 - + -Flags used in g_bus_watch_name(). - -Since: 2.26 +The file containing the icon. - - - No flags set. - - - - If no-one owns the name when -beginning to watch the name, ask the bus to launch an owner for the -name. - - - - + - + -An enumeration for well-known message buses. +Flags that can be used with g_file_measure_disk_usage(). -Since: 2.26 +Since: 2.38 - - An alias for the message bus that activated the process, if any. + + No flags set. - - Not a message bus. + + Report any error encountered +while traversing the directory tree. Normally errors are only +reported for the toplevel file. - - The system-wide message bus. + + Tally usage based on apparent file +sizes. Normally, the block-size is used, if available, as this is a +more accurate representation of disk space used. +Compare with `du --apparent-size`. - - The login session message bus. + + Do not cross mount point boundaries. +Compare with `du -x`. - + -The bytes containing the icon. - - - +Emitted when @file has been changed. - - -Emitted when the operation has been cancelled. +If using %G_FILE_MONITOR_WATCH_RENAMES on a directory monitor, and +the information is available (and if supported by the backend), +@event_type may be %G_FILE_MONITOR_EVENT_RENAMED, +%G_FILE_MONITOR_EVENT_MOVED_IN or %G_FILE_MONITOR_EVENT_MOVED_OUT. -Can be used by implementations of cancellable operations. If the -operation is cancelled from another thread, the signal will be -emitted in the thread that cancelled the operation, not the -thread that is running the operation. +In all cases @file will be a child of the monitored directory. For +renames, @file will be the old name and @other_file is the new +name. For "moved in" events, @file is the name of the file that +appeared and @other_file is the old name that it was moved from (in +another directory). For "moved out" events, @file is the name of +the file that used to be in this directory and @other_file is the +name of the file at its new location. -Note that disconnecting from this signal (or any signal) in a -multi-threaded program is prone to race conditions. For instance -it is possible that a signal handler may be invoked even after -a call to g_signal_handler_disconnect() for that handler has -already returned. - -There is also a problem when cancellation happens right before -connecting to the signal. If this happens the signal will -unexpectedly not be emitted, and checking before connecting to -the signal leaves a race condition where this is still happening. - -In order to make it safe and easy to connect handlers there -are two helper functions: g_cancellable_connect() and -g_cancellable_disconnect() which protect against problems -like this. - -An example of how to us this: -|[<!-- language="C" --> -// Make sure we don't do unnecessary work if already cancelled -if (g_cancellable_set_error_if_cancelled (cancellable, error)) -return; - -// Set up all the data needed to be able to handle cancellation -// of the operation -my_data = my_data_new (...); - -id = 0; -if (cancellable) -id = g_cancellable_connect (cancellable, -G_CALLBACK (cancelled_handler) -data, NULL); - -// cancellable operation here... - -g_cancellable_disconnect (cancellable, id); - -// cancelled_handler is never called after this, it is now safe -// to free the data -my_data_free (my_data); -]| - -Note that the cancelled signal is emitted in the thread that -the user cancelled from, which may be the main thread. So, the -cancellable signal should not do something that can block. - - - - - a #GCancellable. - - - - - - - - -Flags used when calling a g_converter_convert(). - -Since: 2.24 - - - - - No flags. - - - - At end of input data - - - - Flush data - - - - - - - -Results returned from g_converter_convert(). - -Since: 2.24 - - - - - There was an error during conversion. - - - - Some data was consumed or produced - - - - The conversion is finished - - - - Flushing is finished - - - - - - - -Enumeration describing different kinds of native credential types. - -Since: 2.26 - - - - - Indicates an invalid native credential type. - - - - The native credentials type is a <type>struct ucred</type>. - - - - The native credentials type is a <type>struct cmsgcred</type>. - - - - The native credentials type is a <type>struct sockpeercred</type>. Added in 2.30. - - - - The native credentials type is a <type>ucred_t</type>. Added in 2.40. - - - - The native credentials type is a <type>struct unpcbid</type>. - - - - - - - -If authenticating as a server, this property contains the -received credentials, if any. - -If authenticating as a client, the property contains the -credentials that were sent, if any. - - - - - - -Emitted to check if @mechanism is allowed to be used. - -Since: 2.34 - - - - - The #GDBusAuthObserver emitting the signal. - - - - The name of the mechanism, e.g. `DBUS_COOKIE_SHA1`. - - - - %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not. - - - - - - -Emitted to check if a peer that is successfully authenticated -is authorized. - -Since: 2.26 - - - - - The #GDBusAuthObserver emitting the signal. - - - - A #GIOStream for the #GDBusConnection. - - - - Credentials received from the peer or %NULL. - - - - %TRUE if the peer is authorized, %FALSE if not. - - - - - - -Flags used in g_dbus_connection_call() and similar APIs. - -Since: 2.26 - - - - - No flags set. - - - - The bus must not launch -an owner for the destination name in response to this method -invocation. - - - - +It makes sense to treat %G_FILE_MONITOR_EVENT_MOVED_IN as +equivalent to %G_FILE_MONITOR_EVENT_CREATED and +%G_FILE_MONITOR_EVENT_MOVED_OUT as equivalent to +%G_FILE_MONITOR_EVENT_DELETED, with extra information. +%G_FILE_MONITOR_EVENT_RENAMED is equivalent to a delete/create +pair. This is exactly how the events will be reported in the case +that the %G_FILE_MONITOR_WATCH_RENAMES flag is not in use. - - -Capabilities negotiated with the remote peer. +If using the deprecated flag %G_FILE_MONITOR_SEND_MOVED flag and @event_type is +#G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the +old path, and @other_file will be set to a #GFile containing the new path. -Since: 2.26 +In all the other cases, @other_file will be set to #NULL. - - No flags set. - - - - The connection -supports exchanging UNIX file descriptors with the remote peer. + + a #GFileMonitor. - - - - - -Emitted when the connection is closed. - -The cause of this event can be - -- If g_dbus_connection_close() is called. In this case -@remote_peer_vanished is set to %FALSE and @error is %NULL. - -- If the remote peer closes the connection. In this case -@remote_peer_vanished is set to %TRUE and @error is set. - -- If the remote peer sends invalid or malformed data. In this -case @remote_peer_vanished is set to %FALSE and @error is set. - -Upon receiving this signal, you should give up your reference to -@connection. You are guaranteed that this signal is emitted only -once. - -Since: 2.26 - - - - - the #GDBusConnection emitting the signal + + a #GFile. - - %TRUE if @connection is closed because the -remote peer closed its end of the connection + + a #GFile or #NULL. - - a #GError with more details about the event or %NULL + + a #GFileMonitorEvent. - - -A D-Bus address specifying potential endpoints that can be used -when establishing the connection. - -Since: 2.26 - - - - - - -A #GDBusAuthObserver object to assist in the authentication process or %NULL. - -Since: 2.26 - - - - - - -Flags from the #GDBusCapabilityFlags enumeration -representing connection features negotiated with the other peer. - -Since: 2.26 - - - - - - -A boolean specifying whether the connection has been closed. - -Since: 2.26 - - - - - - -A boolean specifying whether the process will be terminated (by -calling `raise(SIGTERM)`) if the connection is closed by the -remote peer. - -Note that #GDBusConnection objects returned by g_bus_get_finish() -and g_bus_get_sync() will (usually) have this property set to %TRUE. - -Since: 2.26 - - - - - - -Flags from the #GDBusConnectionFlags enumeration. - -Since: 2.26 - - - - - - -The GUID of the peer performing the role of server when -authenticating. - -If you are constructing a #GDBusConnection and pass -%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the -#GDBusConnection:flags property then you MUST also set this -property to a valid guid. - -If you are constructing a #GDBusConnection and pass -%G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the -#GDBusConnection:flags property you will be able to read the GUID -of the other peer here after the connection has been successfully -initialized. - -Since: 2.26 - - - - - - -A boolean specifying whether the message is locked. - -Since: 2.26 - - - - - - -The underlying #GIOStream used for I/O. - -If this is passed on construction and is a #GSocketConnection, -then the corresponding #GSocket will be put into non-blocking mode. - -While the #GDBusConnection is active, it will interact with this -stream from a worker thread, so it is not safe to interact with -the stream directly. - -Since: 2.26 - - - - - - -The unique name as assigned by the message bus or %NULL if the -connection is not open or not a message bus connection. - -Since: 2.26 - - - - - - -Flags used when creating a new #GDBusConnection. - -Since: 2.26 - - - - - No flags set. - - - - Perform authentication against server. - - - - Perform authentication against client. - - - - When -authenticating as a server, allow the anonymous authentication -method. - - - - Pass this flag if connecting to a peer that is a -message bus. This means that the Hello() method will be invoked as part of the connection setup. - - - - If set, processing of D-Bus messages is -delayed until g_dbus_connection_start_message_processing() is called. - - - - - - + -Error codes for the %G_DBUS_ERROR error domain. - -Since: 2.26 +Specifies what type of event a monitor event is. - - -A generic error; "something went wrong" - see the error message for -more. - - - - -There was not enough memory to complete an operation. + + a file changed. - - -The bus doesn't know how to launch a service to supply the bus name -you wanted. + + a hint that this was probably the last change in a set of changes. - - -The bus name you referenced doesn't exist (i.e. no application owns -it). + + a file was deleted. - - -No reply to a message expecting one, usually means a timeout occurred. + + a file was created. - - -Something went wrong reading or writing to a socket, for example. + + a file attribute was changed. - - -A D-Bus bus address was malformed. + + the file location will soon be unmounted. - - -Requested operation isn't supported (like ENOSYS on UNIX). + + the file location was unmounted. - - -Some limited resource is exhausted. + + the file was moved -- only sent if the +(deprecated) %G_FILE_MONITOR_SEND_MOVED flag is set - - -Security restrictions don't allow doing what you're trying to do. + + the file was renamed within the +current directory -- only sent if the %G_FILE_MONITOR_WATCH_MOVES +flag is set. Since: 2.44. - - -Authentication didn't work. + + the file was moved into the +monitored directory from another location -- only sent if the +%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44. - - -Unable to connect to server (probably caused by ECONNREFUSED on a -socket). - - - - -Certain timeout errors, possibly ETIMEDOUT on a socket. Note that -%G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning: -this is confusingly-named given that %G_DBUS_ERROR_TIMED_OUT also -exists. We can't fix it for compatibility reasons so just be -careful. - - - - -No network access (probably ENETUNREACH on a socket). - - - - -Can't bind a socket since its address is in use (i.e. EADDRINUSE). - - - - -The connection is disconnected and you're trying to use it. - - - - -Invalid arguments passed to a method call. - - - - -Missing file. - - - - -Existing file and the operation you're using does not silently overwrite. - - - - -Method name you invoked isn't known by the object you invoked it on. - - - - -Object you invoked a method on isn't known. Since 2.42 - - - - -Interface you invoked a method on isn't known by the object. Since 2.42 - - - - -Property you tried to access isn't known by the object. Since 2.42 - - - - -Property you tried to set is read-only. Since 2.42 - - - - -Certain timeout errors, e.g. while starting a service. Warning: this is -confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We -can't fix it for compatibility reasons so just be careful. - - - - -Tried to remove or modify a match rule that didn't exist. - - - - -The match rule isn't syntactically valid. - - - - -While starting a new process, the exec() call failed. - - - - -While starting a new process, the fork() call failed. - - - - -While starting a new process, the child exited with a status code. - - - - -While starting a new process, the child exited on a signal. - - - - -While starting a new process, something went wrong. - - - - -We failed to setup the environment correctly. - - - - -We failed to setup the config parser correctly. - - - - -Bus name was not valid. - - - - -Service file not found in system-services directory. - - - - -Permissions are incorrect on the setuid helper. - - - - -Service file invalid (Name, User or Exec missing). - - - - -Tried to get a UNIX process ID and it wasn't available. - - - - -Tried to get a UNIX process ID and it wasn't available. - - - - -A type signature is not valid. - - - - -A file contains invalid syntax or is otherwise broken. - - - - -Asked for SELinux security context and it wasn't available. - - - - -Asked for ADT audit data and it wasn't available. - - - - -There's already an object with the requested object path. - - - - - - - -Emitted when a method is invoked by a remote caller and used to -determine if the method call is authorized. - -Note that this signal is emitted in a thread dedicated to -handling the method call so handlers are allowed to perform -blocking IO. This means that it is appropriate to call e.g. -[polkit_authority_check_authorization_sync()](http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync) -with the -[POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION](http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS) -flag set. - -If %FALSE is returned then no further handlers are run and the -signal handler must take a reference to @invocation and finish -handling the call (e.g. return an error via -g_dbus_method_invocation_return_error()). - -Otherwise, if %TRUE is returned, signal emission continues. If no -handlers return %FALSE, then the method is dispatched. If -@interface has an enclosing #GDBusObjectSkeleton, then the -#GDBusObjectSkeleton::authorize-method signal handlers run before -the handlers for this signal. - -The default class handler just returns %TRUE. - -Please note that the common case is optimized: if no signals -handlers are connected and the default class handler isn't -overridden (for both @interface and the enclosing -#GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does -not have the -%G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD -flags set, no dedicated thread is ever used and the call will be -handled in the same thread as the object that @interface belongs -to was exported in. - -Since: 2.30 - - - - - The #GDBusInterfaceSkeleton emitting the signal. - - - - A #GDBusMethodInvocation. - - - - %TRUE if the call is authorized, %FALSE otherwise. - - - - - - -Flags from the #GDBusInterfaceSkeletonFlags enumeration. - -Since: 2.30 - - - - - - -Flags describing the behavior of a #GDBusInterfaceSkeleton instance. - -Since: 2.30 - - - - - No flags set. - - - - Each method invocation is handled in -a thread dedicated to the invocation. This means that the method implementation can use blocking IO -without blocking any other part of the process. It also means that the method implementation must -use locking to access data structures used by other threads. - - - - - - - -Enumeration used to describe the byte order of a D-Bus message. - -Since: 2.26 - - - - - The byte order is big endian. - - - - The byte order is little endian. - - - - - - - -Message flags used in #GDBusMessage. - -Since: 2.26 - - - - - No flags set. - - - - A reply is not expected. - - - - The bus must not launch an -owner for the destination name in response to this message. - - - - - - - -Header fields used in #GDBusMessage. - -Since: 2.26 - - - - - Not a valid header field. - - - - The object path. - - - - The interface name. - - - - The method or signal name. - - - - The name of the error that occurred. - - - - The serial number the message is a reply to. - - - - The name the message is intended for. - - - - Unique name of the sender of the message (filled in by the bus). - - - - The signature of the message body. - - - - The number of UNIX file descriptors that accompany the message. - - - - - - - -Message types used in #GDBusMessage. - -Since: 2.26 - - - - - Message is of invalid type. - - - - Method call. - - - - Method reply. - - - - Error reply. - - - - Signal emission. - - - - - - - -Emitted when @interface is added to @object. - -Since: 2.30 - - - - - The #GDBusObject emitting the signal. - - - - The #GDBusInterface that was added. - - - - - - - - -Emitted when @interface is removed from @object. - -Since: 2.30 - - - - - The #GDBusObject emitting the signal. - - - - The #GDBusInterface that was removed. - - - - - - - - -Emitted when @interface is added to @object. - -This signal exists purely as a convenience to avoid having to -connect signals to all objects managed by @manager. - -Since: 2.30 - - - - - The #GDBusObjectManager emitting the signal. - - - - The #GDBusObject on which an interface was added. - - - - The #GDBusInterface that was added. - - - - - - - - -Emitted when @interface has been removed from @object. - -This signal exists purely as a convenience to avoid having to -connect signals to all objects managed by @manager. - -Since: 2.30 - - - - - The #GDBusObjectManager emitting the signal. - - - - The #GDBusObject on which an interface was removed. - - - - The #GDBusInterface that was removed. - - - - - - - - -Emitted when @object is added to @manager. - -Since: 2.30 - - - - - The #GDBusObjectManager emitting the signal. - - - - The #GDBusObject that was added. - - - - - - - - -Emitted when @object is removed from @manager. - -Since: 2.30 - - - - - The #GDBusObjectManager emitting the signal. - - - - The #GDBusObject that was removed. - - - - - - - - -Emitted when one or more D-Bus properties on proxy changes. The -local cache has already been updated when this signal fires. Note -that both @changed_properties and @invalidated_properties are -guaranteed to never be %NULL (either may be empty though). - -This signal exists purely as a convenience to avoid having to -connect signals to all interface proxies managed by @manager. - -This signal is emitted in the -[thread-default main context][g-main-context-push-thread-default] -that @manager was constructed in. - -Since: 2.30 - - - - - The #GDBusObjectManagerClient emitting the signal. - - - - The #GDBusObjectProxy on which an interface has properties that are changing. - - - - The #GDBusProxy that has properties that are changing. - - - - A #GVariant containing the properties that changed. - - - - A %NULL terminated array of properties that was invalidated. - - - - - - - - -Emitted when a D-Bus signal is received on @interface_proxy. - -This signal exists purely as a convenience to avoid having to -connect signals to all interface proxies managed by @manager. - -This signal is emitted in the -[thread-default main context][g-main-context-push-thread-default] -that @manager was constructed in. - -Since: 2.30 - - - - - The #GDBusObjectManagerClient emitting the signal. - - - - The #GDBusObjectProxy on which an interface is emitting a D-Bus signal. - - - - The #GDBusProxy that is emitting a D-Bus signal. - - - - The sender of the signal or NULL if the connection is not a bus connection. - - - - The signal name. - - - - A #GVariant tuple with parameters for the signal. - - - - - - - - -If this property is not %G_BUS_TYPE_NONE, then -#GDBusObjectManagerClient:connection must be %NULL and will be set to the -#GDBusConnection obtained by calling g_bus_get() with the value -of this property. - -Since: 2.30 - - - - - - -The #GDBusConnection to use. - -Since: 2.30 - - - - - - -Flags from the #GDBusObjectManagerClientFlags enumeration. - -Since: 2.30 - - - - - - -A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data. - -Since: 2.30 - - - - - - -The #GDBusProxyTypeFunc to use when determining what #GType to -use for interface proxies or %NULL. - -Since: 2.30 - - - - - - -The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func. - -Since: 2.30 - - - - - - -The well-known name or unique name that the manager is for. - -Since: 2.30 - - - - - - -The unique name that owns #GDBusObjectManagerClient:name or %NULL if -no-one is currently owning the name. Connect to the -#GObject::notify signal to track changes to this property. - -Since: 2.30 - - - - - - -The object path the manager is for. - -Since: 2.30 - - - - - - -Flags used when constructing a #GDBusObjectManagerClient. - -Since: 2.30 - - - - - No flags set. - - - - If not set and the -manager is for a well-known name, then request the bus to launch -an owner for the name if no-one owns the name. This flag can only -be used in managers for well-known names. - - - - - - - -The #GDBusConnection to export objects on. - -Since: 2.30 - - - - - - -The object path to register the manager object at. - -Since: 2.30 - - - - - - -The connection of the proxy. - -Since: 2.30 - - - - - - -The object path of the proxy. - -Since: 2.30 - - - - - - -Emitted when a method is invoked by a remote caller and used to -determine if the method call is authorized. - -This signal is like #GDBusInterfaceSkeleton's -#GDBusInterfaceSkeleton::g-authorize-method signal, -except that it is for the enclosing object. - -The default class handler just returns %TRUE. - -Since: 2.30 - - - - - The #GDBusObjectSkeleton emitting the signal. - - - - The #GDBusInterfaceSkeleton that @invocation is for. - - - - A #GDBusMethodInvocation. - - - - %TRUE if the call is authorized, %FALSE otherwise. - - - - - - -The object path where the object is exported. - -Since: 2.30 - - - - - - -Flags describing the access control of a D-Bus property. - -Since: 2.26 - - - - - No flags set. - - - - Property is readable. - - - - Property is writable. - - - - - - - -Emitted when one or more D-Bus properties on @proxy changes. The -local cache has already been updated when this signal fires. Note -that both @changed_properties and @invalidated_properties are -guaranteed to never be %NULL (either may be empty though). - -If the proxy has the flag -%G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then -@invalidated_properties will always be empty. - -This signal corresponds to the -`PropertiesChanged` D-Bus signal on the -`org.freedesktop.DBus.Properties` interface. - -Since: 2.26 - - - - - The #GDBusProxy emitting the signal. - - - - A #GVariant containing the properties that changed - - - - A %NULL terminated array of properties that was invalidated - - - - - - - - -Emitted when a signal from the remote object and interface that @proxy is for, has been received. - -Since: 2.26 - - - - - The #GDBusProxy emitting the signal. - - - - The sender of the signal or %NULL if the connection is not a bus connection. - - - - The name of the signal. - - - - A #GVariant tuple with parameters for the signal. - - - - - - - - -If this property is not %G_BUS_TYPE_NONE, then -#GDBusProxy:g-connection must be %NULL and will be set to the -#GDBusConnection obtained by calling g_bus_get() with the value -of this property. - -Since: 2.26 - - - - - - -The #GDBusConnection the proxy is for. - -Since: 2.26 - - - - - - -The timeout to use if -1 (specifying default timeout) is passed -as @timeout_msec in the g_dbus_proxy_call() and -g_dbus_proxy_call_sync() functions. - -This allows applications to set a proxy-wide timeout for all -remote method invocations on the proxy. If this property is -1, -the default timeout (typically 25 seconds) is used. If set to -%G_MAXINT, then no timeout is used. - -Since: 2.26 - - - - - - -Flags from the #GDBusProxyFlags enumeration. - -Since: 2.26 - - - - - - -Ensure that interactions with this proxy conform to the given -interface. This is mainly to ensure that malformed data received -from the other peer is ignored. The given #GDBusInterfaceInfo is -said to be the "expected interface". - -The checks performed are: -- When completing a method call, if the type signature of -the reply message isn't what's expected, the reply is -discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT. - -- Received signals that have a type signature mismatch are dropped and -a warning is logged via g_warning(). - -- Properties received via the initial `GetAll()` call or via the -`::PropertiesChanged` signal (on the -[org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties) -interface) or set using g_dbus_proxy_set_cached_property() -with a type signature mismatch are ignored and a warning is -logged via g_warning(). - -Note that these checks are never done on methods, signals and -properties that are not referenced in the given -#GDBusInterfaceInfo, since extending a D-Bus interface on the -service-side is not considered an ABI break. - -Since: 2.26 - - - - - - -The D-Bus interface name the proxy is for. - -Since: 2.26 - - - - - - -The well-known or unique name that the proxy is for. - -Since: 2.26 - - - - - - -The unique name that owns #GDBusProxy:g-name or %NULL if no-one -currently owns that name. You may connect to #GObject::notify signal to -track changes to this property. - -Since: 2.26 - - - - - - -The object path the proxy is for. - -Since: 2.26 - - - - - - -Flags used when constructing an instance of a #GDBusProxy derived class. - -Since: 2.26 - - - - - No flags set. - - - - Don't load properties. - - - - Don't connect to signals on the remote object. - - - - If not set and the proxy if for a well-known name, -then request the bus to launch an owner for the name if no-one owns the name. This flag can -only be used in proxies for well-known names. - - - - If set, the property value for any <emphasis>invalidated property</emphasis> will be (asynchronously) retrieved upon receiving the <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">PropertiesChanged</ulink> D-Bus signal and the property will not cause emission of the #GDBusProxy::g-properties-changed signal. When the value is received the #GDBusProxy::g-properties-changed signal is emitted for the property along with the retrieved value. Since 2.32. - - - - If the proxy is for a well-known name, -do not ask the bus to launch an owner during proxy initialization, but allow it to be -autostarted by a method call. This flag is only meaningful in proxies for well-known names, -and only if %G_DBUS_PROXY_FLAGS_DO_NOT_AUTOSTART is not also specified. - - - - - - - -Flags used when sending #GDBusMessages on a #GDBusConnection. - -Since: 2.26 - - - - - No flags set. - - - - Do not automatically -assign a serial number from the #GDBusConnection object when -sending a message. - - - - - - - -Emitted when a new authenticated connection has been made. Use -g_dbus_connection_get_peer_credentials() to figure out what -identity (if any), was authenticated. - -If you want to accept the connection, take a reference to the -@connection object and return %TRUE. When you are done with the -connection call g_dbus_connection_close() and give up your -reference. Note that the other peer may disconnect at any time - -a typical thing to do when accepting a connection is to listen to -the #GDBusConnection::closed signal. - -If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD -then the signal is emitted in a new thread dedicated to the -connection. Otherwise the signal is emitted in the -[thread-default main context][g-main-context-push-thread-default] -of the thread that @server was constructed in. - -You are guaranteed that signal handlers for this signal runs -before incoming messages on @connection are processed. This means -that it's suitable to call g_dbus_connection_register_object() or -similar from the signal handler. - -Since: 2.26 - - - - - The #GDBusServer emitting the signal. - - - - A #GDBusConnection for the new connection. - - - - %TRUE to claim @connection, %FALSE to let other handlers -run. - - - - - - -Whether the server is currently active. - -Since: 2.26 - - - - - - -The D-Bus address to listen on. - -Since: 2.26 - - - - - - -A #GDBusAuthObserver object to assist in the authentication process or %NULL. - -Since: 2.26 - - - - - - -The D-Bus address that clients can use. - -Since: 2.26 - - - - - - -Flags from the #GDBusServerFlags enumeration. - -Since: 2.26 - - - - - - -The guid of the server. - -Since: 2.26 - - - - - - -Flags used when creating a #GDBusServer. - -Since: 2.26 - - - - - No flags set. - - - - All #GDBusServer::new-connection -signals will run in separated dedicated threads (see signal for -details). - - - - Allow the anonymous -authentication method. - - - - - - - -Flags used when subscribing to signals via g_dbus_connection_signal_subscribe(). - -Since: 2.26 - - - - - No flags set. - - - - Don't actually send the AddMatch -D-Bus call for this signal subscription. This gives you more control -over which match rules you add (but you must add them manually). - - - - Match first arguments that -contain a bus or interface name with the given namespace. - - - - Match first arguments that -contain an object path that is either equivalent to the given path, -or one of the paths is a subpath of the other. - - - - - - - -Flags passed to g_dbus_connection_register_subtree(). - -Since: 2.26 - - - - - No flags set. - - - - Method calls to objects not in the enumerated range -will still be dispatched. This is useful if you want -to dynamically spawn objects in the subtree. - - - - - - - -Determines the byte ordering that is used when writing -multi-byte entities (such as integers) to the stream. - - - - - - -The ::byte-order property determines the byte ordering that -is used when reading multi-byte entities (such as integers) -from the stream. - - - - - - -The :newline-type property determines what is considered -as a line ending when reading complete lines from the stream. - - - - - - -#GDataStreamByteOrder is used to ensure proper endianness of streaming data sources -across various machine architectures. - - - - - - Selects Big Endian byte order. - - - - Selects Little Endian byte order. - - - - Selects endianness based on host machine's architecture. - - - - - - - -#GDataStreamNewlineType is used when checking for or setting the line endings for a given file. - - - - - Selects "LF" line endings, common on most modern UNIX platforms. - - - - Selects "CR" line endings. - - - - Selects "CR, LF" line ending, common on Microsoft Windows. - - - - Automatically try to handle any line ending type. - - - - - - - -The origin filename of this #GDesktopAppInfo - - - - - - -Emitted when the drive's state has changed. - - - - - a #GDrive. - - - - - - - - -This signal is emitted when the #GDrive have been -disconnected. If the recipient is holding references to the -object they should release them so the object can be -finalized. - - - - - a #GDrive. - - - - - - - - -Emitted when the physical eject button (if any) of a drive has -been pressed. - - - - - a #GDrive. - - - - - - - - -Emitted when the physical stop button (if any) of a drive has -been pressed. - -Since: 2.22 - - - - - a #GDrive. - - - - - - - - -Flags used when starting a drive. - -Since: 2.22 - - - - - No flags set. - - - - - - - -Enumeration describing how a drive can be started/stopped. - -Since: 2.22 - - - - - Unknown or drive doesn't support -start/stop. - - - - The stop method will physically -shut down the drive and e.g. power down the port the drive is -attached to. - - - - The start/stop methods are used -for connecting/disconnect to the drive over the network. - - - - The start/stop methods will -assemble/disassemble a virtual drive from several physical -drives. - - - - The start/stop methods will -unlock/lock the disk (for example using the ATA <quote>SECURITY -UNLOCK DEVICE</quote> command) - - - - - - - -GEmblemOrigin is used to add information about the origin of the emblem -to #GEmblem. - -Since: 2.18 - - - - - Emblem of unknown origin - - - - Emblem adds device-specific information - - - - Emblem depicts live metadata, such as "readonly" - - - - Emblem comes from a user-defined tag, e.g. set by nautilus (in the future) - - - - - - - -Flags specifying the behaviour of an attribute. - - - - - no flags set. - - - - copy the attribute values when the file is copied. - - - - copy the attribute values when the file is moved. - - - - - - - -Used by g_file_set_attributes_from_info() when setting file attributes. - - - - - Attribute value is unset (empty). - - - - Attribute value is set. - - - - Indicates an error in setting the value. - - - - - - - -The data types for file attributes. - - - - - indicates an invalid or uninitalized type. - - - - a null terminated UTF8 string. - - - - a zero terminated string of non-zero bytes. - - - - a boolean value. - - - - an unsigned 4-byte/32-bit integer. - - - - a signed 4-byte/32-bit integer. - - - - an unsigned 8-byte/64-bit integer. - - - - a signed 8-byte/64-bit integer. - - - - a #GObject. - - - - a %NULL terminated char **. Since 2.22 - - - - - - - -Flags used when copying or moving files. - - - - - No flags set. - - - - Overwrite any existing files - - - - Make a backup of any existing files. - - - - Don't follow symlinks. - - - - Copy all file metadata instead of just default set used for copy (see #GFileInfo). - - - - Don't use copy and delete fallback if native move not supported. - - - - Leaves target file with default perms, instead of setting the source file perms. - - - - - - - -Flags used when an operation may create a file. - - - - - No flags set. - - - - Create a file that can only be -accessed by the current user. - - - - Replace the destination -as if it didn't exist before. Don't try to keep any old -permissions, replace instead of following links. This -is generally useful if you're doing a "copy over" -rather than a "save new version of" replace operation. -You can think of it as "unlink destination" before -writing to it, although the implementation may not -be exactly like that. Since 2.20 - - - - - - - -The file containing the icon. - - - - - - -Flags that can be used with g_file_measure_disk_usage(). - -Since: 2.38 - - - - - No flags set. - - - - Report any error encountered -while traversing the directory tree. Normally errors are only -reported for the toplevel file. - - - - Tally usage based on apparent file -sizes. Normally, the block-size is used, if available, as this is a -more accurate representation of disk space used. -Compare with `du --apparent-size`. - - - - Do not cross mount point boundaries. -Compare with `du -x`. - - - - - - - -Emitted when @file has been changed. - -If using %G_FILE_MONITOR_WATCH_RENAMES on a directory monitor, and -the information is available (and if supported by the backend), -@event_type may be %G_FILE_MONITOR_EVENT_RENAMED, -%G_FILE_MONITOR_EVENT_MOVED_IN or %G_FILE_MONITOR_EVENT_MOVED_OUT. - -In all cases @file will be a child of the monitored directory. For -renames, @file will be the old name and @other_file is the new -name. For "moved in" events, @file is the name of the file that -appeared and @other_file is the old name that it was moved from (in -another directory). For "moved out" events, @file is the name of -the file that used to be in this directory and @other_file is the -name of the file at its new location. - -It makes sense to treat %G_FILE_MONITOR_EVENT_MOVED_IN as -equivalent to %G_FILE_MONITOR_EVENT_CREATED and -%G_FILE_MONITOR_EVENT_MOVED_OUT as equivalent to -%G_FILE_MONITOR_EVENT_DELETED, with extra information. -%G_FILE_MONITOR_EVENT_RENAMED is equivalent to a delete/create -pair. This is exactly how the events will be reported in the case -that the %G_FILE_MONITOR_WATCH_RENAMES flag is not in use. - -If using the deprecated flag %G_FILE_MONITOR_SEND_MOVED flag and @event_type is -#G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the -old path, and @other_file will be set to a #GFile containing the new path. - -In all the other cases, @other_file will be set to #NULL. - - - - - a #GFileMonitor. - - - - a #GFile. - - - - a #GFile or #NULL. - - - - a #GFileMonitorEvent. - - - - - - - - -Specifies what type of event a monitor event is. - - - - - a file changed. - - - - a hint that this was probably the last change in a set of changes. - - - - a file was deleted. - - - - a file was created. - - - - a file attribute was changed. - - - - the file location will soon be unmounted. - - - - the file location was unmounted. - - - - the file was moved -- only sent if the -(deprecated) %G_FILE_MONITOR_SEND_MOVED flag is set - - - - the file was renamed within the -current directory -- only sent if the %G_FILE_MONITOR_WATCH_MOVES -flag is set. Since: 2.44. - - - - the file was moved into the -monitored directory from another location -- only sent if the -%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44. - - - - the file was moved out of the -monitored directory to another location -- only sent if the -%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44 - - - - - - - -Flags used to set what a #GFileMonitor will watch for. - - - - - No flags set. - - - - Watch for mount events. - - - - Pair DELETED and CREATED events caused -by file renames (moves) and send a single G_FILE_MONITOR_EVENT_MOVED -event instead (NB: not supported on all backends; the default -behaviour -without specifying this flag- is to send single DELETED -and CREATED events). Deprecated since 2.44: use -%G_FILE_MONITOR_WATCH_MOVES instead. - - - - Watch for changes to the file made -via another hard link. Since 2.36. - - - - Watch for rename operations on a -monitored directory. This causes %G_FILE_MONITOR_EVENT_RENAMED, -%G_FILE_MONITOR_EVENT_MOVED_IN and %G_FILE_MONITOR_EVENT_MOVED_OUT -events to be emitted when possible. Since: 2.44. - - - - - - - -Flags used when querying a #GFileInfo. - - - - - No flags set. - - - - Don't follow symlinks. - - - - - - - -Indicates the file's on-disk type. - - - - - File's type is unknown. - - - - File handle represents a regular file. - - - - File handle represents a directory. - - - - File handle represents a symbolic link -(Unix systems). - - - - File is a "special" file, such as a socket, fifo, -block device, or character device. - - - - File is a shortcut (Windows systems). - - - - File is a mountable location. - - - - - - - -Emitted when the file name completion information comes available. - - - - - - - - - -Indicates a hint from the file system whether files should be -previewed in a file manager. Returned as the value of the key -#G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW. - - - - - Only preview files if user has explicitly requested it. - - - - Preview files if user has requested preview of "local" files. - - - - Never preview files. - - - - - - - -Error codes returned by GIO functions. - -Note that this domain may be extended in future GLib releases. In -general, new error codes either only apply to new APIs, or else -replace %G_IO_ERROR_FAILED in cases that were not explicitly -distinguished before. You should therefore avoid writing code like -|[<!-- language="C" --> -if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED)) -{ -// Assume that this is EPRINTERONFIRE -... -} -]| -but should instead treat all unrecognized error codes the same as -#G_IO_ERROR_FAILED. - - - - - Generic error condition for when an operation fails -and no more specific #GIOErrorEnum value is defined. - - - - File not found. - - - - File already exists. - - - - File is a directory. - - - - File is not a directory. - - - - File is a directory that isn't empty. - - - - File is not a regular file. - - - - File is not a symbolic link. - - - - File cannot be mounted. - - - - Filename is too many characters. - - - - Filename is invalid or contains invalid characters. - - - - File contains too many symbolic links. - - - - No space left on drive. - - - - Invalid argument. - - - - Permission denied. - - - - Operation (or one of its parameters) not supported - - - - File isn't mounted. - - - - File is already mounted. - - - - File was closed. - - - - Operation was cancelled. See #GCancellable. - - - - Operations are still pending. - - - - File is read only. - - - - Backup couldn't be created. - - - - File's Entity Tag was incorrect. - - - - Operation timed out. - - - - Operation would be recursive. - - - - File is busy. - - - - Operation would block. - - - - Host couldn't be found (remote operations). - - - - Operation would merge files. - - - - Operation failed and a helper program has -already interacted with the user. Do not display any error dialog. - - - - The current process has too many files -open and can't open any more. Duplicate descriptors do count toward -this limit. Since 2.20 - - - - The object has not been initialized. Since 2.22 - - - - The requested address is already in use. Since 2.22 - - - - Need more input to finish operation. Since 2.24 - - - - The input data was invalid. Since 2.24 - - - - A remote object generated an error that -doesn't correspond to a locally registered #GError error -domain. Use g_dbus_error_get_remote_error() to extract the D-Bus -error name and g_dbus_error_strip_remote_error() to fix up the -message so it matches what was received on the wire. Since 2.26. - - - - Host unreachable. Since 2.26 - - - - Network unreachable. Since 2.26 - - - - Connection refused. Since 2.26 - - - - Connection to proxy server failed. Since 2.26 - - - - Proxy authentication failed. Since 2.26 - - - - Proxy server needs authentication. Since 2.26 - - - - Proxy connection is not allowed by ruleset. -Since 2.26 - - - - Broken pipe. Since 2.36 - - - - Connection closed by peer. Note that this -is the same code as %G_IO_ERROR_BROKEN_PIPE; before 2.44 some -"connection closed" errors returned %G_IO_ERROR_BROKEN_PIPE, but others -returned %G_IO_ERROR_FAILED. Now they should all return the same -value, which has this more logical name. Since 2.44. - - - - Transport endpoint is not connected. Since 2.44 - - - - - - - -Flags for use with g_io_module_scope_new(). - -Since: 2.30 - - - - - No module scan flags - - - - When using this scope to load or -scan modules, automatically block a modules which has the same base -basename as previously loaded module. - - - - - - - -GIOStreamSpliceFlags determine how streams should be spliced. - -Since: 2.28 - - - - - Do not close either stream. - - - - Close the first stream after -the splice. - - - - Close the second stream after -the splice. - - - - Wait for both splice operations to finish -before calling the callback. - - - - - - - -Whether this is the "any" address for its family. -See g_inet_address_get_is_any(). - -Since: 2.22 - - - - - - -Whether this is a link-local address. -See g_inet_address_get_is_link_local(). - -Since: 2.22 - - - - - - -Whether this is the loopback address for its family. -See g_inet_address_get_is_loopback(). - -Since: 2.22 - - - - - - -Whether this is a global multicast address. -See g_inet_address_get_is_mc_global(). - -Since: 2.22 - - - - - - -Whether this is a link-local multicast address. -See g_inet_address_get_is_mc_link_local(). - -Since: 2.22 - - - - - - -Whether this is a node-local multicast address. -See g_inet_address_get_is_mc_node_local(). - -Since: 2.22 - - - - - - -Whether this is an organization-local multicast address. -See g_inet_address_get_is_mc_org_local(). - -Since: 2.22 - - - - - - -Whether this is a site-local multicast address. -See g_inet_address_get_is_mc_site_local(). - -Since: 2.22 - - - - - - -Whether this is a multicast address. -See g_inet_address_get_is_multicast(). - -Since: 2.22 - - - - - - -Whether this is a site-local address. -See g_inet_address_get_is_loopback(). - -Since: 2.22 - - - - - - -The `sin6_flowinfo` field, for IPv6 addresses. - -Since: 2.32 - - - - - - -This signal is emitted whenever items were added or removed to -@list. At @position, @removed items were removed and @added items -were added in their place. - -Since: 2.44 - - - - - the #GListModel that changed - - - - the position at which @list changed - - - - the number of items removed - - - - the number of items added - - - - - - - - -The type of items contained in this list store. Items must be -subclasses of #GObject. - -Since: 2.44 - - - - - - -Pointer to buffer where data will be written. - -Since: 2.24 - - - - - - -Size of data written to the buffer. - -Since: 2.24 - - - - - - -Function called with the buffer as argument when the stream is destroyed. - -Since: 2.24 - - - - - - -Function with realloc semantics called to enlarge the buffer. - -Since: 2.24 - - - - - - -Current size of the data buffer. - -Since: 2.24 - - - - - - -Emitted when a change has occured to the menu. - -The only changes that can occur to a menu is that items are removed -or added. Items may not change (except by being removed and added -back in the same location). This signal is capable of describing -both of those changes (at the same time). - -The signal means that starting at the index @position, @removed -items were removed and @added items were added in their place. If -@removed is zero then only items were added. If @added is zero -then only items were removed. - -As an example, if the menu contains items a, b, c, d (in that -order) and the signal (2, 1, 3) occurs then the new composition of -the menu will be a, b, _, _, _, d (with each _ representing some -new item). - -Signal handlers may query the model (particularly the added items) -and expect to see the results of the modification that is being -reported. The signal is emitted after the modification. - - - - - the #GMenuModel that is changing - - - - the position of the change - - - - the number of items removed - - - - the number of items added - - - - - - - - -Emitted when the mount has been changed. - - - - - the object on which the signal is emitted - - - - - - - - -This signal is emitted when the #GMount is about to be -unmounted. - -Since: 2.22 - - - - - the object on which the signal is emitted - - - - - - - - -This signal is emitted when the #GMount have been -unmounted. If the recipient is holding references to the -object they should release them so the object can be -finalized. - - - - - the object on which the signal is emitted - - - - - - - - -Flags used when mounting a mount. - - - - - No flags set. - - - - - - - -Emitted by the backend when e.g. a device becomes unavailable -while a mount operation is in progress. - -Implementations of GMountOperation should handle this signal -by dismissing open password dialogs. - -Since: 2.20 - - - - - - - - - -Emitted when a mount operation asks the user for a password. - -If the message contains a line break, the first line should be -presented as a heading. For example, it may be used as the -primary text in a #GtkMessageDialog. - - - - - a #GMountOperation requesting a password. - - - - string containing a message to display to the user. - - - - string containing the default user name. - - - - string containing the default domain. - - - - a set of #GAskPasswordFlags. - - - - - - - - -Emitted when asking the user a question and gives a list of -choices for the user to choose from. - -If the message contains a line break, the first line should be -presented as a heading. For example, it may be used as the -primary text in a #GtkMessageDialog. - - - - - a #GMountOperation asking a question. - - - - string containing a message to display to the user. - - - - an array of strings for each possible choice. - - - - - - - - -Emitted when the user has replied to the mount operation. - - - - - a #GMountOperation. - - - - a #GMountOperationResult indicating how the request was handled - - - - - - - - -Emitted when one or more processes are blocking an operation -e.g. unmounting/ejecting a #GMount or stopping a #GDrive. - -Note that this signal may be emitted several times to update the -list of blocking processes as processes close files. The -application should only respond with g_mount_operation_reply() to -the latest signal (setting #GMountOperation:choice to the choice -the user made). - -If the message contains a line break, the first line should be -presented as a heading. For example, it may be used as the -primary text in a #GtkMessageDialog. - -Since: 2.22 - - - - - a #GMountOperation. - - - - string containing a message to display to the user. - - - - an array of #GPid for processes -blocking the operation. - - - - an array of strings for each possible choice. - - - - - - - - -Emitted when an unmount operation has been busy for more than some time -(typically 1.5 seconds). - -When unmounting or ejecting a volume, the kernel might need to flush -pending data in its buffers to the volume stable storage, and this operation -can take a considerable amount of time. This signal may be emitted several -times as long as the unmount operation is outstanding, and then one -last time when the operation is completed, with @bytes_left set to zero. - -Implementations of GMountOperation should handle this signal by -showing an UI notification, and then dismiss it, or show another notification -of completion, when @bytes_left reaches zero. - -If the message contains a line break, the first line should be -presented as a heading. For example, it may be used as the -primary text in a #GtkMessageDialog. - -Since: 2.34 - - - - - a #GMountOperation: - - - - string containing a mesage to display to the user - - - - the estimated time left before the operation completes, -in microseconds, or -1 - - - - the amount of bytes to be written before the operation -completes (or -1 if such amount is not known), or zero if the operation -is completed - - - - - - - - -Whether to use an anonymous user when authenticating. - - - - - - -The index of the user's choice when a question is asked during the -mount operation. See the #GMountOperation::ask-question signal. - - - - - - -The domain to use for the mount operation. - - - - - - -The password that is used for authentication when carrying out -the mount operation. - - - - - - -Determines if and how the password information should be saved. - - - - - - -The user name that is used for authentication when carrying out -the mount operation. - - - - - - -#GMountOperationResult is returned as a result when a request for -information is send by the mounting operation. - - - - - The request was fulfilled and the -user specified data is now available - - - - The user requested the mount operation -to be aborted - - - - The request was unhandled (i.e. not -implemented) - - - - - - - -Flags used when an unmounting a mount. - - - - - No flags set. - - - - Unmount even if there are outstanding -file operations on the mount. - - - - - - - -The host's network connectivity state, as reported by #GNetworkMonitor. - -Since: 2.44 - - - - - The host is not configured with a -route to the Internet; it may or may not be connected to a local -network. - - - - The host is connected to a network, but -does not appear to be able to reach the full Internet, perhaps -due to upstream network problems. - - - - The host is behind a captive portal and -cannot reach the full Internet. - - - - The host is connected to a network, and -appears to be able to reach the full Internet. - - - - - - - -Emitted when the network configuration changes. If @available is -%TRUE, then some hosts may be reachable that were not reachable -before, while others that were reachable before may no longer be -reachable. If @available is %FALSE, then no remote hosts are -reachable. - -Since: 2.32 - - - - - a #GNetworkMonitor - - - - the current value of #GNetworkMonitor:network-available - - - - - - - - -More detailed information about the host's network connectivity. -See g_network_monitor_get_connectivity() and -#GNetworkConnectivity for more details. - -Since: 2.44 - - - - - - -Whether the network is considered available. That is, whether the -system has a default route for at least one of IPv4 or IPv6. - -Real-world networks are of course much more complicated than -this; the machine may be connected to a wifi hotspot that -requires payment before allowing traffic through, or may be -connected to a functioning router that has lost its own upstream -connectivity. Some hosts might only be accessible when a VPN is -active. Other hosts might only be accessible when the VPN is -not active. Thus, it is best to use g_network_monitor_can_reach() -or g_network_monitor_can_reach_async() to test for reachability -on a host-by-host basis. (On the other hand, when the property is -%FALSE, the application can reasonably expect that no remote -hosts at all are reachable, and should indicate this to the user -in its UI.) - -See also #GNetworkMonitor::network-changed. - -Since: 2.32 - - - - - - -Priority levels for #GNotifications. - -Since: 2.42 - - - - - for notifications that do not require -immediate attention - typically used for contextual background -information, such as contact birthdays or local weather - - - - the default priority, to be used for the -majority of notifications (for example email messages, software updates, -completed download/sync operations) - - - - for events that require more attention, -usually because responses are time-sensitive (for example chat and SMS -messages or alarms) - - - - for urgent notifications, or notifications -that require a response in a short space of time (for example phone calls -or emergency warnings) - - - - - - - -GOutputStreamSpliceFlags determine how streams should be spliced. - - - - - Do not close either stream. - - - - Close the source stream after -the splice. - - - - Close the target stream after -the splice. - - - - - - - -#GPasswordSave is used to indicate the lifespan of a saved password. - -#Gvfs stores passwords in the Gnome keyring when this flag allows it -to, and later retrieves it again from there. - - - - - never save a password. - - - - save a password for the session. - - - - save a password permanently. - - - - - - - -%TRUE if the caller currently has permission to perform the action that -@permission represents the permission to perform. - - - - - - -%TRUE if it is generally possible to acquire the permission by calling -g_permission_acquire(). - - - - - - -%TRUE if it is generally possible to release the permission by calling -g_permission_release(). - - - - - - -If @action is currently enabled. - -If the action is disabled then calls to g_action_activate() and -g_action_change_state() have no effect. - -Since: 2.38 - - - - - - -The name of the action. This is mostly meaningful for identifying -the action once it has been added to a #GActionMap. - -Since: 2.38 - - - - - - -The object to wrap a property on. - -The object must be a non-%NULL #GObject with properties. - -Since: 2.38 - - - - - - -The type of the parameter that must be given when activating the -action. - -Since: 2.38 - - - - - - -The name of the property to wrap on the object. - -The property must exist on the passed-in object and it must be -readable and writable (and not construct-only). - -Since: 2.38 - - - - - - -The state of the action, or %NULL if the action is stateless. - -Since: 2.38 - - - - - - -The #GVariantType of the state that the action has, or %NULL if the -action is stateless. - -Since: 2.38 - - - - - - -The protocol being spoke to the destination host, or %NULL if -the #GProxyAddress doesn't know. - -Since: 2.34 - - - - - - -The URI string that the proxy was constructed from (or %NULL -if the creator didn't specify this). - -Since: 2.34 - - - - - - -The default port to use if #GProxyAddressEnumerator:uri does not -specify one. - -Since: 2.38 - - - - - - -The proxy resolver to use. - -Since: 2.36 - - - - - - -Emitted when the resolver notices that the system resolver -configuration has changed. - - - - - a #GResolver - - - - - - - - -An error code used with %G_RESOLVER_ERROR in a #GError returned -from a #GResolver routine. - -Since: 2.22 - - - - - the requested name/address/service was not -found - - - - the requested information could not -be looked up due to a network error or similar problem - - - - unknown error - - - - - - - -The type of record that g_resolver_lookup_records() or -g_resolver_lookup_records_async() should retrieve. The records are returned -as lists of #GVariant tuples. Each record type has different values in -the variant tuples returned. - -%G_RESOLVER_RECORD_SRV records are returned as variants with the signature -'(qqqs)', containing a guint16 with the priority, a guint16 with the -weight, a guint16 with the port, and a string of the hostname. - -%G_RESOLVER_RECORD_MX records are returned as variants with the signature -'(qs)', representing a guint16 with the preference, and a string containing -the mail exchanger hostname. - -%G_RESOLVER_RECORD_TXT records are returned as variants with the signature -'(as)', representing an array of the strings in the text record. - -%G_RESOLVER_RECORD_SOA records are returned as variants with the signature -'(ssuuuuu)', representing a string containing the primary name server, a -string containing the administrator, the serial as a guint32, the refresh -interval as guint32, the retry interval as a guint32, the expire timeout -as a guint32, and the ttl as a guint32. - -%G_RESOLVER_RECORD_NS records are returned as variants with the signature -'(s)', representing a string of the hostname of the name server. - -Since: 2.34 - - - - - lookup DNS SRV records for a domain - - - - lookup DNS MX records for a domain - - - - lookup DNS TXT records for a name - - - - lookup DNS SOA records for a zone - - - - lookup DNS NS records for a domain - - - - - - - -An error code used with %G_RESOURCE_ERROR in a #GError returned -from a #GResource routine. - -Since: 2.32 - - - - - no file was found at the requested path - - - - unknown error - - - - - - - -GResourceFlags give information about a particular file inside a resource -bundle. - -Since: 2.32 - - - - - No flags set. - - - - The file is compressed. - - - - - - - -GResourceLookupFlags determine how resource path lookups are handled. - -Since: 2.32 - - - - - No flags set. - - - - - - - -The "change-event" signal is emitted once per change event that -affects this settings object. You should connect to this signal -only if you are interested in viewing groups of changes before they -are split out into multiple emissions of the "changed" signal. -For most use cases it is more appropriate to use the "changed" signal. - -In the event that the change event applies to one or more specified -keys, @keys will be an array of #GQuark of length @n_keys. In the -event that the change event applies to the #GSettings object as a -whole (ie: potentially every key has been changed) then @keys will -be %NULL and @n_keys will be 0. - -The default handler for this signal invokes the "changed" signal -for each affected key. If any other connected handler returns -%TRUE then this default functionality will be suppressed. - - - - - - the object on which the signal was emitted - - - - -an array of #GQuarks for the changed keys, or %NULL - - - - the length of the @keys array, or 0 - - - - %TRUE to stop other handlers from being invoked for the -event. FALSE to propagate the event further. - - - - - -The "changed" signal is emitted when a key has potentially changed. -You should call one of the g_settings_get() calls to check the new -value. - -This signal supports detailed connections. You can connect to the -detailed signal "changed::x" in order to only receive callbacks -when key "x" changes. - - - - - the object on which the signal was emitted - - - - the name of the key that changed - - - - - - - - -The "writable-change-event" signal is emitted once per writability -change event that affects this settings object. You should connect -to this signal if you are interested in viewing groups of changes -before they are split out into multiple emissions of the -"writable-changed" signal. For most use cases it is more -appropriate to use the "writable-changed" signal. - -In the event that the writability change applies only to a single -key, @key will be set to the #GQuark for that key. In the event -that the writability change affects the entire settings object, -@key will be 0. - -The default handler for this signal invokes the "writable-changed" -and "changed" signals for each affected key. This is done because -changes in writability might also imply changes in value (if for -example, a new mandatory setting is introduced). If any other -connected handler returns %TRUE then this default functionality -will be suppressed. - - - - - - the object on which the signal was emitted - - - - the quark of the key, or 0 - - - - %TRUE to stop other handlers from being invoked for the -event. FALSE to propagate the event further. - - - - - -The "writable-changed" signal is emitted when the writability of a -key has potentially changed. You should call -g_settings_is_writable() in order to determine the new status. - -This signal supports detailed connections. You can connect to the -detailed signal "writable-changed::x" in order to only receive -callbacks when the writability of "x" changes. - - - - - the object on which the signal was emitted - - - - the key - - - - - - - - -The name of the context that the settings are stored in. - - - - - - -Whether the #GSettings object is in 'delay-apply' mode. See -g_settings_delay() for details. - -Since: 2.28 - - - - - - -If this property is %TRUE, the #GSettings object has outstanding -changes that will be applied when g_settings_apply() is called. - - - - - - -The path within the backend where the settings are stored. - - - - - - -The name of the schema that describes the types of keys -for this #GSettings object. - -The type of this property is *not* #GSettingsSchema. -#GSettingsSchema has only existed since version 2.32 and -unfortunately this name was used in previous versions to refer to -the schema ID rather than the schema itself. Take care to use the -'settings-schema' property if you wish to pass in a -#GSettingsSchema. - -Deprecated:2.32:Use the 'schema-id' property instead. In a future -version, this property may instead refer to a #GSettingsSchema. - - - - - - -The name of the schema that describes the types of keys -for this #GSettings object. - - - - - - -The #GSettingsSchema describing the types of keys for this -#GSettings object. - -Ideally, this property would be called 'schema'. #GSettingsSchema -has only existed since version 2.32, however, and before then the -'schema' property was used to refer to the ID of the schema rather -than the schema itself. Take care. - - - - - - -Flags used when creating a binding. These flags determine in which -direction the binding works. The default is to synchronize in both -directions. - - - - - Equivalent to `G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET` - - - - Update the #GObject property when the setting changes. -It is an error to use this flag if the property is not writable. - - - - Update the setting when the #GObject property changes. -It is an error to use this flag if the property is not readable. - - - - Do not try to bind a "sensitivity" property to the writability of the setting - - - - When set in addition to #G_SETTINGS_BIND_GET, set the #GObject property -value initially from the setting, but do not listen for changes of the setting - - - - When passed to g_settings_bind(), uses a pair of mapping functions that invert -the boolean value when mapping between the setting and the property. The setting and property must both -be booleans. You cannot pass this flag to g_settings_bind_with_mapping(). - - - - - - - -Indicates that the action was just activated. - -@parameter will always be of the expected type. In the event that -an incorrect type was given, no signal will be emitted. - -Since GLib 2.40, if no handler is connected to this signal then the -default behaviour for boolean-stated actions with a %NULL parameter -type is to toggle them via the #GSimpleAction::change-state signal. -For stateful actions where the state type is equal to the parameter -type, the default is to forward them directly to -#GSimpleAction::change-state. This should allow almost all users -of #GSimpleAction to connect only one handler or the other. - -Since: 2.28 - - - - - the #GSimpleAction - - - - the parameter to the activation - - - - - - - - -Indicates that the action just received a request to change its -state. - -@value will always be of the correct state type. In the event that -an incorrect type was given, no signal will be emitted. - -If no handler is connected to this signal then the default -behaviour is to call g_simple_action_set_state() to set the state -to the requested value. If you connect a signal handler then no -default action is taken. If the state should change then you must -call g_simple_action_set_state() from the handler. - -An example of a 'change-state' handler: -|[<!-- language="C" --> -static void -change_volume_state (GSimpleAction *action, -GVariant *value, -gpointer user_data) -{ -gint requested; - -requested = g_variant_get_int32 (value); - -// Volume only goes from 0 to 10 -if (0 <= requested && requested <= 10) -g_simple_action_set_state (action, value); -} -]| - -The handler need not set the state to the requested value. -It could set it to any value at all, or take some other action. - -Since: 2.30 - - - - - the #GSimpleAction - - - - the requested value for the state - - - - - - - - -If @action is currently enabled. - -If the action is disabled then calls to g_action_activate() and -g_action_change_state() have no effect. - -Since: 2.28 - - - - - - -The name of the action. This is mostly meaningful for identifying -the action once it has been added to a #GSimpleActionGroup. - -Since: 2.28 - - - - - - -The type of the parameter that must be given when activating the -action. - -Since: 2.28 - - - - - - -The state of the action, or %NULL if the action is stateless. - -Since: 2.28 - - - - - - -The #GVariantType of the state that the action has, or %NULL if the -action is stateless. - -Since: 2.28 - - - - - - -Since: 2.44 - - - - - - -Since: 2.44 - - - - - - -The default proxy URI that will be used for any URI that doesn't -match #GSimpleProxyResolver:ignore-hosts, and doesn't match any -of the schemes set with g_simple_proxy_resolver_set_uri_proxy(). - -Note that as a special case, if this URI starts with -"socks://", #GSimpleProxyResolver will treat it as referring -to all three of the socks5, socks4a, and socks4 proxy types. - - - - - - -A list of hostnames and IP addresses that the resolver should -allow direct connections to. - -Entries can be in one of 4 formats: - -- A hostname, such as "example.com", ".example.com", or -"*.example.com", any of which match "example.com" or -any subdomain of it. - -- An IPv4 or IPv6 address, such as "192.168.1.1", -which matches only that address. - -- A hostname or IP address followed by a port, such as -"example.com:80", which matches whatever the hostname or IP -address would match, but only for URLs with the (explicitly) -indicated port. In the case of an IPv6 address, the address -part must appear in brackets: "[::1]:443" - -- An IP address range, given by a base address and prefix length, -such as "fe80::/10", which matches any address in that range. - -Note that when dealing with Unicode hostnames, the matching is -done against the ASCII form of the name. - -Also note that hostname exclusions apply only to connections made -to hosts identified by name, and IP address exclusions apply only -to connections made to hosts identified by address. That is, if -example.com has an address of 192.168.1.1, and the :ignore-hosts list -contains only "192.168.1.1", then a connection to "example.com" -(eg, via a #GNetworkAddress) will use the proxy, and a connection to -"192.168.1.1" (eg, via a #GInetSocketAddress) will not. - -These rules match the "ignore-hosts"/"noproxy" rules most -commonly used by other applications. - - - - - - -Whether the socket should allow sending to broadcast addresses. - -Since: 2.32 - - - - - - -Whether outgoing multicast packets loop back to the local host. - -Since: 2.32 - - - - - - -Time-to-live out outgoing multicast packets - -Since: 2.32 - - - - - - -The timeout in seconds on socket I/O - -Since: 2.26 - - - - - - -Time-to-live for outgoing unicast packets - -Since: 2.32 - - - - - - -Emitted when @client's activity on @connectable changes state. -Among other things, this can be used to provide progress -information about a network connection in the UI. The meanings of -the different @event values are as follows: - -- %G_SOCKET_CLIENT_RESOLVING: @client is about to look up @connectable -in DNS. @connection will be %NULL. - -- %G_SOCKET_CLIENT_RESOLVED: @client has successfully resolved -@connectable in DNS. @connection will be %NULL. - -- %G_SOCKET_CLIENT_CONNECTING: @client is about to make a connection -to a remote host; either a proxy server or the destination server -itself. @connection is the #GSocketConnection, which is not yet -connected. Since GLib 2.40, you can access the remote -address via g_socket_connection_get_remote_address(). - -- %G_SOCKET_CLIENT_CONNECTED: @client has successfully connected -to a remote host. @connection is the connected #GSocketConnection. - -- %G_SOCKET_CLIENT_PROXY_NEGOTIATING: @client is about to negotiate -with a proxy to get it to connect to @connectable. @connection is -the #GSocketConnection to the proxy server. - -- %G_SOCKET_CLIENT_PROXY_NEGOTIATED: @client has negotiated a -connection to @connectable through a proxy server. @connection is -the stream returned from g_proxy_connect(), which may or may not -be a #GSocketConnection. - -- %G_SOCKET_CLIENT_TLS_HANDSHAKING: @client is about to begin a TLS -handshake. @connection is a #GTlsClientConnection. - -- %G_SOCKET_CLIENT_TLS_HANDSHAKED: @client has successfully completed -the TLS handshake. @connection is a #GTlsClientConnection. - -- %G_SOCKET_CLIENT_COMPLETE: @client has either successfully connected -to @connectable (in which case @connection is the #GSocketConnection -that it will be returning to the caller) or has failed (in which -case @connection is %NULL and the client is about to return an error). - -Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted -multiple times (or not at all) for a given connectable (in -particular, if @client ends up attempting to connect to more than -one address). However, if @client emits the #GSocketClient::event -signal at all for a given connectable, that it will always emit -it with %G_SOCKET_CLIENT_COMPLETE when it is done. - -Note that there may be additional #GSocketClientEvent values in -the future; unrecognized @event values should be ignored. - -Since: 2.32 - - - - - the #GSocketClient - - - - the event that is occurring - - - - the #GSocketConnectable that @event is occurring on - - - - the current representation of the connection - - - - - - - - -The proxy resolver to use - -Since: 2.36 - - - - - - -Describes an event occurring on a #GSocketClient. See the -#GSocketClient::event signal for more details. - -Additional values may be added to this type in the future. - -Since: 2.32 - - - - - The client is doing a DNS lookup. - - - - The client has completed a DNS lookup. - - - - The client is connecting to a remote -host (either a proxy or the destination server). - - - - The client has connected to a remote -host. - - - - The client is negotiating -with a proxy to connect to the destination server. - - - - The client has negotiated -with the proxy server. - - - - The client is performing a -TLS handshake. - - - - The client has performed a -TLS handshake. - - - - The client is done with a particular -#GSocketConnectable. - - - - - - - -The protocol family of a #GSocketAddress. (These values are -identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX, -if available.) - -Since: 2.22 - - - - - no address family - - - - the IPv4 family - - - - the IPv6 family - - - - the UNIX domain family - - - - - - - -Emitted when @listener's activity on @socket changes state. -Note that when @listener is used to listen on both IPv4 and -IPv6, a separate set of signals will be emitted for each, and -the order they happen in is undefined. - -Since: 2.46 - - - - - the #GSocketListener - - - - the event that is occurring - - - - the #GSocket the event is occurring on - - - - - - - - -Describes an event occurring on a #GSocketListener. See the -#GSocketListener::event signal for more details. - -Additional values may be added to this type in the future. - -Since: 2.46 - - - - - The listener is about to bind a socket. - - - - The listener has bound a socket. - - - - The listener is about to start -listening on this socket. - - - - The listener is now listening on -this socket. - - - - - - - -Flags used in g_socket_receive_message() and g_socket_send_message(). -The flags listed in the enum are some commonly available flags, but the -values used for them are the same as on the platform, and any other flags -are passed in/out as is. So to use a platform specific flag, just include -the right system header and pass in the flag. - -Since: 2.22 - - - - - No flags. - - - - Request to send/receive out of band data. - - - - Read data from the socket without removing it from -the queue. - - - - Don't use a gateway to send out the packet, -only send to hosts on directly connected networks. - - - - - - - -A protocol identifier is specified when creating a #GSocket, which is a -family/type specific identifier, where 0 means the default protocol for -the particular family/type. - -This enum contains a set of commonly available and used protocols. You -can also pass any other identifiers handled by the platform in order to -use protocols not listed here. - -Since: 2.22 - - - - - The protocol type is unknown - - - - The default protocol for the family/type - - - - TCP over IP - - - - UDP over IP - - - - SCTP over IP - - - - - - - -The ::incoming signal is emitted when a new incoming connection -to @service needs to be handled. The handler must initiate the -handling of @connection, but may not block; in essence, -asynchronous operations must be used. - -@connection will be unreffed once the signal handler returns, -so you need to ref it yourself if you are planning to use it. - -Since: 2.22 - - - - - the #GSocketService - - - - a new #GSocketConnection object - - - - the source_object passed to -g_socket_listener_add_address() - - - - %TRUE to stop other handlers from being called - - - - - - -Flags used when creating a #GSocket. Some protocols may not implement -all the socket types. - -Since: 2.22 - - - - - Type unknown or wrong - - - - Reliable connection-based byte streams (e.g. TCP). - - - - Connectionless, unreliable datagram passing. -(e.g. UDP) - - - - Reliable connection-based passing of datagrams -of fixed maximum length (e.g. SCTP). - - - - - - - -Flags to define the behaviour of a #GSubprocess. - -Note that the default for stdin is to redirect from /dev/null. For -stdout and stderr the default are for them to inherit the -corresponding descriptor from the calling process. - -Note that it is a programmer error to mix 'incompatible' flags. For -example, you may not request both %G_SUBPROCESS_FLAGS_STDOUT_PIPE and -%G_SUBPROCESS_FLAGS_STDOUT_SILENCE. - -Since: 2.40 - - - - - No flags. - - - - create a pipe for the stdin of the -spawned process that can be accessed with -g_subprocess_get_stdin_pipe(). - - - - stdin is inherited from the -calling process. - - - - create a pipe for the stdout of the -spawned process that can be accessed with -g_subprocess_get_stdout_pipe(). - - - - silence the stdout of the spawned -process (ie: redirect to /dev/null). - - - - create a pipe for the stderr of the -spawned process that can be accessed with -g_subprocess_get_stderr_pipe(). - - - - silence the stderr of the spawned -process (ie: redirect to /dev/null). - - - - merge the stderr of the spawned -process with whatever the stdout happens to be. This is a good way -of directing both streams to a common log file, for example. - - - - spawned processes will inherit the -file descriptors of their parent, unless those descriptors have -been explicitly marked as close-on-exec. This flag has no effect -over the "standard" file descriptors (stdin, stdout, stderr). - - - - - - - -Whether the task has completed, meaning its callback (if set) has been -invoked. This can only happen after g_task_return_pointer(), -g_task_return_error() or one of the other return functions have been called -on the task. - -This property is guaranteed to change from %FALSE to %TRUE exactly once. - -The #GObject::notify signal for this change is emitted in the same main -context as the task’s callback, immediately after that callback is invoked. - -Since: 2.44 - - - - - - -#GTestDBusFlags specifying the behaviour of the D-Bus session. - -Since: 2.34 - - - - - - -Flags to define future #GTestDBus behaviour. - -Since: 2.34 - - - - - No flags. - - - - - - - -The icon name. - - - - - - -A %NULL-terminated array of icon names. - - - - - - -Whether to use the default fallbacks found by shortening the icon name -at '-' characters. If the "names" array has more than one element, -ignores any past the first. - -For example, if the icon name was "gnome-dev-cdrom-audio", the array -would become -|[<!-- language="C" --> -{ -"gnome-dev-cdrom-audio", -"gnome-dev-cdrom", -"gnome-dev", -"gnome", -NULL -}; -]| - - - - - - -The ::run signal is emitted in a worker thread in response to an -incoming connection. This thread is dedicated to handling -@connection and may perform blocking IO. The signal handler need -not return until the connection is closed. - - - - - - the #GThreadedSocketService. - - - - a new #GSocketConnection object. - - - - the source_object passed to g_socket_listener_add_address(). - - - - %TRUE to stop further signal handlers from being called - - - - - -The client authentication mode for a #GTlsServerConnection. - -Since: 2.28 - - - - - client authentication not required - - - - client authentication is requested - - - - client authentication is required - - - - - - - -The DER (binary) encoded representation of the certificate. -This property and the #GTlsCertificate:certificate-pem property -represent the same data, just in different forms. - -Since: 2.28 - - - - - - -The PEM (ASCII) encoded representation of the certificate. -This property and the #GTlsCertificate:certificate -property represent the same data, just in different forms. - -Since: 2.28 - - - - - - -A #GTlsCertificate representing the entity that issued this -certificate. If %NULL, this means that the certificate is either -self-signed, or else the certificate of the issuer is not -available. - -Since: 2.28 - - - - - - -The DER (binary) encoded representation of the certificate's -private key, in either PKCS#1 format or unencrypted PKCS#8 -format. This property (or the #GTlsCertificate:private-key-pem -property) can be set when constructing a key (eg, from a file), -but cannot be read. - -PKCS#8 format is supported since 2.32; earlier releases only -support PKCS#1. You can use the `openssl rsa` -tool to convert PKCS#8 keys to PKCS#1. - -Since: 2.28 - - - - - - -The PEM (ASCII) encoded representation of the certificate's -private key in either PKCS#1 format ("`BEGIN RSA PRIVATE -KEY`") or unencrypted PKCS#8 format ("`BEGIN -PRIVATE KEY`"). This property (or the -#GTlsCertificate:private-key property) can be set when -constructing a key (eg, from a file), but cannot be read. - -PKCS#8 format is supported since 2.32; earlier releases only -support PKCS#1. You can use the `openssl rsa` -tool to convert PKCS#8 keys to PKCS#1. - -Since: 2.28 - - - - - - -A set of flags describing TLS certification validation. This can be -used to set which validation steps to perform (eg, with -g_tls_client_connection_set_validation_flags()), or to describe why -a particular certificate was rejected (eg, in -#GTlsConnection::accept-certificate). - -Since: 2.28 - - - - - The signing certificate authority is -not known. - - - - The certificate does not match the -expected identity of the site that it was retrieved from. - - - - The certificate's activation time -is still in the future - - - - The certificate has expired - - - - The certificate has been revoked -according to the #GTlsConnection's certificate revocation list. - - - - The certificate's algorithm is -considered insecure. - - - - Some other error occurred validating -the certificate - - - - the combination of all of the above -flags - - - - - - - -Flags for g_tls_interaction_request_certificate(), -g_tls_interaction_request_certificate_async(), and -g_tls_interaction_invoke_request_certificate(). - -Since: 2.40 - - - - - No flags - - - - - - - -A list of the distinguished names of the Certificate Authorities -that the server will accept client certificates signed by. If the -server requests a client certificate during the handshake, then -this property will be set after the handshake completes. - -Each item in the list is a #GByteArray which contains the complete -subject DN of the certificate authority. - -Since: 2.28 - - - - - - -A #GSocketConnectable describing the identity of the server that -is expected on the other end of the connection. - -If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in -#GTlsClientConnection:validation-flags, this object will be used -to determine the expected identify of the remote end of the -connection; if #GTlsClientConnection:server-identity is not set, -or does not match the identity presented by the server, then the -%G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail. - -In addition to its use in verifying the server certificate, -this is also used to give a hint to the server about what -certificate we expect, which is useful for servers that serve -virtual hosts. - -Since: 2.28 - - - - - - -If %TRUE, tells the connection to use a fallback version of TLS -or SSL, rather than trying to negotiate the best version of TLS -to use. This can be used when talking to servers that don't -implement version negotiation correctly and therefore refuse to -handshake at all with a "modern" TLS handshake. - -Despite the property name, the fallback version is not -necessarily SSL 3.0; if SSL 3.0 has been disabled, the -#GTlsClientConnection will use the next highest available version -(normally TLS 1.0) as the fallback version. - -Since: 2.28 - - - - - - -What steps to perform when validating a certificate received from -a server. Server certificates that fail to validate in all of the -ways indicated here will be rejected unless the application -overrides the default via #GTlsConnection::accept-certificate. - -Since: 2.28 - - - - - - -Emitted during the TLS handshake after the peer certificate has -been received. You can examine @peer_cert's certification path by -calling g_tls_certificate_get_issuer() on it. - -For a client-side connection, @peer_cert is the server's -certificate, and the signal will only be emitted if the -certificate was not acceptable according to @conn's -#GTlsClientConnection:validation_flags. If you would like the -certificate to be accepted despite @errors, return %TRUE from the -signal handler. Otherwise, if no handler accepts the certificate, -the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE. - -For a server-side connection, @peer_cert is the certificate -presented by the client, if this was requested via the server's -#GTlsServerConnection:authentication_mode. On the server side, -the signal is always emitted when the client presents a -certificate, and the certificate will only be accepted if a -handler returns %TRUE. - -Note that if this signal is emitted as part of asynchronous I/O -in the main thread, then you should not attempt to interact with -the user before returning from the signal handler. If you want to -let the user decide whether or not to accept the certificate, you -would have to return %FALSE from the signal handler on the first -attempt, and then after the connection attempt returns a -%G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if -the user decides to accept the certificate, remember that fact, -create a new connection, and return %TRUE from the signal handler -the next time. - -If you are doing I/O in another thread, you do not -need to worry about this, and can simply block in the signal -handler until the UI thread returns an answer. - -Since: 2.28 - - - - - a #GTlsConnection - - - - the peer's #GTlsCertificate - - - - the problems with @peer_cert. - - - - %TRUE to accept @peer_cert (which will also -immediately end the signal emission). %FALSE to allow the signal -emission to continue, which will cause the handshake to fail if -no one else overrides it. - - - - - - -The #GIOStream that the connection wraps - -Since: 2.28 - - - - - - -The connection's certificate; see -g_tls_connection_set_certificate(). - -Since: 2.28 - - - - - - -The certificate database to use when verifying this TLS connection. -If no cerificate database is set, then the default database will be -used. See g_tls_backend_get_default_database(). - -Since: 2.30 - - - - - - -A #GTlsInteraction object to be used when the connection or certificate -database need to interact with the user. This will be used to prompt the -user for passwords where necessary. - -Since: 2.30 - - - - - - -The connection's peer's certificate, after the TLS handshake has -completed and the certificate has been accepted. Note in -particular that this is not yet set during the emission of -#GTlsConnection::accept-certificate. - -(You can watch for a #GObject::notify signal on this property to -detect when a handshake has occurred.) - -Since: 2.28 - - - - - - -The errors noticed-and-ignored while verifying -#GTlsConnection:peer-certificate. Normally this should be 0, but -it may not be if #GTlsClientConnection:validation-flags is not -%G_TLS_CERTIFICATE_VALIDATE_ALL, or if -#GTlsConnection::accept-certificate overrode the default -behavior. - -Since: 2.28 - - - - - - -The rehandshaking mode. See -g_tls_connection_set_rehandshake_mode(). - -Since: 2.28 - - - - - - -Whether or not proper TLS close notification is required. -See g_tls_connection_set_require_close_notify(). - -Since: 2.28 - - - - - - -Whether or not the system certificate database will be used to -verify peer certificates. See -g_tls_connection_set_use_system_certdb(). - -Deprecated: 2.30: Use GTlsConnection:database instead - - - - - - -Flags for g_tls_database_lookup_certificate_handle(), -g_tls_database_lookup_certificate_issuer(), -and g_tls_database_lookup_certificates_issued_by(). - -Since: 2.30 - - - - - No lookup flags - - - - Restrict lookup to certificates that have -a private key. - - - - - - - -Flags for g_tls_database_verify_chain(). - -Since: 2.30 - - - - - No verification flags - - - - - - - -An error code used with %G_TLS_ERROR in a #GError returned from a -TLS-related routine. - -Since: 2.28 - - - - - No TLS provider is available - - - - Miscellaneous TLS error - - - - A certificate could not be parsed - - - - The TLS handshake failed because the -peer does not seem to be a TLS server. - - - - The TLS handshake failed because the -peer's certificate was not acceptable. - - - - The TLS handshake failed because -the server requested a client-side certificate, but none was -provided. See g_tls_connection_set_certificate(). - - - - The TLS connection was closed without proper -notice, which may indicate an attack. See -g_tls_connection_set_require_close_notify(). - - - - - - - -The path to a file containing PEM encoded certificate authority -root anchors. The certificates in this file will be treated as -root authorities for the purpose of verifying other certificates -via the g_tls_database_verify_chain() operation. - -Since: 2.30 - - - - - - -#GTlsInteractionResult is returned by various functions in #GTlsInteraction -when finishing an interaction request. - -Since: 2.30 - - - - - The interaction was unhandled (i.e. not -implemented). - - - - The interaction completed, and resulting data -is available. - - - - The interaction has failed, or was cancelled. -and the operation should be aborted. - - - - - - - -Various flags for the password. - -Since: 2.30 - - - - - No flags - - - - The password was wrong, and the user should retry. - - - - Hint to the user that the password has been -wrong many times, and the user may not have many chances left. - - - - Hint to the user that this is the last try to get -this password right. - - - - - - - -When to allow rehandshaking. See -g_tls_connection_set_rehandshake_mode(). - -Since: 2.28 - - - - - Never allow rehandshaking - - - - Allow safe rehandshaking only - - - - Allow unsafe rehandshaking - - - - - - - -The #GTlsAuthenticationMode for the server. This can be changed -before calling g_tls_connection_handshake() if you want to -rehandshake with a different mode from the initial handshake. - -Since: 2.28 - - - - - - -The credentials stored in the message. - -Since: 2.26 - - - - - - -Whether to close the file descriptor when the stream is closed. - -Since: 2.20 - - - - - - -The file descriptor that the stream reads from. - -Since: 2.20 - - - - - - -Emitted when the unix mount points have changed. - - - - - the object on which the signal is emitted - - - - - - - - -Emitted when the unix mounts have changed. - - - - - the object on which the signal is emitted - - - - - - - - -Types of UNIX mounts. - - - - - Unknown UNIX mount type. - - - - Floppy disk UNIX mount type. - - - - CDROM UNIX mount type. - - - - Network File System (NFS) UNIX mount type. - - - - ZIP UNIX mount type. - - - - JAZZ UNIX mount type. - - - - Memory Stick UNIX mount type. - - - - Compact Flash UNIX mount type. - - - - Smart Media UNIX mount type. - - - - SD/MMC UNIX mount type. - - - - iPod UNIX mount type. - - - - Digital camera UNIX mount type. - - - - Hard drive UNIX mount type. - - - - - - - -Whether to close the file descriptor when the stream is closed. - -Since: 2.20 - - - - - - -The file descriptor that the stream writes to. - -Since: 2.20 - - - - - - -Whether or not this is an abstract address - -Deprecated: Use #GUnixSocketAddress:address-type, which -distinguishes between zero-padded and non-zero-padded -abstract addresses. - - - - - - -The type of name used by a #GUnixSocketAddress. -%G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain -socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS -indicates a socket not bound to any name (eg, a client-side socket, -or a socket created with socketpair()). - -For abstract sockets, there are two incompatible ways of naming -them; the man pages suggest using the entire `struct sockaddr_un` -as the name, padding the unused parts of the %sun_path field with -zeroes; this corresponds to %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. -However, many programs instead just use a portion of %sun_path, and -pass an appropriate smaller length to bind() or connect(). This is -%G_UNIX_SOCKET_ADDRESS_ABSTRACT. - -Since: 2.26 - - - - - invalid - - - - anonymous - - - - a filesystem path - - - - an abstract name - - - - an abstract name, 0-padded -to the full length of a unix socket name - - - - - - - -Emitted when the volume has been changed. - - - - - - - - - -This signal is emitted when the #GVolume have been removed. If -the recipient is holding references to the object they should -release them so the object can be finalized. - - - - - - - - - -Emitted when a drive changes. - - - - - The volume monitor emitting the signal. - - - - the drive that changed - - - - - - - - -Emitted when a drive is connected to the system. - - - - - The volume monitor emitting the signal. - - - - a #GDrive that was connected. - - - - - - - - -Emitted when a drive is disconnected from the system. - - - - - The volume monitor emitting the signal. - - - - a #GDrive that was disconnected. - - - - - - - - -Emitted when the eject button is pressed on @drive. - -Since: 2.18 - - - - - The volume monitor emitting the signal. - - - - the drive where the eject button was pressed - - - - - - - - -Emitted when the stop button is pressed on @drive. - -Since: 2.22 - - - - - The volume monitor emitting the signal. - - - - the drive where the stop button was pressed - - - - - - - - -Emitted when a mount is added. - - - - - The volume monitor emitting the signal. - - - - a #GMount that was added. - - - - - - - - -Emitted when a mount changes. - - - - - The volume monitor emitting the signal. - - - - a #GMount that changed. - - - - - - - - -Emitted when a mount is about to be removed. - - - - - The volume monitor emitting the signal. - - - - a #GMount that is being unmounted. - - - - - - - - -Emitted when a mount is removed. - - - - - The volume monitor emitting the signal. - - - - a #GMount that was removed. - - - - - - - - -Emitted when a mountable volume is added to the system. - - - - - The volume monitor emitting the signal. - - - - a #GVolume that was added. - - - - - - - - -Emitted when mountable volume is changed. - - - - - The volume monitor emitting the signal. - - - - a #GVolume that changed. - - - - - - - - -Emitted when a mountable volume is removed from the system. - - - - - The volume monitor emitting the signal. - - - - a #GVolume that was removed. - - - - - - - - -Whether to close the file handle when the stream is closed. - -Since: 2.26 - - - - - - -The handle that the stream reads from. - -Since: 2.26 - - - - - - -Whether to close the file handle when the stream is closed. - -Since: 2.26 - - - - - - -The file handle that the stream writes to. - -Since: 2.26 - - - - - - -If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is -%G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name -and modification time from the file info to the GZIP header. - -Since: 2.26 - - - - - - -Used to select the type of data format to use for #GZlibDecompressor -and #GZlibCompressor. - -Since: 2.24 - - - - - deflate compression with zlib header - - - - gzip file format - - - - deflate compression with no header - - - - - - - -A #GFileInfo containing the information found in the GZIP header -of the data stream processed, or %NULL if the header was not yet -fully processed, is not present at all, or the compressor's -#GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP. - -Since: 2.26 - - - - - - -Translates kqueue filter flags into GIO event flags. - - - - - - a set of kqueue filter flags - - - - a pointer to #gboolean indicating that the -conversion has been done (out) - - - - a #GFileMonitorEvent - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-gtk-GDBus-Example-ObjectManager-Animal.Poke">Poke()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_animal_call_poke_finish() to get the result of the operation. - -See example_animal_call_poke_sync() for the synchronous, blocking version of this method. - -Since: 2.30 - - - - - A #ExampleAnimalProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_animal_call_poke(). - -Since: 2.30 - - - - - A #ExampleAnimalProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_animal_call_poke(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-gtk-GDBus-Example-ObjectManager-Animal.Poke">Poke()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See example_animal_call_poke() for the asynchronous version of this method. - -Since: 2.30 - - - - - A #ExampleAnimalProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gtk-GDBus-Example-ObjectManager-Animal.Poke">Poke()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - A #GDBusMethodInvocation. - - - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Bar">"Bar"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -Since: 2.36 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Foo">"Foo"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Mood">"Mood"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - - -Emits the <link linkend="gdbus-signal-org-gtk-GDBus-Example-ObjectManager-Animal.Jumped">"Jumped"</link> D-Bus signal. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - Argument to pass with the signal. - - - - - - - - -Gets the value of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Bar">"Bar"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use example_animal_dup_bar() if on another thread.</warning> - -Since: 2.36 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - - -Gets the value of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Foo">"Foo"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use example_animal_dup_foo() if on another thread.</warning> - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - - -Gets the value of the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Mood">"Mood"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use example_animal_dup_mood() if on another thread.</warning> - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link> D-Bus interface. - -Since: 2.30 - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - - -Overrides all #GObject properties in the #ExampleAnimal interface for a concrete class. -The properties are overridden in the order they are defined. - -Since: 2.30 - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_animal_proxy_new_finish() to get the result of the operation. - -See example_animal_proxy_new_sync() for the synchronous, blocking version of this constructor. - -Since: 2.30 - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_animal_proxy_new(). - -Since: 2.30 - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_animal_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - - -Like example_animal_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_animal_proxy_new_for_bus_finish() to get the result of the operation. - -See example_animal_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - -Since: 2.30 - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_animal_proxy_new_for_bus(). - -Since: 2.30 - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_animal_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - - -Like example_animal_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See example_animal_proxy_new_for_bus() for the asynchronous version of this constructor. - -Since: 2.30 - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See example_animal_proxy_new() for the asynchronous version of this constructor. - -Since: 2.30 - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - - -Sets the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Bar">"Bar"</link> D-Bus property to @value. - -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - -Since: 2.36 - - - - - A #ExampleAnimal. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Foo">"Foo"</link> D-Bus property to @value. - -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-gtk-GDBus-Example-ObjectManager-Animal.Mood">"Mood"</link> D-Bus property to @value. - -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - -Since: 2.30 - - - - - A #ExampleAnimal. - - - - The value to set. - - - - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link>. - -Since: 2.30 - - - - - The skeleton object. - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #ExampleCat interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_cat_proxy_new_finish() to get the result of the operation. - -See example_cat_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_cat_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_cat_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like example_cat_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_cat_proxy_new_for_bus_finish() to get the result of the operation. - -See example_cat_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_cat_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_cat_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like example_cat_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See example_cat_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See example_cat_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link>. - - - - - - The skeleton object. - - - - - -Gets the #ExampleAnimal instance for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link> on @object, if any. - -Since: 2.30 - - - - - A #ExampleObject. - - - - A #ExampleAnimal that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - - - - - -Gets the #ExampleCat instance for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link> on @object, if any. - - - - - - A #ExampleObject. - - - - A #ExampleCat that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - - - - -A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types. - - - - - - A #GDBusObjectManagerClient. - - - - The object path of the remote object (unused). - - - - Interface name of the remote object or %NULL to get the object proxy #GType. - - - - User data (unused). - - - - A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ExampleObjectProxy. - - - - - -Asynchronously creates #GDBusObjectManagerClient using example_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_object_manager_client_new_finish() to get the result of the operation. - -See example_object_manager_client_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_object_manager_client_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_object_manager_client_new(). - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - - - - -Like example_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call example_object_manager_client_new_for_bus_finish() to get the result of the operation. - -See example_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with example_object_manager_client_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to example_object_manager_client_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - - - - -Like example_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See example_object_manager_client_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - - - - -Synchronously creates #GDBusObjectManagerClient using example_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See example_object_manager_client_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - - - - -Like example_object_get_animal() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - -Since: 2.30 - - - - - A #ExampleObject. - - - - A #ExampleAnimal or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - - - - - -Like example_object_get_cat() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - - - - - - A #ExampleObject. - - - - A #ExampleCat or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - - - - -Creates a new proxy object. - - - - - - A #GDBusConnection. - - - - An object path. - - - - The proxy object. - - - - - -Creates a new skeleton object. - - - - - - An object path. - - - - The skeleton object. - - - - - -Sets the #ExampleAnimal instance for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Animal.top_of_page">org.gtk.GDBus.Example.ObjectManager.Animal</link> on @object. - -Since: 2.30 - - - - - A #ExampleObjectSkeleton. - - - - A #ExampleAnimal or %NULL to clear the interface. - - - - - - - - -Sets the #ExampleCat instance for the D-Bus interface <link linkend="gdbus-interface-org-gtk-GDBus-Example-ObjectManager-Cat.top_of_page">org.gtk.GDBus.Example.ObjectManager.Cat</link> on @object. - - - - - A #ExampleObjectSkeleton. - - - - A #ExampleCat or %NULL to clear the interface. - - - - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_authorize_call_check_authorized_finish() to get the result of the operation. - -See foo_igen_authorize_call_check_authorized_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_authorize_call_check_authorized(). - - - - - - A #FooiGenAuthorizeProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_authorize_call_check_authorized(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_authorize_call_check_authorized() for the asynchronous version of this method. - - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorized">CheckNotAuthorized()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_authorize_call_check_not_authorized_finish() to get the result of the operation. - -See foo_igen_authorize_call_check_not_authorized_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_authorize_call_check_not_authorized(). - - - - - - A #FooiGenAuthorizeProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_authorize_call_check_not_authorized(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorizedFromObject">CheckNotAuthorizedFromObject()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_authorize_call_check_not_authorized_from_object_finish() to get the result of the operation. - -See foo_igen_authorize_call_check_not_authorized_from_object_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_authorize_call_check_not_authorized_from_object(). - - - - - - A #FooiGenAuthorizeProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_authorize_call_check_not_authorized_from_object(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorizedFromObject">CheckNotAuthorizedFromObject()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_authorize_call_check_not_authorized_from_object() for the asynchronous version of this method. - - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorized">CheckNotAuthorized()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_authorize_call_check_not_authorized() for the asynchronous version of this method. - - - - - - A #FooiGenAuthorizeProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Authorize.CheckAuthorized">CheckAuthorized()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenAuthorize. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorized">CheckNotAuthorized()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenAuthorize. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Authorize.CheckNotAuthorizedFromObject">CheckNotAuthorizedFromObject()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenAuthorize. - - - - A #GDBusMethodInvocation. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenAuthorize interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_authorize_proxy_new_finish() to get the result of the operation. - -See foo_igen_authorize_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_authorize_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_authorize_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_authorize_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_authorize_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_authorize_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_authorize_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_authorize_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_authorize_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_authorize_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_authorize_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.HelloWorld">HelloWorld()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_hello_world_finish() to get the result of the operation. - -See foo_igen_bar_call_hello_world_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_hello_world(). - - - - - - A #FooiGenBarProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_hello_world(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.HelloWorld">HelloWorld()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_hello_world() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.PropertyCancellation">PropertyCancellation()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_property_cancellation_finish() to get the result of the operation. - -See foo_igen_bar_call_property_cancellation_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_property_cancellation(). - - - - - - A #FooiGenBarProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_property_cancellation(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.PropertyCancellation">PropertyCancellation()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_property_cancellation() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.RequestMultiPropertyMods">RequestMultiPropertyMods()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_request_multi_property_mods_finish() to get the result of the operation. - -See foo_igen_bar_call_request_multi_property_mods_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_request_multi_property_mods(). - - - - - - A #FooiGenBarProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_request_multi_property_mods(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.RequestMultiPropertyMods">RequestMultiPropertyMods()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_request_multi_property_mods() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.RequestSignalEmission">RequestSignalEmission()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_request_signal_emission_finish() to get the result of the operation. - -See foo_igen_bar_call_request_signal_emission_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_request_signal_emission(). - - - - - - A #FooiGenBarProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_request_signal_emission(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.RequestSignalEmission">RequestSignalEmission()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_request_signal_emission() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.TestNonPrimitiveTypes">TestNonPrimitiveTypes()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_test_non_primitive_types_finish() to get the result of the operation. - -See foo_igen_bar_call_test_non_primitive_types_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_test_non_primitive_types(). - - - - - - A #FooiGenBarProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_test_non_primitive_types(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.TestNonPrimitiveTypes">TestNonPrimitiveTypes()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_test_non_primitive_types() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.TestPrimitiveTypes">TestPrimitiveTypes()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_test_primitive_types_finish() to get the result of the operation. - -See foo_igen_bar_call_test_primitive_types_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_test_primitive_types(). - - - - - - A #FooiGenBarProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_test_primitive_types(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.TestPrimitiveTypes">TestPrimitiveTypes()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_test_primitive_types() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar.UnimplementedMethod">UnimplementedMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_call_unimplemented_method_finish() to get the result of the operation. - -See foo_igen_bar_call_unimplemented_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_call_unimplemented_method(). - - - - - - A #FooiGenBarProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_call_unimplemented_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar.UnimplementedMethod">UnimplementedMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_call_unimplemented_method() for the asynchronous version of this method. - - - - - - A #FooiGenBarProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.HelloWorld">HelloWorld()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.PropertyCancellation">PropertyCancellation()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.RequestMultiPropertyMods">RequestMultiPropertyMods()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.RequestSignalEmission">RequestSignalEmission()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.TestNonPrimitiveTypes">TestNonPrimitiveTypes()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.TestPrimitiveTypes">TestPrimitiveTypes()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar.UnimplementedMethod">UnimplementedMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBar. - - - - A #GDBusMethodInvocation. - - - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.aay">"aay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.ag">"ag"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.ao">"ao"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.as">"as"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.ay">"ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.FinallyNormalName">"FinallyNormalName"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.g">"g"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.o">"o"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.ReadonlyProperty">"ReadonlyProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.s">"s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_ag">"unset_ag"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_ao">"unset_ao"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_as">"unset_as"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_ay">"unset_ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_g">"unset_g"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_o">"unset_o"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_s">"unset_s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.unset_struct">"unset_struct"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bar.WriteonlyProperty">"WriteonlyProperty"</link> D-Bus property. - -Since this D-Bus property is not readable, it is only meaningful to use this function on the service-side. - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Emits the <link linkend="gdbus-signal-org-project-Bar.AnotherSignal">"AnotherSignal"</link> D-Bus signal. - - - - - A #FooiGenBar. - - - - Argument to pass with the signal. - - - - - - - - -Emits the <link linkend="gdbus-signal-org-project-Bar.TestSignal">"TestSignal"</link> D-Bus signal. - - - - - A #FooiGenBar. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bar-Frobnicator.RandomMethod">RandomMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_frobnicator_call_random_method_finish() to get the result of the operation. - -See foo_igen_bar_frobnicator_call_random_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBarFrobnicatorProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_frobnicator_call_random_method(). - - - - - - A #FooiGenBarFrobnicatorProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_frobnicator_call_random_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bar-Frobnicator.RandomMethod">RandomMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bar_frobnicator_call_random_method() for the asynchronous version of this method. - - - - - - A #FooiGenBarFrobnicatorProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bar-Frobnicator.RandomMethod">RandomMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBarFrobnicator. - - - - A #GDBusMethodInvocation. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenBarFrobnicator interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_frobnicator_proxy_new_finish() to get the result of the operation. - -See foo_igen_bar_frobnicator_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_frobnicator_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_frobnicator_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bar_frobnicator_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_frobnicator_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_bar_frobnicator_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_frobnicator_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_frobnicator_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bar_frobnicator_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_bar_frobnicator_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_bar_frobnicator_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link>. - - - - - - The skeleton object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.aay">"aay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_aay() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.ag">"ag"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_ag() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.ao">"ao"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_ao() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.as">"as"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_as() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.ay">"ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_ay() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.b">"b"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.d">"d"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.FinallyNormalName">"FinallyNormalName"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_finally_normal_name() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.g">"g"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_g() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.i">"i"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.n">"n"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.o">"o"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_o() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.q">"q"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.ReadonlyProperty">"ReadonlyProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_readonly_property() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.s">"s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_s() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.t">"t"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.u">"u"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_ag">"unset_ag"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_ag() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_ao">"unset_ao"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_ao() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_as">"unset_as"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_as() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_ay">"unset_ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_ay() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_d">"unset_d"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_g">"unset_g"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_g() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_i">"unset_i"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_o">"unset_o"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_o() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_s">"unset_s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_s() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.unset_struct">"unset_struct"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_unset_struct() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.WriteonlyProperty">"WriteonlyProperty"</link> D-Bus property. - -Since this D-Bus property is not readable, it is only meaningful to use this function on the service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bar_dup_writeonly_property() if on another thread.</warning> - - - - - - A #FooiGenBar. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.x">"x"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bar.y">"y"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBar. - - - - The property value. - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenBar interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_proxy_new_finish() to get the result of the operation. - -See foo_igen_bar_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bar_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bar_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_bar_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bar_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bar_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bar_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_bar_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_bar_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.aay">"aay"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.ag">"ag"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.ao">"ao"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.as">"as"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.ay">"ay"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.b">"b"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.d">"d"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.FinallyNormalName">"FinallyNormalName"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.g">"g"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.i">"i"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.n">"n"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.o">"o"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.q">"q"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.ReadonlyProperty">"ReadonlyProperty"</link> D-Bus property to @value. - -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.s">"s"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.t">"t"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.u">"u"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_ag">"unset_ag"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_ao">"unset_ao"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_as">"unset_as"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_ay">"unset_ay"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_d">"unset_d"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_g">"unset_g"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_i">"unset_i"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_o">"unset_o"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_s">"unset_s"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.unset_struct">"unset_struct"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.WriteonlyProperty">"WriteonlyProperty"</link> D-Bus property to @value. - -Since this D-Bus property is writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.x">"x"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bar.y">"y"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBar. - - - - The value to set. - - - - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-Bat.ForceMethod">ForceMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bat_call_force_method_finish() to get the result of the operation. - -See foo_igen_bat_call_force_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenBatProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bat_call_force_method(). - - - - - - A #FooiGenBatProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bat_call_force_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-Bat.ForceMethod">ForceMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_bat_call_force_method() for the asynchronous version of this method. - - - - - - A #FooiGenBatProxy. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-Bat.ForceMethod">ForceMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenBat. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - Parameter to return. - - - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bat.force_ay">"force_ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bat.force_i">"force_i"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bat.force_s">"force_s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-Bat.force_struct">"force_struct"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - - - - -Emits the <link linkend="gdbus-signal-org-project-Bat.ForceSignal">"ForceSignal"</link> D-Bus signal. - - - - - A #FooiGenBat. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - Argument to pass with the signal. - - - - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bat.force_ay">"force_ay"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bat_dup_force_ay() if on another thread.</warning> - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bat.force_i">"force_i"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bat_dup_force_i() if on another thread.</warning> - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bat.force_s">"force_s"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bat_dup_force_s() if on another thread.</warning> - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-Bat.force_struct">"force_struct"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_bat_dup_force_struct() if on another thread.</warning> - - - - - - A #FooiGenBat. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenBat interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bat_proxy_new_finish() to get the result of the operation. - -See foo_igen_bat_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bat_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bat_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bat_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_bat_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_bat_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_bat_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_bat_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_bat_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_bat_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_bat_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Sets the <link linkend="gdbus-property-org-project-Bat.force_ay">"force_ay"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBat. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bat.force_i">"force_i"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBat. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bat.force_s">"force_s"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBat. - - - - The value to set. - - - - - - - - -Sets the <link linkend="gdbus-property-org-project-Bat.force_struct">"force_struct"</link> D-Bus property to @value. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - - - - - A #FooiGenBat. - - - - The value to set. - - - - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link>. - - - - - - The skeleton object. - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenBaz interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_baz_proxy_new_finish() to get the result of the operation. - -See foo_igen_baz_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_baz_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_baz_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_baz_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_baz_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_baz_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_baz_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_baz_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_baz_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_baz_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_baz_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.AddedMethodIn10">AddedMethodIn10()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_call_added_method_in10_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_call_added_method_in10_sync() for the synchronous, blocking version of this method. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_call_added_method_in10(). - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_call_added_method_in10(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.AddedMethodIn10">AddedMethodIn10()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_call_added_method_in10() for the asynchronous version of this method. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.BarMethod">BarMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_call_bar_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_call_bar_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_call_bar_method(). - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_call_bar_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.BarMethod">BarMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_call_bar_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.BazMethod">BazMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_call_baz_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_call_baz_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_call_baz_method(). - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_call_baz_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.BazMethod">BazMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_call_baz_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.FooMethod">FooMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_call_foo_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_call_foo_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_call_foo_method(). - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_call_foo_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.FooMethod">FooMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_call_foo_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.NewMethodIn2">NewMethodIn2()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_call_new_method_in2_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_call_new_method_in2_sync() for the synchronous, blocking version of this method. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_call_new_method_in2(). - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_call_new_method_in2(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV10.NewMethodIn2">NewMethodIn2()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_call_new_method_in2() for the asynchronous version of this method. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV10.AddedMethodIn10">AddedMethodIn10()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV10.BarMethod">BarMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV10. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV10.BazMethod">BazMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV10. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV10.FooMethod">FooMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV10. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV10.NewMethodIn2">NewMethodIn2()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10. - - - - A #GDBusMethodInvocation. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV10.AddedSignalIn10">"AddedSignalIn10"</link> D-Bus signal. - -Since: 10.0 - - - - - A #FooiGenChangingInterfaceV10. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV10.BarSignal">"BarSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV10.BazSignal">"BazSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV10.FooSignal">"FooSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV10. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV10.NewSignalIn2">"NewSignalIn2"</link> D-Bus signal. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV10. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenChangingInterfaceV10 interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_proxy_new_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v10_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v10_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_changing_interface_v10_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v10_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v10_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v10_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v10_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.BarMethod">BarMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v1_call_bar_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v1_call_bar_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v1_call_bar_method(). - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v1_call_bar_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.BarMethod">BarMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v1_call_bar_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.BazMethod">BazMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v1_call_baz_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v1_call_baz_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v1_call_baz_method(). - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v1_call_baz_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.BazMethod">BazMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v1_call_baz_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.FooMethod">FooMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v1_call_foo_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v1_call_foo_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v1_call_foo_method(). - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v1_call_foo_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV1.FooMethod">FooMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v1_call_foo_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV1Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV1.BarMethod">BarMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV1. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV1.BazMethod">BazMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV1. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV1.FooMethod">FooMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV1. - - - - A #GDBusMethodInvocation. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV1.BarSignal">"BarSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV1.BazSignal">"BazSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV1.FooSignal">"FooSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV1. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenChangingInterfaceV1 interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v1_proxy_new_finish() to get the result of the operation. - -See foo_igen_changing_interface_v1_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v1_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v1_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v1_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_changing_interface_v1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v1_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v1_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v1_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v1_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.BarMethod">BarMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_call_bar_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_call_bar_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_call_bar_method(). - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_call_bar_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.BarMethod">BarMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_call_bar_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.BazMethod">BazMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_call_baz_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_call_baz_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_call_baz_method(). - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_call_baz_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.BazMethod">BazMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_call_baz_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.FooMethod">FooMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_call_foo_method_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_call_foo_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_call_foo_method(). - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_call_foo_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.FooMethod">FooMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_call_foo_method() for the asynchronous version of this method. - - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.NewMethodIn2">NewMethodIn2()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_call_new_method_in2_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_call_new_method_in2_sync() for the synchronous, blocking version of this method. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_call_new_method_in2(). - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_call_new_method_in2(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Synchronously invokes the <link linkend="gdbus-method-ChangingInterfaceV2.NewMethodIn2">NewMethodIn2()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_call_new_method_in2() for the asynchronous version of this method. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV2Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV2.BarMethod">BarMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV2. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV2.BazMethod">BazMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV2. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV2.FooMethod">FooMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenChangingInterfaceV2. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-ChangingInterfaceV2.NewMethodIn2">NewMethodIn2()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV2. - - - - A #GDBusMethodInvocation. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV2.BarSignal">"BarSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV2. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV2.BazSignal">"BazSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV2. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV2.FooSignal">"FooSignal"</link> D-Bus signal. - - - - - A #FooiGenChangingInterfaceV2. - - - - - - - - -Emits the <link linkend="gdbus-signal-ChangingInterfaceV2.NewSignalIn2">"NewSignalIn2"</link> D-Bus signal. - -Since: 2.0 - - - - - A #FooiGenChangingInterfaceV2. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenChangingInterfaceV2 interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_proxy_new_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v2_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_changing_interface_v2_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_changing_interface_v2_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_changing_interface_v2_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_changing_interface_v2_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_changing_interface_v2_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_changing_interface_v2_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Attack">Attack()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_com_acme_coyote_call_attack_finish() to get the result of the operation. - -See foo_igen_com_acme_coyote_call_attack_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_com_acme_coyote_call_attack(). - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_com_acme_coyote_call_attack(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Attack">Attack()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_com_acme_coyote_call_attack() for the asynchronous version of this method. - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Run">Run()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_com_acme_coyote_call_run_finish() to get the result of the operation. - -See foo_igen_com_acme_coyote_call_run_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_com_acme_coyote_call_run(). - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_com_acme_coyote_call_run(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Run">Run()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_com_acme_coyote_call_run() for the asynchronous version of this method. - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Sleep">Sleep()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_com_acme_coyote_call_sleep_finish() to get the result of the operation. - -See foo_igen_com_acme_coyote_call_sleep_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_com_acme_coyote_call_sleep(). - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_com_acme_coyote_call_sleep(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-com-acme-Coyote.Sleep">Sleep()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_com_acme_coyote_call_sleep() for the asynchronous version of this method. - - - - - - A #FooiGenComAcmeCoyoteProxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-acme-Coyote.Attack">Attack()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenComAcmeCoyote. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-acme-Coyote.Run">Run()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenComAcmeCoyote. - - - - A #GDBusMethodInvocation. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-acme-Coyote.Sleep">Sleep()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenComAcmeCoyote. - - - - A #GDBusMethodInvocation. - - - - - - - - -Gets a copy of the <link linkend="gdbus-property-com-acme-Coyote.Mood">"Mood"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenComAcmeCoyote. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Emits the <link linkend="gdbus-signal-com-acme-Coyote.Surprised">"Surprised"</link> D-Bus signal. - - - - - A #FooiGenComAcmeCoyote. - - - - - - - - -Gets the value of the <link linkend="gdbus-property-com-acme-Coyote.Mood">"Mood"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_com_acme_coyote_dup_mood() if on another thread.</warning> - - - - - - A #FooiGenComAcmeCoyote. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenComAcmeCoyote interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_com_acme_coyote_proxy_new_finish() to get the result of the operation. - -See foo_igen_com_acme_coyote_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_com_acme_coyote_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_com_acme_coyote_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_com_acme_coyote_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_com_acme_coyote_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_com_acme_coyote_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_com_acme_coyote_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_com_acme_coyote_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_com_acme_coyote_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_com_acme_coyote_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_com_acme_coyote_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Sets the <link linkend="gdbus-property-com-acme-Coyote.Mood">"Mood"</link> D-Bus property to @value. - -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - - - - - A #FooiGenComAcmeCoyote. - - - - The value to set. - - - - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-FDPassing.HelloFD">HelloFD()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_fdpassing_call_hello_fd_finish() to get the result of the operation. - -See foo_igen_fdpassing_call_hello_fd_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenFDPassingProxy. - - - - Argument to pass with the method invocation. - - - - A #GUnixFDList or %NULL. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_fdpassing_call_hello_fd(). - - - - - - A #FooiGenFDPassingProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for a #GUnixFDList or %NULL. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_fdpassing_call_hello_fd(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-FDPassing.HelloFD">HelloFD()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_fdpassing_call_hello_fd() for the asynchronous version of this method. - - - - - - A #FooiGenFDPassingProxy. - - - - Argument to pass with the method invocation. - - - - A #GUnixFDList or %NULL. - - - - Return location for return parameter or %NULL to ignore. - - - - Return location for a #GUnixFDList or %NULL. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-FDPassing.HelloFD">HelloFD()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenFDPassing. - - - - A #GDBusMethodInvocation. - - - - A #GUnixFDList or %NULL. - - - - Parameter to return. - - - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link> D-Bus interface. - - - - - - A #GDBusInterfaceInfo. Do not free. - - - - - -Overrides all #GObject properties in the #FooiGenFDPassing interface for a concrete class. -The properties are overridden in the order they are defined. - - - - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - - - - -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_fdpassing_proxy_new_finish() to get the result of the operation. - -See foo_igen_fdpassing_proxy_new_sync() for the synchronous, blocking version of this constructor. - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_fdpassing_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_fdpassing_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_fdpassing_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_fdpassing_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_fdpassing_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_fdpassing_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_fdpassing_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_fdpassing_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_fdpassing_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_fdpassing_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link>. - - - - - - The skeleton object. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-InlineDocs.FooMethod">FooMethod()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_inline_docs_call_foo_method_finish() to get the result of the operation. - -See foo_igen_inline_docs_call_foo_method_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenInlineDocsProxy. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_inline_docs_call_foo_method(). - - - - - - A #FooiGenInlineDocsProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_inline_docs_call_foo_method(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-InlineDocs.FooMethod">FooMethod()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_inline_docs_call_foo_method() for the asynchronous version of this method. - - - - - - A #FooiGenInlineDocsProxy. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Asynchronously invokes the <link linkend="gdbus-method-org-project-InlineDocs.Method2">Method2()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_inline_docs_call_method2_finish() to get the result of the operation. - -See foo_igen_inline_docs_call_method2_sync() for the synchronous, blocking version of this method. - - - - - A #FooiGenInlineDocsProxy. - - - - Argument to pass with the method invocation. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - - - - -Finishes an operation started with foo_igen_inline_docs_call_method2(). - - - - - - A #FooiGenInlineDocsProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_inline_docs_call_method2(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Synchronously invokes the <link linkend="gdbus-method-org-project-InlineDocs.Method2">Method2()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_inline_docs_call_method2() for the asynchronous version of this method. - - - - - - A #FooiGenInlineDocsProxy. - - - - Argument to pass with the method invocation. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-InlineDocs.FooMethod">FooMethod()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenInlineDocs. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - - - - - -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-InlineDocs.Method2">Method2()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. - - - - - A #FooiGenInlineDocs. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.BazProperty">"BazProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenInlineDocs. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.FancyProperty">"FancyProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenInlineDocs. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.Property2">"Property2"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenInlineDocs. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.Property3">"Property3"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenInlineDocs. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.Property4">"Property4"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - - - - - - A #FooiGenInlineDocs. + + the file was moved out of the +monitored directory to another location -- only sent if the +%G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.44 - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - + - + -Gets a copy of the <link linkend="gdbus-property-org-project-InlineDocs.Property5">"Property5"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - +Flags used to set what a #GFileMonitor will watch for. - - A #FooiGenInlineDocs. + + No flags set. - - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - - - - -Emits the <link linkend="gdbus-signal-org-project-InlineDocs.BarSignal">"BarSignal"</link> D-Bus signal. - - - - - A #FooiGenInlineDocs. + + Watch for mount events. - - Argument to pass with the signal. + + Pair DELETED and CREATED events caused +by file renames (moves) and send a single G_FILE_MONITOR_EVENT_MOVED +event instead (NB: not supported on all backends; the default +behaviour -without specifying this flag- is to send single DELETED +and CREATED events). Deprecated since 2.44: use +%G_FILE_MONITOR_WATCH_MOVES instead. - - Argument to pass with the signal. + + Watch for changes to the file made +via another hard link. Since 2.36. - - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.BazProperty">"BazProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_baz_property() if on another thread.</warning> - - - - - - A #FooiGenInlineDocs. + + Watch for rename operations on a +monitored directory. This causes %G_FILE_MONITOR_EVENT_RENAMED, +%G_FILE_MONITOR_EVENT_MOVED_IN and %G_FILE_MONITOR_EVENT_MOVED_OUT +events to be emitted when possible. Since: 2.44. - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - + - + -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.FancyProperty">"FancyProperty"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_fancy_property() if on another thread.</warning> - +Flags used when querying a #GFileInfo. - - A #FooiGenInlineDocs. + + No flags set. - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.Property2">"Property2"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_property2() if on another thread.</warning> - - - - - - A #FooiGenInlineDocs. + + Don't follow symlinks. - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - + - + -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.Property3">"Property3"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_property3() if on another thread.</warning> - +Indicates the file's on-disk type. - - A #FooiGenInlineDocs. + + File's type is unknown. - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.Property4">"Property4"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_property4() if on another thread.</warning> - - - - - - A #FooiGenInlineDocs. + + File handle represents a regular file. - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - - - - -Gets the value of the <link linkend="gdbus-property-org-project-InlineDocs.Property5">"Property5"</link> D-Bus property. - -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_inline_docs_dup_property5() if on another thread.</warning> - - - - - - A #FooiGenInlineDocs. + + File handle represents a directory. + + + + File handle represents a symbolic link +(Unix systems). + + + + File is a "special" file, such as a socket, fifo, +block device, or character device. + + + + File is a shortcut (Windows systems). + + + + File is a mountable location. - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link> D-Bus interface. - +Emitted when the file name completion information comes available. - A #GDBusInterfaceInfo. Do not free. - - + + - + -Overrides all #GObject properties in the #FooiGenInlineDocs interface for a concrete class. -The properties are overridden in the order they are defined. - +Indicates a hint from the file system whether files should be +previewed in a file manager. Returned as the value of the key +#G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW. - - The class structure for a #GObject<!-- -->-derived class. + + Only preview files if user has explicitly requested it. - - The property id to assign to the first overridden property. + + Preview files if user has requested preview of "local" files. + + + + Never preview files. - The last property id. - - + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_inline_docs_proxy_new_finish() to get the result of the operation. +Error codes returned by GIO functions. -See foo_igen_inline_docs_proxy_new_sync() for the synchronous, blocking version of this constructor. +Note that this domain may be extended in future GLib releases. In +general, new error codes either only apply to new APIs, or else +replace %G_IO_ERROR_FAILED in cases that were not explicitly +distinguished before. You should therefore avoid writing code like +|[<!-- language="C" --> +if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED)) +{ +// Assume that this is EPRINTERONFIRE +... +} +]| +but should instead treat all unrecognized error codes the same as +#G_IO_ERROR_FAILED. - - A #GDBusConnection. + + Generic error condition for when an operation fails +and no more specific #GIOErrorEnum value is defined. - - Flags from the #GDBusProxyFlags enumeration. + + File not found. - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + File already exists. - - An object path. + + File is a directory. - - A #GCancellable or %NULL. + + File is not a directory. - - A #GAsyncReadyCallback to call when the request is satisfied. + + File is a directory that isn't empty. - - User data to pass to @callback. + + File is not a regular file. - - - - - - -Finishes an operation started with foo_igen_inline_docs_proxy_new(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_inline_docs_proxy_new(). + + File is not a symbolic link. - - Return location for error or %NULL + + File cannot be mounted. - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_inline_docs_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_inline_docs_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_inline_docs_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - - - - - A #GBusType. + + Filename is too many characters. - - Flags from the #GDBusProxyFlags enumeration. + + Filename is invalid or contains invalid characters. - - A bus name (well-known or unique). + + File contains too many symbolic links. - - An object path. + + No space left on drive. - - A #GCancellable or %NULL. + + Invalid argument. - - A #GAsyncReadyCallback to call when the request is satisfied. + + Permission denied. - - User data to pass to @callback. + + Operation (or one of its parameters) not supported - - - - - - -Finishes an operation started with foo_igen_inline_docs_proxy_new_for_bus(). - - - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_inline_docs_proxy_new_for_bus(). + + File isn't mounted. - - Return location for error or %NULL + + File is already mounted. - - The constructed proxy object or %NULL if @error is set. - - - - - -Like foo_igen_inline_docs_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_inline_docs_proxy_new_for_bus() for the asynchronous version of this constructor. - - - - - - A #GBusType. + + File was closed. - - Flags from the #GDBusProxyFlags enumeration. + + Operation was cancelled. See #GCancellable. - - A bus name (well-known or unique). + + Operations are still pending. - - An object path. + + File is read only. - - A #GCancellable or %NULL. + + Backup couldn't be created. - - Return location for error or %NULL + + File's Entity Tag was incorrect. - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_inline_docs_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. + + Operation timed out. - - Flags from the #GDBusProxyFlags enumeration. + + Operation would be recursive. - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + File is busy. - - An object path. + + Operation would block. - - A #GCancellable or %NULL. + + Host couldn't be found (remote operations). - - Return location for error or %NULL + + Operation would merge files. + + + + Operation failed and a helper program has +already interacted with the user. Do not display any error dialog. + + + + The current process has too many files +open and can't open any more. Duplicate descriptors do count toward +this limit. Since 2.20 + + + + The object has not been initialized. Since 2.22 + + + + The requested address is already in use. Since 2.22 + + + + Need more input to finish operation. Since 2.24 + + + + The input data was invalid. Since 2.24 + + + + A remote object generated an error that +doesn't correspond to a locally registered #GError error +domain. Use g_dbus_error_get_remote_error() to extract the D-Bus +error name and g_dbus_error_strip_remote_error() to fix up the +message so it matches what was received on the wire. Since 2.26. + + + + Host unreachable. Since 2.26 + + + + Network unreachable. Since 2.26 + + + + Connection refused. Since 2.26 + + + + Connection to proxy server failed. Since 2.26 + + + + Proxy authentication failed. Since 2.26 + + + + Proxy server needs authentication. Since 2.26 + + + + Proxy connection is not allowed by ruleset. +Since 2.26 + + + + Broken pipe. Since 2.36 + + + + Connection closed by peer. Note that this +is the same code as %G_IO_ERROR_BROKEN_PIPE; before 2.44 some +"connection closed" errors returned %G_IO_ERROR_BROKEN_PIPE, but others +returned %G_IO_ERROR_FAILED. Now they should all return the same +value, which has this more logical name. Since 2.44. + + + + Transport endpoint is not connected. Since 2.44 - The constructed proxy object or %NULL if @error is set. - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.BazProperty">"BazProperty"</link> D-Bus property to @value. +Flags for use with g_io_module_scope_new(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.30 - - A #FooiGenInlineDocs. + + No module scan flags - - The value to set. + + When using this scope to load or +scan modules, automatically block a modules which has the same base +basename as previously loaded module. - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.FancyProperty">"FancyProperty"</link> D-Bus property to @value. +GIOStreamSpliceFlags determine how streams should be spliced. -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.28 - - A #FooiGenInlineDocs. + + Do not close either stream. - - The value to set. + + Close the first stream after +the splice. + + + + Close the second stream after +the splice. + + + + Wait for both splice operations to finish +before calling the callback. - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.Property2">"Property2"</link> D-Bus property to @value. +Whether this is the "any" address for its family. +See g_inet_address_get_is_any(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.22 - - - A #FooiGenInlineDocs. - - - - The value to set. - - - - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.Property3">"Property3"</link> D-Bus property to @value. +Whether this is a link-local address. +See g_inet_address_get_is_link_local(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.22 - - - A #FooiGenInlineDocs. - - - - The value to set. - - - - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.Property4">"Property4"</link> D-Bus property to @value. +Whether this is the loopback address for its family. +See g_inet_address_get_is_loopback(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.22 - - - A #FooiGenInlineDocs. - - - - The value to set. - - - - - + - + -Sets the <link linkend="gdbus-property-org-project-InlineDocs.Property5">"Property5"</link> D-Bus property to @value. +Whether this is a global multicast address. +See g_inet_address_get_is_mc_global(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.22 - - - A #FooiGenInlineDocs. - - - - The value to set. - - - - - + - + -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link>. +Whether this is a link-local multicast address. +See g_inet_address_get_is_mc_link_local(). +Since: 2.22 - - - The skeleton object. - - + - + -Asynchronously invokes the <link linkend="gdbus-method-org-project-MethodThreads.GetSelf">GetSelf()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_method_threads_call_get_self_finish() to get the result of the operation. +Whether this is a node-local multicast address. +See g_inet_address_get_is_mc_node_local(). -See foo_igen_method_threads_call_get_self_sync() for the synchronous, blocking version of this method. +Since: 2.22 - - - A #FooiGenMethodThreadsProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_method_threads_call_get_self(). +Whether this is an organization-local multicast address. +See g_inet_address_get_is_mc_org_local(). +Since: 2.22 - - - A #FooiGenMethodThreadsProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_method_threads_call_get_self(). - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Synchronously invokes the <link linkend="gdbus-method-org-project-MethodThreads.GetSelf">GetSelf()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_method_threads_call_get_self() for the asynchronous version of this method. +Whether this is a site-local multicast address. +See g_inet_address_get_is_mc_site_local(). +Since: 2.22 - - - A #FooiGenMethodThreadsProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-project-MethodThreads.GetSelf">GetSelf()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. +Whether this is a multicast address. +See g_inet_address_get_is_multicast(). -This method will free @invocation, you cannot use it afterwards. +Since: 2.22 - - - A #FooiGenMethodThreads. - - - - A #GDBusMethodInvocation. - - - - Parameter to return. - - - - - + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link> D-Bus interface. +Whether this is a site-local address. +See g_inet_address_get_is_loopback(). +Since: 2.22 - - - A #GDBusInterfaceInfo. Do not free. - - + - + -Overrides all #GObject properties in the #FooiGenMethodThreads interface for a concrete class. -The properties are overridden in the order they are defined. +The `sin6_flowinfo` field, for IPv6 addresses. +Since: 2.32 - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_method_threads_proxy_new_finish() to get the result of the operation. +This signal is emitted whenever items were added or removed to +@list. At @position, @removed items were removed and @added items +were added in their place. -See foo_igen_method_threads_proxy_new_sync() for the synchronous, blocking version of this constructor. +Since: 2.44 - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. + + the #GListModel that changed - - A #GCancellable or %NULL. + + the position at which @list changed - - A #GAsyncReadyCallback to call when the request is satisfied. + + the number of items removed - - User data to pass to @callback. + + the number of items added - + - + -Finishes an operation started with foo_igen_method_threads_proxy_new(). +The type of items contained in this list store. Items must be +subclasses of #GObject. +Since: 2.44 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_method_threads_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Like foo_igen_method_threads_proxy_new() but takes a #GBusType instead of a #GDBusConnection. +Pointer to buffer where data will be written. + +Since: 2.24 -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_method_threads_proxy_new_for_bus_finish() to get the result of the operation. + + + + + +Size of data written to the buffer. -See foo_igen_method_threads_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +Since: 2.24 - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_method_threads_proxy_new_for_bus(). +Function called with the buffer as argument when the stream is destroyed. +Since: 2.24 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_method_threads_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Like foo_igen_method_threads_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. +Function with realloc semantics called to enlarge the buffer. -The calling thread is blocked until a reply is received. +Since: 2.24 + + + -See foo_igen_method_threads_proxy_new_for_bus() for the asynchronous version of this constructor. + + +Current size of the data buffer. +Since: 2.24 - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link>. See g_dbus_proxy_new_sync() for more details. +Emitted when a change has occured to the menu. + +The only changes that can occur to a menu is that items are removed +or added. Items may not change (except by being removed and added +back in the same location). This signal is capable of describing +both of those changes (at the same time). -The calling thread is blocked until a reply is received. +The signal means that starting at the index @position, @removed +items were removed and @added items were added in their place. If +@removed is zero then only items were added. If @added is zero +then only items were removed. -See foo_igen_method_threads_proxy_new() for the asynchronous version of this constructor. +As an example, if the menu contains items a, b, c, d (in that +order) and the signal (2, 1, 3) occurs then the new composition of +the menu will be a, b, _, _, _, d (with each _ representing some +new item). +Signal handlers may query the model (particularly the added items) +and expect to see the results of the modification that is being +reported. The signal is emitted after the modification. - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + the #GMenuModel that is changing - - An object path. + + the position of the change - - A #GCancellable or %NULL. + + the number of items removed - - Return location for error or %NULL + + the number of items added - The constructed proxy object or %NULL if @error is set. - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link>. - - - - - - The skeleton object. - - + + - + -Gets the value of the <link linkend="gdbus-property-Naming.Type">"Type"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - +Emitted when the mount has been changed. - - A #FooiGenNaming. + + the object on which the signal is emitted - The property value. - - + + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-Naming.top_of_page">Naming</link> D-Bus interface. +This signal is emitted when the #GMount is about to be +unmounted. +Since: 2.22 + + the object on which the signal is emitted + + - A #GDBusInterfaceInfo. Do not free. - - + + - + -Overrides all #GObject properties in the #FooiGenNaming interface for a concrete class. -The properties are overridden in the order they are defined. - +This signal is emitted when the #GMount have been +unmounted. If the recipient is holding references to the +object they should release them so the object can be +finalized. - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. + + the object on which the signal is emitted - The last property id. - - + + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_naming_proxy_new_finish() to get the result of the operation. - -See foo_igen_naming_proxy_new_sync() for the synchronous, blocking version of this constructor. +Flags used when mounting a mount. - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. + + No flags set. - - + - + -Finishes an operation started with foo_igen_naming_proxy_new(). +Emitted by the backend when e.g. a device becomes unavailable +while a mount operation is in progress. + +Implementations of GMountOperation should handle this signal +by dismissing open password dialogs. +Since: 2.20 - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_naming_proxy_new(). - - - - Return location for error or %NULL - - - The constructed proxy object or %NULL if @error is set. - - + + - + -Like foo_igen_naming_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_naming_proxy_new_for_bus_finish() to get the result of the operation. +Emitted when a mount operation asks the user for a password. -See foo_igen_naming_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +If the message contains a line break, the first line should be +presented as a heading. For example, it may be used as the +primary text in a #GtkMessageDialog. - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). + + a #GMountOperation requesting a password. - - An object path. + + string containing a message to display to the user. - - A #GCancellable or %NULL. + + string containing the default user name. - - A #GAsyncReadyCallback to call when the request is satisfied. + + string containing the default domain. - - User data to pass to @callback. + + a set of #GAskPasswordFlags. - + - + -Finishes an operation started with foo_igen_naming_proxy_new_for_bus(). +Emitted when asking the user a question and gives a list of +choices for the user to choose from. +If the message contains a line break, the first line should be +presented as a heading. For example, it may be used as the +primary text in a #GtkMessageDialog. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_naming_proxy_new_for_bus(). + + a #GMountOperation asking a question. - - Return location for error or %NULL + + string containing a message to display to the user. + + + + an array of strings for each possible choice. - The constructed proxy object or %NULL if @error is set. - - + + - + -Like foo_igen_naming_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_naming_proxy_new_for_bus() for the asynchronous version of this constructor. - +Emitted when the user has replied to the mount operation. - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. + + a #GMountOperation. - - Return location for error or %NULL + + a #GMountOperationResult indicating how the request was handled - The constructed proxy object or %NULL if @error is set. - - + + - + -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link>. See g_dbus_proxy_new_sync() for more details. +Emitted when one or more processes are blocking an operation +e.g. unmounting/ejecting a #GMount or stopping a #GDrive. -The calling thread is blocked until a reply is received. +Note that this signal may be emitted several times to update the +list of blocking processes as processes close files. The +application should only respond with g_mount_operation_reply() to +the latest signal (setting #GMountOperation:choice to the choice +the user made). -See foo_igen_naming_proxy_new() for the asynchronous version of this constructor. +If the message contains a line break, the first line should be +presented as a heading. For example, it may be used as the +primary text in a #GtkMessageDialog. +Since: 2.22 - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + a #GMountOperation. - - An object path. + + string containing a message to display to the user. - - A #GCancellable or %NULL. + + an array of #GPid for processes +blocking the operation. - - Return location for error or %NULL + + an array of strings for each possible choice. - The constructed proxy object or %NULL if @error is set. - - + + - + -Sets the <link linkend="gdbus-property-Naming.Type">"Type"</link> D-Bus property to @value. +Emitted when an unmount operation has been busy for more than some time +(typically 1.5 seconds). + +When unmounting or ejecting a volume, the kernel might need to flush +pending data in its buffers to the volume stable storage, and this operation +can take a considerable amount of time. This signal may be emitted several +times as long as the unmount operation is outstanding, and then one +last time when the operation is completed, with @bytes_left set to zero. + +Implementations of GMountOperation should handle this signal by +showing an UI notification, and then dismiss it, or show another notification +of completion, when @bytes_left reaches zero. + +If the message contains a line break, the first line should be +presented as a heading. For example, it may be used as the +primary text in a #GtkMessageDialog. -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. +Since: 2.34 - - A #FooiGenNaming. + + a #GMountOperation: - - The value to set. + + string containing a mesage to display to the user + + + + the estimated time left before the operation completes, +in microseconds, or -1 + + + + the amount of bytes to be written before the operation +completes (or -1 if such amount is not known), or zero if the operation +is completed - + - + -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link>. - +Whether to use an anonymous user when authenticating. - - - The skeleton object. - - + - + -Gets the #FooiGenAuthorize instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link> on @object, if any. - +The index of the user's choice when a question is asked during the +mount operation. See the #GMountOperation::ask-question signal. - - - A #FooiGenObject. - - - - A #FooiGenAuthorize that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenBar instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link> on @object, if any. - +The domain to use for the mount operation. - - - A #FooiGenObject. - - - - A #FooiGenBar that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenBarFrobnicator instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link> on @object, if any. - +The password that is used for authentication when carrying out +the mount operation. - - - A #FooiGenObject. - - - - A #FooiGenBarFrobnicator that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenBat instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link> on @object, if any. - +Determines if and how the password information should be saved. - - - A #FooiGenObject. - - - - A #FooiGenBat that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenBaz instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link> on @object, if any. +The user name that is used for authentication when carrying out +the mount operation. + + + + + +#GMountOperationResult is returned as a result when a request for +information is send by the mounting operation. - - A #FooiGenObject. + + The request was fulfilled and the +user specified data is now available + + + + The user requested the mount operation +to be aborted + + + + The request was unhandled (i.e. not +implemented) - A #FooiGenBaz that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenChangingInterfaceV1 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link> on @object, if any. - +Flags used when an unmounting a mount. - - A #FooiGenObject. + + No flags set. + + + + Unmount even if there are outstanding +file operations on the mount. - A #FooiGenChangingInterfaceV1 that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenChangingInterfaceV10 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link> on @object, if any. +The host's network connectivity state, as reported by #GNetworkMonitor. +Since: 2.44 - - A #FooiGenObject. + + The host is not configured with a +route to the Internet; it may or may not be connected to a local +network. + + + + The host is connected to a network, but +does not appear to be able to reach the full Internet, perhaps +due to upstream network problems. + + + + The host is behind a captive portal and +cannot reach the full Internet. + + + + The host is connected to a network, and +appears to be able to reach the full Internet. - A #FooiGenChangingInterfaceV10 that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenChangingInterfaceV2 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link> on @object, if any. +Emitted when the network configuration changes. If @available is +%TRUE, then some hosts may be reachable that were not reachable +before, while others that were reachable before may no longer be +reachable. If @available is %FALSE, then no remote hosts are +reachable. +Since: 2.32 - - A #FooiGenObject. + + a #GNetworkMonitor + + + + the current value of #GNetworkMonitor:network-available - A #FooiGenChangingInterfaceV2 that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + + - + -Gets the #FooiGenComAcmeCoyote instance for the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link> on @object, if any. +More detailed information about the host's network connectivity. +See g_network_monitor_get_connectivity() and +#GNetworkConnectivity for more details. +Since: 2.44 - - - A #FooiGenObject. - - - - A #FooiGenComAcmeCoyote that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenFDPassing instance for the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link> on @object, if any. +Whether the network is considered available. That is, whether the +system has a default route for at least one of IPv4 or IPv6. + +Real-world networks are of course much more complicated than +this; the machine may be connected to a wifi hotspot that +requires payment before allowing traffic through, or may be +connected to a functioning router that has lost its own upstream +connectivity. Some hosts might only be accessible when a VPN is +active. Other hosts might only be accessible when the VPN is +not active. Thus, it is best to use g_network_monitor_can_reach() +or g_network_monitor_can_reach_async() to test for reachability +on a host-by-host basis. (On the other hand, when the property is +%FALSE, the application can reasonably expect that no remote +hosts at all are reachable, and should indicate this to the user +in its UI.) + +See also #GNetworkMonitor::network-changed. +Since: 2.32 - - - A #FooiGenObject. - - - - A #FooiGenFDPassing that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenInlineDocs instance for the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link> on @object, if any. +Priority levels for #GNotifications. +Since: 2.42 - - A #FooiGenObject. + + for notifications that do not require +immediate attention - typically used for contextual background +information, such as contact birthdays or local weather + + + + the default priority, to be used for the +majority of notifications (for example email messages, software updates, +completed download/sync operations) + + + + for events that require more attention, +usually because responses are time-sensitive (for example chat and SMS +messages or alarms) + + + + for urgent notifications, or notifications +that require a response in a short space of time (for example phone calls +or emergency warnings) - A #FooiGenInlineDocs that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenMethodThreads instance for the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link> on @object, if any. - +GOutputStreamSpliceFlags determine how streams should be spliced. - - A #FooiGenObject. + + Do not close either stream. + + + + Close the source stream after +the splice. + + + + Close the target stream after +the splice. - A #FooiGenMethodThreads that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenNaming instance for the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link> on @object, if any. +#GPasswordSave is used to indicate the lifespan of a saved password. +#Gvfs stores passwords in the Gnome keyring when this flag allows it +to, and later retrieves it again from there. - - A #FooiGenObject. + + never save a password. + + + + save a password for the session. + + + + save a password permanently. - A #FooiGenNaming that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenOldieInterface instance for the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link> on @object, if any. +%TRUE if the caller currently has permission to perform the action that +@permission represents the permission to perform. + + + -Deprecated: The D-Bus interface has been deprecated. + + +%TRUE if it is generally possible to acquire the permission by calling +g_permission_acquire(). - - - A #FooiGenObject. - - - - A #FooiGenOldieInterface that must be freed with g_object_unref() or %NULL if @object does not implement the interface. + - - + + +%TRUE if it is generally possible to release the permission by calling +g_permission_release(). + + + - + -Gets the #FooiGenRocket123 instance for the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link> on @object, if any. +If @action is currently enabled. + +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. +Since: 2.38 - - - A #FooiGenObject. - - - - A #FooiGenRocket123 that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenTesTuglyCASEInterface instance for the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link> on @object, if any. +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GActionMap. +Since: 2.38 - - - A #FooiGenObject. - - - - A #FooiGenTesTuglyCASEInterface that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -Gets the #FooiGenUnknownXmlTags instance for the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link> on @object, if any. +The object to wrap a property on. + +The object must be a non-%NULL #GObject with properties. +Since: 2.38 - - - A #FooiGenObject. - - - - A #FooiGenUnknownXmlTags that must be freed with g_object_unref() or %NULL if @object does not implement the interface. - - + - + -A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types. +The type of the parameter that must be given when activating the +action. +Since: 2.38 - - - A #GDBusObjectManagerClient. - - - - The object path of the remote object (unused). - - - - Interface name of the remote object or %NULL to get the object proxy #GType. - - - - User data (unused). - - - - A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #FooiGenObjectProxy. - - + - + -Asynchronously creates #GDBusObjectManagerClient using foo_igen_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details. +The name of the property to wrap on the object. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_object_manager_client_new_finish() to get the result of the operation. +The property must exist on the passed-in object and it must be +readable and writable (and not construct-only). -See foo_igen_object_manager_client_new_sync() for the synchronous, blocking version of this constructor. +Since: 2.38 - - - A #GDBusConnection. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_object_manager_client_new(). +The state of the action, or %NULL if the action is stateless. +Since: 2.38 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_object_manager_client_new(). - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - + - + -Like foo_igen_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection. +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. + +Since: 2.38 + + + -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_object_manager_client_new_for_bus_finish() to get the result of the operation. + + +The protocol being spoke to the destination host, or %NULL if +the #GProxyAddress doesn't know. -See foo_igen_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor. +Since: 2.34 - - - A #GBusType. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + + + + +The URI string that the proxy was constructed from (or %NULL +if the creator didn't specify this). - +Since: 2.34 + + + + + -Finishes an operation started with foo_igen_object_manager_client_new_for_bus(). +The default port to use if #GProxyAddressEnumerator:uri does not +specify one. +Since: 2.38 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_object_manager_client_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed object manager client or %NULL if @error is set. - - + - + -Like foo_igen_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. +The proxy resolver to use. -The calling thread is blocked until a reply is received. +Since: 2.36 -See foo_igen_object_manager_client_new_for_bus() for the asynchronous version of this constructor. + + + + +Emitted when the resolver notices that the system resolver +configuration has changed. - - A #GBusType. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. - - - - A bus name (well-known or unique). + + a #GResolver - - An object path. + + + + + + +An error code used with %G_RESOLVER_ERROR in a #GError returned +from a #GResolver routine. + +Since: 2.22 + + + + + the requested name/address/service was not +found - - A #GCancellable or %NULL. + + the requested information could not +be looked up due to a network error or similar problem - - Return location for error or %NULL + + unknown error - The constructed object manager client or %NULL if @error is set. - - + - + -Synchronously creates #GDBusObjectManagerClient using foo_igen_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details. +The type of record that g_resolver_lookup_records() or +g_resolver_lookup_records_async() should retrieve. The records are returned +as lists of #GVariant tuples. Each record type has different values in +the variant tuples returned. + +%G_RESOLVER_RECORD_SRV records are returned as variants with the signature +'(qqqs)', containing a guint16 with the priority, a guint16 with the +weight, a guint16 with the port, and a string of the hostname. -The calling thread is blocked until a reply is received. +%G_RESOLVER_RECORD_MX records are returned as variants with the signature +'(qs)', representing a guint16 with the preference, and a string containing +the mail exchanger hostname. + +%G_RESOLVER_RECORD_TXT records are returned as variants with the signature +'(as)', representing an array of the strings in the text record. + +%G_RESOLVER_RECORD_SOA records are returned as variants with the signature +'(ssuuuuu)', representing a string containing the primary name server, a +string containing the administrator, the serial as a guint32, the refresh +interval as guint32, the retry interval as a guint32, the expire timeout +as a guint32, and the ttl as a guint32. -See foo_igen_object_manager_client_new() for the asynchronous version of this constructor. +%G_RESOLVER_RECORD_NS records are returned as variants with the signature +'(s)', representing a string of the hostname of the name server. +Since: 2.34 - - A #GDBusConnection. - - - - Flags from the #GDBusObjectManagerClientFlags enumeration. + + lookup DNS SRV records for a domain - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + lookup DNS MX records for a domain - - An object path. + + lookup DNS TXT records for a name - - A #GCancellable or %NULL. + + lookup DNS SOA records for a zone - - Return location for error or %NULL + + lookup DNS NS records for a domain - The constructed object manager client or %NULL if @error is set. - - + - + -Like foo_igen_object_get_authorize() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +An error code used with %G_RESOURCE_ERROR in a #GError returned +from a #GResource routine. +Since: 2.32 - - A #FooiGenObject. + + no file was found at the requested path - - A #FooiGenAuthorize or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - - - - -Like foo_igen_object_get_bar() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - - - - - - A #FooiGenObject. + + unknown error - A #FooiGenBar or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_bar_frobnicator() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +GResourceFlags give information about a particular file inside a resource +bundle. +Since: 2.32 - - A #FooiGenObject. + + No flags set. + + + + The file is compressed. - A #FooiGenBarFrobnicator or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_bat() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +GResourceLookupFlags determine how resource path lookups are handled. +Since: 2.32 - - A #FooiGenObject. + + No flags set. - A #FooiGenBat or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_baz() but doesn't increase the reference count on the returned object. +The "change-event" signal is emitted once per change event that +affects this settings object. You should connect to this signal +only if you are interested in viewing groups of changes before they +are split out into multiple emissions of the "changed" signal. +For most use cases it is more appropriate to use the "changed" signal. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +In the event that the change event applies to one or more specified +keys, @keys will be an array of #GQuark of length @n_keys. In the +event that the change event applies to the #GSettings object as a +whole (ie: potentially every key has been changed) then @keys will +be %NULL and @n_keys will be 0. + +The default handler for this signal invokes the "changed" signal +for each affected key. If any other connected handler returns +%TRUE then this default functionality will be suppressed. - - A #FooiGenObject. + + the object on which the signal was emitted + + + + +an array of #GQuarks for the changed keys, or %NULL + + + + the length of the @keys array, or 0 - A #FooiGenBaz or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + %TRUE to stop other handlers from being invoked for the +event. FALSE to propagate the event further. - + - + -Like foo_igen_object_get_changing_interface_v1() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +The "changed" signal is emitted when a key has potentially changed. +You should call one of the g_settings_get() calls to check the new +value. +This signal supports detailed connections. You can connect to the +detailed signal "changed::x" in order to only receive callbacks +when key "x" changes. - - A #FooiGenObject. + + the object on which the signal was emitted + + + + the name of the key that changed - A #FooiGenChangingInterfaceV1 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + + - + -Like foo_igen_object_get_changing_interface_v10() but doesn't increase the reference count on the returned object. +The "writable-change-event" signal is emitted once per writability +change event that affects this settings object. You should connect +to this signal if you are interested in viewing groups of changes +before they are split out into multiple emissions of the +"writable-changed" signal. For most use cases it is more +appropriate to use the "writable-changed" signal. + +In the event that the writability change applies only to a single +key, @key will be set to the #GQuark for that key. In the event +that the writability change affects the entire settings object, +@key will be 0. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +The default handler for this signal invokes the "writable-changed" +and "changed" signals for each affected key. This is done because +changes in writability might also imply changes in value (if for +example, a new mandatory setting is introduced). If any other +connected handler returns %TRUE then this default functionality +will be suppressed. - - A #FooiGenObject. + + the object on which the signal was emitted + + + + the quark of the key, or 0 - A #FooiGenChangingInterfaceV10 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + %TRUE to stop other handlers from being invoked for the +event. FALSE to propagate the event further. - + - + -Like foo_igen_object_get_changing_interface_v2() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +The "writable-changed" signal is emitted when the writability of a +key has potentially changed. You should call +g_settings_is_writable() in order to determine the new status. +This signal supports detailed connections. You can connect to the +detailed signal "writable-changed::x" in order to only receive +callbacks when the writability of "x" changes. - - A #FooiGenObject. + + the object on which the signal was emitted + + + + the key - A #FooiGenChangingInterfaceV2 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + + - + -Like foo_igen_object_get_com_acme_coyote() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - +The name of the context that the settings are stored in. - - - A #FooiGenObject. - - - - A #FooiGenComAcmeCoyote or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_fdpassing() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +Whether the #GSettings object is in 'delay-apply' mode. See +g_settings_delay() for details. +Since: 2.28 - - - A #FooiGenObject. - - - - A #FooiGenFDPassing or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_inline_docs() but doesn't increase the reference count on the returned object. +If this property is %TRUE, the #GSettings object has outstanding +changes that will be applied when g_settings_apply() is called. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> + + + + +The path within the backend where the settings are stored. - - - A #FooiGenObject. - - - - A #FooiGenInlineDocs or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_method_threads() but doesn't increase the reference count on the returned object. +The name of the schema that describes the types of keys +for this #GSettings object. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +The type of this property is *not* #GSettingsSchema. +#GSettingsSchema has only existed since version 2.32 and +unfortunately this name was used in previous versions to refer to +the schema ID rather than the schema itself. Take care to use the +'settings-schema' property if you wish to pass in a +#GSettingsSchema. +Deprecated:2.32:Use the 'schema-id' property instead. In a future +version, this property may instead refer to a #GSettingsSchema. - - - A #FooiGenObject. - - - - A #FooiGenMethodThreads or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_naming() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - +The name of the schema that describes the types of keys +for this #GSettings object. - - - A #FooiGenObject. - - - - A #FooiGenNaming or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_oldie_interface() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +The #GSettingsSchema describing the types of keys for this +#GSettings object. -Deprecated: The D-Bus interface has been deprecated. +Ideally, this property would be called 'schema'. #GSettingsSchema +has only existed since version 2.32, however, and before then the +'schema' property was used to refer to the ID of the schema rather +than the schema itself. Take care. - - - A #FooiGenObject. - - - - A #FooiGenOldieInterface or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - - + - + -Like foo_igen_object_get_rocket123() but doesn't increase the reference count on the returned object. - -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> - +Flags used when creating a binding. These flags determine in which +direction the binding works. The default is to synchronize in both +directions. - - A #FooiGenObject. + + Equivalent to `G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET` + + + + Update the #GObject property when the setting changes. +It is an error to use this flag if the property is not writable. + + + + Update the setting when the #GObject property changes. +It is an error to use this flag if the property is not readable. + + + + Do not try to bind a "sensitivity" property to the writability of the setting + + + + When set in addition to #G_SETTINGS_BIND_GET, set the #GObject property +value initially from the setting, but do not listen for changes of the setting + + + + When passed to g_settings_bind(), uses a pair of mapping functions that invert +the boolean value when mapping between the setting and the property. The setting and property must both +be booleans. You cannot pass this flag to g_settings_bind_with_mapping(). - A #FooiGenRocket123 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + - + -Like foo_igen_object_get_test_ugly_case_interface() but doesn't increase the reference count on the returned object. +Indicates that the action was just activated. + +@parameter will always be of the expected type. In the event that +an incorrect type was given, no signal will be emitted. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +Since GLib 2.40, if no handler is connected to this signal then the +default behaviour for boolean-stated actions with a %NULL parameter +type is to toggle them via the #GSimpleAction::change-state signal. +For stateful actions where the state type is equal to the parameter +type, the default is to forward them directly to +#GSimpleAction::change-state. This should allow almost all users +of #GSimpleAction to connect only one handler or the other. +Since: 2.28 - - A #FooiGenObject. + + the #GSimpleAction + + + + the parameter to the activation - A #FooiGenTesTuglyCASEInterface or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - + + - + -Like foo_igen_object_get_unknown_xml_tags() but doesn't increase the reference count on the returned object. +Indicates that the action just received a request to change its +state. -<warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> +@value will always be of the correct state type. In the event that +an incorrect type was given, no signal will be emitted. +If no handler is connected to this signal then the default +behaviour is to call g_simple_action_set_state() to set the state +to the requested value. If you connect a signal handler then no +default action is taken. If the state should change then you must +call g_simple_action_set_state() from the handler. - - - - A #FooiGenObject. - - - - A #FooiGenUnknownXmlTags or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. - - +An example of a 'change-state' handler: +|[<!-- language="C" --> +static void +change_volume_state (GSimpleAction *action, +GVariant *value, +gpointer user_data) +{ +gint requested; - - -Creates a new proxy object. +requested = g_variant_get_int32 (value); + +// Volume only goes from 0 to 10 +if (0 <= requested && requested <= 10) +g_simple_action_set_state (action, value); +} +]| + +The handler need not set the state to the requested value. +It could set it to any value at all, or take some other action. +Since: 2.30 - - A #GDBusConnection. + + the #GSimpleAction - - An object path. + + the requested value for the state - The proxy object. - - + + - + -Creates a new skeleton object. - +If @action is currently enabled. - - - - An object path. - - - - The skeleton object. - - +If the action is disabled then calls to g_action_activate() and +g_action_change_state() have no effect. - - -Sets the #FooiGenAuthorize instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Authorize.top_of_page">org.project.Authorize</link> on @object. +Since: 2.28 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenAuthorize or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenBar instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar.top_of_page">org.project.Bar</link> on @object. +The name of the action. This is mostly meaningful for identifying +the action once it has been added to a #GSimpleActionGroup. + +Since: 2.28 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenBar or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenBarFrobnicator instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bar-Frobnicator.top_of_page">org.project.Bar.Frobnicator</link> on @object. +The type of the parameter that must be given when activating the +action. + +Since: 2.28 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenBarFrobnicator or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenBat instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Bat.top_of_page">org.project.Bat</link> on @object. +The state of the action, or %NULL if the action is stateless. + +Since: 2.28 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenBat or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenBaz instance for the D-Bus interface <link linkend="gdbus-interface-org-project-Baz.top_of_page">org.project.Baz</link> on @object. +The #GVariantType of the state that the action has, or %NULL if the +action is stateless. + +Since: 2.28 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenBaz or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenChangingInterfaceV1 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV1.top_of_page">ChangingInterfaceV1</link> on @object. +Since: 2.44 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenChangingInterfaceV1 or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenChangingInterfaceV10 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV10.top_of_page">ChangingInterfaceV10</link> on @object. +Since: 2.44 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenChangingInterfaceV10 or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenChangingInterfaceV2 instance for the D-Bus interface <link linkend="gdbus-interface-ChangingInterfaceV2.top_of_page">ChangingInterfaceV2</link> on @object. +The default proxy URI that will be used for any URI that doesn't +match #GSimpleProxyResolver:ignore-hosts, and doesn't match any +of the schemes set with g_simple_proxy_resolver_set_uri_proxy(). + +Note that as a special case, if this URI starts with +"socks://", #GSimpleProxyResolver will treat it as referring +to all three of the socks5, socks4a, and socks4 proxy types. - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenChangingInterfaceV2 or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenComAcmeCoyote instance for the D-Bus interface <link linkend="gdbus-interface-com-acme-Coyote.top_of_page">com.acme.Coyote</link> on @object. +A list of hostnames and IP addresses that the resolver should +allow direct connections to. + +Entries can be in one of 4 formats: + +- A hostname, such as "example.com", ".example.com", or +"*.example.com", any of which match "example.com" or +any subdomain of it. + +- An IPv4 or IPv6 address, such as "192.168.1.1", +which matches only that address. + +- A hostname or IP address followed by a port, such as +"example.com:80", which matches whatever the hostname or IP +address would match, but only for URLs with the (explicitly) +indicated port. In the case of an IPv6 address, the address +part must appear in brackets: "[::1]:443" + +- An IP address range, given by a base address and prefix length, +such as "fe80::/10", which matches any address in that range. + +Note that when dealing with Unicode hostnames, the matching is +done against the ASCII form of the name. + +Also note that hostname exclusions apply only to connections made +to hosts identified by name, and IP address exclusions apply only +to connections made to hosts identified by address. That is, if +example.com has an address of 192.168.1.1, and the :ignore-hosts list +contains only "192.168.1.1", then a connection to "example.com" +(eg, via a #GNetworkAddress) will use the proxy, and a connection to +"192.168.1.1" (eg, via a #GInetSocketAddress) will not. + +These rules match the "ignore-hosts"/"noproxy" rules most +commonly used by other applications. - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenComAcmeCoyote or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenFDPassing instance for the D-Bus interface <link linkend="gdbus-interface-FDPassing.top_of_page">FDPassing</link> on @object. +Whether the socket should allow sending to broadcast addresses. + +Since: 2.32 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenFDPassing or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenInlineDocs instance for the D-Bus interface <link linkend="gdbus-interface-org-project-InlineDocs.top_of_page">org.project.InlineDocs</link> on @object. +Whether outgoing multicast packets loop back to the local host. + +Since: 2.32 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenInlineDocs or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenMethodThreads instance for the D-Bus interface <link linkend="gdbus-interface-org-project-MethodThreads.top_of_page">org.project.MethodThreads</link> on @object. +Time-to-live out outgoing multicast packets + +Since: 2.32 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenMethodThreads or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenNaming instance for the D-Bus interface <link linkend="gdbus-interface-Naming.top_of_page">Naming</link> on @object. +The timeout in seconds on socket I/O + +Since: 2.26 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenNaming or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenOldieInterface instance for the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link> on @object. +Time-to-live for outgoing unicast packets -Deprecated: The D-Bus interface has been deprecated. +Since: 2.32 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenOldieInterface or %NULL to clear the interface. - - - - - + - + -Sets the #FooiGenRocket123 instance for the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link> on @object. +Emitted when @client's activity on @connectable changes state. +Among other things, this can be used to provide progress +information about a network connection in the UI. The meanings of +the different @event values are as follows: + +- %G_SOCKET_CLIENT_RESOLVING: @client is about to look up @connectable +in DNS. @connection will be %NULL. + +- %G_SOCKET_CLIENT_RESOLVED: @client has successfully resolved +@connectable in DNS. @connection will be %NULL. + +- %G_SOCKET_CLIENT_CONNECTING: @client is about to make a connection +to a remote host; either a proxy server or the destination server +itself. @connection is the #GSocketConnection, which is not yet +connected. Since GLib 2.40, you can access the remote +address via g_socket_connection_get_remote_address(). + +- %G_SOCKET_CLIENT_CONNECTED: @client has successfully connected +to a remote host. @connection is the connected #GSocketConnection. + +- %G_SOCKET_CLIENT_PROXY_NEGOTIATING: @client is about to negotiate +with a proxy to get it to connect to @connectable. @connection is +the #GSocketConnection to the proxy server. + +- %G_SOCKET_CLIENT_PROXY_NEGOTIATED: @client has negotiated a +connection to @connectable through a proxy server. @connection is +the stream returned from g_proxy_connect(), which may or may not +be a #GSocketConnection. + +- %G_SOCKET_CLIENT_TLS_HANDSHAKING: @client is about to begin a TLS +handshake. @connection is a #GTlsClientConnection. + +- %G_SOCKET_CLIENT_TLS_HANDSHAKED: @client has successfully completed +the TLS handshake. @connection is a #GTlsClientConnection. + +- %G_SOCKET_CLIENT_COMPLETE: @client has either successfully connected +to @connectable (in which case @connection is the #GSocketConnection +that it will be returning to the caller) or has failed (in which +case @connection is %NULL and the client is about to return an error). + +Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted +multiple times (or not at all) for a given connectable (in +particular, if @client ends up attempting to connect to more than +one address). However, if @client emits the #GSocketClient::event +signal at all for a given connectable, that it will always emit +it with %G_SOCKET_CLIENT_COMPLETE when it is done. + +Note that there may be additional #GSocketClientEvent values in +the future; unrecognized @event values should be ignored. + +Since: 2.32 - - A #FooiGenObjectSkeleton. + + the #GSocketClient - - A #FooiGenRocket123 or %NULL to clear the interface. + + the event that is occurring - - - - - - -Sets the #FooiGenTesTuglyCASEInterface instance for the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link> on @object. - - - - - A #FooiGenObjectSkeleton. + + the #GSocketConnectable that @event is occurring on - - A #FooiGenTesTuglyCASEInterface or %NULL to clear the interface. + + the current representation of the connection - + - + -Sets the #FooiGenUnknownXmlTags instance for the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link> on @object. +The proxy resolver to use + +Since: 2.36 - - - A #FooiGenObjectSkeleton. - - - - A #FooiGenUnknownXmlTags or %NULL to clear the interface. - - - - - + - + -Asynchronously invokes the <link linkend="gdbus-method-OldieInterface.Foo">Foo()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_oldie_interface_call_foo_finish() to get the result of the operation. +Describes an event occurring on a #GSocketClient. See the +#GSocketClient::event signal for more details. -See foo_igen_oldie_interface_call_foo_sync() for the synchronous, blocking version of this method. +Additional values may be added to this type in the future. -Deprecated: The D-Bus method has been deprecated. +Since: 2.32 - - A #FooiGenOldieInterfaceProxy. - - - - A #GCancellable or %NULL. + + The client is doing a DNS lookup. - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + + The client has completed a DNS lookup. - - User data to pass to @callback. + + The client is connecting to a remote +host (either a proxy or the destination server). - - - - - - -Finishes an operation started with foo_igen_oldie_interface_call_foo(). - -Deprecated: The D-Bus method has been deprecated. - - - - - A #FooiGenOldieInterfaceProxy. + + The client has connected to a remote +host. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_oldie_interface_call_foo(). + + The client is negotiating +with a proxy to connect to the destination server. - - Return location for error or %NULL. + + The client has negotiated +with the proxy server. - - %TRUE if the call succeded, %FALSE if @error is set. - - - - - - -Synchronously invokes the <link linkend="gdbus-method-OldieInterface.Foo">Foo()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. - -See foo_igen_oldie_interface_call_foo() for the asynchronous version of this method. - -Deprecated: The D-Bus method has been deprecated. - - - - - A #FooiGenOldieInterfaceProxy. + + The client is performing a +TLS handshake. - - A #GCancellable or %NULL. + + The client has performed a +TLS handshake. - - Return location for error or %NULL. + + The client is done with a particular +#GSocketConnectable. - %TRUE if the call succeded, %FALSE if @error is set. - - - + - + -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-OldieInterface.Foo">Foo()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. +The protocol family of a #GSocketAddress. (These values are +identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX, +if available.) -Deprecated: The D-Bus method has been deprecated. +Since: 2.22 - - A #FooiGenOldieInterface. + + no address family - - A #GDBusMethodInvocation. + + the IPv4 family - - - - - - -Emits the <link linkend="gdbus-signal-OldieInterface.Bar">"Bar"</link> D-Bus signal. - -Deprecated: The D-Bus signal has been deprecated. - - - - - A #FooiGenOldieInterface. + + the IPv6 family - - - - - - -Gets the value of the <link linkend="gdbus-property-OldieInterface.Bat">"Bat"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -Deprecated: The D-Bus property has been deprecated. - - - - - A #FooiGenOldieInterface. + + the UNIX domain family - The property value. - - - - - - -Gets a machine-readable description of the <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link> D-Bus interface. - -Deprecated: The D-Bus interface has been deprecated. - - - - - A #GDBusInterfaceInfo. Do not free. - - - + - + -Overrides all #GObject properties in the #FooiGenOldieInterface interface for a concrete class. -The properties are overridden in the order they are defined. +Emitted when @listener's activity on @socket changes state. +Note that when @listener is used to listen on both IPv4 and +IPv6, a separate set of signals will be emitted for each, and +the order they happen in is undefined. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.46 - - The class structure for a #GObject<!-- -->-derived class. + + the #GSocketListener + + + + the event that is occurring - - The property id to assign to the first overridden property. + + the #GSocket the event is occurring on - The last property id. - - - + + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_oldie_interface_proxy_new_finish() to get the result of the operation. +Describes an event occurring on a #GSocketListener. See the +#GSocketListener::event signal for more details. -See foo_igen_oldie_interface_proxy_new_sync() for the synchronous, blocking version of this constructor. +Additional values may be added to this type in the future. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.46 - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. + + The listener is about to bind a socket. - - A #GCancellable or %NULL. + + The listener has bound a socket. - - A #GAsyncReadyCallback to call when the request is satisfied. + + The listener is about to start +listening on this socket. - - User data to pass to @callback. + + The listener is now listening on +this socket. - - + - + -Finishes an operation started with foo_igen_oldie_interface_proxy_new(). +Flags used in g_socket_receive_message() and g_socket_send_message(). +The flags listed in the enum are some commonly available flags, but the +values used for them are the same as on the platform, and any other flags +are passed in/out as is. So to use a platform specific flag, just include +the right system header and pass in the flag. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.22 - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_oldie_interface_proxy_new(). + + No flags. - - Return location for error or %NULL + + Request to send/receive out of band data. + + + + Read data from the socket without removing it from +the queue. + + + + Don't use a gateway to send out the packet, +only send to hosts on directly connected networks. - The constructed proxy object or %NULL if @error is set. - - - + - + -Like foo_igen_oldie_interface_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_oldie_interface_proxy_new_for_bus_finish() to get the result of the operation. +A protocol identifier is specified when creating a #GSocket, which is a +family/type specific identifier, where 0 means the default protocol for +the particular family/type. -See foo_igen_oldie_interface_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +This enum contains a set of commonly available and used protocols. You +can also pass any other identifiers handled by the platform in order to +use protocols not listed here. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.22 - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). + + The protocol type is unknown - - An object path. + + The default protocol for the family/type - - A #GCancellable or %NULL. + + TCP over IP - - A #GAsyncReadyCallback to call when the request is satisfied. + + UDP over IP - - User data to pass to @callback. + + SCTP over IP - - + - + -Finishes an operation started with foo_igen_oldie_interface_proxy_new_for_bus(). +The ::incoming signal is emitted when a new incoming connection +to @service needs to be handled. The handler must initiate the +handling of @connection, but may not block; in essence, +asynchronous operations must be used. + +@connection will be unreffed once the signal handler returns, +so you need to ref it yourself if you are planning to use it. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.22 - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_oldie_interface_proxy_new_for_bus(). + + the #GSocketService - - Return location for error or %NULL + + a new #GSocketConnection object + + + + the source_object passed to +g_socket_listener_add_address() - The constructed proxy object or %NULL if @error is set. + %TRUE to stop other handlers from being called - + - + -Like foo_igen_oldie_interface_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_oldie_interface_proxy_new_for_bus() for the asynchronous version of this constructor. +Flags used when creating a #GSocket. Some protocols may not implement +all the socket types. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.22 - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). + + Type unknown or wrong - - An object path. + + Reliable connection-based byte streams (e.g. TCP). - - A #GCancellable or %NULL. + + Connectionless, unreliable datagram passing. +(e.g. UDP) - - Return location for error or %NULL + + Reliable connection-based passing of datagrams +of fixed maximum length (e.g. SCTP). - The constructed proxy object or %NULL if @error is set. - - - + - + -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link>. See g_dbus_proxy_new_sync() for more details. +Flags to define the behaviour of a #GSubprocess. -The calling thread is blocked until a reply is received. +Note that the default for stdin is to redirect from /dev/null. For +stdout and stderr the default are for them to inherit the +corresponding descriptor from the calling process. -See foo_igen_oldie_interface_proxy_new() for the asynchronous version of this constructor. +Note that it is a programmer error to mix 'incompatible' flags. For +example, you may not request both %G_SUBPROCESS_FLAGS_STDOUT_PIPE and +%G_SUBPROCESS_FLAGS_STDOUT_SILENCE. -Deprecated: The D-Bus interface has been deprecated. +Since: 2.40 - - A #GDBusConnection. + + No flags. - - Flags from the #GDBusProxyFlags enumeration. + + create a pipe for the stdin of the +spawned process that can be accessed with +g_subprocess_get_stdin_pipe(). - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + stdin is inherited from the +calling process. - - An object path. + + create a pipe for the stdout of the +spawned process that can be accessed with +g_subprocess_get_stdout_pipe(). - - A #GCancellable or %NULL. + + silence the stdout of the spawned +process (ie: redirect to /dev/null). - - Return location for error or %NULL + + create a pipe for the stderr of the +spawned process that can be accessed with +g_subprocess_get_stderr_pipe(). + + + + silence the stderr of the spawned +process (ie: redirect to /dev/null). + + + + merge the stderr of the spawned +process with whatever the stdout happens to be. This is a good way +of directing both streams to a common log file, for example. + + + + spawned processes will inherit the +file descriptors of their parent, unless those descriptors have +been explicitly marked as close-on-exec. This flag has no effect +over the "standard" file descriptors (stdin, stdout, stderr). - The constructed proxy object or %NULL if @error is set. + - - + + +Whether the task has completed, meaning its callback (if set) has been +invoked. This can only happen after g_task_return_pointer(), +g_task_return_error() or one of the other return functions have been called +on the task. + +This property is guaranteed to change from %FALSE to %TRUE exactly once. + +The #GObject::notify signal for this change is emitted in the same main +context as the task’s callback, immediately after that callback is invoked. + +Since: 2.44 + + + - + -Sets the <link linkend="gdbus-property-OldieInterface.Bat">"Bat"</link> D-Bus property to @value. +#GTestDBusFlags specifying the behaviour of the D-Bus session. -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. +Since: 2.34 + + + + + + +Flags to define future #GTestDBus behaviour. -Deprecated: The D-Bus property has been deprecated. +Since: 2.34 - - A #FooiGenOldieInterface. - - - - The value to set. + + No flags. - - + - + -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-OldieInterface.top_of_page">OldieInterface</link>. +The icon name. + + + -Deprecated: The D-Bus interface has been deprecated. + + +A %NULL-terminated array of icon names. - - - The skeleton object. + - - + + +Whether to use the default fallbacks found by shortening the icon name +at '-' characters. If the "names" array has more than one element, +ignores any past the first. + +For example, if the icon name was "gnome-dev-cdrom-audio", the array +would become +|[<!-- language="C" --> +{ +"gnome-dev-cdrom-audio", +"gnome-dev-cdrom", +"gnome-dev", +"gnome", +NULL +}; +]| + + + - + -Asynchronously invokes the <link linkend="gdbus-method-com-acme-Rocket.Ignite">Ignite()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_rocket123_call_ignite_xyz_finish() to get the result of the operation. +The ::run signal is emitted in a worker thread in response to an +incoming connection. This thread is dedicated to handling +@connection and may perform blocking IO. The signal handler need +not return until the connection is closed. -See foo_igen_rocket123_call_ignite_xyz_sync() for the synchronous, blocking version of this method. - - A #FooiGenRocket123Proxy. - - - - A #GCancellable or %NULL. + + the #GThreadedSocketService. - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + + a new #GSocketConnection object. - - User data to pass to @callback. + + the source_object passed to g_socket_listener_add_address(). - - + %TRUE to stop further signal handlers from being called + + - + -Finishes an operation started with foo_igen_rocket123_call_ignite_xyz(). +The client authentication mode for a #GTlsServerConnection. +Since: 2.28 - - A #FooiGenRocket123Proxy. + + client authentication not required - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_rocket123_call_ignite_xyz(). + + client authentication is requested - - Return location for error or %NULL. + + client authentication is required - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Synchronously invokes the <link linkend="gdbus-method-com-acme-Rocket.Ignite">Ignite()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. +The DER (binary) encoded representation of the certificate. +This property and the #GTlsCertificate:certificate-pem property +represent the same data, just in different forms. -See foo_igen_rocket123_call_ignite_xyz() for the asynchronous version of this method. +Since: 2.28 + + + + + + +The PEM (ASCII) encoded representation of the certificate. +This property and the #GTlsCertificate:certificate +property represent the same data, just in different forms. +Since: 2.28 - - - A #FooiGenRocket123Proxy. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-com-acme-Rocket.Ignite">Ignite()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. +A #GTlsCertificate representing the entity that issued this +certificate. If %NULL, this means that the certificate is either +self-signed, or else the certificate of the issuer is not +available. -This method will free @invocation, you cannot use it afterwards. +Since: 2.28 - - - A #FooiGenRocket123. - - - - A #GDBusMethodInvocation. - - - - - + - + -Gets a copy of the <link linkend="gdbus-property-com-acme-Rocket.Direction">"Direction"</link> D-Bus property. +The DER (binary) encoded representation of the certificate's +private key, in either PKCS#1 format or unencrypted PKCS#8 +format. This property (or the #GTlsCertificate:private-key-pem +property) can be set when constructing a key (eg, from a file), +but cannot be read. -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. +PKCS#8 format is supported since 2.32; earlier releases only +support PKCS#1. You can use the `openssl rsa` +tool to convert PKCS#8 keys to PKCS#1. +Since: 2.28 - - - A #FooiGenRocket123. - - - - The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - - + - + -Gets a copy of the <link linkend="gdbus-property-com-acme-Rocket.Type">"Type"</link> D-Bus property. +The PEM (ASCII) encoded representation of the certificate's +private key in either PKCS#1 format ("`BEGIN RSA PRIVATE +KEY`") or unencrypted PKCS#8 format ("`BEGIN +PRIVATE KEY`"). This property (or the +#GTlsCertificate:private-key property) can be set when +constructing a key (eg, from a file), but cannot be read. + +PKCS#8 format is supported since 2.32; earlier releases only +support PKCS#1. You can use the `openssl rsa` +tool to convert PKCS#8 keys to PKCS#1. + +Since: 2.28 + + + -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + + +A set of flags describing TLS certification validation. This can be +used to set which validation steps to perform (eg, with +g_tls_client_connection_set_validation_flags()), or to describe why +a particular certificate was rejected (eg, in +#GTlsConnection::accept-certificate). +Since: 2.28 - - A #FooiGenRocket123. + + The signing certificate authority is +not known. + + + + The certificate does not match the +expected identity of the site that it was retrieved from. + + + + The certificate's activation time +is still in the future + + + + The certificate has expired + + + + The certificate has been revoked +according to the #GTlsConnection's certificate revocation list. + + + + The certificate's algorithm is +considered insecure. + + + + Some other error occurred validating +the certificate + + + + the combination of all of the above +flags - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - + - + -Emits the <link linkend="gdbus-signal-com-acme-Rocket.Exploded">"Exploded"</link> D-Bus signal. +Flags for g_tls_interaction_request_certificate(), +g_tls_interaction_request_certificate_async(), and +g_tls_interaction_invoke_request_certificate(). + +Since: 2.40 - - A #FooiGenRocket123. + + No flags - - + + + + +A list of the distinguished names of the Certificate Authorities +that the server will accept client certificates signed by. If the +server requests a client certificate during the handshake, then +this property will be set after the handshake completes. + +Each item in the list is a #GByteArray which contains the complete +subject DN of the certificate authority. + +Since: 2.28 + + + - + -Gets the value of the <link linkend="gdbus-property-com-acme-Rocket.Direction">"Direction"</link> D-Bus property. +A #GSocketConnectable describing the identity of the server that +is expected on the other end of the connection. -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. +If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in +#GTlsClientConnection:validation-flags, this object will be used +to determine the expected identify of the remote end of the +connection; if #GTlsClientConnection:server-identity is not set, +or does not match the identity presented by the server, then the +%G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail. -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_rocket123_dup_direction() if on another thread.</warning> +In addition to its use in verifying the server certificate, +this is also used to give a hint to the server about what +certificate we expect, which is useful for servers that serve +virtual hosts. +Since: 2.28 - - - A #FooiGenRocket123. - - - - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - + - + -Gets the value of the <link linkend="gdbus-property-com-acme-Rocket.Speed">"Speed"</link> D-Bus property. +If %TRUE, tells the connection to use a fallback version of TLS +or SSL, rather than trying to negotiate the best version of TLS +to use. This can be used when talking to servers that don't +implement version negotiation correctly and therefore refuse to +handshake at all with a "modern" TLS handshake. -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. +Despite the property name, the fallback version is not +necessarily SSL 3.0; if SSL 3.0 has been disabled, the +#GTlsClientConnection will use the next highest available version +(normally TLS 1.0) as the fallback version. +Since: 2.28 - - - A #FooiGenRocket123. - - - - The property value. - - + + + + +What steps to perform when validating a certificate received from +a server. Server certificates that fail to validate in all of the +ways indicated here will be rejected unless the application +overrides the default via #GTlsConnection::accept-certificate. + +Since: 2.28 + + + - + -Gets the value of the <link linkend="gdbus-property-com-acme-Rocket.Type">"Type"</link> D-Bus property. +Emitted during the TLS handshake after the peer certificate has +been received. You can examine @peer_cert's certification path by +calling g_tls_certificate_get_issuer() on it. + +For a client-side connection, @peer_cert is the server's +certificate, and the signal will only be emitted if the +certificate was not acceptable according to @conn's +#GTlsClientConnection:validation_flags. If you would like the +certificate to be accepted despite @errors, return %TRUE from the +signal handler. Otherwise, if no handler accepts the certificate, +the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE. + +For a server-side connection, @peer_cert is the certificate +presented by the client, if this was requested via the server's +#GTlsServerConnection:authentication_mode. On the server side, +the signal is always emitted when the client presents a +certificate, and the certificate will only be accepted if a +handler returns %TRUE. -Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. +Note that if this signal is emitted as part of asynchronous I/O +in the main thread, then you should not attempt to interact with +the user before returning from the signal handler. If you want to +let the user decide whether or not to accept the certificate, you +would have to return %FALSE from the signal handler on the first +attempt, and then after the connection attempt returns a +%G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if +the user decides to accept the certificate, remember that fact, +create a new connection, and return %TRUE from the signal handler +the next time. -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_rocket123_dup_type_() if on another thread.</warning> +If you are doing I/O in another thread, you do not +need to worry about this, and can simply block in the signal +handler until the UI thread returns an answer. +Since: 2.28 - - A #FooiGenRocket123. + + a #GTlsConnection + + + + the peer's #GTlsCertificate + + + + the problems with @peer_cert. - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + %TRUE to accept @peer_cert (which will also +immediately end the signal emission). %FALSE to allow the signal +emission to continue, which will cause the handshake to fail if +no one else overrides it. + - + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link> D-Bus interface. +The #GIOStream that the connection wraps +Since: 2.28 - - - A #GDBusInterfaceInfo. Do not free. - - + - + -Overrides all #GObject properties in the #FooiGenRocket123 interface for a concrete class. -The properties are overridden in the order they are defined. +The connection's certificate; see +g_tls_connection_set_certificate(). +Since: 2.28 - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_rocket123_proxy_new_finish() to get the result of the operation. +The certificate database to use when verifying this TLS connection. +If no cerificate database is set, then the default database will be +used. See g_tls_backend_get_default_database(). -See foo_igen_rocket123_proxy_new_sync() for the synchronous, blocking version of this constructor. +Since: 2.30 - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_rocket123_proxy_new(). +A #GTlsInteraction object to be used when the connection or certificate +database need to interact with the user. This will be used to prompt the +user for passwords where necessary. +Since: 2.30 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_rocket123_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Like foo_igen_rocket123_proxy_new() but takes a #GBusType instead of a #GDBusConnection. +The connection's peer's certificate, after the TLS handshake has +completed and the certificate has been accepted. Note in +particular that this is not yet set during the emission of +#GTlsConnection::accept-certificate. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_rocket123_proxy_new_for_bus_finish() to get the result of the operation. +(You can watch for a #GObject::notify signal on this property to +detect when a handshake has occurred.) -See foo_igen_rocket123_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +Since: 2.28 - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_rocket123_proxy_new_for_bus(). +The errors noticed-and-ignored while verifying +#GTlsConnection:peer-certificate. Normally this should be 0, but +it may not be if #GTlsClientConnection:validation-flags is not +%G_TLS_CERTIFICATE_VALIDATE_ALL, or if +#GTlsConnection::accept-certificate overrode the default +behavior. +Since: 2.28 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_rocket123_proxy_new_for_bus(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Like foo_igen_rocket123_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_rocket123_proxy_new_for_bus() for the asynchronous version of this constructor. +The rehandshaking mode. See +g_tls_connection_set_rehandshake_mode(). +Since: 2.28 - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_rocket123_proxy_new() for the asynchronous version of this constructor. +Whether or not proper TLS close notification is required. +See g_tls_connection_set_require_close_notify(). +Since: 2.28 - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Sets the <link linkend="gdbus-property-com-acme-Rocket.Direction">"Direction"</link> D-Bus property to @value. +Whether or not the system certificate database will be used to +verify peer certificates. See +g_tls_connection_set_use_system_certdb(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Deprecated: 2.30: Use GTlsConnection:database instead - - - A #FooiGenRocket123. - - - - The value to set. - - - - - + - + -Sets the <link linkend="gdbus-property-com-acme-Rocket.Speed">"Speed"</link> D-Bus property to @value. +Flags for g_tls_database_lookup_certificate_handle(), +g_tls_database_lookup_certificate_issuer(), +and g_tls_database_lookup_certificates_issued_by(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.30 - - A #FooiGenRocket123. + + No lookup flags - - The value to set. + + Restrict lookup to certificates that have +a private key. - - + - + -Sets the <link linkend="gdbus-property-com-acme-Rocket.Type">"Type"</link> D-Bus property to @value. +Flags for g_tls_database_verify_chain(). -Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. +Since: 2.30 - - A #FooiGenRocket123. - - - - The value to set. + + No verification flags - - - - - -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-com-acme-Rocket.top_of_page">com.acme.Rocket</link>. - - - - - - The skeleton object. - - + - + -Asynchronously invokes the <link linkend="gdbus-method-TestUglyCaseInterface.GetiSCSIServers">GetiSCSIServers()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_test_ugly_case_interface_call_get_iscsi_servers_finish() to get the result of the operation. +An error code used with %G_TLS_ERROR in a #GError returned from a +TLS-related routine. -See foo_igen_test_ugly_case_interface_call_get_iscsi_servers_sync() for the synchronous, blocking version of this method. +Since: 2.28 - - A #FooiGenTesTuglyCASEInterfaceProxy. + + No TLS provider is available - - A #GCancellable or %NULL. + + Miscellaneous TLS error - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + + A certificate could not be parsed - - User data to pass to @callback. + + The TLS handshake failed because the +peer does not seem to be a TLS server. - - - - - - -Finishes an operation started with foo_igen_test_ugly_case_interface_call_get_iscsi_servers(). - - - - - - A #FooiGenTesTuglyCASEInterfaceProxy. + + The TLS handshake failed because the +peer's certificate was not acceptable. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_test_ugly_case_interface_call_get_iscsi_servers(). + + The TLS handshake failed because +the server requested a client-side certificate, but none was +provided. See g_tls_connection_set_certificate(). - - Return location for error or %NULL. + + The TLS connection was closed without proper +notice, which may indicate an attack. See +g_tls_connection_set_require_close_notify(). - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Synchronously invokes the <link linkend="gdbus-method-TestUglyCaseInterface.GetiSCSIServers">GetiSCSIServers()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. +The path to a file containing PEM encoded certificate authority +root anchors. The certificates in this file will be treated as +root authorities for the purpose of verifying other certificates +via the g_tls_database_verify_chain() operation. + +Since: 2.30 + + + -See foo_igen_test_ugly_case_interface_call_get_iscsi_servers() for the asynchronous version of this method. + + +#GTlsInteractionResult is returned by various functions in #GTlsInteraction +when finishing an interaction request. +Since: 2.30 - - A #FooiGenTesTuglyCASEInterfaceProxy. + + The interaction was unhandled (i.e. not +implemented). - - A #GCancellable or %NULL. + + The interaction completed, and resulting data +is available. - - Return location for error or %NULL. + + The interaction has failed, or was cancelled. +and the operation should be aborted. - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-TestUglyCaseInterface.GetiSCSIServers">GetiSCSIServers()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. +Various flags for the password. -This method will free @invocation, you cannot use it afterwards. +Since: 2.30 - - A #FooiGenTesTuglyCASEInterface. + + No flags - - A #GDBusMethodInvocation. + + The password was wrong, and the user should retry. - - - - - - -Emits the <link linkend="gdbus-signal-TestUglyCaseInterface.serversUPDATEDNOW">"serversUPDATEDNOW"</link> D-Bus signal. - - - - - A #FooiGenTesTuglyCASEInterface. + + Hint to the user that the password has been +wrong many times, and the user may not have many chances left. + + + + Hint to the user that this is the last try to get +this password right. - - + - + -Gets the value of the <link linkend="gdbus-property-TestUglyCaseInterface.UGLYNAME">"UGLYNAME"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. +When to allow rehandshaking. See +g_tls_connection_set_rehandshake_mode(). +Since: 2.28 - - A #FooiGenTesTuglyCASEInterface. + + Never allow rehandshaking + + + + Allow safe rehandshaking only + + + + Allow unsafe rehandshaking - The property value. - - + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link> D-Bus interface. +The #GTlsAuthenticationMode for the server. This can be changed +before calling g_tls_connection_handshake() if you want to +rehandshake with a different mode from the initial handshake. +Since: 2.28 - - - A #GDBusInterfaceInfo. Do not free. - - + - + -Overrides all #GObject properties in the #FooiGenTesTuglyCASEInterface interface for a concrete class. -The properties are overridden in the order they are defined. +The credentials stored in the message. +Since: 2.26 - - - The class structure for a #GObject<!-- -->-derived class. - - - - The property id to assign to the first overridden property. - - - - The last property id. - - + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_test_ugly_case_interface_proxy_new_finish() to get the result of the operation. +Whether to close the file descriptor when the stream is closed. -See foo_igen_test_ugly_case_interface_proxy_new_sync() for the synchronous, blocking version of this constructor. +Since: 2.20 - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_test_ugly_case_interface_proxy_new(). +The file descriptor that the stream reads from. +Since: 2.20 - - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_test_ugly_case_interface_proxy_new(). - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Like foo_igen_test_ugly_case_interface_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_test_ugly_case_interface_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_test_ugly_case_interface_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +Emitted when the unix mount points have changed. - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. - - - - User data to pass to @callback. + + the object on which the signal is emitted - + - + -Finishes an operation started with foo_igen_test_ugly_case_interface_proxy_new_for_bus(). - +Emitted when the unix mounts have changed. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_test_ugly_case_interface_proxy_new_for_bus(). - - - - Return location for error or %NULL + + the object on which the signal is emitted - The constructed proxy object or %NULL if @error is set. - - + + - + -Like foo_igen_test_ugly_case_interface_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - -The calling thread is blocked until a reply is received. - -See foo_igen_test_ugly_case_interface_proxy_new_for_bus() for the asynchronous version of this constructor. - +Types of UNIX mounts. - - A #GBusType. + + Unknown UNIX mount type. - - Flags from the #GDBusProxyFlags enumeration. + + Floppy disk UNIX mount type. - - A bus name (well-known or unique). + + CDROM UNIX mount type. - - An object path. + + Network File System (NFS) UNIX mount type. - - A #GCancellable or %NULL. + + ZIP UNIX mount type. - - Return location for error or %NULL + + JAZZ UNIX mount type. - - The constructed proxy object or %NULL if @error is set. - - - - - -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link>. See g_dbus_proxy_new_sync() for more details. - -The calling thread is blocked until a reply is received. - -See foo_igen_test_ugly_case_interface_proxy_new() for the asynchronous version of this constructor. - - - - - - A #GDBusConnection. + + Memory Stick UNIX mount type. - - Flags from the #GDBusProxyFlags enumeration. + + Compact Flash UNIX mount type. - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + + Smart Media UNIX mount type. - - An object path. + + SD/MMC UNIX mount type. - - A #GCancellable or %NULL. + + iPod UNIX mount type. - - Return location for error or %NULL + + Digital camera UNIX mount type. + + + + Hard drive UNIX mount type. - The constructed proxy object or %NULL if @error is set. - - + - + -Sets the <link linkend="gdbus-property-TestUglyCaseInterface.UGLYNAME">"UGLYNAME"</link> D-Bus property to @value. +Whether to close the file descriptor when the stream is closed. -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. +Since: 2.20 - - - A #FooiGenTesTuglyCASEInterface. - - - - The value to set. - - - - - + - + -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-TestUglyCaseInterface.top_of_page">TestUglyCaseInterface</link>. +The file descriptor that the stream writes to. +Since: 2.20 - - - The skeleton object. - - + - + -Asynchronously invokes the <link linkend="gdbus-method-UnknownXmlTags.CanSetTimezone">CanSetTimezone()</link> D-Bus method on @proxy. -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_unknown_xml_tags_call_can_set_timezone_finish() to get the result of the operation. +Whether or not this is an abstract address -See foo_igen_unknown_xml_tags_call_can_set_timezone_sync() for the synchronous, blocking version of this method. +Deprecated: Use #GUnixSocketAddress:address-type, which +distinguishes between zero-padded and non-zero-padded +abstract addresses. - - - A #FooiGenUnknownXmlTagsProxy. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - - - - User data to pass to @callback. - - - - - + - + -Finishes an operation started with foo_igen_unknown_xml_tags_call_can_set_timezone(). +The type of name used by a #GUnixSocketAddress. +%G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain +socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS +indicates a socket not bound to any name (eg, a client-side socket, +or a socket created with socketpair()). + +For abstract sockets, there are two incompatible ways of naming +them; the man pages suggest using the entire `struct sockaddr_un` +as the name, padding the unused parts of the %sun_path field with +zeroes; this corresponds to %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. +However, many programs instead just use a portion of %sun_path, and +pass an appropriate smaller length to bind() or connect(). This is +%G_UNIX_SOCKET_ADDRESS_ABSTRACT. +Since: 2.26 - - A #FooiGenUnknownXmlTagsProxy. + + invalid - - Return location for return parameter or %NULL to ignore. + + anonymous - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_unknown_xml_tags_call_can_set_timezone(). + + a filesystem path - - Return location for error or %NULL. + + an abstract name + + + + an abstract name, 0-padded +to the full length of a unix socket name - %TRUE if the call succeded, %FALSE if @error is set. - - + - + -Synchronously invokes the <link linkend="gdbus-method-UnknownXmlTags.CanSetTimezone">CanSetTimezone()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. +Emitted when the volume has been changed. -See foo_igen_unknown_xml_tags_call_can_set_timezone() for the asynchronous version of this method. + + + + + + + +This signal is emitted when the #GVolume have been removed. If +the recipient is holding references to the object they should +release them so the object can be finalized. - - A #FooiGenUnknownXmlTagsProxy. - - - - Return location for return parameter or %NULL to ignore. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL. - - - %TRUE if the call succeded, %FALSE if @error is set. - - + + - + -Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-UnknownXmlTags.CanSetTimezone">CanSetTimezone()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - -This method will free @invocation, you cannot use it afterwards. +Emitted when a drive changes. - - A #FooiGenUnknownXmlTags. - - - - A #GDBusMethodInvocation. + + The volume monitor emitting the signal. - - Parameter to return. + + the drive that changed - + - + -Gets a copy of the <link linkend="gdbus-property-UnknownXmlTags.SomeProperty">"SomeProperty"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - +Emitted when a drive is connected to the system. - - A #FooiGenUnknownXmlTags. + + The volume monitor emitting the signal. + + + + a #GDrive that was connected. - The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - - + + - + -Emits the <link linkend="gdbus-signal-UnknownXmlTags.SomeSignal">"SomeSignal"</link> D-Bus signal. +Emitted when a drive is disconnected from the system. - - A #FooiGenUnknownXmlTags. + + The volume monitor emitting the signal. + + + + a #GDrive that was disconnected. - + - + -Gets the value of the <link linkend="gdbus-property-UnknownXmlTags.SomeProperty">"SomeProperty"</link> D-Bus property. - -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. - -<warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use foo_igen_unknown_xml_tags_dup_some_property() if on another thread.</warning> +Emitted when the eject button is pressed on @drive. +Since: 2.18 - - A #FooiGenUnknownXmlTags. + + The volume monitor emitting the signal. + + + + the drive where the eject button was pressed - The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - - + + - + -Gets a machine-readable description of the <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link> D-Bus interface. +Emitted when the stop button is pressed on @drive. +Since: 2.22 + + The volume monitor emitting the signal. + + + + the drive where the stop button was pressed + + - A #GDBusInterfaceInfo. Do not free. - - + + - + -Overrides all #GObject properties in the #FooiGenUnknownXmlTags interface for a concrete class. -The properties are overridden in the order they are defined. - +Emitted when a mount is added. - - The class structure for a #GObject<!-- -->-derived class. + + The volume monitor emitting the signal. - - The property id to assign to the first overridden property. + + a #GMount that was added. - The last property id. - - + + - + -Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link>. See g_dbus_proxy_new() for more details. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_unknown_xml_tags_proxy_new_finish() to get the result of the operation. - -See foo_igen_unknown_xml_tags_proxy_new_sync() for the synchronous, blocking version of this constructor. +Emitted when a mount changes. - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - A #GAsyncReadyCallback to call when the request is satisfied. + + The volume monitor emitting the signal. - - User data to pass to @callback. + + a #GMount that changed. - + - + -Finishes an operation started with foo_igen_unknown_xml_tags_proxy_new(). - +Emitted when a mount is about to be removed. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_unknown_xml_tags_proxy_new(). + + The volume monitor emitting the signal. - - Return location for error or %NULL + + a #GMount that is being unmounted. - The constructed proxy object or %NULL if @error is set. - - + + - + -Like foo_igen_unknown_xml_tags_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - -When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. -You can then call foo_igen_unknown_xml_tags_proxy_new_for_bus_finish() to get the result of the operation. - -See foo_igen_unknown_xml_tags_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. +Emitted when a mount is removed. - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. + + The volume monitor emitting the signal. - - A bus name (well-known or unique). + + a #GMount that was removed. - - An object path. + + + + + + +Emitted when a mountable volume is added to the system. + + + + + The volume monitor emitting the signal. - - A #GCancellable or %NULL. + + a #GVolume that was added. - - A #GAsyncReadyCallback to call when the request is satisfied. + + + + + + +Emitted when mountable volume is changed. + + + + + The volume monitor emitting the signal. - - User data to pass to @callback. + + a #GVolume that changed. - + - + -Finishes an operation started with foo_igen_unknown_xml_tags_proxy_new_for_bus(). - +Emitted when a mountable volume is removed from the system. - - The #GAsyncResult obtained from the #GAsyncReadyCallback passed to foo_igen_unknown_xml_tags_proxy_new_for_bus(). + + The volume monitor emitting the signal. - - Return location for error or %NULL + + a #GVolume that was removed. - The constructed proxy object or %NULL if @error is set. - - + + - + -Like foo_igen_unknown_xml_tags_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. +Whether to close the file handle when the stream is closed. + +Since: 2.26 -The calling thread is blocked until a reply is received. + + -See foo_igen_unknown_xml_tags_proxy_new_for_bus() for the asynchronous version of this constructor. + + +The handle that the stream reads from. +Since: 2.26 - - - A #GBusType. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique). - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + - + -Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link>. See g_dbus_proxy_new_sync() for more details. +Whether to close the file handle when the stream is closed. -The calling thread is blocked until a reply is received. +Since: 2.26 + + + -See foo_igen_unknown_xml_tags_proxy_new() for the asynchronous version of this constructor. + + +The file handle that the stream writes to. +Since: 2.26 - - - A #GDBusConnection. - - - - Flags from the #GDBusProxyFlags enumeration. - - - - A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - - - - An object path. - - - - A #GCancellable or %NULL. - - - - Return location for error or %NULL - - - - The constructed proxy object or %NULL if @error is set. - - + + + + +If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is +%G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name +and modification time from the file info to the GZIP header. + +Since: 2.26 - + + + + -Sets the <link linkend="gdbus-property-UnknownXmlTags.SomeProperty">"SomeProperty"</link> D-Bus property to @value. +Used to select the type of data format to use for #GZlibDecompressor +and #GZlibCompressor. -Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. +Since: 2.24 - - A #FooiGenUnknownXmlTags. + + deflate compression with zlib header - - The value to set. + + gzip file format + + + + deflate compression with no header - - + - + -Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-UnknownXmlTags.top_of_page">UnknownXmlTags</link>. +A #GFileInfo containing the information found in the GZIP header +of the data stream processed, or %NULL if the header was not yet +fully processed, is not present at all, or the compressor's +#GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP. +Since: 2.26 - - - The skeleton object. - - + @@ -69564,18 +53974,6 @@ Since: 2.26 - - -Returns a new #GVfs handle for a WinHttp vfs. - - - - - - a new #GVfs handle. - - - Returns the #GZlibCompressor:file-info property. @@ -69683,25 +54081,6 @@ Since: 2.24 - - -Sleep for a short time, then get a session bus connection and call -a method on it. - -Runs in a non-main thread. - - - - - - delay in microseconds - - - - the connection - - - Returns the list of logical and viewable drives as defined by @@ -69718,657 +54097,4 @@ GetLogicalDrives() is returned. - - -Looks up a value named @key in @file. - -This call is equivalent to gvdb_table_get_value() except that it -never byteswaps the value. - - - - - - a #GvdbTable - - - - a string - - - - a #GVariant, or %NULL - - - - - -Looks up the hash table named @key in @file. - -The toplevel hash table in a #GvdbTable can contain reference to -child hash tables (and those can contain further references...). - -If @key is not found in @file then %NULL is returned. Otherwise, a -new #GvdbTable is returned, referring to the child hashtable as -contained in the file. This newly-created #GvdbTable does not depend -on the continued existence of @file. - -You should call gvdb_table_unref() on the return result when you no -longer require it. - - - - - - a #GvdbTable - - - - a string - - - - a new #GvdbTable, or %NULL - - - - - -Looks up a value named @key in @file. - -If the value is not found then %NULL is returned. Otherwise, a new -#GVariant instance is returned. The #GVariant does not depend on the -continued existence of @file. - -You should call g_variant_unref() on the return result when you no -longer require it. - - - - - - a #GvdbTable - - - - a string - - - - a #GVariant, or %NULL - - - - - -Checks for a value named @key in @file. - -Note: this function does not consider non-value nodes (other hash -tables, for example). - - - - - - a #GvdbTable - - - - a string - - - - %TRUE if @key is in the table - - - - - -Checks if the table is still valid. - -An on-disk GVDB can be marked as invalid. This happens when the file -has been replaced. The appropriate action is typically to reopen the -file. - - - - - - a #GvdbTable - - - - %TRUE if @table is still valid - - - - - -List all of the keys that appear below @key. The nesting of keys -within the hash file is defined by the program that created the hash -file. One thing is constant: each item in the returned array can be -concatenated to @key to obtain the full name of that key. - -It is not possible to tell from this function if a given key is -itself a path, a value, or another hash table; you are expected to -know this for yourself. - -You should call g_strfreev() on the return result when you no longer -require it. - - - - - - a #GvdbTable - - - - a string - - - - a %NULL-terminated string array - - - - - -Creates a new #GvdbTable from the contents of the file found at -@filename. - -The only time this function fails is if the file cannot be opened. -In that case, the #GError that is returned will be an error from -g_mapped_file_new(). - -An empty or otherwise corrupted file is considered to be a valid -#GvdbTable with no entries. - -You should call gvdb_table_unref() on the return result when you no -longer require it. - - - - - - the path to the hash file - - - - if the contents of @filename are trusted - - - - %NULL, or a pointer to a %NULL #GError - - - - a new #GvdbTable - - - - - -Creates a new #GvdbTable from the data in @data. - -An empty or otherwise corrupted data is considered to be a valid -#GvdbTable with no entries. - -You should call gvdb_table_unref() on the return result when you no -longer require it. - - - - - - the data - - - - the length of @data in bytes - - - - if the contents of @data are trusted - - - - User supplied data that owns @data - - - - Ref function for @user_data - - - - Unref function for @user_data - - - - a new #GvdbTable - - - - - -Increases the reference count on @file. - - - - - - a #GvdbTable - - - - a new reference on @file - - - - - -Decreases the reference count on @file, possibly freeing it. - -Since: 2.26 - - - - - a #GvdbTable - - - - - - - - -Looks up the list at @key and iterate over the items in it. - -First, @open_func is called to signal that we are starting to iterate over -the list. Then the list is iterated. When all items in the list have been -iterated over, the @close_func is called. - -When iterating, if a given item in the list is a value then @value_func is -called. - -If a given item in the list is itself a list then @open_func is called. If -that function returns %TRUE then the walk begins iterating the items in the -sublist, until there are no more items, at which point a matching -@close_func call is made. If @open_func returns %FALSE then no iteration of -the sublist occurs and no corresponding @close_func call is made. - - - - - a #GvdbTable - - - - a key corresponding to a list - - - - the #GvdbWalkOpenFunc - - - - the #GvdbWalkValueFunc - - - - the #GvdbWalkCloseFunc - - - - data to pass to the callbacks - - - - - - - - -A callback function for the directory diff calculation routine, -produces G_FILE_MONITOR_EVENT_CREATED event for a created file. - - - - - a pointer to user data (#handle_context). - - - - file name of a new file. - - - - inode number of a new file. - - - - - - - - -A callback function for the directory diff calculation routine, -produces G_FILE_MONITOR_EVENT_DELETED event for a deleted file. - - - - - a pointer to user data (#handle_context). - - - - file name of the removed file. - - - - inode number of the removed file. - - - - - - - - -A callback function for the directory diff calculation routine, -produces G_FILE_MONITOR_EVENT_RENAMED event on a move. - - - - - a pointer to user data (#handle_context). - - - - file name of the source file. - - - - inode number of the source file. - - - - file name of the replaced file. - - - - inode number of the replaced file. - - - - - - - - -A callback function for the directory diff calculation routine, -produces G_FILE_MONITOR_EVENT_DELETED/CREATED event pair when -an overwrite occurs in the directory (see dep-list for details). - - - - - a pointer to user data (#handle_context). - - - - file name of the overwritten file. - - - - inode number of the overwritten file. - - - - - - - - -Extends the allocated memory, if needed. - - - - - a #kevents - - - - the number of new objects to be added - - - - - - - - -Resets the kevents object and frees all the associated memory. - - - - - a #kevents - - - - - - - - -Initializes a #kevents object. - - - - - a #kevents - - - - the initial preallocated memory size. If it is less than -%KEVENTS_EXTEND_COUNT, this value will be used instead. - - - - - - - - -Reduces the allocated heap size, if needed. - -If the allocated heap size is >= 3*used -and 2*used >= %KEVENTS_EXTEND_COUNT, reduce it to 2*used. - - - - - a #kevents - - - - - - - - -The core missing files watching routine. - -Traverses through a list of missing files, tries to start watching each with -kqueue, removes the appropriate entry and invokes a user callback if the file -has appeared. - - - - - - unused - - - - %FALSE if no missing files left, %TRUE otherwise. - - - - - -Represents an event occured on a file descriptor. Used for marshalling from -kqueue thread to its subscribers. - - - - - file descriptor, on which an activity has occured. - - - - kqueue event flags, see man kevent(2). - - - - - - - - -Represents a subscription on a file or directory. - - - - - a name of the file to monitor - - - - the pointer to user data - - - - unused (currently not implemented) - - - - the associated file descriptor (used by kqueue) - - - - - - - - -Processes notifications, coming from the kqueue thread. - -Reads notifications from the command file descriptor, emits the -"changed" event on the appropriate monitor. - -A typical GIO Channel callback function. - - - - - - unused. - - - - unused. - - - - unused. - - - - %TRUE - - - - - -Return two #GIOStream<!---->s connected to each other with pipes. -The "left" input stream is connected by a unidirectional pipe -to the "right" output stream, and vice versa. This can be used -as a bidirectional pipe to a child process, for instance. - -See test_pipe() if you only need a one-way pipe. - - - - - - used to return one #GIOStream - - - - used to return the other #GIOStream - - - - used to raise an error - - - - %TRUE on success - - - - - -Return a simple #GIOStream binding together @input_stream and -@output_stream. They have no additional semantics as a result of being -part of this I/O stream: in particular, closing one does not close -the other (although closing the #GIOStream will close both sub-streams). - - - - - - an input stream - - - - an output stream - - - - a new #GIOStream - - - - - -Return a "pipe to self" connecting @is to @os. This can be used -as a unidirectional pipe to or from a child process, for instance. - -See test_bidi_pipe() if you want to emulate a bidirectional pipe -via a pair of unidirectional pipes. - - - - - - used to return a #GInputStream - - - - used to return a #GOutputStream - - - - used to raise an error - - - - %TRUE on success - - - diff --git a/tools/gen_scripts/gio_generate_docs.sh b/tools/gen_scripts/gio_generate_docs.sh index 2b0364a5..81fc2e8a 100755 --- a/tools/gen_scripts/gio_generate_docs.sh +++ b/tools/gen_scripts/gio_generate_docs.sh @@ -13,7 +13,7 @@ PREFIX="$JHBUILD_SOURCES" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/gio/src" -PARAMS="--with-properties" +PARAMS="--with-properties --no-recursion" for dir in "$PREFIX"/glib/gio; do PARAMS="$PARAMS -s $dir" done diff --git a/tools/gen_scripts/glib_generate_docs.sh b/tools/gen_scripts/glib_generate_docs.sh index 654814fb..92a942ff 100755 --- a/tools/gen_scripts/glib_generate_docs.sh +++ b/tools/gen_scripts/glib_generate_docs.sh @@ -13,8 +13,8 @@ PREFIX="$JHBUILD_SOURCES" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" -PARAMS="--with-properties" -for dir in "$PREFIX"/glib/{glib,gmodule,gobject,gthread}; do +PARAMS="--with-properties --no-recursion" +for dir in "$PREFIX"/glib/{glib,glib/deprecated,gmodule,gobject,gthread}; do PARAMS="$PARAMS -s $dir" done -- cgit v1.2.1 From 7f6feb8bbbe2b233248b6916253473a62ee6eed4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 4 Jun 2015 16:03:45 +0200 Subject: docextract_to_xml.py: Minor fix in internal data * tools/defs_gen/docextract.py: * tools/defs_gen/docextract_to_xml.py: Keep 'SECTION:' in section names when data is stored in a dictionary (map, hash table). As before, don't write it to the 'section' elements in the generated xml file. --- tools/defs_gen/docextract.py | 2 +- tools/defs_gen/docextract_to_xml.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/defs_gen/docextract.py b/tools/defs_gen/docextract.py index 7ee2ef5b..1b18f56c 100644 --- a/tools/defs_gen/docextract.py +++ b/tools/defs_gen/docextract.py @@ -70,7 +70,7 @@ function_name_pattern = re.compile(r'^([a-z]\w*)\s*:?(\s*\(.*\)\s*){0,2}\s*$') signal_name_pattern = re.compile(r'^([A-Z]\w+::[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') property_name_pattern = re.compile(r'^([A-Z]\w+:[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') enum_name_pattern = re.compile(r'^([A-Z]\w+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') -section_name_pattern = re.compile(r'^SECTION:([a-z0-9_-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') +section_name_pattern = re.compile(r'^(SECTION:[a-z0-9_-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') return_pattern = re.compile(r'^@?(returns:|return\s+value:)(.*\n?)$', re.IGNORECASE) deprecated_pattern = re.compile(r'^(deprecated\s*:\s*.*\n?)$', re.IGNORECASE) rename_to_pattern = re.compile(r'^(rename\s+to)\s*:\s*(.*\n?)$', re.IGNORECASE) diff --git a/tools/defs_gen/docextract_to_xml.py b/tools/defs_gen/docextract_to_xml.py index 3bf75c64..a3221350 100755 --- a/tools/defs_gen/docextract_to_xml.py +++ b/tools/defs_gen/docextract_to_xml.py @@ -116,8 +116,17 @@ if __name__ == '__main__': elif block_type == 'property' and not with_properties: continue # Likewise for sections. - elif block_type == 'section' and not with_sections: - continue + elif block_type == 'section': + if not with_sections: + continue + # Delete 'SECTION:' from the name. + # (It could easily be deleted by docextract.extract(), but then + # there would be a theoretical risk that a section name would + # be identical to a function name, when all kinds of elements + # are stored in the docs dictionary with their names as key.) + last_colon_pos = name.rfind(':') + if last_colon_pos >= 0: + name = name[last_colon_pos+1:] # Likewise for enums. elif block_type == 'enum' and not with_enums: continue -- cgit v1.2.1 From e021103113aa73cc4016424ac028387f5834522e Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 8 Jun 2015 12:18:06 +0200 Subject: 2.45.2 --- NEWS | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6fc5c036..8748bbc3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,57 @@ +2.45.2 (unstable): + +Glib: +* Add Glib::format_size(). + (Kjell Ahlstedt) Bug #747311 (Zsolt Bölöny) +* Add get_user_special_dir(UserDirectory), deprecating + get_user_special_dir(GUserDirectory directory). + (Kjell Ahlstedt) Bug #747311 +* Threads::Thread: Use GThread only via a pointer. + Kjell Ahlstedt (Bug #746533) +* VariantBase: Add is_castable_to(). +* VariantContainerBase: get_iter(): Accept casts of complicated types + containing object paths and DBus type signatures to Variant<> types + containing Glib::ustring and std::string. + (Kjell Ahlstedt) Bug #747508. +* Variant: Wrap handles and add get_data_as_bytes() + (Kjell Ahlstedt) +* Added SignalProxyDetailed. + +Gio: +* Settings: Add signal_changed(key). + (Kjell Ahlstedt, Murray Cumming) Bug #749034. +* Added SimpleIOStream. + (Kjell Ahlstedt) + +Documentation: +* API Reference: Remove generated " "You rarely need to use properties". + Some new glib and gtk+ classes (GSimpleIOStream, GtkModelButton, + GtkPopoverMenu) have no public set/get methods for their properties. + (Kjell Ahlstedt) +* API Reference: Fix the version numbers in some @newin Doxygen commands. + (Kjell Ahlstedt) + +gmmproc: +* Add _IGNORE_PROPERTY() and _IGNORE_CHILD_PROPERTY() macros. + (Kjell Ahlstedt) +* Add support for 'newin "n,m"' in some _WRAP macros. + (Kjell Ahlstedt) Bug #748856 (Andrew Potter) +* _WRAP_SIGNAL: Add support for detail_name. + (Kjell Ahlstedt) Bug #749034 +* Fetch property documentation from the docs.xml file, if available there. + (Kjell Ahlstedt) +* docextract_to_xml.py: Distinguish sections from properties. + (Kjell Ahlstedt) +* docextract_to_xml.py: Add support for the --no-recursion option. + (Kjell Ahlstedt) + +Build: +* Glib::ObjectBase: Don't use std::auto_ptr (deprecated in C++11). + (Kjell Ahlstedt) Bug #748630 (Hubert Figuiere) +* Add missing GLIBMM_API for Interface + (Mikhail Titov) Bug #748719. + + 2.44: API additions since 2.42: diff --git a/configure.ac b/configure.ac index 1eda740b..e854d810 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.44.0], +AC_INIT([glibmm], [2.45.2], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From c64c404259b74898bc14fd2c06fccef9fe2cfcbf Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 17 Jun 2015 18:28:35 +0200 Subject: Glib::Thread: Don't disable more deprecation warnings than necessary * glib/src/thread.hg: Don't define GLIB_DISABLE_DEPRECATION_WARNINGS in the .h file, only in the .cc file. If it's defined in the .h file, it disables warnings in every file that includes glibmm/thread.h or glibmm.h. Don't include in the .cc file. It became unnecessary when thread.hg was added to glibmm_files_deprecated_hg in glib/src/filelist.am. Bug #750379. --- glib/src/thread.hg | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/glib/src/thread.hg b/glib/src/thread.hg index fb6f19b7..dd116c35 100644 --- a/glib/src/thread.hg +++ b/glib/src/thread.hg @@ -21,23 +21,16 @@ _CONFIGINCLUDE(glibmmconfig.h) _IS_DEPRECATED // This whole file is deprecated. #m4 _PUSH(SECTION_CC_PRE_INCLUDES) -// Must be included in the .cc file before the generated #ifndef GLIBMM_DISABLE_DEPRECATED, -// or else "configure --disable-deprecated-api" + "make" will fail. -#include +//Stop the compiler warnings about using the deprecated API; +#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 #m4 _POP() // We use GThreadFunctions in the (deprecated) API, so we must temporarily undef G_DISABLE_DEPRECATED. // Temporarily undef G_DISABLE_DEPRECATED, redefining it later if appropriate. #if defined(G_DISABLE_DEPRECATED) && !defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED) - //Stop the deprecation ifdef guards around the API declarations: #undef G_DISABLE_DEPRECATED - -//Stop the compiler warnings about using the deprecated API; -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 - #define GLIBMM_G_DISABLE_DEPRECATED_UNDEFED 1 - #endif #include @@ -45,7 +38,6 @@ _IS_DEPRECATED // This whole file is deprecated. // Redefine G_DISABLE_DEPRECATED if it was defined before we temporarily undefed it: #if defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED) #define G_DISABLE_DEPRECATED 1 -#undef GLIB_DISABLE_DEPRECATION_WARNINGS #undef GLIBMM_G_DISABLE_DEPRECATED_UNDEFED #endif -- cgit v1.2.1 From c570362cfc1f46e85b66093567a3f925741cb1c2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 17 Jun 2015 18:29:37 +0200 Subject: gmmproc: _WRAP_METHOD: Use G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS * tools/m4/method.m4: Put G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS around deprecated code. In most cases it's then not necessary to undef [G|GDK|GTK]_DISABLE_DEPRECATED and define [GLIB|GDK]_DISABLE_DEPRECATION_WARNINGS. Bug #750379. --- tools/m4/method.m4 | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/tools/m4/method.m4 b/tools/m4/method.m4 index 3c48b3e1..7becc7c5 100644 --- a/tools/m4/method.m4 +++ b/tools/m4/method.m4 @@ -1,22 +1,24 @@ -dnl $Id$ - dnl dnl dnl Code generation sections for making a method. dnl dnl - dnl dnl method -dnl $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 -dnl _METHOD(cppname,cname,cpprettype,crettype,arglist,cdeclarations,cargs,cinitializations,const,refreturn,errthrow,deprecated,constversion,ifdef,arglist_without_types,out_param,out_param_cpptype,slot_type,slot_name,no_slot_copy,wrap_line) +dnl $1 $2 $3 $4 $5 $6 $7 $8 +dnl _METHOD(cppname,cname,cpprettype,crettype,arglist,cdeclarations,cargs,cinitializations, +dnl $9 $10 $11 $12 $13 $14 $15 +dnl const,refreturn,errthrow,deprecated,constversion,arglist_without_types,ifdef, +dnl $16 $17 $18 $19 $20 $21 +dnl out_param,out_param_cpptype,slot_type,slot_name,no_slot_copy,wrap_line) define(`_METHOD',`dnl _PUSH(SECTION_CC) -ifelse(`$12',,,`_DEPRECATE_IFDEF_START -')dnl ifelse(`$15',,,`#ifdef $15' )dnl +ifelse(`$12',,,`_DEPRECATE_IFDEF_START`'dnl The expansion of _DEPRECATE_IFDEF_START ends with a newline +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +')dnl $3 __CPPNAME__::$1`'($5)ifelse(`$9',1,` const') { ifelse(`$13',,dnl @@ -99,24 +101,27 @@ ifelse(`$3',void,,` return retvalue; ',` return const_cast<__CPPNAME__*>(this)->$1($14); ')dnl } - -ifelse(`$15',,,` -#endif // $15 -')dnl -ifelse(`$12',,,`_DEPRECATE_IFDEF_END -')dnl +ifelse(`$12',,,`G_GNUC_END_IGNORE_DEPRECATIONS +_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline +ifelse(`$15',,,`#endif // $15 +') _POP()') dnl dnl static method -dnl $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 -dnl _STATIC_METHOD(cppname,cname,cpprettype,crettype,arglist,cdeclarations,cargs,cinitializations,refreturn,errthrow,deprecated,ifdef,out_param,out_param_type,slot_type,slot_name,no_slot_copy,wrap_line) +dnl $1 $2 $3 $4 $5 $6 $7 +dnl _STATIC_METHOD(cppname,cname,cpprettype,crettype,arglist,cdeclarations,cargs, +dnl $8 $9 $10 $11 $12 $13 +dnl cinitializations,refreturn,errthrow,deprecated,ifdef,out_param, +dnl $14 $15 $16 $17 $18 +dnl out_param_type,slot_type,slot_name,no_slot_copy,wrap_line) define(`_STATIC_METHOD',`dnl _PUSH(SECTION_CC) -ifelse(`$11',,,`_DEPRECATE_IFDEF_START -')dnl ifelse(`$12',,,`#ifdef $12' )dnl +ifelse(`$11',,,`_DEPRECATE_IFDEF_START`'dnl The expansion of _DEPRECATE_IFDEF_START ends with a newline +G_GNUC_BEGIN_IGNORE_DEPRECATIONS +')dnl $3 __CPPNAME__::$1($5) { ifelse(`$9'`$10',,dnl @@ -185,10 +190,8 @@ ifelse(`$3',void,,` return retvalue; ')dnl ')dnl } - -ifelse(`$12',,,` -#endif // $12 -')dnl -ifelse(`$11',,,`_DEPRECATE_IFDEF_END +ifelse(`$11',,,`G_GNUC_END_IGNORE_DEPRECATIONS +_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline +ifelse(`$12',,,`#endif // $12 ') _POP()') -- cgit v1.2.1 From 833025c1eb451150d16c34e79ac2aca6301d84b3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 17 Jun 2015 18:30:53 +0200 Subject: Don't disable more deprecation warnings than necessary * gio/src/application.hg: * gio/src/desktopappinfo.hg: * gio/src/file.hg: * gio/src/notification.hg: * gio/src/settings.[ccg|hg]: * gio/src/simpleactiongroup.hg: * gio/src/tlsconnection.hg: * gio/src/volumemonitor.hg: * glib/src/date.hg: Don't #undef G_DISABLE_DEPRECATED or #define GLIB_DISABLE_DEPRECATION_WARNINGS. This is unnecessary when deprecated code is surrounded by G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS. Bug #750379. --- gio/src/application.hg | 5 ----- gio/src/desktopappinfo.hg | 7 ------- gio/src/file.hg | 5 ----- gio/src/notification.hg | 5 ----- gio/src/settings.ccg | 2 ++ gio/src/settings.hg | 5 ----- gio/src/simpleactiongroup.hg | 5 ----- gio/src/tlsconnection.hg | 5 ----- gio/src/volumemonitor.hg | 7 ------- glib/src/date.hg | 6 ------ 10 files changed, 2 insertions(+), 50 deletions(-) diff --git a/gio/src/application.hg b/gio/src/application.hg index 24b0167c..98c5e570 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -17,11 +17,6 @@ _CONFIGINCLUDE(giommconfig.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - #include #include #include diff --git a/gio/src/desktopappinfo.hg b/gio/src/desktopappinfo.hg index 916830ef..9c084014 100644 --- a/gio/src/desktopappinfo.hg +++ b/gio/src/desktopappinfo.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -25,11 +23,6 @@ _CONFIGINCLUDE(giommconfig.h) _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - namespace Glib { diff --git a/gio/src/file.hg b/gio/src/file.hg index 3618b060..27b991c7 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -15,11 +15,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - #include #include #include diff --git a/gio/src/notification.hg b/gio/src/notification.hg index cd5ec921..806cd2e8 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -21,11 +21,6 @@ _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - namespace Gio { class Icon; diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index d800aa90..03e48075 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -64,10 +64,12 @@ void Settings::bind_writable(const Glib::ustring& key, } _DEPRECATE_IFDEF_START +G_GNUC_BEGIN_IGNORE_DEPRECATIONS std::vector Settings::list_schemas() { return Glib::ArrayHandler::array_to_vector(g_settings_list_schemas(), Glib::OWNERSHIP_NONE); } +G_GNUC_END_IGNORE_DEPRECATIONS _DEPRECATE_IFDEF_END } diff --git a/gio/src/settings.hg b/gio/src/settings.hg index e87c0b3a..eb660dd2 100644 --- a/gio/src/settings.hg +++ b/gio/src/settings.hg @@ -25,11 +25,6 @@ _CONFIGINCLUDE(giommconfig.h) _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - namespace Gio { diff --git a/gio/src/simpleactiongroup.hg b/gio/src/simpleactiongroup.hg index 138e4fe0..0c3fc8c6 100644 --- a/gio/src/simpleactiongroup.hg +++ b/gio/src/simpleactiongroup.hg @@ -23,11 +23,6 @@ _CONFIGINCLUDE(giommconfig.h) _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - namespace Gio { diff --git a/gio/src/tlsconnection.hg b/gio/src/tlsconnection.hg index bc753d3a..7a4a044e 100644 --- a/gio/src/tlsconnection.hg +++ b/gio/src/tlsconnection.hg @@ -24,11 +24,6 @@ _CONFIGINCLUDE(giommconfig.h) _DEFS(giomm,gio) _PINCLUDE(giomm/private/iostream_p.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - namespace Gio { diff --git a/gio/src/volumemonitor.hg b/gio/src/volumemonitor.hg index 5a5fcf92..df326460 100644 --- a/gio/src/volumemonitor.hg +++ b/gio/src/volumemonitor.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -19,11 +17,6 @@ _CONFIGINCLUDE(giommconfig.h) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - #include #include #include diff --git a/glib/src/date.hg b/glib/src/date.hg index 472dc609..5a307e61 100644 --- a/glib/src/date.hg +++ b/glib/src/date.hg @@ -17,12 +17,6 @@ _DEFS(glibmm,glib) -#m4 _PUSH(SECTION_CC_PRE_INCLUDES) -/* So we can use deprecated functions in our deprecated methods */ -#undef G_DISABLE_DEPRECATED -#define GLIB_DISABLE_DEPRECATION_WARNINGS 1 -#m4 _POP() - #include #include #include -- cgit v1.2.1 From 49967e80f73032522c31707c4fcd25e092d7a14b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 21 Jun 2015 13:05:52 +0200 Subject: Regenerate glib method .defs. --- glib/src/glib_functions.defs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index feae55c7..b93b6ce5 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -7612,6 +7612,18 @@ ) ) +(define-function g_log_set_handler_full + (c-name "g_log_set_handler_full") + (return-type "guint") + (parameters + '("const-gchar*" "log_domain") + '("GLogLevelFlags" "log_levels") + '("GLogFunc" "log_func") + '("gpointer" "user_data") + '("GDestroyNotify" "destroy") + ) +) + (define-function g_log_remove_handler (c-name "g_log_remove_handler") (return-type "none") -- cgit v1.2.1 From 493eb8bfc6549c0c2aeba9dc331918e20dee500a Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 21 Jun 2015 13:06:20 +0200 Subject: Regenerate glib docs.xml. --- glib/src/glib_docs.xml | 585 +++++++++++++++++++++---------------------------- 1 file changed, 255 insertions(+), 330 deletions(-) diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index 14472083..99b82185 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -9424,40 +9424,35 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with handlers that -take a flags type as an argument and return a boolean. If you have -such a signal, you will probably also need to use an accumulator, -such as g_signal_accumulator_true_handled(). +A marshaller for a #GCClosure with a callback of type +`gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter +denotes a flags type. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + a #GValue which can store the returned #gboolean - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding instance and arg1 - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -9586,78 +9581,44 @@ g_closure_set_meta_marshal() -An old alias for g_cclosure_marshal_BOOLEAN__FLAGS(). +Another name for g_cclosure_marshal_BOOLEAN__FLAGS(). - - A #GClosure. - - - - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. - - - - The length of the @param_values array. - - - - An array of #GValues holding the arguments -on which to invoke the callback of closure. - - - - The invocation hint given as the last argument to -g_closure_invoke(). - - - - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() - - -A #GClosureMarshal function for use with signals with handlers that -take a #GObject and a pointer and produce a string. It is highly -unlikely that your signal handler fits this description. +A marshaller for a #GCClosure with a callback of type +`gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + a #GValue, which can store the returned string - The length of the @param_values array. + 3 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding instance, arg1 and arg2 - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -9709,38 +9670,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -boolean argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gboolean parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -9792,38 +9749,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -argument which is any boxed pointer type. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #GBoxed* parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -9875,38 +9828,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -character argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gchar parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -9958,38 +9907,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with one -double-precision floating point argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gdouble parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10041,38 +9986,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -argument with an enumerated type. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type.. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the enumeration parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10124,38 +10065,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -argument with a flags types. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the flags parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10207,38 +10144,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with one -single-precision floating point argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gfloat parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10290,38 +10223,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -integer argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gint arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gint parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10373,38 +10302,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with with a single -long integer argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, glong arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #glong parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10456,38 +10381,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -#GObject argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #GObject* parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10539,38 +10460,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -argument of type #GParamSpec. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #GParamSpec* parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10622,42 +10539,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single raw -pointer argument type. - -If it is possible, it is better to use one of the more specific -functions such as g_cclosure_marshal_VOID__OBJECT() or -g_cclosure_marshal_VOID__OBJECT(). +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gpointer parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10709,38 +10618,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single string -argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gchar* parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10792,38 +10697,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -unsigned character argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #guchar parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10875,38 +10776,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with with a single -unsigned integer argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, guint arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #guint parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -10915,38 +10812,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a unsigned int -and a pointer as arguments. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 3 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding instance, arg1 and arg2 - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -11041,38 +10934,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -unsigned long integer argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #gulong parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -11124,38 +11013,36 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with a single -#GVariant argument. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`. + +Since: 2.26 - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 2 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding the instance and the #GVariant* parameter - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -11207,37 +11094,34 @@ g_closure_set_meta_marshal() -A #GClosureMarshal function for use with signals with no arguments. +A marshaller for a #GCClosure with a callback of type +`void (*callback) (gpointer instance, gpointer user_data)`. - A #GClosure. + the #GClosure to which the marshaller belongs - A #GValue to store the return value. May be %NULL -if the callback of closure doesn't return a value. + ignored - The length of the @param_values array. + 1 - An array of #GValues holding the arguments -on which to invoke the callback of closure. + a #GValue array holding only the instance - The invocation hint given as the last argument to -g_closure_invoke(). + the invocation hint given as the last argument +to g_closure_invoke() - Additional data specified when registering the -marshaller, see g_closure_set_marshal() and -g_closure_set_meta_marshal() + additional data specified when registering the marshaller @@ -14234,8 +14118,8 @@ etc. The date must be valid. Returns the week of the year, where weeks are understood to start on -Monday. If the date is before the first Monday of the year, return -0. The date must be valid. +Monday. If the date is before the first Monday of the year, return 0. +The date must be valid. @@ -14289,9 +14173,9 @@ Returns the month of the year. The date must be valid. -Returns the week of the year during which this date falls, if weeks -are understood to being on Sunday. The date must be valid. Can return -0 if the day is before the first Sunday of the year. +Returns the week of the year during which this date falls, if +weeks are understood to being on Sunday. The date must be valid. +Can return 0 if the day is before the first Sunday of the year. @@ -16853,8 +16737,7 @@ for an empty environment list - the environment variable to get, in the GLib file name -encoding + the environment variable to get @@ -16992,7 +16875,7 @@ be returned. If @domain contains a `FAILED` (or otherwise generic) error code, you should generally not check for it explicitly, but should instead treat any not-explicitly-recognized error code as being -equilalent to the `FAILED` code. This way, if the domain is +equivalent to the `FAILED` code. This way, if the domain is extended in the future to provide a more specific error code for a certain case, your code will still work. @@ -18524,9 +18407,9 @@ GLib and should not be modified or freed. Returns the value of an environment variable. -The name and value are in the GLib file name encoding. On UNIX, -this means the actual bytes which might or might not be in some -consistent character set and encoding. On Windows, it is in UTF-8. +On UNIX, the name and value are byte strings which might or might not +be in some consistent character set and encoding. On Windows, they are +in UTF-8. On Windows, in case the environment variable's value contains references to other environment variables, they are expanded. @@ -18534,8 +18417,7 @@ references to other environment variables, they are expanded. - the environment variable to get, in the GLib file name -encoding + the environment variable to get @@ -21745,10 +21627,12 @@ should be freed with g_free() when no longer needed. Retrieves a comment above @key from @group_name. -If @key is %NULL then @comment will be read from above -@group_name. If both @key and @group_name are %NULL, then +If @key is %NULL then @comment will be read from above +@group_name. If both @key and @group_name are %NULL, then @comment will be read from above the first group in the file. +Note that the returned string includes the '#' comment markers. + Since: 2.6 @@ -22716,10 +22600,14 @@ Since: 2.6 Places a comment above @key from @group_name. -If @key is %NULL then @comment will be written above @group_name. -If both @key and @group_name are %NULL, then @comment will be + +If @key is %NULL then @comment will be written above @group_name. +If both @key and @group_name are %NULL, then @comment will be written above the first group in the file. +Note that this function prepends a '#' comment marker to +each line of @comment. + Since: 2.6 @@ -24338,6 +24226,44 @@ the log levels with the #G_LOG_FLAG_FATAL and + + +Like g_log_sets_handler(), but takes a destroy notify for the @user_data. + +Since: 2.46 + + + + + the log domain, or %NULL for the default "" +application domain + + + + the log levels to apply the log handler for. +To handle fatal and recursive messages as well, combine +the log levels with the #G_LOG_FLAG_FATAL and +#G_LOG_FLAG_RECURSION bit flags. + + + + the log handler function + + + + data passed to the log handler + + + + destroy notify for @user_data, or %NULL + + + + the id of the new handler + + + + Logs an error or debugging message. @@ -38529,10 +38455,9 @@ example. -Sets an environment variable. Both the variable's name and value -should be in the GLib file name encoding. On UNIX, this means that -they can be arbitrary byte strings. On Windows, they should be in -UTF-8. +Sets an environment variable. On UNIX, both the variable's name and +value can be arbitrary byte strings, except that the variable's name +cannot contain '='. On Windows, they should be in UTF-8. Note that on some systems, when variables are overwritten, the memory used for the previous variables and its value isn't reclaimed. -- cgit v1.2.1 From ba95467c72a8a0afe43f40996895a843a5c28fda Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 21 Jun 2015 13:08:38 +0200 Subject: Regenerate gio .defs. --- gio/src/gio_enums.defs | 100 ++++++++++- gio/src/gio_methods.defs | 456 +++++++++++++++++++++++++++++++++++++++++++---- gio/src/gio_signals.defs | 28 ++- 3 files changed, 535 insertions(+), 49 deletions(-) diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs index 0e68617e..b7733934 100644 --- a/gio/src/gio_enums.defs +++ b/gio/src/gio_enums.defs @@ -322,7 +322,8 @@ ;; G_FILE_MONITOR_NONE = 0, ;; G_FILE_MONITOR_WATCH_MOUNTS = (1 << 0), ;; G_FILE_MONITOR_SEND_MOVED = (1 << 1), -;; G_FILE_MONITOR_WATCH_HARD_LINKS = (1 << 2) +;; G_FILE_MONITOR_WATCH_HARD_LINKS = (1 << 2), +;; G_FILE_MONITOR_WATCH_MOVES = (1 << 3) ;; } GFileMonitorFlags; (define-flags-extended FileMonitorFlags @@ -333,6 +334,7 @@ '("watch-mounts" "G_FILE_MONITOR_WATCH_MOUNTS" "(1 << 0)") '("send-moved" "G_FILE_MONITOR_SEND_MOVED" "(1 << 1)") '("watch-hard-links" "G_FILE_MONITOR_WATCH_HARD_LINKS" "(1 << 2)") + '("watch-moves" "G_FILE_MONITOR_WATCH_MOVES" "(1 << 3)") ) ) @@ -387,7 +389,10 @@ ;; G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED, ;; G_FILE_MONITOR_EVENT_PRE_UNMOUNT, ;; G_FILE_MONITOR_EVENT_UNMOUNTED, -;; G_FILE_MONITOR_EVENT_MOVED +;; G_FILE_MONITOR_EVENT_MOVED, +;; G_FILE_MONITOR_EVENT_RENAMED, +;; G_FILE_MONITOR_EVENT_MOVED_IN, +;; G_FILE_MONITOR_EVENT_MOVED_OUT ;; } GFileMonitorEvent; (define-enum-extended FileMonitorEvent @@ -402,6 +407,9 @@ '("pre-unmount" "G_FILE_MONITOR_EVENT_PRE_UNMOUNT" "5") '("unmounted" "G_FILE_MONITOR_EVENT_UNMOUNTED" "6") '("moved" "G_FILE_MONITOR_EVENT_MOVED" "7") + '("renamed" "G_FILE_MONITOR_EVENT_RENAMED" "8") + '("moved-in" "G_FILE_MONITOR_EVENT_MOVED_IN" "9") + '("moved-out" "G_FILE_MONITOR_EVENT_MOVED_OUT" "10") ) ) @@ -1042,7 +1050,8 @@ ;; Original typedef: ;; typedef enum { ;; G_DBUS_CALL_FLAGS_NONE = 0, -;; G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0) +;; G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0), +;; G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<1) ;; } GDBusCallFlags; (define-flags-extended DBusCallFlags @@ -1051,6 +1060,7 @@ (values '("none" "G_DBUS_CALL_FLAGS_NONE" "0x0") '("no-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START" "(1<<0)") + '("allow-interactive-authorization" "G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION" "(1<<1)") ) ) @@ -1079,7 +1089,8 @@ ;; typedef enum { ;; G_DBUS_MESSAGE_FLAGS_NONE = 0, ;; G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED = (1<<0), -;; G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1) +;; G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1), +;; G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<2) ;; } GDBusMessageFlags; (define-flags-extended DBusMessageFlags @@ -1089,6 +1100,7 @@ '("none" "G_DBUS_MESSAGE_FLAGS_NONE" "0x0") '("no-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED" "(1<<0)") '("no-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START" "(1<<1)") + '("allow-interactive-authorization" "G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION" "(1<<2)") ) ) @@ -1520,6 +1532,25 @@ ) ) +;; Original typedef: +;; typedef enum { +;; G_SOCKET_LISTENER_BINDING, +;; G_SOCKET_LISTENER_BOUND, +;; G_SOCKET_LISTENER_LISTENING, +;; G_SOCKET_LISTENER_LISTENED +;; } GSocketListenerEvent; + +(define-enum-extended SocketListenerEvent + (in-module "G") + (c-name "GSocketListenerEvent") + (values + '("binding" "G_SOCKET_LISTENER_BINDING" "0") + '("bound" "G_SOCKET_LISTENER_BOUND" "1") + '("listening" "G_SOCKET_LISTENER_LISTENING" "2") + '("listened" "G_SOCKET_LISTENER_LISTENED" "3") + ) +) + ;; Original typedef: ;; typedef enum /*< flags >*/ { ;; G_TEST_DBUS_NONE = 0 @@ -1618,3 +1649,64 @@ ) ) +;; From gwin32registrykey.h + +;; Original typedef: +;; typedef enum { +;; G_WIN32_REGISTRY_VALUE_NONE = 0, +;; G_WIN32_REGISTRY_VALUE_BINARY = 1, +;; G_WIN32_REGISTRY_VALUE_UINT32LE = 2, +;; G_WIN32_REGISTRY_VALUE_UINT32BE = 3, +;; #if G_BYTE_ORDER == G_BIG_ENDIAN +;; G_WIN32_REGISTRY_VALUE_UINT32 = G_WIN32_REGISTRY_VALUE_UINT32BE, +;; #else +;; G_WIN32_REGISTRY_VALUE_UINT32 = G_WIN32_REGISTRY_VALUE_UINT32LE, +;; #endif +;; G_WIN32_REGISTRY_VALUE_EXPAND_STR = 4, +;; G_WIN32_REGISTRY_VALUE_LINK = 5, +;; G_WIN32_REGISTRY_VALUE_MULTI_STR = 6, +;; G_WIN32_REGISTRY_VALUE_UINT64LE = 7, +;; #if G_BYTE_ORDER == G_LITTLE_ENDIAN +;; G_WIN32_REGISTRY_VALUE_UINT64 = G_WIN32_REGISTRY_VALUE_UINT64LE, +;; #endif +;; G_WIN32_REGISTRY_VALUE_STR = 8 +;; } GWin32RegistryValueType; + +(define-enum-extended Win32RegistryValueType + (in-module "G") + (c-name "GWin32RegistryValueType") + (values + '("none" "G_WIN32_REGISTRY_VALUE_NONE" "0") + '("binary" "G_WIN32_REGISTRY_VALUE_BINARY" "1") + '("uint32le" "G_WIN32_REGISTRY_VALUE_UINT32LE" "2") + '("uint32be" "G_WIN32_REGISTRY_VALUE_UINT32BE" "3") + '("uint32" "G_WIN32_REGISTRY_VALUE_UINT32" "3") + '("uint32" "G_WIN32_REGISTRY_VALUE_UINT32" "2") + '("expand-str" "G_WIN32_REGISTRY_VALUE_EXPAND_STR" "4") + '("link" "G_WIN32_REGISTRY_VALUE_LINK" "5") + '("multi-str" "G_WIN32_REGISTRY_VALUE_MULTI_STR" "6") + '("uint64le" "G_WIN32_REGISTRY_VALUE_UINT64LE" "7") + '("uint64" "G_WIN32_REGISTRY_VALUE_UINT64" "7") + '("str" "G_WIN32_REGISTRY_VALUE_STR" "8") + ) +) + +;; Original typedef: +;; typedef enum { +;; G_WIN32_REGISTRY_WATCH_NAME = 1 << 0, +;; G_WIN32_REGISTRY_WATCH_ATTRIBUTES = 1 << 1, +;; G_WIN32_REGISTRY_WATCH_VALUES = 1 << 2, +;; G_WIN32_REGISTRY_WATCH_SECURITY = 1 << 3, +;; } GWin32RegistryKeyWatcherFlags; + +(define-flags-extended Win32RegistryKeyWatcherFlags + (in-module "G") + (c-name "GWin32RegistryKeyWatcherFlags") + (values + '("name" "G_WIN32_REGISTRY_WATCH_NAME" "1 << 0") + '("attributes" "G_WIN32_REGISTRY_WATCH_ATTRIBUTES" "1 << 1") + '("values" "G_WIN32_REGISTRY_WATCH_VALUES" "1 << 2") + '("security" "G_WIN32_REGISTRY_WATCH_SECURITY" "1 << 3") + ) +) + diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 46171945..1d46463e 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -280,13 +280,6 @@ (gtype-id "G_TYPE_LOADABLE_ICON") ) -(define-object DirectoryMonitor - (in-module "GLocal") - (parent "GFileMonitor") - (c-name "GLocalDirectoryMonitor") - (gtype-id "G_TYPE_LOCAL_DIRECTORY_MONITOR") -) - (define-object FileIOStream (in-module "GLocal") (parent "GFileIOStream") @@ -516,6 +509,13 @@ (gtype-id "G_TYPE_SOCKET_ADDRESS") ) +(define-object SocketAddress + (in-module "GNative") + (parent "GSocketAddress") + (c-name "GNativeSocketAddress") + (gtype-id "G_TYPE_NATIVE_SOCKET_ADDRESS") +) + (define-object SocketAddress (in-module "GInet") (parent "GSocketAddress") @@ -759,6 +759,13 @@ (gtype-id "G_TYPE_WIN32_OUTPUT_STREAM") ) +(define-object 32RegistryKey + (in-module "GWin") + (parent "GObject") + (c-name "GWin32RegistryKey") + (gtype-id "G_TYPE_WIN32_REGISTRY_KEY") +) + ;; Enumerations and flags ... (define-enum AuthMechanismState @@ -970,6 +977,7 @@ '("watch-mounts" "G_FILE_MONITOR_WATCH_MOUNTS") '("send-moved" "G_FILE_MONITOR_SEND_MOVED") '("watch-hard-links" "G_FILE_MONITOR_WATCH_HARD_LINKS") + '("watch-moves" "G_FILE_MONITOR_WATCH_MOVES") ) ) @@ -1012,6 +1020,9 @@ '("pre-unmount" "G_FILE_MONITOR_EVENT_PRE_UNMOUNT") '("unmounted" "G_FILE_MONITOR_EVENT_UNMOUNTED") '("moved" "G_FILE_MONITOR_EVENT_MOVED") + '("renamed" "G_FILE_MONITOR_EVENT_RENAMED") + '("moved-in" "G_FILE_MONITOR_EVENT_MOVED_IN") + '("moved-out" "G_FILE_MONITOR_EVENT_MOVED_OUT") ) ) @@ -1397,6 +1408,7 @@ (values '("none" "G_DBUS_CALL_FLAGS_NONE") '("no-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START") + '("allow-interactive-authorization" "G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION") ) ) @@ -1421,6 +1433,7 @@ '("none" "G_DBUS_MESSAGE_FLAGS_NONE") '("no-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED") '("no-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START") + '("allow-interactive-authorization" "G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION") ) ) @@ -1674,6 +1687,18 @@ ) ) +(define-enum ListenerEvent + (in-module "GSocket") + (c-name "GSocketListenerEvent") + (gtype-id "G_TYPE_SOCKET_LISTENER_EVENT") + (values + '("binding" "G_SOCKET_LISTENER_BINDING") + '("bound" "G_SOCKET_LISTENER_BOUND") + '("listening" "G_SOCKET_LISTENER_LISTENING") + '("listened" "G_SOCKET_LISTENER_LISTENED") + ) +) + (define-enum DBusFlags (in-module "GTest") (c-name "GTestDBusFlags") @@ -10505,6 +10530,11 @@ (return-type "GType") ) +(define-function g_socket_listener_event_get_type + (c-name "g_socket_listener_event_get_type") + (return-type "GType") +) + (define-function g_test_dbus_flags_get_type (c-name "g_test_dbus_flags_get_type") (return-type "GType") @@ -11089,36 +11119,28 @@ -;; From glocaldirectorymonitor.h +;; From glocalfileenumerator.h -(define-function g_local_directory_monitor_get_type - (c-name "g_local_directory_monitor_get_type") - (return-type "GType") -) -(define-method start - (of-object "GLocalDirectoryMonitor") - (c-name "g_local_directory_monitor_start") - (return-type "none") -) -(define-function g_local_directory_monitor_new_in_worker - (c-name "g_local_directory_monitor_new_in_worker") - (return-type "GLocalDirectoryMonitor*") +;; From glocalfile.h + +(define-function g_local_file_is_remote + (c-name "g_local_file_is_remote") + (return-type "gboolean") (parameters - '("const-char*" "pathname") - '("GFileMonitorFlags" "flags") - '("GError**" "error") + '("const-gchar*" "filename") ) ) - - -;; From glocalfileenumerator.h - - - -;; From glocalfile.h +(define-function g_local_file_new_from_dirname_and_basename + (c-name "g_local_file_new_from_dirname_and_basename") + (return-type "GFile*") + (parameters + '("const-char*" "dirname") + '("const-char*" "basename") + ) +) @@ -11141,22 +11163,43 @@ (return-type "GType") ) -(define-method start - (of-object "GLocalFileMonitor") - (c-name "g_local_file_monitor_start") - (return-type "none") +(define-function g_local_file_monitor_new_for_path + (c-name "g_local_file_monitor_new_for_path") + (return-type "GFileMonitor*") + (parameters + '("const-gchar*" "pathname") + '("gboolean" "is_directory") + '("GFileMonitorFlags" "flags") + '("GError**" "error") + ) ) (define-function g_local_file_monitor_new_in_worker (c-name "g_local_file_monitor_new_in_worker") - (return-type "GLocalFileMonitor*") + (return-type "GFileMonitor*") (parameters - '("const-char*" "pathname") + '("const-gchar*" "pathname") + '("gboolean" "is_directory") '("GFileMonitorFlags" "flags") + '("GFileMonitorCallback" "callback") + '("gpointer" "user_data") '("GError**" "error") ) ) +(define-method handle_event + (of-object "GFileMonitorSource") + (c-name "g_file_monitor_source_handle_event") + (return-type "gboolean") + (parameters + '("GFileMonitorEvent" "event_type") + '("const-gchar*" "child") + '("const-gchar*" "rename_to") + '("GFile*" "other") + '("gint64" "event_time") + ) +) + ;; From glocalfileoutputstream.h @@ -12132,6 +12175,25 @@ +;; From gnativesocketaddress.h + +(define-function g_native_socket_address_get_type + (c-name "g_native_socket_address_get_type") + (return-type "GType") +) + +(define-function g_native_socket_address_new + (c-name "g_native_socket_address_new") + (is-constructor-of "GNativeSocketAddress") + (return-type "GSocketAddress*") + (parameters + '("gpointer" "native") + '("gsize" "len") + ) +) + + + ;; From gnativevolumemonitor.h (define-function g_native_volume_monitor_get_type @@ -14613,6 +14675,12 @@ ) ) +(define-method list_keys + (of-object "GSettingsSchema") + (c-name "g_settings_schema_list_keys") + (return-type "gchar**") +) + (define-method list_children (of-object "GSettingsSchema") (c-name "g_settings_schema_list_children") @@ -17633,6 +17701,15 @@ (return-type "GList*") ) +(define-method copy_session_state + (of-object "GTlsClientConnection") + (c-name "g_tls_client_connection_copy_session_state") + (return-type "none") + (parameters + '("GTlsClientConnection*" "source") + ) +) + ;; From gtlsconnection.h @@ -19219,6 +19296,313 @@ +;; From gwin32registrykey.h + +(define-method copy + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_copy") + (return-type "GWin32RegistrySubkeyIter*") +) + +(define-method free + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_free") + (return-type "none") +) + +(define-method assign + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_assign") + (return-type "none") + (parameters + '("const-GWin32RegistrySubkeyIter*" "other") + ) +) + +(define-function g_win32_registry_subkey_iter_get_type + (c-name "g_win32_registry_subkey_iter_get_type") + (return-type "GType") +) + +(define-method copy + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_copy") + (return-type "GWin32RegistryValueIter*") +) + +(define-method free + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_free") + (return-type "none") +) + +(define-method assign + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_assign") + (return-type "none") + (parameters + '("const-GWin32RegistryValueIter*" "other") + ) +) + +(define-function g_win32_registry_value_iter_get_type + (c-name "g_win32_registry_value_iter_get_type") + (return-type "GType") +) + +(define-function g_win32_registry_key_get_type + (c-name "g_win32_registry_key_get_type") + (return-type "GType") +) + +(define-function g_win32_registry_key_new + (c-name "g_win32_registry_key_new") + (is-constructor-of "GWin32RegistryKey") + (return-type "GWin32RegistryKey*") + (parameters + '("const-gchar*" "path") + '("GError**" "error") + ) +) + +(define-function g_win32_registry_key_new_w + (c-name "g_win32_registry_key_new_w") + (return-type "GWin32RegistryKey*") + (parameters + '("const-gunichar2*" "path") + '("GError**" "error") + ) +) + +(define-method get_child + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_child") + (return-type "GWin32RegistryKey*") + (parameters + '("const-gchar*" "subkey") + '("GError**" "error") + ) +) + +(define-method get_child_w + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_child_w") + (return-type "GWin32RegistryKey*") + (parameters + '("const-gunichar2*" "subkey") + '("GError**" "error") + ) +) + +(define-method init + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_init") + (return-type "gboolean") + (parameters + '("GWin32RegistryKey*" "key") + '("GError**" "error") + ) +) + +(define-method clear + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_clear") + (return-type "none") +) + +(define-method n_subkeys + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_n_subkeys") + (return-type "gsize") +) + +(define-method next + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_next") + (return-type "gboolean") + (parameters + '("gboolean" "skip_errors") + '("GError**" "error") + ) +) + +(define-method get_name + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_get_name") + (return-type "gboolean") + (parameters + '("gchar**" "subkey_name") + '("gsize*" "subkey_name_len") + '("GError**" "error") + ) +) + +(define-method get_name_w + (of-object "GWin32RegistrySubkeyIter") + (c-name "g_win32_registry_subkey_iter_get_name_w") + (return-type "gboolean") + (parameters + '("gunichar2**" "subkey_name") + '("gsize*" "subkey_name_len") + '("GError**" "error") + ) +) + +(define-method init + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_init") + (return-type "gboolean") + (parameters + '("GWin32RegistryKey*" "key") + '("GError**" "error") + ) +) + +(define-method clear + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_clear") + (return-type "none") +) + +(define-method n_values + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_n_values") + (return-type "gsize") +) + +(define-method next + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_next") + (return-type "gboolean") + (parameters + '("gboolean" "skip_errors") + '("GError**" "error") + ) +) + +(define-method get_value_type + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_get_value_type") + (return-type "gboolean") + (parameters + '("GWin32RegistryValueType*" "value_type") + '("GError**" "error") + ) +) + +(define-method get_name + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_get_name") + (return-type "gboolean") + (parameters + '("gchar**" "value_name") + '("gsize*" "value_name_len") + '("GError**" "error") + ) +) + +(define-method get_name_w + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_get_name_w") + (return-type "gboolean") + (parameters + '("gunichar2**" "value_name") + '("gsize*" "value_name_len") + '("GError**" "error") + ) +) + +(define-method get_data + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_get_data") + (return-type "gboolean") + (parameters + '("gboolean" "auto_expand") + '("gpointer*" "value_data") + '("gsize*" "value_data_size") + '("GError**" "error") + ) +) + +(define-method get_data_w + (of-object "GWin32RegistryValueIter") + (c-name "g_win32_registry_value_iter_get_data_w") + (return-type "gboolean") + (parameters + '("gboolean" "auto_expand") + '("gpointer*" "value_data") + '("gsize*" "value_data_size") + '("GError**" "error") + ) +) + +(define-method get_value + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_value") + (return-type "gboolean") + (parameters + '("gboolean" "auto_expand") + '("const-gchar*" "value_name") + '("GWin32RegistryValueType*" "value_type") + '("gpointer*" "value_data") + '("gsize*" "value_data_size") + '("GError**" "error") + ) +) + +(define-method get_value_w + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_value_w") + (return-type "gboolean") + (parameters + '("gboolean" "auto_expand") + '("const-gunichar2*" "value_name") + '("GWin32RegistryValueType*" "value_type") + '("gpointer*" "value_data") + '("gsize*" "value_data_size") + '("GError**" "error") + ) +) + +(define-method get_path + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_path") + (return-type "const-gchar*") +) + +(define-method get_path_w + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_get_path_w") + (return-type "const-gunichar2*") +) + +(define-method watch + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_watch") + (return-type "gboolean") + (parameters + '("gboolean" "watch_children") + '("GWin32RegistryKeyWatcherFlags" "watch_flags") + '("GWin32RegistryKeyWatchCallbackFunc" "callback") + '("gpointer" "user_data") + '("GError**" "error") + ) +) + +(define-method has_changed + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_has_changed") + (return-type "gboolean") +) + +(define-method erase_change_indicator + (of-object "GWin32RegistryKey") + (c-name "g_win32_registry_key_erase_change_indicator") + (return-type "none") +) + + + ;; From gwin32volumemonitor.h diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 289e6766..d6c76b55 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -420,15 +420,6 @@ (construct-only #f) ) -(define-property context - (of-object "GFileMonitor") - (prop-type "GParamBoxed") - (docs "The main context to dispatch from") - (readable #f) - (writable #t) - (construct-only #t) -) - ;; From GFilenameCompleter (define-signal got-completion-data @@ -880,6 +871,15 @@ (construct-only #t) ) +(define-property invert-boolean + (of-object "GPropertyAction") + (prop-type "GParamBoolean") + (docs "Whether to invert the value of a boolean property") + (readable #t) + (writable #t) + (construct-only #t) +) + ;; From GProxy ;; From GProxyAddress @@ -2280,6 +2280,16 @@ ;; From GSocketListener +(define-signal event + (of-object "GSocketListener") + (return-type "void") + (when "last") + (parameters + '("GSocketListenerEvent" "p0") + '("GSocket*" "p1") + ) +) + (define-property listen-backlog (of-object "GSocketListener") (prop-type "GParamInt") -- cgit v1.2.1 From 4c7f7ac0945a5133a033bbada9c27b7adb30471f Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 21 Jun 2015 13:14:26 +0200 Subject: Add SettingsSchema, SettingsSchemaKey and SettingsSchemaSource. However, these are completely untested, and not all functions have been wrapped. --- gio/giomm.h | 2 + gio/src/filelist.am | 3 ++ gio/src/gio_extra_objects.defs | 12 +++++ gio/src/gio_signals.defs | 6 +++ gio/src/settings.hg | 2 +- gio/src/settingsschema.ccg | 23 +++++++++ gio/src/settingsschema.hg | 82 +++++++++++++++++++++++++++++++ gio/src/settingsschemakey.ccg | 23 +++++++++ gio/src/settingsschemakey.hg | 63 ++++++++++++++++++++++++ gio/src/settingsschemasource.ccg | 23 +++++++++ gio/src/settingsschemasource.hg | 65 ++++++++++++++++++++++++ tools/extra_defs_gen/generate_defs_gio.cc | 3 ++ tools/m4/convert_gio.m4 | 8 +++ 13 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 gio/src/settingsschema.ccg create mode 100644 gio/src/settingsschema.hg create mode 100644 gio/src/settingsschemakey.ccg create mode 100644 gio/src/settingsschemakey.hg create mode 100644 gio/src/settingsschemasource.ccg create mode 100644 gio/src/settingsschemasource.hg diff --git a/gio/giomm.h b/gio/giomm.h index e778d366..43f6ed55 100644 --- a/gio/giomm.h +++ b/gio/giomm.h @@ -114,6 +114,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 71e4fe0f..8f65f782 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -101,6 +101,9 @@ giomm_files_any_hg = \ resource.hg \ seekable.hg \ settings.hg \ + settingsschema.hg \ + settingsschemakey.hg \ + settingsschemasource.hg \ simpleaction.hg \ simpleactiongroup.hg \ simpleiostream.hg \ diff --git a/gio/src/gio_extra_objects.defs b/gio/src/gio_extra_objects.defs index a47e231c..c1ed447a 100644 --- a/gio/src/gio_extra_objects.defs +++ b/gio/src/gio_extra_objects.defs @@ -193,6 +193,18 @@ (gtype-id "G_TYPE_RESOURCE") ) +(define-object SettingsSchema + (in-module "Gio") + (c-name "GSettingsSchema") + (gtype-id "G_TYPE_SETTINGS_SCHEMA") +) + +(define-object SettingsSchemaKey + (in-module "Gio") + (c-name "GSettingsSchemaKey") + (gtype-id "G_TYPE_SETTINGS_SCHEMA_KEY") +) + (define-object SimpleAction (in-module "Gio") (c-name "GSimpleAction") diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index d6c76b55..92d6701d 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -1784,6 +1784,12 @@ (construct-only #f) ) +;; GSettingsSchema is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GSettingsSchemaKey is neither a GObject nor a GInterface. Not checked for signals and properties. + +;; GSettingsSchemaSource is neither a GObject nor a GInterface. Not checked for signals and properties. + ;; From GSimplePermission ;; From GSocket diff --git a/gio/src/settings.hg b/gio/src/settings.hg index eb660dd2..7d48e729 100644 --- a/gio/src/settings.hg +++ b/gio/src/settings.hg @@ -176,7 +176,7 @@ _DEPRECATE_IFDEF_END #m4 _CONVERSION(`gchar**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(std::vector list_children() const, g_settings_list_children) - _WRAP_METHOD(std::vector list_keys() const, g_settings_list_keys) + _WRAP_METHOD(std::vector list_keys() const, g_settings_list_keys, deprecated "Use SettingsSchema::list_kes().") _IGNORE(g_settings_get_range, g_settings_list_relocatable_schemas) // deprecated diff --git a/gio/src/settingsschema.ccg b/gio/src/settingsschema.ccg new file mode 100644 index 00000000..a8ef5d43 --- /dev/null +++ b/gio/src/settingsschema.ccg @@ -0,0 +1,23 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +#include + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/settingsschema.hg b/gio/src/settingsschema.hg new file mode 100644 index 00000000..4ff7e833 --- /dev/null +++ b/gio/src/settingsschema.hg @@ -0,0 +1,82 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +_CONFIGINCLUDE(giommconfig.h) + +#include +#include + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/object_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GSettingsSchema GSettingsSchema; +#endif + +namespace Gio +{ + +//TODO: Translate more of the class documentation from the C docs. + +/** Introspecting and controlling the loading of GSettings schemas. + * + * The SettingsSchemaSource and SettingsSchema APIs provide a + * mechanism for advanced control over the loading of schemas and a + * mechanism for introspecting their content. + * + * Plugin loading systems that wish to provide plugins a way to access + * settings face the problem of how to make the schemas for these + * settings visible to GSettings. Typically, a plugin will want to ship + * the schema along with itself and it won't be installed into the + * standard system directories for schemas. + * + * SettingsSchemaSource provides a mechanism for dealing with this by + * allowing the creation of a new 'schema source' from which schemas can + * be acquired. This schema source can then become part of the metadata + * associated with the plugin and queried whenever the plugin requires + * access to some settings. + * + * @newin{2,32} + */ +class SettingsSchema +{ + _CLASS_OPAQUE_REFCOUNTED(SettingsSchema, GSettingsSchema, NONE, g_settings_schema_ref, g_settings_schema_unref) + +protected: + _IGNORE(g_settings_schema_ref, g_settings_schema_unref) + + //Ignore internal GSettingsSchema functions. + _IGNORE(g_settings_schema_get_value, g_settings_schema_list, g_settings_schema_get_string, g_settings_schema_get_gettext_domain) + +public: + _WRAP_METHOD(Glib::ustring get_id() const, g_settings_schema_get_id) + _WRAP_METHOD(Glib::ustring get_path() const, g_settings_schema_get_path) + + //Note that these don't need refreturn because they seem to return a reference + //(they are documented as transfer:full) + _WRAP_METHOD(Glib::RefPtr get_key(const Glib::ustring& name), g_settings_schema_get_key) + _WRAP_METHOD(Glib::RefPtr get_key(const Glib::ustring& name) const, g_settings_schema_get_key) + + _WRAP_METHOD(bool has_key(const Glib::ustring& name) const, g_settings_schema_has_key) + +#m4 _CONVERSION(`gchar**',`std::vector',`Glib::ArrayHandler::array_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector list_keys() const, g_settings_schema_list_keys) + + _WRAP_METHOD(std::vector list_children() const, g_settings_schema_list_children) +}; + +} // namespace Gio diff --git a/gio/src/settingsschemakey.ccg b/gio/src/settingsschemakey.ccg new file mode 100644 index 00000000..a8ef5d43 --- /dev/null +++ b/gio/src/settingsschemakey.ccg @@ -0,0 +1,23 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +#include + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/settingsschemakey.hg b/gio/src/settingsschemakey.hg new file mode 100644 index 00000000..cca21c76 --- /dev/null +++ b/gio/src/settingsschemakey.hg @@ -0,0 +1,63 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +_CONFIGINCLUDE(giommconfig.h) + +#include + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/object_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GSettingsSchemaKey GSettingsSchemaKey; +#endif + +namespace Gio +{ + +//TODO: Add some class documentation, though there is none in the C docs. + +/** See SettingsSchema. + * + * @newin{2,32} + */ +class SettingsSchemaKey +{ + _CLASS_OPAQUE_REFCOUNTED(SettingsSchemaKey, GSettingsSchemaKey, NONE, g_settings_schema_key_ref, g_settings_schema_key_unref) + +protected: + _IGNORE(g_settings_schema_key_ref, g_settings_schema_key_unref) + + //Ignore internal GSettingsSchemaKey functions. + _IGNORE(g_settings_schema_key_init, g_settings_schema_key_clear, + g_settings_schema_key_type_check, g_settings_schema_key_range_fixup, + g_settings_schema_key_get_translated_default, g_settings_schema_key_to_enum, + g_settings_schema_key_from_enum, g_settings_schema_key_to_flags, + g_settings_schema_key_from_flags) + +public: + //TODO: _WRAP_METHOD(const GVariantType * g_settings_schema_key_get_value_type (), g_settings_schema_key_get_value_type) + //_WRAP_METHOD(GVariant * g_settings_schema_key_get_default_value (), g_settings_schema_key_get_default_value) + //_WRAP_METHOD(GVariant * g_settings_schema_key_get_range (), g_settings_schema_key_get_range) + //TODO: _WRAP_METHOD(bool range_check(GVariant *value), g_settings_schema_key_range_check) + + _WRAP_METHOD(Glib::ustring get_name() const, g_settings_schema_key_get_name) + _WRAP_METHOD(Glib::ustring get_summary() const, g_settings_schema_key_get_summary) + _WRAP_METHOD(Glib::ustring get_description() const, g_settings_schema_key_get_description) +}; + +} // namespace Gio diff --git a/gio/src/settingsschemasource.ccg b/gio/src/settingsschemasource.ccg new file mode 100644 index 00000000..a8ef5d43 --- /dev/null +++ b/gio/src/settingsschemasource.ccg @@ -0,0 +1,23 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +#include + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/settingsschemasource.hg b/gio/src/settingsschemasource.hg new file mode 100644 index 00000000..2731f2b3 --- /dev/null +++ b/gio/src/settingsschemasource.hg @@ -0,0 +1,65 @@ +/* Copyright (C) 2015 The giomm 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. + */ + +_CONFIGINCLUDE(giommconfig.h) + +#include + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/object_p.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GSettingsSchemaSource GSettingsSchemaSource; +#endif + +namespace Gio +{ + +//TODO: Add some class documentation, though there is none in the C docs. + +/** See SettingsSchema. + * + * @newin{2,32} + */ +class SettingsSchemaSource +{ + _CLASS_OPAQUE_REFCOUNTED(SettingsSchemaSource, GSettingsSchemaSource, NONE, g_settings_schema_source_ref, g_settings_schema_source_unref) + +protected: + _IGNORE(g_settings_schema_source_ref, g_settings_schema_source_unref) + +public: + + _WRAP_METHOD(static Glib::RefPtr get_default(), g_settings_schema_source_get_default) + +/* TODO: +GLIB_AVAILABLE_IN_2_32 +GSettingsSchemaSource * g_settings_schema_source_new_from_directory (const gchar *directory, + GSettingsSchemaSource *parent, + gboolean trusted, + GError **error); +*/ + + //Note this doesn't need refreturn because the C function returns a reference. + //- it is documented as transfer:full + _WRAP_METHOD(Glib::RefPtr lookup(const Glib::ustring& schema_id, bool recursive), g_settings_schema_source_lookup) + _WRAP_METHOD(Glib::RefPtr lookup(const Glib::ustring& schema_id, bool recursive) const, g_settings_schema_source_lookup) + + //TODO:_WRAP_METHOD(void list_schemas(bool recursive, gchar*** non_relocatable, gchar*** relocatable), g_settings_schema_source_list_schemas) +}; + +} // namespace Gio diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index 373e3dea..602b59b4 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -118,6 +118,9 @@ int main(int, char**) << get_defs(G_TYPE_NETWORK_MONITOR) << get_defs(G_TYPE_NETWORK_SERVICE) << get_defs(G_TYPE_SETTINGS) + << get_defs(G_TYPE_SETTINGS_SCHEMA) + << get_defs(G_TYPE_SETTINGS_SCHEMA_KEY) + << get_defs(G_TYPE_SETTINGS_SCHEMA_SOURCE) << get_defs(G_TYPE_SIMPLE_PERMISSION) << get_defs(G_TYPE_SOCKET) << get_defs(G_TYPE_SOCKET_CLIENT) diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index d0672bac..8219d4d0 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -268,6 +268,14 @@ _CONVERSION(`GSettings*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*-const*',`($3).data()') _CONVERSION(`const Glib::RefPtr&',`GSettingsBackend*',__CONVERT_REFPTR_TO_P) +_CONVERSION(`GSettingsSchemaKey*',`Glib::RefPtr',`Glib::wrap($3)') +_CONVERSION(`GSettingsSchemaKey*',`Glib::RefPtr',`Glib::wrap($3)') + +_CONVERSION(`GSettingsSchema*',`Glib::RefPtr',`Glib::wrap($3)') +_CONVERSION(`GSettingsSchema*',`Glib::RefPtr',`Glib::wrap($3)') + +_CONVERSION(`GSettingsSchemaSource*',`Glib::RefPtr',`Glib::wrap($3)') + #Socket _CONVERSION(`const Glib::RefPtr&',`GSocket*',__CONVERT_CONST_REFPTR_TO_P) -- cgit v1.2.1 From b4198dd1945ef4a9787b76c1a68e61708a9b1fa9 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 29 Jun 2015 08:25:30 +0200 Subject: tools/m4/list.m4: GP_LIST: Remove this because nothing uses it. I think this has not been used by any *mm projects since gtkmm-2.4 We can add it back if I am wrong. And we doing new gtkmm-2.4 releases is hard enough anyway so there isn't much point in keeping stuff around just for that. --- tools/m4/filelist.am | 1 - tools/m4/list.m4 | 232 --------------------------------------------------- 2 files changed, 233 deletions(-) delete mode 100644 tools/m4/list.m4 diff --git a/tools/m4/filelist.am b/tools/m4/filelist.am index 04d0b01b..55fedb2b 100644 --- a/tools/m4/filelist.am +++ b/tools/m4/filelist.am @@ -25,7 +25,6 @@ files_codegen_m4 = \ initialize_gio.m4 \ initialize_glib.m4 \ initialize_glibmm.m4 \ - list.m4 \ member.m4 \ method.m4 \ property.m4 \ diff --git a/tools/m4/list.m4 b/tools/m4/list.m4 deleted file mode 100644 index 954beb19..00000000 --- a/tools/m4/list.m4 +++ /dev/null @@ -1,232 +0,0 @@ -_PUSH() - -dnl -dnl These variables affect the generation of the list -dnl -define(GP_LIST_HELPER_NAMESPACE,`define(`__LIST_NAMESPACE__',$1)') -define(GP_LIST_ELEM,`define(`__LISTELEM__',`$*')') -define(GP_LIST_ITER,`define(`__LISTITER__',`$*')') -define(GP_LIST_NOINSERT,`define(`__LISTEO__')') - -dnl -dnl GP_LIST(ListName, ParentCppType, ParentCType, ChildCppType, FieldNameC) -dnl -dnl In the .ccg file, you'll need to implement: -dnl iterator insert(iterator position, element_type& e); -dnl -dnl Fieldname assumed to be children if not specified -define(GP_LIST,` -_PUSH() - -define(`__LISTNAME__',$1) -define(`__LISTPARENT__',$2) -define(`__LISTPARENT_G__',$3) -define(`__LISTTYPE__',$4) -define(`__LISTELEM__',const Element) -define(`__LISTITER__',Glib::List_Iterator< __LISTTYPE__ >) -define(`__LIST_NAMESPACE__',$2_Helpers) -#define(`__LISTFIELD__',ifelse($5,,children,$5)) -define(`__LISTFIELD__',$5) - -_SECTION(SECTION_USR) -') - -dnl -dnl GP_LIST_END() -dnl -dnl Closes a list -define(GP_LIST_END,`dnl -_POP() - -class __LISTNAME__ : public Glib::HelperList< __LISTTYPE__, __LISTELEM__, __LISTITER__ > -{ -public: - __LISTNAME__`'(); - explicit __LISTNAME__`'(__LISTPARENT_G__* gparent); - __LISTNAME__`'(const __LISTNAME__& src); - virtual ~__LISTNAME__`'() {} - - __LISTNAME__& operator=(const __LISTNAME__& src); - - typedef Glib::HelperList< __LISTTYPE__, __LISTELEM__, __LISTITER__ > type_base; - - __LISTPARENT_G__* gparent(); - const __LISTPARENT_G__* gparent() const; - - virtual GList*& glist() const; // front of list - - virtual void erase(iterator start, iterator stop); - virtual iterator erase(iterator); //Implented as custom or by LIST_CONTAINER_REMOVE - virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE - - /// This is order n. (use at own risk) - reference operator[](size_type l) const; - -ifdef(`__LISTEO__',`dnl -protected: - //Hide these because it's read-only: - iterator insert(iterator position, element_type& e); - - inline void pop_front(); - inline void pop_back(); -,`dnl -public: - iterator insert(iterator position, element_type& e); //custom-implemented. - - template - inline void insert(iterator position, InputIterator first, InputIterator last) - { - for(;first != last; ++first) - position = insert(position, *first); - } - - inline void push_front(element_type& e) - { insert(begin(), e); } - inline void push_back(element_type& e) - { insert(end(), e); } -')dnl - -_IMPORT(SECTION_USR) -}; - -_PUSH(SECTION_CC) - -namespace __LIST_NAMESPACE__ -{ - -__LISTNAME__::__LISTNAME__`'() -{} - -__LISTNAME__::__LISTNAME__`'(__LISTPARENT_G__* gparent) -: type_base((GObject*)gparent) -{} - -__LISTNAME__::__LISTNAME__`'(const __LISTNAME__& src) -: - type_base(src) -{} - -__LISTNAME__& __LISTNAME__::operator=(const __LISTNAME__& src) -{ - type_base::operator=(src); - return *this; -} - -ifelse(__LISTFIELD__,CUSTOM,`dnl -',`dnl else -GList*& __LISTNAME__::glist() const -{ - return ((__LISTPARENT_G__*)gparent_)->__LISTFIELD__; -} -')dnl endif - -void __LISTNAME__::erase(iterator start, iterator stop) -{ - type_base::erase(start, stop); -} - -__LISTPARENT_G__* __LISTNAME__::gparent() -{ - return (__LISTPARENT_G__*)type_base::gparent(); -} - -const __LISTPARENT_G__* __LISTNAME__::gparent() const -{ - return (__LISTPARENT_G__*)type_base::gparent(); -} - -__LISTNAME__::reference __LISTNAME__::operator[](size_type l) const -{ - return type_base::operator[](l); -} - -} /* namespace __LIST_NAMESPACE__ */ - -undefine(`__LISTNAME__')dnl -undefine(`__LISTTYPE__')dnl -undefine(`__LISTPARENT__')dnl -undefine(`__LISTELEM__')dnl -undefine(`__LISTFIELD__')dnl -_POP() -') - -dnl -dnl GP_LIST_FIND(access_method) -dnl -dnl Defines find(containertype) and find(Widget&) -dnl access_method is the name of method returning a Widget* -define(GP_LIST_FIND,` - iterator find(const_reference c); - iterator find(Widget&); -_PUSH(SECTION_CC) - -namespace __LIST_NAMESPACE__ -{ - -__LISTNAME__::iterator __LISTNAME__::find(const_reference w) -{ - iterator i = begin(); - while (i != end() && (i->ifelse($1,,,$1()->)gobj() != w.ifelse($1,,,$1()->)gobj())) - ++i; - return i; -} - -__LISTNAME__::iterator __LISTNAME__::find(Widget& w) -{ - iterator i = begin(); - while (i != end() && ((GtkWidget*)i->ifelse($1,,,$1()->)gobj() != w.gobj())) - ++i; - return i; -} - -} /* namespace __LIST_NAMESPACE__ */ - -_POP() -') - -dnl -dnl GP_LIST_CONTAINER_REMOVE(access_method) -dnl -dnl Implements remove(const_reference), erase(iterator) -dnl and defines remove(Widget&) -dnl (assumes that the widget uses gtk+ container methods). -dnl access_method is the name of the method returning a Widget* -define(GP_LIST_CONTAINER_REMOVE,` -virtual void remove(Widget& w); //Implented as custom or by LIST_CONTAINER_REMOVE -_PUSH(SECTION_CC) - -namespace __LIST_NAMESPACE__ -{ - -void __LISTNAME__::remove(const_reference child) -{ - gtk_container_remove(GTK_CONTAINER(gparent_), - (GtkWidget*)(child.ifelse($1,,,$1()->)gobj())); -} - -void __LISTNAME__::remove(Widget& widget) -{ - gtk_container_remove(GTK_CONTAINER(gparent_), (GtkWidget*)(widget.gobj())); -} - -__LISTNAME__::iterator __LISTNAME__::erase(iterator position) -{ - //Check that it is a valid iterator, to a real item: - if ( !position.node_|| (position == end()) ) - return end(); - - //Get an iterator the the next item, to return: - iterator next = position; - next++; - - //Use GTK+ C function to remove it, by providing the GtkWidget*: - gtk_container_remove( GTK_CONTAINER(gparent_), (GtkWidget*)(position->ifelse($1,,,$1()->)gobj()) ); - return next; -} - -} /* namespace __LIST_NAMESPACE__ */ - -_POP() -') - -_POP()dnl -- cgit v1.2.1 From 08c6cc2ca8dfdab8c1294bc925ea31df0b6ff8ff Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 29 Jun 2015 08:27:16 +0200 Subject: HelperList: Deprecate this. Because nothing uses it anymore. See the previous commit about GP_LIST. --- glib/glibmm/helperlist.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index dfdc0706..1955be14 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -22,12 +22,19 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef GLIBMM_DISABLE_DEPRECATED + #include namespace Glib { // This class has some pure virtual methods which need to be implemented by derived classes. + +/** + * @deprecated This class should no longer be necessary. It has not been used + * by glibmm or gtkmm since gtkmm-2.4. + */ template< typename T_Child, typename T_CppElement, typename T_Iterator > class HelperList { @@ -162,5 +169,7 @@ protected: } /* namespace Glib */ +#endif //GLIBMM_DISABLE_DEPRECATED + #endif /* _GLIBMM_HELPERLIST_H */ -- cgit v1.2.1 From f4ba3c84bd87791cf41482e73f1908ab8d864326 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 29 Jun 2015 08:41:12 +0200 Subject: ArrayHandle: Add a comment about removing this one day. We still use it in lots of glibmm API, because glibmm (unlike gtkmm) hasn't had an ABI break since 2004. --- glib/glibmm/arrayhandle.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glib/glibmm/arrayhandle.h b/glib/glibmm/arrayhandle.h index 6938c641..87127ebd 100644 --- a/glib/glibmm/arrayhandle.h +++ b/glib/glibmm/arrayhandle.h @@ -210,6 +210,10 @@ private: } // namespace Container_Helpers +//TODO: When we can break ABI, remove this and replace uses of it with std::vector. +//We cannot deprecate it yet, because we cannot easily deprecate methods that use it +//- for instance, we cannot just override methods that use it as a return type. + /** This is an intermediate type. When a method takes this, or returns this, you * should use a standard C++ container of your choice, such as std::list or * std::vector. -- cgit v1.2.1 From 67f41eef515326268c576ec5cfd56c40c726ddf1 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 29 Jun 2015 08:42:36 +0200 Subject: SArray: Deprecate this and remove ifdef0-ed code. Nothing seems to use this anymore, so it seems safe to deprecate it. --- glib/glibmm/sarray.cc | 61 --------------------------------------- glib/glibmm/sarray.h | 80 +++++---------------------------------------------- 2 files changed, 7 insertions(+), 134 deletions(-) diff --git a/glib/glibmm/sarray.cc b/glib/glibmm/sarray.cc index 2d7c6828..a7d6e315 100644 --- a/glib/glibmm/sarray.cc +++ b/glib/glibmm/sarray.cc @@ -21,65 +21,4 @@ */ #include -/* -namespace Glib -{ -SArray::SArray(const SArray& src) -: type_base(src) -{ -} - -SArray::SArray(const T_c* pValues, size_type size) -: type_base(pValues, size) -{ -} - -SArray::operator std::vector() const -{ - return std::vector(begin(), end()); -} - -SArray::operator std::vector() const -{ - return std::vector(begin(), end()); -} - -SArray::operator std::vector() const -{ - return std::vector(begin(), end()); -} - - -SArray::operator std::deque() const -{ - return std::deque(begin(), end()); -} - -SArray::operator std::deque() const -{ - return std::deque(begin(), end()); -} - -SArray::operator std::deque() const -{ - return std::deque(begin(), end()); -} - -SArray::operator std::list() const -{ - return std::list(begin(), end()); -} - -SArray::operator std::list() const -{ - return std::list(begin(), end()); -} - -SArray::operator std::list() const -{ - return std::list(begin(), end()); -} - -}; // namespace Glib -*/ diff --git a/glib/glibmm/sarray.h b/glib/glibmm/sarray.h index 4f7e4740..6226f50e 100644 --- a/glib/glibmm/sarray.h +++ b/glib/glibmm/sarray.h @@ -23,86 +23,20 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - +#ifndef GLIBMM_DISABLE_DEPRECATED #include #include -namespace Glib { typedef Glib::ArrayHandle SArray; } - -#if 0 - -namespace Glib -{ - -template <> -inline void cpp_type_to_c_type(const ustring& cpp_value, type_constpch& ref_c_value) -{ - ref_c_value = cpp_value.c_str(); -} - -template <> -inline void cpp_type_to_c_type(const std::string& cpp_value, type_constpch& ref_c_value) -{ - ref_c_value = cpp_value.c_str(); -} - -typedef Array SArray; - -/* -class SArray: public Array -{ -public: - typedef const char* T_c; - typedef Array type_base; - - SArray(const SArray& src); - - // copy other containers - template - SArray(const T_container& t) - { - owned_ = Array_Helpers::Traits::get_owned(); - size_ = Array_Helpers::Traits::get_size(t); - pData_ = Array_Helpers::Traits::get_data(t); - } - - SArray(const T_c* pValues, size_type size); - - // copy a sequence - template - SArray(Iterator b, Iterator e); - - operator std::vector() const; - operator std::vector() const; - operator std::vector() const; - - operator std::deque() const; - operator std::deque() const; - operator std::deque() const; - - operator std::list() const; - operator std::list() const; - operator std::list() const; -}; - - -//template -//SArray::SArray(const T_container& t) -//: type_base(t) -//{ -//} +namespace Glib { +/** + * @deprecated Use a std::vector instead. + */ +typedef Glib::ArrayHandle SArray; -template -SArray::SArray(Iterator b, Iterator e) -: type_base(b, e) -{ } -*/ - -} // namespace Glib -#endif /* #if 0 */ +#endif //GLIBMM_DISABLE_DEPRECATED #endif // _GLIBMM_SARRAY_H -- cgit v1.2.1 From a8f22f4369b8e7630d623f61a003a3cacf1cbc97 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 30 Jun 2015 09:31:00 +0200 Subject: 2.45.3 --- NEWS | 19 +++++++++++++++++++ configure.ac | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8748bbc3..a98524d3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +2.45.3 (unstable): + +* Add SettingsSchema, SettingsSchemaKey and SettingsSchemaSource. + (Murray Cumming) +* Deprecate HelperList and SArray because nothing uses them. + (Murray Cumming) + +Build: +* Don't disable more deprecation warnings than necessary + (Kjell Ahlstedt) Bug #750379. + +gmmproc: +* _WRAP_METHOD: deprecated: Use G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS + per function, instead of one big undef [G|GDK|GTK]_DISABLE_DEPRECATED. + (Kjell Ahlstedt) Bug #750379 +* Remove GP_LIST, because nothing uses it. + (Murray Cumming) + + 2.45.2 (unstable): Glib: diff --git a/configure.ac b/configure.ac index e854d810..57128644 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.2], +AC_INIT([glibmm], [2.45.3], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.44.0' +glibreq='2.0 >= 2.45.3' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" -- cgit v1.2.1 From 9c5e30622e38974e909fef60ea045d08000e33a0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 2 Jul 2015 21:03:00 +0200 Subject: gmmproc: _WRAP_SIGNAL: Accept apostrophes in a preceding comment * tools/pm/Output.pm: If a _WRAP_SIGNAL() is preceded by a Doxygen comment, add enough m4 quotes to the comment in the call to _SIGNAL_PROXY(). If not, the generated code is wrong if the comment contains an apostrophe. This bug was probably introduced when I added support for detail_name. --- tools/pm/Output.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 099a1e46..e0f0c294 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -617,6 +617,9 @@ sub output_wrap_sig_decl($$$$$$$$$$$$$$) { # Strip leading whitespace $doxycomment =~ s/^\s+//; + # Add a level of m4 quotes. Necessary if $commentblock contains __FT__ or __BT__. + # DocsParser::lookup_documentation() adds it in $documentation. + $commentblock = "`" . $commentblock . "'"; # We don't have something to add, so just use $commentblock with # opening and closing tokens added. -- cgit v1.2.1 From d6f7c5f69a8ee5935de75c87378b873967119100 Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Thu, 9 Jul 2015 15:24:13 +0200 Subject: Glib::HelperList: fix iterator check in operator[] Signed-off-by: Maks Naumov Bug #751530. --- glib/glibmm/helperlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index 1955be14..d9a1c952 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -117,7 +117,7 @@ public: { size_type j = 0; iterator i; - for(i = begin(), j = 0; i != end(), j < l; ++i, ++j) + for(i = begin(), j = 0; i != end() && j < l; ++i, ++j) ; return (*i); } -- cgit v1.2.1 From ab7f780442703ceba9549a6525b73cad0961ecc4 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 9 Jul 2015 22:50:41 +0200 Subject: Require C++11. configure.ac: Use AX_CXX_COMPILE_STDCXX_11 to check for compiler support for C++11 and use it (--std=c++11 for current versions of g++). --- build/ax_cxx_compile_stdcxx_11.m4 | 168 ++++++++++++++++++++++++++++++++++++++ configure.ac | 2 + 2 files changed, 170 insertions(+) create mode 100644 build/ax_cxx_compile_stdcxx_11.m4 diff --git a/build/ax_cxx_compile_stdcxx_11.m4 b/build/ax_cxx_compile_stdcxx_11.m4 new file mode 100644 index 00000000..b83fac4c --- /dev/null +++ b/build/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1,168 @@ +# ============================================================================ +# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================ +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXXFLAGS to enable support. +# +# The first argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The second argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline C++11 support is required and that the macro +# should error out if no mode with that support is found. If specified +# 'optional', then configuration proceeds regardless, after defining +# HAVE_CXX11 if and only if a supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() override {} + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check check_type; + check_type c; + check_type&& cr = static_cast(c); + + auto d = a; + auto l = [](){}; + // Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable] + struct use_l { use_l() { l(); } }; + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this + namespace test_template_alias_sfinae { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { + func(0); + } + } +]]) + +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl + m4_if([$1], [], [], + [$1], [ext], [], + [$1], [noext], [], + [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl + m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], + [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], + [$2], [optional], [ax_cxx_compile_cxx11_required=false], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++11 features by default, + ax_cv_cxx_compile_cxx11, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [ax_cv_cxx_compile_cxx11=yes], + [ax_cv_cxx_compile_cxx11=no])]) + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + m4_if([$1], [noext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=gnu++11 -std=gnu++0x; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + + m4_if([$1], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + for switch in -std=c++11 -std=c++0x +std=c++11; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) + fi + else + if test x$ac_success = xno; then + HAVE_CXX11=0 + AC_MSG_NOTICE([No compiler with C++11 support was found]) + else + HAVE_CXX11=1 + AC_DEFINE(HAVE_CXX11,1, + [define if the compiler supports basic C++11 syntax]) + fi + + AC_SUBST(HAVE_CXX11) + fi +]) + diff --git a/configure.ac b/configure.ac index 57128644..f690a520 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,8 @@ MM_CONFIG_DOCTOOL_DIR([docs]) AC_SUBST([LIBGLIBMM_SO_VERSION], [4:0:3]) AC_PROG_CXX +AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) + AC_DISABLE_STATIC LT_INIT([win32-dll]) MM_PATH_PERL -- cgit v1.2.1 From 1b23397544bd031331b3110be1b790659bdceb24 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 9 Jul 2015 23:17:54 +0200 Subject: C++11: _CLASS_BOXEDTYPE: Generate move constructors and assignment operators. Bug #751432 --- tools/m4/class_boxedtype.m4 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4 index 1a9b731f..fc46097d 100644 --- a/tools/m4/class_boxedtype.m4 +++ b/tools/m4/class_boxedtype.m4 @@ -135,6 +135,20 @@ __CPPNAME__::__CPPNAME__`'(const __CPPNAME__& other) gobject_ ((other.gobject_) ? __BOXEDTYPE_FUNC_COPY`'(other.gobject_) : 0) {} +__CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other) +: + gobject_(other.gobject_) +{ + other.gobject_ = 0; +} + +__CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other) +{ + __CPPNAME__ temp (other); + swap(temp); + return *this; +} + ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else __CPPNAME__::__CPPNAME__`'(__CNAME__* gobject, bool make_a_copy) : @@ -208,6 +222,9 @@ ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else __CPPNAME__`'(const __CPPNAME__& other); __CPPNAME__& operator=(const __CPPNAME__& other); + __CPPNAME__`'(__CPPNAME__&& other); + __CPPNAME__& operator=(__CPPNAME__&& other); + _IMPORT(SECTION_DTOR_DOCUMENTATION) ~__CPPNAME__`'(); -- cgit v1.2.1 From 2cad48817914213f41fd7b85cac0f650b0f9d7ce Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 26 Jun 2013 10:46:22 +0200 Subject: C++11: Use range-based for loops. --- examples/dbus/client_bus_listnames.cc | 4 ++-- examples/keyfile/main.cc | 4 ++-- examples/markup/parser.cc | 4 ++-- examples/network/resolver.cc | 16 +++++++--------- examples/options/main.cc | 9 +++++---- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc index b46fdcf8..0a49d739 100644 --- a/examples/dbus/client_bus_listnames.cc +++ b/examples/dbus/client_bus_listnames.cc @@ -60,8 +60,8 @@ void on_dbus_proxy_available(Glib::RefPtr& result) std::cout << "The names on the message bus are:" << std::endl; - for(unsigned i = 0; i < names.size(); i++) - std::cout << names[i] << "." << std::endl; + for(const auto& i : names) + std::cout << i << "." << std::endl; } catch(const Glib::Error& error) { diff --git a/examples/keyfile/main.cc b/examples/keyfile/main.cc index 533bc532..2f56b21a 100644 --- a/examples/keyfile/main.cc +++ b/examples/keyfile/main.cc @@ -68,8 +68,8 @@ int main(int, char**) { const std::vector values = keyfile.get_integer_list("Another Group", "Numbers"); - for(std::vector::const_iterator p = values.begin(); p != values.end(); ++p) - std::cout << "Number list value: item=" << *p << std::endl; + for(const auto& p : values) + std::cout << "Number list value: item=" << p << std::endl; } catch(const Glib::KeyFileError& ex) { diff --git a/examples/markup/parser.cc b/examples/markup/parser.cc index 30423a66..54bac451 100644 --- a/examples/markup/parser.cc +++ b/examples/markup/parser.cc @@ -84,9 +84,9 @@ void DumpParser::on_start_element(Glib::Markup::ParseContext&, indent(); std::cout << '<' << element_name; - for(AttributeMap::const_iterator p = attributes.begin(); p != attributes.end(); ++p) + for(const auto& p : attributes) { - std::cout << ' ' << p->first << "=\"" << p->second << '"'; + std::cout << ' ' << p.first << "=\"" << p.second << '"'; } std::cout << ">\n"; diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index 4112c146..ca630d9d 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -95,10 +95,9 @@ print_resolved_addresses (const Glib::ustring& name, { G_LOCK (response); std::cout << Glib::ustring::compose ("Name: %1\n", name); - for (std::list >::const_iterator iter = addresses.begin (); - iter != addresses.end (); ++iter) + for (const auto& i : addresses) { - std::cout << Glib::ustring::compose ("Address: %1\n", (*iter)->to_string ()); + std::cout << Glib::ustring::compose ("Address: %1\n", i->to_string ()); } std::cout << std::endl; @@ -112,15 +111,14 @@ print_resolved_service (const Glib::ustring& service, { G_LOCK (response); std::cout << Glib::ustring::compose ("Service: %1\n", service); - for (std::list::const_iterator iter = targets.begin (); - iter != targets.end (); ++iter) + for (const auto& i : targets) { std::cout << Glib::ustring::compose ("%1:%2 (pri %3, weight %4)\n", - iter->get_hostname (), - iter->get_port (), - iter->get_priority (), - iter->get_weight ()); + i.get_hostname (), + i.get_port (), + i.get_priority (), + i.get_weight ()); } std::cout << std::endl; diff --git a/examples/options/main.cc b/examples/options/main.cc index 1ef290b1..baa36150 100644 --- a/examples/options/main.cc +++ b/examples/options/main.cc @@ -221,17 +221,18 @@ int main(int argc, char** argv) //This one shows the results of multiple instance of the same option, such as --list=1 --list=a --list=b std::cout << " list = "; - for(Glib::OptionGroup::vecustrings::const_iterator iter = group.m_arg_list.begin(); iter != group.m_arg_list.end(); ++iter) + for(const auto& i : group.m_arg_list) + { - std::cout << *iter << ", "; + std::cout << i << ", "; } std::cout << std::endl; //This one shows the remaining arguments on the command line, which had no name= form: std::cout << " remaining = "; - for(Glib::OptionGroup::vecustrings::const_iterator iter = group.m_remaining_list.begin(); iter != group.m_remaining_list.end(); ++iter) + for(const auto& i : group.m_remaining_list) { - std::cout << *iter << ", "; + std::cout << i << ", "; } std::cout << std::endl; -- cgit v1.2.1 From e0a8d05f0457d157a392303ced2b4237b228901b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 27 Jun 2013 09:55:52 +0200 Subject: C++11: examples: No need for > > now. --- examples/dbus/client_bus_listnames.cc | 2 +- examples/network/resolver.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc index 0a49d739..3c51e12c 100644 --- a/examples/dbus/client_bus_listnames.cc +++ b/examples/dbus/client_bus_listnames.cc @@ -52,7 +52,7 @@ void on_dbus_proxy_available(Glib::RefPtr& result) // Now extract the single item in the variant container which is the // array of strings (the names). - Glib::Variant< std::vector > names_variant; + Glib::Variant< std::vector> names_variant; result.get_child(names_variant); // Get the vector of strings. diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index ca630d9d..4fdf0cfa 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -91,7 +91,7 @@ print_resolved_name (const Glib::ustring& phys, static void print_resolved_addresses (const Glib::ustring& name, - const std::list >& addresses) + const std::list>& addresses) { G_LOCK (response); std::cout << Glib::ustring::compose ("Name: %1\n", name); -- cgit v1.2.1 From 8de5b1c659df65d0cc381a32ef7a7cd84a8e1038 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 27 Jun 2013 10:25:21 +0200 Subject: C++11: examples: Use nullptr. --- examples/child_watch/main.cc | 2 +- examples/iochannel_stream/fdstream.cc | 8 ++++---- examples/network/resolver.cc | 2 +- examples/thread/dispatcher.cc | 4 ++-- examples/thread/dispatcher2.cc | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/child_watch/main.cc b/examples/child_watch/main.cc index 3bbc368b..883577a2 100644 --- a/examples/child_watch/main.cc +++ b/examples/child_watch/main.cc @@ -40,7 +40,7 @@ void ChildWatch::run() { GPid pid = fork(); - if(pid==0) + if(!pid) { sleep(5); exit(0); diff --git a/examples/iochannel_stream/fdstream.cc b/examples/iochannel_stream/fdstream.cc index be97676f..90df473e 100644 --- a/examples/iochannel_stream/fdstream.cc +++ b/examples/iochannel_stream/fdstream.cc @@ -280,8 +280,8 @@ std::streamsize fdstreambuf::xsgetn(char* dest, std::streamsize num) } fdstream::fdstream(int fd, bool manage) -: std::istream(0), - std::ostream(0), +: std::istream(nullptr), + std::ostream(nullptr), buf(fd, manage) { std::istream::rdbuf(&buf); @@ -289,8 +289,8 @@ fdstream::fdstream(int fd, bool manage) } fdstream::fdstream() -: std::istream(0), - std::ostream(0) +: std::istream(nullptr), + std::ostream(nullptr) { std::istream::rdbuf(&buf); std::ostream::rdbuf(&buf); diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index 4fdf0cfa..dee1ebf5 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -405,7 +405,7 @@ do_connectable (const std::string& arg, gboolean synchronous) { host = arg.substr (0, pos); port_str = arg.substr(pos); - port = strtoul (port_str.c_str (), NULL, 10); + port = strtoul (port_str.c_str (), nullptr, 10); } else port = 0; diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc index 21833e7f..1c1eb667 100644 --- a/examples/thread/dispatcher.cc +++ b/examples/thread/dispatcher.cc @@ -80,7 +80,7 @@ public: ThreadProgress::ThreadProgress(int id) : - thread_ (0), + thread_ (nullptr), id_ (id), progress_ (0) { @@ -91,7 +91,7 @@ ThreadProgress::ThreadProgress(int id) ThreadProgress::~ThreadProgress() { // It is an error if the thread is still running at this point. - g_return_if_fail(thread_ == 0); + g_return_if_fail(thread_ == nullptr); } int ThreadProgress::id() const diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc index dd7d7de8..b9afebc1 100644 --- a/examples/thread/dispatcher2.cc +++ b/examples/thread/dispatcher2.cc @@ -77,7 +77,7 @@ ThreadTimer::ThreadTimer() // Create a new Glib::Dispatcher that is attached to the default main context, signal_increment_ (), // This pointer will be initialized later by the 2nd thread. - signal_finished_ptr_ (NULL) + signal_finished_ptr_ (nullptr) { // Connect the cross-thread signal. signal_increment_.connect(sigc::mem_fun(*this, &ThreadTimer::timer_increment)); @@ -99,7 +99,7 @@ void ThreadTimer::launch() sigc::mem_fun(*this, &ThreadTimer::thread_function)); // Wait for the 2nd thread's startup notification. - while(signal_finished_ptr_ == NULL) + while(!signal_finished_ptr_) startup_cond_.wait(startup_mutex_); } @@ -109,10 +109,10 @@ void ThreadTimer::signal_finished_emit() signal_finished_ptr_->emit(); // wait for the thread to join - if(thread_ != NULL) + if(thread_) thread_->join(); - signal_finished_ptr_ = NULL; + signal_finished_ptr_ = nullptr; } void ThreadTimer::print() const @@ -189,7 +189,7 @@ ThreadTimer::type_signal_end ThreadTimer::signal_end_; ThreadDispatcher::ThreadDispatcher() : - timer_ (NULL) + timer_ (nullptr) { std::cout << "Thread Dispatcher Example #2" << std::endl; -- cgit v1.2.1 From f4e15e79601e47b1e56ef7c32d70bb68c2641ed5 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 4 Jul 2013 10:27:35 +0200 Subject: C++11: examples: more use of auto. --- examples/dbus/client_bus_listnames.cc | 4 ++-- examples/dbus/server_without_bus.cc | 2 +- examples/dbus/session_bus_service.cc | 2 +- examples/iochannel_stream/fdstream.cc | 3 ++- examples/iochannel_stream/main.cc | 2 +- examples/markup/parser.cc | 2 +- examples/network/resolver.cc | 35 +++++++++++++++-------------------- examples/network/socket-client.cc | 2 +- examples/network/socket-server.cc | 35 ++++++++++++++--------------------- examples/regex/main.cc | 2 +- examples/thread/dispatcher.cc | 2 +- examples/thread/thread.cc | 2 +- examples/thread/threadpool.cc | 4 ++-- 13 files changed, 43 insertions(+), 54 deletions(-) diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc index 3c51e12c..4507aec1 100644 --- a/examples/dbus/client_bus_listnames.cc +++ b/examples/dbus/client_bus_listnames.cc @@ -34,7 +34,7 @@ bool on_main_loop_idle() // method. void on_dbus_proxy_available(Glib::RefPtr& result) { - Glib::RefPtr proxy = Gio::DBus::Proxy::create_finish(result); + const auto proxy = Gio::DBus::Proxy::create_finish(result); if(!proxy) { @@ -48,7 +48,7 @@ void on_dbus_proxy_available(Glib::RefPtr& result) { // The proxy's call method returns a tuple of the value(s) that the method // call produces so just get the tuple as a VariantContainerBase. - const Glib::VariantContainerBase result = proxy->call_sync("ListNames"); + const auto result = proxy->call_sync("ListNames"); // Now extract the single item in the variant container which is the // array of strings (the names). diff --git a/examples/dbus/server_without_bus.cc b/examples/dbus/server_without_bus.cc index d50632dc..005dc554 100644 --- a/examples/dbus/server_without_bus.cc +++ b/examples/dbus/server_without_bus.cc @@ -166,7 +166,7 @@ int main(int, char**) std::locale::global(std::locale("")); Gio::init(); - try + try { introspection_data = Gio::DBus::NodeInfo::create_for_xml(introspection_xml); } diff --git a/examples/dbus/session_bus_service.cc b/examples/dbus/session_bus_service.cc index 0f0bd01d..b5ec2a71 100644 --- a/examples/dbus/session_bus_service.cc +++ b/examples/dbus/session_bus_service.cc @@ -156,7 +156,7 @@ int main(int, char**) return 1; } - const guint id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION, + const auto id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION, "org.glibmm.DBusExample", sigc::ptr_fun(&on_bus_acquired), sigc::ptr_fun(&on_name_acquired), diff --git a/examples/iochannel_stream/fdstream.cc b/examples/iochannel_stream/fdstream.cc index 90df473e..3764546a 100644 --- a/examples/iochannel_stream/fdstream.cc +++ b/examples/iochannel_stream/fdstream.cc @@ -265,7 +265,8 @@ std::streamsize fdstreambuf::xsgetn(char* dest, std::streamsize num) *putback_buffer = *(gptr() - 1); putback_count = 2; } - else putback_count = 1; + else + putback_count = 1; } *(putback_buffer + 1) = *(dest + (chars_read - 1)); diff --git a/examples/iochannel_stream/main.cc b/examples/iochannel_stream/main.cc index aaebbdda..e2e670f0 100644 --- a/examples/iochannel_stream/main.cc +++ b/examples/iochannel_stream/main.cc @@ -81,7 +81,7 @@ int main( /* int argc, char *argv[] */) } } - int read_fd = open("testfifo", O_RDONLY); + const auto read_fd = open("testfifo", O_RDONLY); if(read_fd == -1) { std::cerr << "error opening fifo" << std::endl; diff --git a/examples/markup/parser.cc b/examples/markup/parser.cc index 54bac451..fafcc2f5 100644 --- a/examples/markup/parser.cc +++ b/examples/markup/parser.cc @@ -26,7 +26,7 @@ namespace void file_get_contents(const std::string& filename, Glib::ustring& contents) { - const Glib::RefPtr channel = Glib::IOChannel::create_from_file(filename, "r"); + const auto channel = Glib::IOChannel::create_from_file(filename, "r"); channel->read_to_end(contents); } diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index dee1ebf5..49ad2a58 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -150,9 +150,8 @@ lookup_one_sync (const Glib::ustring& arg) { if (arg.find ('/') != std::string::npos) { - std::list targets; /* service/protocol/domain */ - std::vector parts = split_service_parts (arg); + const auto parts = split_service_parts (arg); if (parts.size () != 3) { usage (); return; @@ -160,7 +159,7 @@ lookup_one_sync (const Glib::ustring& arg) try { - targets = resolver->lookup_service (parts[0], parts[1], parts[2], + const auto targets = resolver->lookup_service (parts[0], parts[1], parts[2], cancellable); print_resolved_service (arg, targets); } @@ -207,13 +206,11 @@ lookup_thread (const Glib::ustring& arg) static void start_threaded_lookups (char **argv, int argc) { - int i; - - for (i = 0; i < argc; i++) - { - Glib::Threads::Thread::create (sigc::bind (sigc::ptr_fun (lookup_thread), - argv[i])); - } + for (auto i = 0; i < argc; i++) + { + Glib::Threads::Thread::create (sigc::bind (sigc::ptr_fun (lookup_thread), + argv[i])); + } } static void @@ -263,7 +260,7 @@ lookup_service_callback (Glib::RefPtr result, static void start_async_lookups (char **argv, int argc) { - for (int i = 0; i < argc; i++) + for (auto i = 0; i < argc; i++) { Glib::ustring arg (argv[i]); if (arg.find ('/') != std::string::npos) @@ -349,7 +346,7 @@ got_next_async (Glib::RefPtr result, { try { - Glib::RefPtr sockaddr = enumerator->next_finish (result); + const auto sockaddr = enumerator->next_finish (result); if (sockaddr) { print_connectable_sockaddr (sockaddr); @@ -382,7 +379,6 @@ do_connectable (const std::string& arg, gboolean synchronous) { std::vector parts; Glib::RefPtr connectable; - Glib::RefPtr enumerator; if (arg.find ('/') != std::string::npos) { @@ -400,7 +396,7 @@ do_connectable (const std::string& arg, gboolean synchronous) std::string host, port_str; guint16 port; - std::size_t pos = arg.find (':'); + const auto pos = arg.find (':'); if (pos != std::string::npos) { host = arg.substr (0, pos); @@ -412,15 +408,14 @@ do_connectable (const std::string& arg, gboolean synchronous) if (Gio::hostname_is_ip_address (host)) { - Glib::RefPtr addr = Gio::InetAddress::create (host); + const auto addr = Gio::InetAddress::create (host); connectable = Gio::InetSocketAddress::create (addr, port); } else connectable = Gio::NetworkAddress::create (arg, port); } - enumerator = connectable->enumerate (); - + const auto enumerator = connectable->enumerate (); if (synchronous) do_sync_connectable (enumerator); else @@ -450,8 +445,8 @@ async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr cancell int main (int argc, char **argv) { - bool synchronous = false; - bool use_connectable = false; + auto synchronous = false; + auto use_connectable = false; #ifdef G_OS_UNIX Glib::RefPtr chan; sigc::connection watch_conn; @@ -495,7 +490,7 @@ main (int argc, char **argv) signal (SIGINT, interrupted); chan = Glib::IOChannel::create_from_fd (cancel_fds[0]); - Glib::RefPtr source = chan->create_watch (Glib::IO_IN); + const auto source = chan->create_watch (Glib::IO_IN); watch_conn = source->connect (sigc::bind (sigc::ptr_fun (async_cancel), cancellable)); #endif diff --git a/examples/network/socket-client.cc b/examples/network/socket-client.cc index c7df51e8..e6ecaba0 100644 --- a/examples/network/socket-client.cc +++ b/examples/network/socket-client.cc @@ -154,7 +154,7 @@ main (int argc, if (argc != 2) { - const char* error_message = "Need to specify hostname"; + const auto error_message = "Need to specify hostname"; std::cerr << Glib::ustring::compose ("%1: %2\n", argv[0], error_message); return 1; } diff --git a/examples/network/socket-server.cc b/examples/network/socket-server.cc index b9e1a837..360c90bd 100644 --- a/examples/network/socket-server.cc +++ b/examples/network/socket-server.cc @@ -68,19 +68,16 @@ public: Glib::ustring socket_address_to_string (const Glib::RefPtr& address) { - Glib::RefPtr inet_address; - Glib::ustring str, res; - int port; - - Glib::RefPtr isockaddr = - Glib::RefPtr::cast_dynamic (address); - if (!isockaddr) - return Glib::ustring (); - inet_address = isockaddr->get_address (); - str = inet_address->to_string (); - port = isockaddr->get_port (); - res = Glib::ustring::compose ("%1:%2", str, port); - return res; + auto isockaddr = + Glib::RefPtr::cast_dynamic (address); + if (!isockaddr) + return Glib::ustring (); + + auto inet_address = isockaddr->get_address (); + auto str = inet_address->to_string (); + auto port = isockaddr->get_port (); + auto res = Glib::ustring::compose ("%1:%2", str, port); + return res; } static bool @@ -132,10 +129,7 @@ main (int argc, char *argv[]) { Glib::RefPtr socket, new_socket, recv_socket; - Glib::RefPtr src_address; Glib::RefPtr address; - Gio::SocketType socket_type; - Gio::SocketFamily socket_family; Glib::RefPtr cancellable; Gio::init (); @@ -161,8 +155,8 @@ main (int argc, loop = Glib::MainLoop::create (); - socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM; - socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4; + auto socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM; + auto socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4; try { socket = Gio::Socket::create (socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT); @@ -175,7 +169,7 @@ main (int argc, if (non_blocking) socket->set_blocking (false); - src_address = Gio::InetSocketAddress::create (Gio::InetAddress::create_any (socket_family), port); + auto src_address = Gio::InetSocketAddress::create (Gio::InetAddress::create_any (socket_family), port); try { socket->bind (src_address, !dont_reuse_address); } catch (const Gio::Error& error) { @@ -234,7 +228,6 @@ main (int argc, { gchar buffer[4096] = { }; gssize size; - gsize to_send; ensure_condition (recv_socket, "receive", cancellable, Glib::IO_IN); try { @@ -266,7 +259,7 @@ main (int argc, "-------------------------\n", (int)size, buffer); - to_send = size; + auto to_send = size; while (to_send > 0) { diff --git a/examples/regex/main.cc b/examples/regex/main.cc index cc128ab2..ed6ac567 100644 --- a/examples/regex/main.cc +++ b/examples/regex/main.cc @@ -24,7 +24,7 @@ int main(int, char**) Glib::init(); /* Reusing one regex pattern: */ - Glib::RefPtr regex = Glib::Regex::create("(a)?(b)"); + const auto regex = Glib::Regex::create("(a)?(b)"); std::cout << "Pattern=" << regex->get_pattern() << ", with string=abcd, result=" << std::boolalpha << regex->match("abcd") diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc index 1c1eb667..79ff64bc 100644 --- a/examples/thread/dispatcher.cc +++ b/examples/thread/dispatcher.cc @@ -134,7 +134,7 @@ void ThreadProgress::thread_function() { Glib::Rand rand; - for (int i = 0; i < ITERATIONS; ++i) + for (auto i = 0; i < ITERATIONS; ++i) { Glib::usleep(rand.get_int_range(2000, 20000)); diff --git a/examples/thread/thread.cc b/examples/thread/thread.cc index ad7cfebd..6fb546c1 100644 --- a/examples/thread/thread.cc +++ b/examples/thread/thread.cc @@ -36,7 +36,7 @@ void MessageQueue::producer() { Glib::Rand rand (1234); - for(int i = 0; i < 200; ++i) + for(auto i = 0; i < 200; ++i) { { Glib::Threads::Mutex::Lock lock (mutex_); diff --git a/examples/thread/threadpool.cc b/examples/thread/threadpool.cc index 632a77af..557997f4 100644 --- a/examples/thread/threadpool.cc +++ b/examples/thread/threadpool.cc @@ -15,7 +15,7 @@ void print_char(char c) { Glib::Rand rand; - for(int i = 0; i < 100; ++i) + for(auto i = 0; i < 100; ++i) { { Glib::Threads::Mutex::Lock lock (mutex); @@ -33,7 +33,7 @@ int main(int, char**) { Glib::ThreadPool pool (10); - for(char c = 'a'; c <= 'z'; ++c) + for(auto c = 'a'; c <= 'z'; ++c) { pool.push(sigc::bind<1>(sigc::ptr_fun(&print_char), c)); } -- cgit v1.2.1 From 84510ee07d9485c977a71f28b4bb3e33904aad25 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 14 Jul 2015 08:48:14 +0200 Subject: configure.ac: Use MM_AX_CXX_COMPILE_STDCXX_11 from mm-common. Instead of AX_CXX_COMPILE_STDCXX_11(). See bug #751432 --- build/ax_cxx_compile_stdcxx_11.m4 | 168 -------------------------------------- configure.ac | 2 +- 2 files changed, 1 insertion(+), 169 deletions(-) delete mode 100644 build/ax_cxx_compile_stdcxx_11.m4 diff --git a/build/ax_cxx_compile_stdcxx_11.m4 b/build/ax_cxx_compile_stdcxx_11.m4 deleted file mode 100644 index b83fac4c..00000000 --- a/build/ax_cxx_compile_stdcxx_11.m4 +++ /dev/null @@ -1,168 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXXFLAGS to enable support. -# -# The first argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The second argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline C++11 support is required and that the macro -# should error out if no mode with that support is found. If specified -# 'optional', then configuration proceeds regardless, after defining -# HAVE_CXX11 if and only if a supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - struct Base { - virtual void f() {} - }; - struct Child : public Base { - virtual void f() override {} - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c); - - auto d = a; - auto l = [](){}; - // Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable] - struct use_l { use_l() { l(); } }; - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this - namespace test_template_alias_sfinae { - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { - func(0); - } - } -]]) - -AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl - m4_if([$1], [], [], - [$1], [ext], [], - [$1], [noext], [], - [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl - m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], - [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], - [$2], [optional], [ax_cxx_compile_cxx11_required=false], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++11 features by default, - ax_cv_cxx_compile_cxx11, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [ax_cv_cxx_compile_cxx11=yes], - [ax_cv_cxx_compile_cxx11=no])]) - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes - fi - - m4_if([$1], [noext], [], [dnl - if test x$ac_success = xno; then - for switch in -std=gnu++11 -std=gnu++0x; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi]) - - m4_if([$1], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - for switch in -std=c++11 -std=c++0x +std=c++11; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx11_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) - fi - else - if test x$ac_success = xno; then - HAVE_CXX11=0 - AC_MSG_NOTICE([No compiler with C++11 support was found]) - else - HAVE_CXX11=1 - AC_DEFINE(HAVE_CXX11,1, - [define if the compiler supports basic C++11 syntax]) - fi - - AC_SUBST(HAVE_CXX11) - fi -]) - diff --git a/configure.ac b/configure.ac index f690a520..3ddef78e 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ MM_CONFIG_DOCTOOL_DIR([docs]) AC_SUBST([LIBGLIBMM_SO_VERSION], [4:0:3]) AC_PROG_CXX -AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) +MM_AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) AC_DISABLE_STATIC LT_INIT([win32-dll]) -- cgit v1.2.1 From 6638238e1453ecb4334ef10bae2341538e5b6ddf Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 11:43:52 +0200 Subject: C++11: Use the override keyword. --- examples/markup/parser.cc | 10 +++++----- examples/options/main.cc | 7 ++++--- tests/glibmm_interface_implementation/main.cc | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/markup/parser.cc b/examples/markup/parser.cc index fafcc2f5..b954a671 100644 --- a/examples/markup/parser.cc +++ b/examples/markup/parser.cc @@ -54,14 +54,14 @@ public: virtual ~DumpParser(); protected: - virtual void on_start_element(Glib::Markup::ParseContext& context, + void on_start_element(Glib::Markup::ParseContext& context, const Glib::ustring& element_name, - const AttributeMap& attributes); + const AttributeMap& attributes) override; - virtual void on_end_element(Glib::Markup::ParseContext& context, - const Glib::ustring& element_name); + void on_end_element(Glib::Markup::ParseContext& context, + const Glib::ustring& element_name) override; - virtual void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text); + void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text) override; private: int parse_depth_; diff --git a/examples/options/main.cc b/examples/options/main.cc index baa36150..d693d09d 100644 --- a/examples/options/main.cc +++ b/examples/options/main.cc @@ -25,9 +25,10 @@ class ExampleOptionGroup : public Glib::OptionGroup public: ExampleOptionGroup(); - virtual bool on_pre_parse(Glib::OptionContext& context, Glib::OptionGroup& group); - virtual bool on_post_parse(Glib::OptionContext& context, Glib::OptionGroup& group); - virtual void on_error(Glib::OptionContext& context, Glib::OptionGroup& group); +private: + bool on_pre_parse(Glib::OptionContext& context, Glib::OptionGroup& group) override; + bool on_post_parse(Glib::OptionContext& context, Glib::OptionGroup& group) override; + void on_error(Glib::OptionContext& context, Glib::OptionGroup& group) override; bool on_option_arg_string(const Glib::ustring& option_name, const Glib::ustring& value, bool has_value); diff --git a/tests/glibmm_interface_implementation/main.cc b/tests/glibmm_interface_implementation/main.cc index ec0ea938..c748215f 100644 --- a/tests/glibmm_interface_implementation/main.cc +++ b/tests/glibmm_interface_implementation/main.cc @@ -20,9 +20,9 @@ public: protected: //Implement vfuncs: - virtual Glib::ustring get_name_vfunc() const; - virtual Glib::VariantType get_state_type_vfunc() const; - virtual Glib::VariantBase get_state_hint_vfunc() const; + Glib::ustring get_name_vfunc() const override; + Glib::VariantType get_state_type_vfunc() const override; + Glib::VariantBase get_state_hint_vfunc() const override; }; CustomAction::CustomAction() -- cgit v1.2.1 From 90df091409fd5addf9d75c4d637d39e0e67e115a Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 11:44:54 +0200 Subject: configure.ac: Use -Wsuggest-override and -Wshadow with --enable-warnings=fatal. Although -Wsuggest-override isn't actually available yet in my version of g++ (4.9.2). --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3ddef78e..a2b99cfb 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,7 @@ GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING # Evaluate the --enable-warnings=level option. MM_ARG_ENABLE_WARNINGS([GLIBMM_WXXFLAGS], [-Wall], - [-pedantic -Wall -Wextra -Wformat-security -Wno-long-long], + [-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override -Wshadow -Wno-long-long], [G SIGCXX]) # Offer the ability to omit some API from the library, -- cgit v1.2.1 From 254f5b93e08e45cd32ccdbb0f4a31c433ece9d08 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 11:48:55 +0200 Subject: Avoid shadowed variables. Because this generally invites programming errors, though I am less concerned about shadowing of method names by parameter or variable names, which requires some tedious parameter renaming. In MatchInfo::set_gobject() the confusion between take_ownership and this.take_ownership does seem to have caused a programming error, hopefully now corrected. --- gio/src/dbussubtreevtable.ccg | 10 +++++----- gio/src/fileinfo.hg | 4 ++-- glib/glibmm/error.cc | 12 ++++++------ glib/glibmm/error.h | 6 +++--- glib/glibmm/streamiochannel.cc | 24 ++++++++++++------------ glib/src/datetime.hg | 2 +- glib/src/iochannel.hg | 4 ++-- glib/src/regex.ccg | 10 +++++----- glib/src/regex.hg | 6 +++--- tests/giomm_tls_client/main.cc | 2 -- tests/glibmm_btree/main.cc | 1 - tests/glibmm_valuearray/main.cc | 18 +++++++++--------- tools/extra_defs_gen/generate_extra_defs.cc | 6 +++--- 13 files changed, 51 insertions(+), 54 deletions(-) diff --git a/gio/src/dbussubtreevtable.ccg b/gio/src/dbussubtreevtable.ccg index a2481012..5e726cc5 100644 --- a/gio/src/dbussubtreevtable.ccg +++ b/gio/src/dbussubtreevtable.ccg @@ -105,21 +105,21 @@ static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback( const char* interface_name, const char* node, void** out_user_data, void* user_data) { - Gio::DBus::SubtreeVTable* vtable = + Gio::DBus::SubtreeVTable* vtable_subtree = static_cast(user_data); Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot = - vtable->get_slot_dispatch(); + vtable_subtree->get_slot_dispatch(); try { - const Gio::DBus::InterfaceVTable* vtable = + const Gio::DBus::InterfaceVTable* vtable_iface = (*the_slot)(Glib::wrap(connection, true), sender, object_path, interface_name, (node ? node : "")); - *out_user_data = const_cast(vtable); + *out_user_data = const_cast(vtable_iface); - return vtable->gobj(); + return vtable_iface->gobj(); } catch(...) { diff --git a/gio/src/fileinfo.hg b/gio/src/fileinfo.hg index d10eb685..b14a6013 100644 --- a/gio/src/fileinfo.hg +++ b/gio/src/fileinfo.hg @@ -200,8 +200,8 @@ public: // helper setters _WRAP_METHOD(void set_file_type(FileType type), g_file_info_set_file_type) - _WRAP_METHOD(void set_is_hidden(bool is_hidden = true), g_file_info_set_is_hidden) - _WRAP_METHOD(void set_is_symlink(bool is_symlink = true), g_file_info_set_is_symlink) + _WRAP_METHOD(void set_is_hidden(bool hidden = true), g_file_info_set_is_hidden) + _WRAP_METHOD(void set_is_symlink(bool symlink = true), g_file_info_set_is_symlink) _WRAP_METHOD(void set_name(const std::string& name), g_file_info_set_name) //TODO: This should take a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4 diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index 57844142..d55cb434 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -42,9 +42,9 @@ Error::Error() gobject_ (0) {} -Error::Error(GQuark domain, int code, const Glib::ustring& message) +Error::Error(GQuark error_domain, int error_code, const Glib::ustring& message) : - gobject_ (g_error_new_literal(domain, code, message.c_str())) + gobject_ (g_error_new_literal(error_domain, error_code, message.c_str())) {} Error::Error(GError* gobject, bool take_copy) @@ -103,9 +103,9 @@ Glib::ustring Error::what() const return gobject_->message; } -bool Error::matches(GQuark domain, int code) const +bool Error::matches(GQuark error_domain, int error_code) const { - return g_error_matches(gobject_, domain, code); + return g_error_matches(gobject_, error_domain, error_code); } GError* Error::gobj() @@ -146,11 +146,11 @@ void Error::register_cleanup() } // static -void Error::register_domain(GQuark domain, Error::ThrowFunc throw_func) +void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func) { g_assert(throw_func_table != 0); - (*throw_func_table)[domain] = throw_func; + (*throw_func_table)[error_domain] = throw_func; } // static, noreturn diff --git a/glib/glibmm/error.h b/glib/glibmm/error.h index b68df859..d2701da4 100644 --- a/glib/glibmm/error.h +++ b/glib/glibmm/error.h @@ -32,7 +32,7 @@ class Error : public Glib::Exception { public: Error(); - Error(GQuark domain, int code, const Glib::ustring& message); + Error(GQuark error_domain, int error_code, const Glib::ustring& message); explicit Error(GError* gobject, bool take_copy = false); Error(const Error& other); @@ -44,7 +44,7 @@ public: int code() const; virtual Glib::ustring what() const; - bool matches(GQuark domain, int code) const; + bool matches(GQuark error_domain, int error_code) const; GError* gobj(); const GError* gobj() const; @@ -57,7 +57,7 @@ public: static void register_init(); static void register_cleanup(); - static void register_domain(GQuark domain, ThrowFunc throw_func); + static void register_domain(GQuark error_domain, ThrowFunc throw_func); static void throw_exception(GError* gobject) G_GNUC_NORETURN; diff --git a/glib/glibmm/streamiochannel.cc b/glib/glibmm/streamiochannel.cc index e5201db7..8a1b10a7 100644 --- a/glib/glibmm/streamiochannel.cc +++ b/glib/glibmm/streamiochannel.cc @@ -133,23 +133,23 @@ IOStatus StreamIOChannel::close_vfunc() { bool failed = false; - if(std::fstream *const stream = dynamic_cast(stream_in_)) + if(std::fstream *const fstream = dynamic_cast(stream_in_)) { - stream->clear(); - stream->close(); - failed = stream->fail(); + fstream->clear(); + fstream->close(); + failed = fstream->fail(); } - else if(std::ifstream *const stream = dynamic_cast(stream_in_)) + else if(std::ifstream *const ifstream = dynamic_cast(stream_in_)) { - stream->clear(); - stream->close(); - failed = stream->fail(); + ifstream->clear(); + ifstream->close(); + failed = ifstream->fail(); } - else if(std::ofstream *const stream = dynamic_cast(stream_out_)) + else if(std::ofstream *const ofstream = dynamic_cast(stream_out_)) { - stream->clear(); - stream->close(); - failed = stream->fail(); + ofstream->clear(); + ofstream->close(); + failed = ofstream->fail(); } else { diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg index a9c42211..82bcd56f 100644 --- a/glib/src/datetime.hg +++ b/glib/src/datetime.hg @@ -149,7 +149,7 @@ public: _WRAP_METHOD(DateTime to_timezone(const TimeZone& tz) const, g_date_time_to_timezone) _WRAP_METHOD(DateTime to_local() const, g_date_time_to_local) _WRAP_METHOD(DateTime to_utc() const, g_date_time_to_utc) - _WRAP_METHOD(Glib::ustring format(const Glib::ustring& format) const, g_date_time_format) + _WRAP_METHOD(Glib::ustring format(const Glib::ustring& format_str) const, g_date_time_format) }; } // namespace Glib diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg index 3c3d5309..93bf749a 100644 --- a/glib/src/iochannel.hg +++ b/glib/src/iochannel.hg @@ -269,11 +269,11 @@ public: * Any pending data to be written will be flushed if @a flush is true. * The channel will not be freed until the last reference is dropped. * Accessing the channel after closing it is considered an error. - * @param flush Whether to flush() pending data before closing the channel. + * @param flush_pending Whether to flush() pending data before closing the channel. * @return The status of the operation. * @throw Glib::IOChannelError */ - _WRAP_METHOD(IOStatus close(bool flush = true), g_io_channel_shutdown, errthrow) + _WRAP_METHOD(IOStatus close(bool flush_pending = true), g_io_channel_shutdown, errthrow) /** Get the IOChannel internal buffer size. * @return The buffer size. diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index af91d4ab..ba5b3938 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -242,19 +242,19 @@ MatchInfo::MatchInfo() { } -MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_ownership) +MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_the_ownership) : gobject_(castitem), - take_ownership(take_ownership) + take_ownership(take_the_ownership) { } -void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_ownership) +void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_the_ownership) { - if(gobject_ && take_ownership) + if(gobject_ && this->take_ownership) g_match_info_free(gobject_); gobject_ = castitem; - this->take_ownership = take_ownership; + this->take_ownership = take_the_ownership; } MatchInfo::~MatchInfo() diff --git a/glib/src/regex.hg b/glib/src/regex.hg index 1b0d5e85..f35af4a0 100644 --- a/glib/src/regex.hg +++ b/glib/src/regex.hg @@ -222,10 +222,10 @@ public: /** C object constructor. * @param castitem The C object. - * @param take_ownership Whether to destroy the C object with the wrapper or + * @param take_the_ownership Whether to destroy the C object with the wrapper or * not. */ - explicit MatchInfo(GMatchInfo* castitem, bool take_ownership = true); + explicit MatchInfo(GMatchInfo* castitem, bool take_the_ownership = true); //TODO: Rename to take_ownership when we can rename the member variable. /// Destructor. virtual ~MatchInfo(); @@ -272,7 +272,7 @@ public: protected: GMatchInfo* gobject_; // The C object. - bool take_ownership; // Bool signaling ownership. + bool take_ownership; // Bool signaling ownership. //TODO: Give this a _ suffix when we can break API. protected: // So that Glib::Regex::match() can set the C object. diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc index a14fe9fe..a8099b72 100644 --- a/tests/giomm_tls_client/main.cc +++ b/tests/giomm_tls_client/main.cc @@ -120,8 +120,6 @@ int main(int, char**) address->get_address()->to_string() << ":" << address->get_port() << "." << std::endl; - Glib::RefPtr tls_connection; - try { Glib::RefPtr tls_connection = diff --git a/tests/glibmm_btree/main.cc b/tests/glibmm_btree/main.cc index c678c37a..8ee1114b 100644 --- a/tests/glibmm_btree/main.cc +++ b/tests/glibmm_btree/main.cc @@ -74,7 +74,6 @@ my_p_key_compare(const type_p_key_value& key_a, const type_p_key_value& key_b) int main() { - type_key_value::const_iterator i; Glib::RefPtr< Glib::BalancedTree > tree = Glib::BalancedTree::create(); for (type_key_value::size_type i = 0; i < str.size(); ++i) diff --git a/tests/glibmm_valuearray/main.cc b/tests/glibmm_valuearray/main.cc index 2139d436..62b19ede 100644 --- a/tests/glibmm_valuearray/main.cc +++ b/tests/glibmm_valuearray/main.cc @@ -41,23 +41,23 @@ int on_compare(const Glib::ValueBase& v1, const Glib::ValueBase& v2) int main(int, char**) { - const int VALUES = 10; + const int VALUES_COUNT = 10; Glib::init(); - Glib::Value value[VALUES]; + Glib::Value values[VALUES_COUNT]; Glib::ValueArray array; - for(int i = 0; i < VALUES; i++) + for(int i = 0; i < VALUES_COUNT; i++) { - value[i].init(Glib::Value::value_type()); - value[i].set(i + 1); // (i + 1) ==> Set to natural counting numbers. - array.prepend(value[i]); + values[i].init(Glib::Value::value_type()); + values[i].set(i + 1); // (i + 1) ==> Set to natural counting numbers. + array.prepend(values[i]); } ostr << "Array members before sorting:" << std::endl; - for(int i = 0; i < VALUES; i++) + for(int i = 0; i < VALUES_COUNT; i++) { Glib::ValueBase value; @@ -75,12 +75,12 @@ int main(int, char**) ostr << std::endl; // End of line for list of array elements. // Sort array and remove last element: - array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES - 1); + array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES_COUNT - 1); ostr << "Array members after sorting without last element:" << std::endl; - for(int i = 0; i < VALUES - 1; i++) + for(int i = 0; i < VALUES_COUNT - 1; i++) { Glib::ValueBase value; diff --git a/tools/extra_defs_gen/generate_extra_defs.cc b/tools/extra_defs_gen/generate_extra_defs.cc index f209348c..8477f056 100644 --- a/tools/extra_defs_gen/generate_extra_defs.cc +++ b/tools/extra_defs_gen/generate_extra_defs.cc @@ -220,13 +220,13 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) { strResult += " (parameters\n"; - for(unsigned i = 0; i < signalQuery.n_params; i++) + for(unsigned j = 0; j < signalQuery.n_params; j++) { - GType typeParamMangled = pParameters[i]; + GType typeParamMangled = pParameters[j]; //Parameter name: //We can't get the real parameter name from the GObject system. It's not registered with g_signal_new(). - gchar* pchNum = g_strdup_printf("%d", i); + gchar* pchNum = g_strdup_printf("%d", j); std::string strParamName = "p" + std::string(pchNum); g_free(pchNum); pchNum = 0; -- cgit v1.2.1 From 40f91e93e079a59d6e39bf0f7f2012357d3ee763 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 12:45:22 +0200 Subject: C++11: Some use of the auto keyword. --- gio/src/action.hg | 8 ++++---- gio/src/actiongroup.hg | 8 ++++---- gio/src/actionmap.ccg | 22 ++++++++++----------- gio/src/application.ccg | 26 ++++++++++++------------- gio/src/asyncinitable.ccg | 20 +++++++++---------- gio/src/asyncresult.ccg | 4 ++-- gio/src/bufferedinputstream.ccg | 4 ++-- gio/src/cancellable.ccg | 2 +- gio/src/datainputstream.ccg | 6 +++--- gio/src/dbusaddress.ccg | 4 ++-- gio/src/dbusconnection.ccg | 30 ++++++++++++++--------------- gio/src/dbusownname.ccg | 16 ++++++++-------- gio/src/dbusproxy.ccg | 8 ++++---- gio/src/dbuswatchname.ccg | 14 +++++++------- gio/src/drive.ccg | 20 +++++++++---------- gio/src/file.ccg | 18 +++++++++--------- gio/src/fileattributeinfolist.ccg | 2 +- gio/src/fileenumerator.ccg | 8 ++++---- gio/src/fileinputstream.ccg | 8 ++++---- gio/src/fileiostream.ccg | 8 ++++---- gio/src/fileoutputstream.ccg | 8 ++++---- gio/src/icon.ccg | 2 +- gio/src/inputstream.ccg | 20 +++++++++---------- gio/src/iostream.ccg | 8 ++++---- gio/src/loadableicon.ccg | 4 ++-- gio/src/memoryinputstream.ccg | 6 +++--- gio/src/mount.ccg | 24 +++++++++++------------ gio/src/networkaddress.ccg | 2 +- gio/src/networkmonitor.ccg | 2 +- gio/src/outputstream.ccg | 20 +++++++++---------- gio/src/proxy.ccg | 4 ++-- gio/src/proxyresolver.ccg | 4 ++-- gio/src/resolver.ccg | 16 ++++++++-------- gio/src/settings.ccg | 6 +++--- gio/src/socket.ccg | 8 ++++---- gio/src/socketaddressenumerator.ccg | 2 +- gio/src/socketclient.ccg | 16 ++++++++-------- gio/src/socketconnection.ccg | 4 ++-- gio/src/socketlistener.ccg | 34 ++++++++++++++++----------------- gio/src/unixconnection.ccg | 8 ++++---- gio/src/unixfdlist.ccg | 4 ++-- gio/src/unixfdmessage.ccg | 2 +- gio/src/volume.ccg | 12 ++++++------ glib/src/date.ccg | 4 ++-- glib/src/fileutils.ccg | 6 +++--- glib/src/iochannel.ccg | 28 +++++++++++++-------------- glib/src/optioncontext.ccg | 4 ++-- glib/src/optiongroup.ccg | 38 ++++++++++++++++++------------------- glib/src/regex.ccg | 8 ++++---- glib/src/spawn.ccg | 12 ++++++------ glib/src/thread.ccg | 10 +++++----- glib/src/threads.ccg | 6 +++--- glib/src/valuearray.ccg | 2 +- glib/src/varianttype.ccg | 4 ++-- 54 files changed, 287 insertions(+), 287 deletions(-) diff --git a/gio/src/action.hg b/gio/src/action.hg index eca98122..1b10876e 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -243,8 +243,8 @@ void Action::get_state(T_Value& value) const g_return_if_fail( g_variant_type_equal(g_action_get_state_type(const_cast(gobj())), type_glib_variant::variant_type().gobj())); - const Glib::VariantBase variantBase = get_state_variant(); - const type_glib_variant variantDerived = variantBase.cast_dynamic(variantBase); + const auto variantBase = get_state_variant(); + const auto variantDerived = variantBase.cast_dynamic(variantBase); value = variantDerived.get(); } @@ -255,13 +255,13 @@ void Action::get_state_hint(T_Value& value) const typedef Glib::Variant type_glib_variant; - const Glib::VariantBase variantBase = get_state_hint_variant(); + const auto variantBase = get_state_hint_variant(); // We can't check the type (a range) that will be returned before getting the range hint. g_return_if_fail( variantBase.is_of_type(type_glib_variant::variant_type()) ); - const type_glib_variant variantDerived = variantBase.cast_dynamic(variantBase); + const auto variantDerived = variantBase.cast_dynamic(variantBase); value = variantDerived.get(); } diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg index 71385be6..a1d5d333 100644 --- a/gio/src/actiongroup.hg +++ b/gio/src/actiongroup.hg @@ -169,10 +169,10 @@ void ActionGroup::get_action_state(const Glib::ustring& action_name, T_Value& va g_return_if_fail( g_variant_type_equal(g_action_group_get_action_state_type(const_cast(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj())); - const Glib::VariantBase variantBase = get_action_state_variant(action_name); + const auto variantBase = get_action_state_variant(action_name); //TODO: Add a bool return instead of letting a std::bad_cast from the cast_dynamic() be thrown up to the caller? - const type_glib_variant variantDerived = variantBase.cast_dynamic(variantBase); + const auto variantDerived = variantBase.cast_dynamic(variantBase); value = variantDerived.get(); } @@ -183,13 +183,13 @@ void ActionGroup::get_action_state_hint(const Glib::ustring& action_name, T_Valu typedef Glib::Variant type_glib_variant; - const Glib::VariantBase variantBase = get_action_state_hint_variant(action_name); + const auto variantBase = get_action_state_hint_variant(action_name); // We can't check the type (a range) that will be returned before getting the range hint. g_return_if_fail( variantBase.is_of_type(type_glib_variant::variant_type()) ); - const type_glib_variant variantDerived = variantBase.cast_dynamic(variantBase); + const auto variantDerived = variantBase.cast_dynamic(variantBase); value = variantDerived.get(); } diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg index 432b65f8..a294bddc 100644 --- a/gio/src/actionmap.ccg +++ b/gio/src/actionmap.ccg @@ -25,21 +25,21 @@ namespace Gio Glib::RefPtr ActionMap::add_action(const Glib::ustring& name) { - Glib::RefPtr action = SimpleAction::create(name); + auto action = SimpleAction::create(name); add_action(action); return action; } Glib::RefPtr ActionMap::add_action_with_parameter(const Glib::ustring& name, const ActivateWithParameterSlot& slot) { - Glib::RefPtr action = add_action(name); + auto action = add_action(name); action->signal_activate().connect(slot); return action; } Glib::RefPtr ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot) { - Glib::RefPtr action = add_action(name); + auto action = add_action(name); action->signal_activate().connect( sigc::hide(slot)); return action; @@ -48,7 +48,7 @@ Glib::RefPtr ActionMap::add_action(const Glib::ustring& name, cons Glib::RefPtr ActionMap::add_action_bool(const Glib::ustring& name, bool state) { - Glib::RefPtr action = SimpleAction::create_bool(name, state); + auto action = SimpleAction::create_bool(name, state); add_action(action); return action; } @@ -56,7 +56,7 @@ Glib::RefPtr ActionMap::add_action_bool(const Glib::ustring& name, //TODO: Use a slot that takes a bool? Glib::RefPtr ActionMap::add_action_bool(const Glib::ustring& name, const ActivateSlot& slot, bool state) { - Glib::RefPtr action = add_action_bool(name, state); + auto action = add_action_bool(name, state); action->signal_activate().connect( sigc::hide(slot)); return action; @@ -65,7 +65,7 @@ Glib::RefPtr ActionMap::add_action_bool(const Glib::ustring& name, //TODO: Use a slot that takes a string? Glib::RefPtr ActionMap::add_action_radio_string(const Glib::ustring& name, const Glib::ustring& state) { - Glib::RefPtr action = SimpleAction::create_radio_string(name, state); + auto action = SimpleAction::create_radio_string(name, state); add_action(action); return action; } @@ -79,7 +79,7 @@ static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio //TODO: This syntax is odd: const Glib::Variant variantDerived = parameter.cast_dynamic< Glib::Variant >(parameter); - const Glib::ustring str = variantDerived.get(); + const auto str = variantDerived.get(); slot(str); } @@ -87,7 +87,7 @@ static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio Glib::RefPtr ActionMap::add_action_radio_string(const Glib::ustring& name, const ActivateWithStringParameterSlot& slot, const Glib::ustring& state) { - Glib::RefPtr action = add_action_radio_string(name, state); + auto action = add_action_radio_string(name, state); action->signal_activate().connect( sigc::bind(sigc::ptr_fun(&on_action_radio_string), slot)); return action; @@ -101,7 +101,7 @@ static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::A //TODO: This syntax is odd: const Glib::Variant variantDerived = parameter.cast_dynamic< Glib::Variant >(parameter); - const int str = variantDerived.get(); + const auto str = variantDerived.get(); slot(str); } @@ -110,14 +110,14 @@ static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::A //TODO: Use a slot that takes an integer? Glib::RefPtr ActionMap::add_action_radio_integer(const Glib::ustring& name, gint32 state) { - Glib::RefPtr action = SimpleAction::create_radio_integer(name, state); + auto action = SimpleAction::create_radio_integer(name, state); add_action(action); return action; } Glib::RefPtr ActionMap::add_action_radio_integer(const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state) { - Glib::RefPtr action = add_action_radio_integer(name, state); + auto action = add_action_radio_integer(name, state); action->signal_activate().connect( sigc::bind(sigc::ptr_fun(&on_action_radio_int), slot)); return action; diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 1952abae..59f17dd7 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -68,7 +68,7 @@ static void Application_signal_open_callback(GApplication* self, GFile** files, vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) @@ -101,7 +101,7 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile** vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) @@ -202,13 +202,13 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* if (option_name[1] == '-') { // Long option name. - const Glib::ustring long_option_name = Glib::ustring(option_name+2); + const auto long_option_name = Glib::ustring(option_name+2); iterFind = option_arg_callback_data.find(long_option_name); } else { // Short option name. - const gchar short_option_name = option_name[1]; + const auto short_option_name = option_name[1]; for (iterFind = option_arg_callback_data.begin(); iterFind != option_arg_callback_data.end(); ++iterFind) { @@ -230,14 +230,14 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* { if (option_arg->is_filename_option()) { - const Glib::OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename(); + const auto the_slot = option_arg->get_slot_filename(); lock.release(); const std::string cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } else { - const Glib::OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string(); + const auto the_slot = option_arg->get_slot_string(); lock.release(); const Glib::ustring cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); @@ -303,7 +303,7 @@ void Application::unset_default() void Application_Class::open_callback(GApplication* self, GFile** files, gint n_files, const gchar *hint) { - Glib::ObjectBase *const obj_base = static_cast( + const auto obj_base = static_cast( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -314,7 +314,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast(obj_base); + const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -325,7 +325,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); obj->on_open(vec_files, hint_str); return; @@ -337,7 +337,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, } } - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). ); @@ -353,7 +353,7 @@ Glib::SignalProxy2< void, const Application::type_vec_files&, const Glib::ustrin void Gio::Application::on_open(const Application::type_vec_files& files, const Glib::ustring& hint) { - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). ); @@ -397,7 +397,7 @@ void Application::add_main_option_entry( if (iterFind != option_arg_callback_data.end()) return; // Ignore duplicates - OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot); + auto callback_data = new OptionArgCallbackData(this, short_name, slot); option_arg_callback_data[long_name] = callback_data; lock.release(); @@ -415,7 +415,7 @@ void Application::add_main_option_entry_filename( if (iterFind != option_arg_callback_data.end()) return; // Ignore duplicates - OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot); + auto callback_data = new OptionArgCallbackData(this, short_name, slot); option_arg_callback_data[long_name] = callback_data; lock.release(); diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 39d3f02e..3867ef0e 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -30,7 +30,7 @@ void AsyncInitable::init_async(const SlotAsyncReady& slot, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_async_initable_init_async(gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); @@ -41,7 +41,7 @@ void AsyncInitable::init_async(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); + auto slot_copy = new SlotAsyncReady(slot); g_async_initable_init_async(gobj(), io_priority, 0, &SignalProxy_async_callback, slot_copy); @@ -51,7 +51,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { - Glib::ObjectBase *const obj_base = static_cast( + const auto obj_base = static_cast( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -61,7 +61,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, // being overridden: if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast(obj_base); + const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -82,7 +82,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, } } - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. ) ); @@ -95,7 +95,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge void Gio::AsyncInitable::init_async_vfunc(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable, int io_priority) { - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. ) ); @@ -110,7 +110,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) / gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, GAsyncResult* res, GError** error) { - Glib::ObjectBase *const obj_base = static_cast( + const auto obj_base = static_cast( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -120,7 +120,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, // being overridden: if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast(obj_base); + const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -135,7 +135,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, } } - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. ) ); @@ -150,7 +150,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge } bool Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr& res) { - BaseClassType *const base = static_cast( + const auto base = static_cast( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. ) ); diff --git a/gio/src/asyncresult.ccg b/gio/src/asyncresult.ccg index 9697606e..b336f181 100644 --- a/gio/src/asyncresult.ccg +++ b/gio/src/asyncresult.ccg @@ -31,8 +31,8 @@ static GObject* unwrap_objectbase_custom(const Glib::RefPtr& c Glib::RefPtr AsyncResult::get_source_object_base() { - GObject* cobj = g_async_result_get_source_object(gobj()); - ObjectBase* cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj); + auto cobj = g_async_result_get_source_object(gobj()); + auto cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj); return Glib::RefPtr(cppobj); //g_async_result_get_source_object() gives us a ref, unusually. //TODO: For some reason this fails: Glib::wrap(cobj); } diff --git a/gio/src/bufferedinputstream.ccg b/gio/src/bufferedinputstream.ccg index b015f9a9..af74ea92 100644 --- a/gio/src/bufferedinputstream.ccg +++ b/gio/src/bufferedinputstream.ccg @@ -36,7 +36,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_buffered_input_stream_fill_async(gobj(), count, @@ -53,7 +53,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_buffered_input_stream_fill_async(gobj(), count, diff --git a/gio/src/cancellable.ccg b/gio/src/cancellable.ccg index a266e7e5..787990e1 100644 --- a/gio/src/cancellable.ccg +++ b/gio/src/cancellable.ccg @@ -43,7 +43,7 @@ void slot_cancelled_proxy(GCancellable * /*cancellable*/, gpointer data) gulong Cancellable::connect(const SlotCancelledCallback& slot) { - SlotCancelledCallback* slot_copy = new SlotCancelledCallback(slot); + auto slot_copy = new SlotCancelledCallback(slot); return g_cancellable_connect (gobj(), G_CALLBACK(slot_cancelled_proxy), slot_copy, diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg index 485c7b1e..0b4b4691 100644 --- a/gio/src/datainputstream.ccg +++ b/gio/src/datainputstream.ccg @@ -65,7 +65,7 @@ void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::Re // 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); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_line_async(gobj(), io_priority, @@ -138,7 +138,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot // 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); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), io_priority, @@ -215,7 +215,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA // 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); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_upto_async(gobj(), stop_chars.c_str(), -1, /* null-terminated */ io_priority, diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index 2fe11d9b..2bcb7d7c 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -47,14 +47,14 @@ bool is_supported(const std::string& address) void get_stream(const std::string& address, const SlotAsyncReady slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_address_get_stream(address.c_str(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void get_stream(const std::string& address, const SlotAsyncReady slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_address_get_stream(address.c_str(), 0, &SignalProxy_async_callback, slot_copy); } diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index f2f60355..31020505 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -68,7 +68,7 @@ static GDBusMessage* DBusConnection_Message_Filter_giomm_callback( try { - Glib::RefPtr result = (*the_slot)( + auto result = (*the_slot)( Glib::wrap(connection, true), Glib::wrap(message, true), static_cast(incoming)); return (result) ? result->gobj_copy() : 0; @@ -477,7 +477,7 @@ Glib::RefPtr Connection::create_for_address_sync( void Connection::get(BusType bus_type, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_bus_get(static_cast(bus_type), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); @@ -486,7 +486,7 @@ void Connection::get(BusType bus_type, const SlotAsyncReady& slot, //static void Connection::get(BusType bus_type, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_bus_get(static_cast(bus_type), 0, &SignalProxy_async_callback, slot_copy); @@ -499,7 +499,7 @@ void Connection::close() void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_close(gobj(), Glib::unwrap(cancellable), @@ -509,7 +509,7 @@ void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_flush(gobj(), Glib::unwrap(cancellable), @@ -534,7 +534,7 @@ void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr& message, void Connection::send_message_with_reply(const Glib::RefPtr& message, int timeout_msec,const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), static_cast(message->get_flags()), @@ -571,7 +571,7 @@ void Connection::send_message_with_reply(const Glib::RefPtr& message, i void Connection::send_message_with_reply(const Glib::RefPtr& message, int timeout_msec,const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), static_cast(message->get_flags()), @@ -635,7 +635,7 @@ void Connection::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -659,7 +659,7 @@ void Connection::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -737,7 +737,7 @@ void Connection::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); 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(), @@ -762,7 +762,7 @@ void Connection::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); 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(), @@ -805,7 +805,7 @@ guint Connection::signal_subscribe( const Glib::ustring& arg0, SignalFlags flags) { - SlotSignal* slot_copy = new SlotSignal(slot); + auto slot_copy = new SlotSignal(slot); return g_dbus_connection_signal_subscribe(gobj(), sender.c_str(), interface_name.c_str(), member.c_str(), object_path.c_str(), arg0.c_str(), @@ -816,7 +816,7 @@ guint Connection::signal_subscribe( guint Connection::add_filter(const SlotMessageFilter& slot) { - SlotMessageFilter* slot_copy = new SlotMessageFilter(slot); + auto slot_copy = new SlotMessageFilter(slot); return g_dbus_connection_add_filter(gobj(), &DBusConnection_Message_Filter_giomm_callback, slot_copy, diff --git a/gio/src/dbusownname.ccg b/gio/src/dbusownname.ccg index d295247d..49de2042 100644 --- a/gio/src/dbusownname.ccg +++ b/gio/src/dbusownname.ccg @@ -37,8 +37,8 @@ extern "C" static void Bus_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast(data); - Gio::DBus::SlotBusAcquired* the_slot = slots->bus_acquired_slot; + auto slots = static_cast(data); + auto the_slot = slots->bus_acquired_slot; try { @@ -53,8 +53,8 @@ static void Bus_Acquired_giomm_callback(GDBusConnection* connection, static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast(data); - Gio::DBus::SlotNameAcquired* the_slot = slots->name_acquired_slot; + auto slots = static_cast(data); + auto the_slot = slots->name_acquired_slot; try { @@ -69,8 +69,8 @@ static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast(data); - Gio::DBus::SlotNameLost* the_slot = slots->name_lost_slot; + auto slots = static_cast(data); + auto the_slot = slots->name_lost_slot; try { @@ -84,7 +84,7 @@ static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, static void Bus_Own_Name_giomm_callback_destroy(void* data) { - OwnSlots* slots = static_cast(data); + auto slots = static_cast(data); if(slots->bus_acquired_slot) delete slots->bus_acquired_slot; @@ -118,7 +118,7 @@ guint own_name( BusNameOwnerFlags flags ) { - struct OwnSlots* slots = new OwnSlots; + auto slots = new OwnSlots; // Make copies of the slots which will be deleted on destroy notification. slots->bus_acquired_slot = new SlotBusAcquired(bus_acquired_slot); diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index 3c93d4b1..25014f6d 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -296,7 +296,7 @@ void Proxy::call(const Glib::ustring& method_name, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast(parameters.gobj()), @@ -314,7 +314,7 @@ void Proxy::call(const Glib::ustring& method_name, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast(parameters.gobj()), @@ -378,7 +378,7 @@ void Proxy::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast(parameters.gobj()), @@ -398,7 +398,7 @@ void Proxy::call( // 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); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast(parameters.gobj()), diff --git a/gio/src/dbuswatchname.ccg b/gio/src/dbuswatchname.ccg index ca9947bb..0900b6a0 100644 --- a/gio/src/dbuswatchname.ccg +++ b/gio/src/dbuswatchname.ccg @@ -36,8 +36,8 @@ extern "C" static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, const gchar* name, const char* name_owner, gpointer data) { - WatchSlots* slots = static_cast(data); - Gio::DBus::SlotNameAppeared* the_slot = slots->name_appeared_slot; + auto slots = static_cast(data); + auto the_slot = slots->name_appeared_slot; try { @@ -53,8 +53,8 @@ static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - WatchSlots* slots = static_cast(data); - Gio::DBus::SlotNameVanished* the_slot = slots->name_vanished_slot; + auto slots = static_cast(data); + auto the_slot = slots->name_vanished_slot; try { @@ -68,7 +68,7 @@ static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, static void Bus_Watch_Name_giomm_callback_destroy(void* data) { - WatchSlots* slots = static_cast(data); + auto slots = static_cast(data); if(slots->name_appeared_slot) delete slots->name_appeared_slot; @@ -98,7 +98,7 @@ guint watch_name( BusNameWatcherFlags flags ) { - struct WatchSlots* slots = new WatchSlots; + auto slots = new WatchSlots; // Make copies of the slots which will be deleted on destroy notification. slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); @@ -118,7 +118,7 @@ guint watch_name( BusNameWatcherFlags flags ) { - struct WatchSlots* slots = new WatchSlots; + auto slots = new WatchSlots; // Make copies of the slots which will be deleted on destroy notification. slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); diff --git a/gio/src/drive.ccg b/gio/src/drive.ccg index c0568616..da3fe0e0 100644 --- a/gio/src/drive.ccg +++ b/gio/src/drive.ccg @@ -31,7 +31,7 @@ void Drive::eject(const SlotAsyncReady& slot, const Glib::RefPtr& c // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast(flags), @@ -46,7 +46,7 @@ void Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast(flags), @@ -61,7 +61,7 @@ void Drive::eject(const Glib::RefPtr& mount_operation, const Slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast(flags), @@ -76,7 +76,7 @@ void Drive::eject(const Glib::RefPtr& mount_operation, const Slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast(flags), @@ -111,7 +111,7 @@ void Drive::poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_stop(gobj(), static_cast(flags), @@ -167,7 +167,7 @@ Drive::stop(const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_stop(gobj(), static_cast(flags), @@ -187,7 +187,7 @@ Drive::start(const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_start(gobj(), static_cast(flags), @@ -205,7 +205,7 @@ Drive::start(const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_drive_start(gobj(), static_cast(flags), diff --git a/gio/src/file.ccg b/gio/src/file.ccg index 639d4d78..56516ea1 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -36,7 +36,7 @@ SignalProxy_file_progress_callback(goffset current_num_bytes, goffset total_num_bytes, gpointer data) { - Gio::File::SlotFileProgress* the_slot = static_cast(data); + auto the_slot = static_cast(data); try { @@ -56,14 +56,14 @@ SignalProxy_file_progress_callback(goffset current_num_bytes, static void SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) { - CopySlots* slot_pair = static_cast(data); - Gio::SlotAsyncReady* the_slot = slot_pair->second; + auto slot_pair = static_cast(data); + auto the_slot = slot_pair->second; try { if(*the_slot) { - Glib::RefPtr result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } @@ -84,14 +84,14 @@ SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) static void SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) { - MeasureSlots* slot_pair = static_cast(data); - Gio::SlotAsyncReady* the_slot = slot_pair->second; + auto slot_pair = static_cast(data); + auto the_slot = slot_pair->second; try { if(*the_slot) { - Glib::RefPtr result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } @@ -108,8 +108,8 @@ SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) static gboolean SignalProxy_load_partial_contents_read_more_callback(const char* file_contents, goffset file_size, gpointer data) { - LoadPartialSlots* slot_pair = static_cast(data); - Gio::File::SlotReadMore* the_slot = slot_pair->first; + auto slot_pair = static_cast(data); + auto the_slot = slot_pair->first; bool result = false; diff --git a/gio/src/fileattributeinfolist.ccg b/gio/src/fileattributeinfolist.ccg index b4320457..7332e3d2 100644 --- a/gio/src/fileattributeinfolist.ccg +++ b/gio/src/fileattributeinfolist.ccg @@ -35,7 +35,7 @@ bool FileAttributeInfoList::empty() const FileAttributeInfo FileAttributeInfoList::lookup(const std::string& name) const { - GFileAttributeInfoList* cobject = const_cast(gobj()); + auto cobject = const_cast(gobj()); const GFileAttributeInfo* cinfo = g_file_attribute_info_list_lookup (cobject, name.c_str()); diff --git a/gio/src/fileenumerator.ccg b/gio/src/fileenumerator.ccg index 49a893af..d5cb85cb 100644 --- a/gio/src/fileenumerator.ccg +++ b/gio/src/fileenumerator.ccg @@ -32,7 +32,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, const Glib::RefPtr< // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_next_files_async(gobj(), num_files, @@ -48,7 +48,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, int num_files, int // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_next_files_async(gobj(), num_files, @@ -66,7 +66,7 @@ FileEnumerator::close_async(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); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_close_async(gobj(), io_priority, @@ -82,7 +82,7 @@ FileEnumerator::close_async(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); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_close_async(gobj(), io_priority, diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg index 9dc275e2..087f9701 100644 --- a/gio/src/fileinputstream.ccg +++ b/gio/src/fileinputstream.ccg @@ -27,7 +27,7 @@ namespace Gio Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -37,7 +37,7 @@ Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr FileInputStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -50,7 +50,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_input_stream_query_info_async(gobj(), const_cast(attributes.c_str()), @@ -66,7 +66,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const std::string& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_input_stream_query_info_async(gobj(), const_cast(attributes.c_str()), diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg index 5ae6ac50..ed8757b9 100644 --- a/gio/src/fileiostream.ccg +++ b/gio/src/fileiostream.ccg @@ -27,7 +27,7 @@ namespace Gio Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -37,7 +37,7 @@ Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& Glib::RefPtr FileIOStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -50,7 +50,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr(attributes.c_str()), @@ -66,7 +66,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const std::string& at // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_io_stream_query_info_async(gobj(), const_cast(attributes.c_str()), diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg index e46308cb..7b940feb 100644 --- a/gio/src/fileoutputstream.ccg +++ b/gio/src/fileoutputstream.ccg @@ -29,7 +29,7 @@ namespace Gio Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -41,7 +41,7 @@ Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr FileOutputStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -56,7 +56,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPt // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_output_stream_query_info_async(gobj(), const_cast(attributes.c_str()), @@ -72,7 +72,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const std::string // 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); + auto slot_copy = new SlotAsyncReady(slot); g_file_output_stream_query_info_async(gobj(), const_cast(attributes.c_str()), diff --git a/gio/src/icon.ccg b/gio/src/icon.ccg index 7b77fa4c..76295bf6 100644 --- a/gio/src/icon.ccg +++ b/gio/src/icon.ccg @@ -33,7 +33,7 @@ Icon::equal(const Glib::RefPtr& other) const Glib::RefPtr Icon::create(const std::string& str) { GError* gerror = 0; - GIcon* icon = g_icon_new_for_string(str.c_str(), &gerror); + auto icon = g_icon_new_for_string(str.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/inputstream.ccg b/gio/src/inputstream.ccg index 82d0c134..54a82620 100644 --- a/gio/src/inputstream.ccg +++ b/gio/src/inputstream.ccg @@ -31,7 +31,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, c // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_async(gobj(), buffer, @@ -48,7 +48,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, i // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_async(gobj(), buffer, @@ -66,7 +66,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_all_async(gobj(), buffer, @@ -83,7 +83,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_all_async(gobj(), buffer, @@ -101,7 +101,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Gli // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_bytes_async(gobj(), count, @@ -117,7 +117,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_pr // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_bytes_async(gobj(), count, @@ -134,7 +134,7 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, const Glib::Ref // 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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_skip_async(gobj(), count, @@ -150,7 +150,7 @@ InputStream::skip_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); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_skip_async(gobj(), count, @@ -166,7 +166,7 @@ InputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr& stream2, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast(flags), io_priority, @@ -77,7 +77,7 @@ IOStream::splice_async(const Glib::RefPtr& stream2, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast(flags), io_priority, 0, diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index 2ff4d601..20281191 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -74,7 +74,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot, const // 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); + auto slot_copy = new SlotAsyncReady(slot); g_loadable_icon_load_async(gobj(), size, @@ -89,7 +89,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot) // 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); + auto slot_copy = new SlotAsyncReady(slot); g_loadable_icon_load_async(gobj(), size, diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg index 0dfd768d..344506d6 100644 --- a/gio/src/memoryinputstream.ccg +++ b/gio/src/memoryinputstream.ccg @@ -41,7 +41,7 @@ private: void destroy_data_callback(void* user_data) { - SlotWithData* slot_with_data = static_cast(user_data); + auto slot_with_data = static_cast(user_data); g_return_if_fail(slot_with_data != 0); try @@ -84,8 +84,8 @@ _DEPRECATE_IFDEF_END void MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot) { - SlotWithData* slot_with_data = new SlotWithData(destroy_slot, const_cast(data)); - GBytes* bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data); + auto slot_with_data = new SlotWithData(destroy_slot, const_cast(data)); + auto bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data); g_memory_input_stream_add_bytes(gobj(), bytes); g_bytes_unref(bytes); // g_memory_input_stream_add_bytes() takes a reference } diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg index 6d1ac668..522a700f 100644 --- a/gio/src/mount.ccg +++ b/gio/src/mount.ccg @@ -32,7 +32,7 @@ void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -47,7 +47,7 @@ void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -73,7 +73,7 @@ void Mount::unmount(const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -89,7 +89,7 @@ void Mount::unmount(const Glib::RefPtr& mount_operation, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -116,7 +116,7 @@ void Mount::remount(const Glib::RefPtr& operation, const SlotAsy // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_remount(gobj(), static_cast(flags), @@ -131,7 +131,7 @@ void Mount::remount(const Glib::RefPtr& operation, const SlotAsy // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_remount(gobj(), static_cast(flags), @@ -166,7 +166,7 @@ void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr& c // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -181,7 +181,7 @@ void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -206,7 +206,7 @@ void Mount::eject(const Glib::RefPtr& mount_operation, const Slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -221,7 +221,7 @@ void Mount::eject(const Glib::RefPtr& mount_operation, const Slo // 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); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -247,7 +247,7 @@ void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr NetworkAddress::parse(const std::string& host_and_port, guint16 default_port) { GError *error = 0; - GNetworkAddress *address = G_NETWORK_ADDRESS + auto *address = G_NETWORK_ADDRESS (g_network_address_parse (host_and_port.c_str (), default_port, &error)); if (error) diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg index aaa5ee13..550a6ac3 100644 --- a/gio/src/networkmonitor.ccg +++ b/gio/src/networkmonitor.ccg @@ -26,7 +26,7 @@ void NetworkMonitor::can_reach_async(const Glib::RefPtr& conn // 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); + auto slot_copy = new SlotAsyncReady(slot); g_network_monitor_can_reach_async(gobj(), Glib::unwrap(connectable), diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index 0ed1e138..5ac47fbd 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -30,7 +30,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_async(gobj(), buffer, @@ -47,7 +47,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_async(gobj(), buffer, @@ -66,7 +66,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_all_async(gobj(), buffer, @@ -83,7 +83,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_all_async(gobj(), buffer, @@ -101,7 +101,7 @@ OutputStream::splice_async(const Glib::RefPtr& source, const SlotAs // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_splice_async(gobj(), Glib::unwrap(source), @@ -118,7 +118,7 @@ OutputStream::splice_async(const Glib::RefPtr& source, const SlotAs // 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); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_splice_async(gobj(), Glib::unwrap(source), @@ -135,7 +135,7 @@ OutputStream::flush_async(const SlotAsyncReady& slot, const Glib::RefPtr& connection, const Glib:: // 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); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_connect_async(gobj(), Glib::unwrap(connection), @@ -46,7 +46,7 @@ void Proxy::connect_async(const Glib::RefPtr& connection, const Glib:: // 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); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_connect_async(gobj(), Glib::unwrap(connection), diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 3fd2d6a8..72cad04e 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -43,7 +43,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_resolver_lookup_async(gobj(), uri.c_str(), @@ -57,7 +57,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_resolver_lookup_async(gobj(), uri.c_str(), diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg index 2f5f6948..0c5f9592 100644 --- a/gio/src/resolver.ccg +++ b/gio/src/resolver.ccg @@ -39,7 +39,7 @@ Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_name_async (gobj(), hostname.c_str(), @@ -52,7 +52,7 @@ void Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_name_async (gobj(), hostname.c_str(), @@ -66,7 +66,7 @@ Resolver::lookup_by_address_async(const Glib::RefPtr& address, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_address_async (gobj(), Glib::unwrap(address), @@ -79,7 +79,7 @@ void Resolver::lookup_by_address_async(const Glib::RefPtr& address, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_address_async (gobj(), Glib::unwrap(address), @@ -95,7 +95,7 @@ Resolver::lookup_service_async(const Glib::ustring& service, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_service_async (gobj(), service.c_str(), @@ -112,7 +112,7 @@ Resolver::lookup_service_async(const Glib::ustring& service, const Glib::ustring& domain, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_service_async (gobj(), service.c_str(), @@ -129,7 +129,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_records_async(gobj(), (rrname.empty() ? 0 : rrname.c_str()), @@ -144,7 +144,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname, ResolverRecordType record_type, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_records_async(gobj(), (rrname.empty() ? 0 : rrname.c_str()), diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index 03e48075..98b6ccd4 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -24,7 +24,7 @@ namespace Gio void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_value(const_cast(gobj()), key.c_str()); + const auto g_value = g_settings_get_value(const_cast(gobj()), key.c_str()); if(!g_value) return; @@ -33,7 +33,7 @@ void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) con bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_user_value(const_cast(gobj()), key.c_str()); + const auto g_value = g_settings_get_user_value(const_cast(gobj()), key.c_str()); if(!g_value) return false; @@ -43,7 +43,7 @@ bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value void Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_default_value(const_cast(gobj()), key.c_str()); + const auto g_value = g_settings_get_default_value(const_cast(gobj()), key.c_str()); if(!g_value) return; diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg index 7a4a211d..107493f5 100644 --- a/gio/src/socket.ccg +++ b/gio/src/socket.ccg @@ -58,7 +58,7 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, { GError* gerror = 0; GSocketAddress* caddr = 0; - gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast(Glib::unwrap(cancellable)), &(gerror)); + auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -72,7 +72,7 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, { GError* gerror = 0; GSocketAddress* caddr = 0; - gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); + auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -86,7 +86,7 @@ gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { GError* gerror = 0; - gssize const retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, + const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -98,7 +98,7 @@ gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { GError* gerror = 0; - gssize const retvalue = g_socket_send_with_blocking(gobj(), buffer, size, + const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/socketaddressenumerator.ccg b/gio/src/socketaddressenumerator.ccg index b783ec8a..d7aca9b6 100644 --- a/gio/src/socketaddressenumerator.ccg +++ b/gio/src/socketaddressenumerator.ccg @@ -31,7 +31,7 @@ namespace Gio { // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_address_enumerator_next_async(gobj(), Glib::unwrap(cancellable), diff --git a/gio/src/socketclient.ccg b/gio/src/socketclient.ccg index ec970358..6448c219 100644 --- a/gio/src/socketclient.ccg +++ b/gio/src/socketclient.ccg @@ -32,7 +32,7 @@ SocketClient::connect_async(const Glib::RefPtr& connectable, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_async (gobj(), connectable->gobj (), @@ -48,7 +48,7 @@ SocketClient::connect_async(const Glib::RefPtr& connectable, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_async (gobj(), connectable->gobj (), @@ -66,7 +66,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_host_async (gobj(), host_and_port.c_str (), @@ -84,7 +84,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_host_async (gobj(), host_and_port.c_str (), @@ -103,7 +103,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_service_async (gobj(), domain.c_str (), @@ -121,7 +121,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_service_async (gobj(), domain.c_str (), @@ -139,7 +139,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_uri_async (gobj(), uri.c_str(), default_port, @@ -155,7 +155,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_uri_async (gobj(), uri.c_str(), default_port, diff --git a/gio/src/socketconnection.ccg b/gio/src/socketconnection.ccg index 8bd85788..79094c16 100644 --- a/gio/src/socketconnection.ccg +++ b/gio/src/socketconnection.ccg @@ -28,7 +28,7 @@ SocketConnection::connect_async(const Glib::RefPtr& address, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_connection_connect_async(gobj(), Glib::unwrap(address), @@ -41,7 +41,7 @@ void SocketConnection::connect_async(const Glib::RefPtr& address, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_connection_connect_async(gobj(), Glib::unwrap(address), diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg index b55c6055..75552e47 100644 --- a/gio/src/socketlistener.ccg +++ b/gio/src/socketlistener.ccg @@ -93,7 +93,7 @@ bool SocketListener::add_inet_port(guint16 port) guint16 SocketListener::add_any_inet_port() { GError* gerror = 0; - const guint16 retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); + const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -105,7 +105,7 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s { GError* gerror = 0; GObject *retobj = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); @@ -122,7 +122,7 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s { GError* gerror = 0; GObject *retobj = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, 0, &gerror); @@ -138,7 +138,7 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr& cancellable) { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), 0, Glib::unwrap(cancellable), &gerror); @@ -151,7 +151,7 @@ Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr SocketListener::accept_socket() { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), 0, 0, &gerror); @@ -167,7 +167,7 @@ void SocketListener::accept_socket_async(const Glib::RefPtr& cancel // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_socket_async(gobj(), Glib::unwrap(cancellable), @@ -180,7 +180,7 @@ void SocketListener::accept_socket_async(const SlotAsyncReady& slot) // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_socket_async(gobj(), 0, @@ -192,7 +192,7 @@ Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr& result) { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(), + auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), 0, &gerror); @@ -222,7 +222,7 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); @@ -239,7 +239,7 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), &retobj, 0, &gerror); @@ -255,7 +255,7 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour Glib::RefPtr SocketListener::accept(const Glib::RefPtr& cancellable) { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), 0, Glib::unwrap(cancellable), &gerror); @@ -268,7 +268,7 @@ Glib::RefPtr SocketListener::accept(const Glib::RefPtr SocketListener::accept() { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), 0, 0, &gerror); @@ -284,7 +284,7 @@ void SocketListener::accept_async(const SlotAsyncReady& slot) // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_async(gobj(), 0, @@ -297,7 +297,7 @@ void SocketListener::accept_async(const Glib::RefPtr& cancellable, // 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); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_async(gobj(), Glib::unwrap(cancellable), @@ -309,7 +309,7 @@ Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr< { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(), + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), &retobj, &gerror); @@ -324,7 +324,7 @@ Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr< Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr& result) { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(), + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), 0, &gerror); diff --git a/gio/src/unixconnection.ccg b/gio/src/unixconnection.ccg index 2341973a..bddc9696 100644 --- a/gio/src/unixconnection.ccg +++ b/gio/src/unixconnection.ccg @@ -27,7 +27,7 @@ namespace Gio void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_receive_credentials_async(gobj(), Glib::unwrap(cancellable), @@ -37,7 +37,7 @@ void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot, void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_receive_credentials_async(gobj(), 0, @@ -49,7 +49,7 @@ void UnixConnection::send_credentials_async(const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_send_credentials_async(gobj(), Glib::unwrap(cancellable), @@ -61,7 +61,7 @@ void UnixConnection::send_credentials_async(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_send_credentials_async(gobj(), 0, diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg index aa26c9c6..b17b0f6d 100644 --- a/gio/src/unixfdlist.ccg +++ b/gio/src/unixfdlist.ccg @@ -50,7 +50,7 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle& fds, int n_fds) const Glib::ArrayHandle UnixFDList::peek_fds() const { int length = 0; - const int* fds = g_unix_fd_list_peek_fds(const_cast(gobj()), &length); + const auto fds = g_unix_fd_list_peek_fds(const_cast(gobj()), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_list_peek_fds() returns. return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_NONE); @@ -59,7 +59,7 @@ const Glib::ArrayHandle UnixFDList::peek_fds() const Glib::ArrayHandle UnixFDList::steal_fds() { int length = 0; - const int* fds = g_unix_fd_list_steal_fds(gobj(), &length); + const auto fds = g_unix_fd_list_steal_fds(gobj(), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_list_steal_fds() returns. return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg index d112bb65..7849a208 100644 --- a/gio/src/unixfdmessage.ccg +++ b/gio/src/unixfdmessage.ccg @@ -25,7 +25,7 @@ namespace Gio Glib::ArrayHandle UnixFDMessage::steal_fds() { int length = 0; - const int* fds = g_unix_fd_message_steal_fds(gobj(), &length); + const auto fds = g_unix_fd_message_steal_fds(gobj(), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_message_steal_fds() returns. return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); diff --git a/gio/src/volume.ccg b/gio/src/volume.ccg index d06790a8..0bffbcb6 100644 --- a/gio/src/volume.ccg +++ b/gio/src/volume.ccg @@ -33,7 +33,7 @@ Volume::mount(const Glib::RefPtr& mount_operation, const SlotAsy // 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_mount(gobj(), static_cast(flags), @@ -50,7 +50,7 @@ Volume::mount(const Glib::RefPtr& mount_operation, const SlotAsy // 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_mount(gobj(), static_cast(flags), @@ -88,7 +88,7 @@ void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr& // 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast(flags), @@ -103,7 +103,7 @@ void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast(flags), @@ -128,7 +128,7 @@ void Volume::eject(const Glib::RefPtr& mount_operation, const Sl // 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast(flags), @@ -143,7 +143,7 @@ void Volume::eject(const Glib::RefPtr& mount_operation, const Sl // 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); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast(flags), diff --git a/glib/src/date.ccg b/glib/src/date.ccg index bc7590c0..ad6b6ef0 100644 --- a/glib/src/date.ccg +++ b/glib/src/date.ccg @@ -305,7 +305,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const struct tm tm_data; g_date_to_struct_tm(&gobject_, &tm_data); - const std::string locale_format = locale_from_utf8(format); + const auto locale_format = locale_from_utf8(format); gsize bufsize = std::max(2 * locale_format.size(), 128); @@ -316,7 +316,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const // Set the first byte to something other than '\0', to be able to // recognize whether strftime actually failed or just returned "". buf.get()[0] = '\1'; - const gsize len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data); + const auto len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data); if(len != 0 || buf.get()[0] == '\0') { diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg index 59fe145c..42be941b 100644 --- a/glib/src/fileutils.ccg +++ b/glib/src/fileutils.ccg @@ -125,7 +125,7 @@ bool file_test(const std::string& filename, FileTest test) int mkstemp(std::string& filename_template) { const ScopedPtr buf (g_strndup(filename_template.data(), filename_template.size())); - const int fileno = g_mkstemp(buf.get()); + const auto fileno = g_mkstemp(buf.get()); filename_template = buf.get(); return fileno; @@ -139,7 +139,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) GError* error = 0; ScopedPtr buf_name_used; - const int fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); @@ -153,7 +153,7 @@ int file_open_tmp(std::string& name_used) GError* error = 0; ScopedPtr buf_name_used; - const int fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg index d0a18aae..e093a50b 100644 --- a/glib/src/iochannel.ccg +++ b/glib/src/iochannel.ccg @@ -160,7 +160,7 @@ IOChannel::~IOChannel() reinterpret_cast(gobject_)->wrapper = 0; } - GIOChannel *const tmp_gobject = gobject_; + const auto tmp_gobject = gobject_; gobject_ = 0; g_io_channel_unref(tmp_gobject); @@ -170,7 +170,7 @@ IOChannel::~IOChannel() Glib::RefPtr IOChannel::create_from_file(const std::string& filename, const std::string& mode) { GError* gerror = 0; - GIOChannel *const channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); + const auto channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); if(gerror) { @@ -211,7 +211,7 @@ IOStatus IOChannel::read_line(Glib::ustring& line) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); + const auto status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); if(gerror) { @@ -232,7 +232,7 @@ IOStatus IOChannel::read_to_end(Glib::ustring& str) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); + const auto status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); if(gerror) { @@ -253,7 +253,7 @@ IOStatus IOChannel::read(Glib::ustring& str, gsize count) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); + const auto status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); if(gerror) { @@ -272,7 +272,7 @@ IOStatus IOChannel::set_encoding(const std::string& encoding) { GError* gerror = 0; - const GIOStatus status = g_io_channel_set_encoding( + const auto status = g_io_channel_set_encoding( gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror); if(gerror) @@ -394,7 +394,7 @@ Glib::RefPtr wrap(GIOChannel* gobject, bool take_copy) GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count, gsize* bytes_read, GError** err) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { @@ -415,7 +415,7 @@ GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count, GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count, gsize* bytes_written, GError** err) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { @@ -435,7 +435,7 @@ GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { @@ -455,7 +455,7 @@ GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { @@ -477,11 +477,11 @@ GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err) // static GSource* GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition condition) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { - const Glib::RefPtr source = wrapper->create_watch_vfunc((IOCondition) condition); + const auto source = wrapper->create_watch_vfunc((IOCondition) condition); return (source) ? source->gobj_copy() : 0; } catch(...) @@ -506,7 +506,7 @@ void GlibmmIOChannel::io_free(GIOChannel* channel) GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { @@ -527,7 +527,7 @@ GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GEr // static GIOFlags GlibmmIOChannel::io_get_flags(GIOChannel* channel) { - IOChannel *const wrapper = reinterpret_cast(channel)->wrapper; + const auto wrapper = reinterpret_cast(channel)->wrapper; try { diff --git a/glib/src/optioncontext.ccg b/glib/src/optioncontext.ccg index 601b928c..ecc1ac85 100644 --- a/glib/src/optioncontext.ccg +++ b/glib/src/optioncontext.ccg @@ -84,7 +84,7 @@ void OptionContext::set_main_group(OptionGroup& group) /* OptionGroup OptionContext::get_main_group() const { - const GOptionGroup* cobj = g_option_context_get_main_group(const_cast( gobj()) ); + const auto cobj = g_option_context_get_main_group(const_cast( gobj()) ); OptionGroup cppObj(const_cast(cobj), true); // take_copy return cppObj; } @@ -95,7 +95,7 @@ void OptionContext::set_translate_func (const SlotTranslate& slot) { //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter. //It will be deleted when SignalProxy_translate_gtk_callback_destroy() is called. - SlotTranslate* slot_copy = new SlotTranslate(slot); + auto slot_copy = new SlotTranslate(slot); g_option_context_set_translate_func( gobj(), &OptionContextPrivate::SignalProxy_translate_gtk_callback, slot_copy, diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index da0f0b89..cffa3435 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -75,7 +75,7 @@ static gboolean g_callback_pre_parse(GOptionContext* context, { OptionContext cppContext(context, false /* take_ownership */); - OptionGroup* option_group = static_cast(data); + auto option_group = static_cast(data); if(!option_group) { OptionError(OptionError::FAILED, "Glib::OptionGroup: g_callback_pre_parse(): " @@ -108,7 +108,7 @@ static void g_callback_error(GOptionContext* context, OptionContext cppContext(context, false /* take_ownership */); - OptionGroup* option_group = static_cast(data); + auto option_group = static_cast(data); if(option_group) return option_group->on_error(cppContext, *option_group); } @@ -160,7 +160,7 @@ gboolean OptionGroup::post_parse_callback(GOptionContext* context, for(type_map_entries::iterator iter = option_group->map_entries_.begin(); iter != option_group->map_entries_.end(); ++iter) { - CppOptionEntry& cpp_entry = iter->second; + auto& cpp_entry = iter->second; cpp_entry.convert_c_to_cpp(); } @@ -198,17 +198,17 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* if(option_name[1] == '-') { //Long option name. - const Glib::ustring long_option_name = Glib::ustring(option_name+2); + const auto long_option_name = Glib::ustring(option_name+2); iterFind = option_group->map_entries_.find(long_option_name); } else { //Short option name. - const gchar short_option_name = option_name[1]; + const auto short_option_name = option_name[1]; for(iterFind = option_group->map_entries_.begin(); iterFind != option_group->map_entries_.end(); ++iterFind) { - const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second; + const auto& cppOptionEntry = iterFind->second; if (cppOptionEntry.entry_ && cppOptionEntry.entry_->get_short_name() == short_option_name) break; @@ -222,7 +222,7 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* return false; } - const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second; + const auto& cppOptionEntry = iterFind->second; if (cppOptionEntry.carg_type_ != G_OPTION_ARG_CALLBACK) { OptionError(OptionError::FAILED, "Glib::OptionGroup::option_arg_callback() " @@ -237,13 +237,13 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* { if (option_arg->is_filename_option()) { - const OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename(); + const auto the_slot = option_arg->get_slot_filename(); const std::string cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } else { - const OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string(); + const auto the_slot = option_arg->get_slot_string(); const Glib::ustring cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } @@ -288,7 +288,7 @@ OptionGroup::~OptionGroup() //Free any C types that were allocated during add_entry(): for(type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter) { - CppOptionEntry& cpp_entry = iter->second; + auto& cpp_entry = iter->second; cpp_entry.release_c_arg(); } @@ -375,7 +375,7 @@ void OptionGroup::add_entry_filename(const OptionEntry& entry, const SlotOptionA void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg arg_type, void* cpp_arg) { - const Glib::ustring name = entry.get_long_name(); + const auto name = entry.get_long_name(); type_map_entries::iterator iterFind = map_entries_.find(name); if (iterFind == map_entries_.end()) //If we have not added this entry already { @@ -395,7 +395,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar for (type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter) { - const CppOptionEntry& cpp_entry = iter->second; + const auto& cpp_entry = iter->second; if (cpp_entry.cpparg_ == cpp_arg && cpp_entry.carg_type_ == arg_type && cpp_entry.carg_) @@ -429,7 +429,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar { //Delete the OptionArgCallback instance that was allocated by add_entry() //or add_entry_filename(). - OptionArgCallback* option_arg = static_cast(cpp_arg); + auto option_arg = static_cast(cpp_arg); delete option_arg; } } @@ -454,7 +454,7 @@ void OptionGroup::set_translate_func(const SlotTranslate& slot) // Create a copy of the slot. A pointer to this will be passed through the // callback's data parameter. It will be deleted when // OptionGroup_Translate_glibmm_callback_destroy() is called. - SlotTranslate* slot_copy = new SlotTranslate(slot); + auto slot_copy = new SlotTranslate(slot); g_option_group_set_translate_func(gobj(), &OptionGroup_Translate_glibmm_callback, slot_copy, &OptionGroup_Translate_glibmm_callback_destroy); @@ -658,7 +658,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() { //Delete the OptionArgCallback instance that was allocated by add_entry() //or add_entry_filename(). - OptionArgCallback* option_arg = static_cast(cpparg_); + auto option_arg = static_cast(cpparg_); delete option_arg; cpparg_ = 0; @@ -687,7 +687,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_STRING: { char** typed_arg = static_cast(carg_); - Glib::ustring* typed_cpp_arg = static_cast(cpparg_); + auto typed_cpp_arg = static_cast(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { *typed_cpp_arg = *typed_arg; @@ -697,7 +697,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_FILENAME: { char** typed_arg = static_cast(carg_); - std::string* typed_cpp_arg = static_cast(cpparg_); + auto typed_cpp_arg = static_cast(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { *typed_cpp_arg = *typed_arg; @@ -717,7 +717,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_STRING_ARRAY: { char*** typed_arg = static_cast(carg_); - vecustrings* typed_cpp_arg = static_cast(cpparg_); + auto typed_cpp_arg = static_cast(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); @@ -757,7 +757,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_FILENAME_ARRAY: { char*** typed_arg = static_cast(carg_); - vecstrings* typed_cpp_arg = static_cast(cpparg_); + auto typed_cpp_arg = static_cast(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index ba5b3938..4f565810 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -25,7 +25,7 @@ Glib::RefPtr Regex::create(const Glib::ustring& pattern, RegexMatchFlags match_options) { GError* gerror = 0; - GRegex* regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, + auto regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, (GRegexMatchFlags)match_options, &gerror); if(gerror) @@ -207,7 +207,7 @@ bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { GError* gerror = 0; - Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); + auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -218,7 +218,7 @@ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, co Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { GError* gerror = 0; - Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); + auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -228,7 +228,7 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi Glib::StringArrayHandle Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const { GError* gerror = 0; - Glib::StringArrayHandle retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); + auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg index 8e2a2506..ef9eed2d 100644 --- a/glib/src/spawn.ccg +++ b/glib/src/spawn.ccg @@ -74,7 +74,7 @@ void spawn_async_with_pipes(const std::string& working_directory, int* standard_error) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -102,7 +102,7 @@ void spawn_async_with_pipes(const std::string& working_directory, int* standard_error) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -127,7 +127,7 @@ void spawn_async(const std::string& working_directory, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -151,7 +151,7 @@ void spawn_async(const std::string& working_directory, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -177,7 +177,7 @@ void spawn_sync(const std::string& working_directory, int* exit_status) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; @@ -211,7 +211,7 @@ void spawn_sync(const std::string& working_directory, int* exit_status) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg index cfc38952..2116b528 100644 --- a/glib/src/thread.ccg +++ b/glib/src/thread.ccg @@ -26,7 +26,7 @@ extern "C" static void* call_thread_entry_slot(void* data) { - sigc::slot_base *const slot = reinterpret_cast(data); + const auto slot = reinterpret_cast(data); try { @@ -71,11 +71,11 @@ void thread_init_impl() Thread* Thread::create(const sigc::slot& slot, bool /* joinable */) { // Make a copy of slot on the heap - sigc::slot_base *const slot_copy = new sigc::slot(slot); + const auto slot_copy = new sigc::slot(slot); GError* error = 0; - GThread *const thread = g_thread_try_new(NULL, + const auto thread = g_thread_try_new(NULL, &call_thread_entry_slot, slot_copy, &error); if(error) @@ -97,11 +97,11 @@ Thread* Thread::create(const sigc::slot& slot, unsigned long stack_size, bool joinable, bool bound, ThreadPriority priority) { // Make a copy of slot on the heap - sigc::slot_base *const slot_copy = new sigc::slot(slot); + const auto slot_copy = new sigc::slot(slot); GError* error = 0; - GThread *const thread = g_thread_create_full( + const auto thread = g_thread_create_full( &call_thread_entry_slot, slot_copy, stack_size, joinable, bound, (GThreadPriority) priority, &error); diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg index 05fc76c4..49ad1079 100644 --- a/glib/src/threads.ccg +++ b/glib/src/threads.ccg @@ -40,7 +40,7 @@ extern "C" static void* call_thread_entry_slot(void* data) { - sigc::slot_base *const slot = reinterpret_cast(data); + const auto slot = reinterpret_cast(data); try { @@ -78,10 +78,10 @@ namespace Threads Thread* Thread::create(const sigc::slot& slot, const std::string& name) { // Make a copy of slot on the heap. - sigc::slot_base *const slot_copy = new sigc::slot(slot); + const auto slot_copy = new sigc::slot(slot); GError* error = 0; - GThread* thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), + auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), &call_thread_entry_slot, slot_copy, &error); if (error) diff --git a/glib/src/valuearray.ccg b/glib/src/valuearray.ccg index 114e978f..8b82aeda 100644 --- a/glib/src/valuearray.ccg +++ b/glib/src/valuearray.ccg @@ -48,7 +48,7 @@ ValueArray::ValueArray(guint n_preallocated) : bool ValueArray::get_nth(guint index, Glib::ValueBase& value) { - GValue* const g_value = g_value_array_get_nth(gobj(), index); + const auto g_value = g_value_array_get_nth(gobj(), index); if(g_value) { diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 71d34d9a..46153d6d 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -54,14 +54,14 @@ VariantType& VariantType::operator=(const GVariantType* castitem) VariantType VariantType::create_tuple(const std::vector& items) { typedef GVariantType* var_ptr; - var_ptr* const var_array = new var_ptr[items.size()]; + const auto var_array = new var_ptr[items.size()]; for(std::vector::size_type i = 0; i < items.size(); i++) { var_array[i] = const_cast(items[i].gobj()); } - VariantType result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size())); + auto result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size())); delete[] var_array; return result; } -- cgit v1.2.1 From a776f52044af21d85a6aecd13f8496c7ce670e83 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 13:01:54 +0200 Subject: C++11: gmmproc: Use of auto in generated files. --- glib/src/signalproxy.h.m4 | 2 +- glib/src/variant_basictypes.cc.m4 | 4 ++-- tools/m4/class_interface.m4 | 2 +- tools/m4/class_opaque_copyable.m4 | 2 +- tools/m4/class_opaque_refcounted.m4 | 2 +- tools/m4/class_shared.m4 | 2 +- tools/m4/method.m4 | 16 ++++++++-------- tools/m4/signal.m4 | 16 ++++++++-------- tools/m4/vfunc.m4 | 16 ++++++++-------- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/glib/src/signalproxy.h.m4 b/glib/src/signalproxy.h.m4 index a95d5974..2f275f99 100644 --- a/glib/src/signalproxy.h.m4 +++ b/glib/src/signalproxy.h.m4 @@ -58,7 +58,7 @@ public: #ifndef DOXYGEN_SHOULD_SKIP_THIS static inline sigc::slot_base* data_to_slot(void* data) { - SignalProxyConnectionNode *const pConnectionNode = static_cast(data); + const auto pConnectionNode = static_cast(data); // Return 0 if the connection is blocked. return (!pConnectionNode->slot_.blocked()) ? &pConnectionNode->slot_ : 0; diff --git a/glib/src/variant_basictypes.cc.m4 b/glib/src/variant_basictypes.cc.m4 index 92e50a30..4247da88 100644 --- a/glib/src/variant_basictypes.cc.m4 +++ b/glib/src/variant_basictypes.cc.m4 @@ -47,13 +47,13 @@ const VariantType& Variant<$1>::variant_type() Variant<$1> Variant<$1>::create($1 data) { - Variant<$1> result = Variant<$1>(g_variant_new_$3(data)); + auto result = Variant<$1>(g_variant_new_$3(data)); return result; } ifelse($4,,,[ Variant<$1> Variant<$1>::create_$4($1 data) { - Variant<$1> result = Variant<$1>(g_variant_new_$4(data)); + auto result = Variant<$1>(g_variant_new_$4(data)); return result; } ])dnl diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4 index fb6d387d..8d25e6ae 100644 --- a/tools/m4/class_interface.m4 +++ b/tools/m4/class_interface.m4 @@ -92,7 +92,7 @@ const Glib::Interface_Class& __CPPNAME__`'_Class::init() void __CPPNAME__`'_Class::iface_init_function(void* g_iface, void*) { - BaseClassType *const klass = static_cast(g_iface); + const auto klass = static_cast(g_iface); //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4 index 9e53649e..b98502f3 100644 --- a/tools/m4/class_opaque_copyable.m4 +++ b/tools/m4/class_opaque_copyable.m4 @@ -122,7 +122,7 @@ ifelse(__OPAQUE_FUNC_COPY,NONE,`dnl ',`dnl else __CPPNAME__& __CPPNAME__::operator=(const __CPPNAME__`'& src) { - __CNAME__ *const new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0; + const auto new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0; if(gobject_) __OPAQUE_FUNC_FREE`'(gobject_); diff --git a/tools/m4/class_opaque_refcounted.m4 b/tools/m4/class_opaque_refcounted.m4 index c9242baf..cec87fa0 100644 --- a/tools/m4/class_opaque_refcounted.m4 +++ b/tools/m4/class_opaque_refcounted.m4 @@ -116,7 +116,7 @@ const __CNAME__* __CPPNAME__::gobj() const __CNAME__* __CPPNAME__::gobj_copy() const { // See the comment at the top of this file, if you want to know why the cast works. - __CNAME__ *const gobject = reinterpret_cast<__CNAME__*>(const_cast<__CPPNAME__*>(this)); + const auto gobject = reinterpret_cast<__CNAME__*>(const_cast<__CPPNAME__*>(this)); __OPAQUE_FUNC_REF`'(gobject); return gobject; } diff --git a/tools/m4/class_shared.m4 b/tools/m4/class_shared.m4 index 4175b575..3442ad15 100644 --- a/tools/m4/class_shared.m4 +++ b/tools/m4/class_shared.m4 @@ -190,7 +190,7 @@ ifdef(`__BOOL_DO_NOT_DERIVE_GTYPE__',`dnl void __CPPNAME__`'_Class::class_init_function(void* g_class, void* class_data) { - BaseClassType *const klass = static_cast(g_class); + const auto klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); _IMPORT(SECTION_PCC_CLASS_INIT_VFUNCS) diff --git a/tools/m4/method.m4 b/tools/m4/method.m4 index 7becc7c5..fe4075d3 100644 --- a/tools/m4/method.m4 +++ b/tools/m4/method.m4 @@ -28,10 +28,10 @@ dnl If a slot type has been specified insert a slot copy declaration. dnl See if the slot should or should not be copied `ifelse(`$20',,dnl ` // Create a copy of the slot. - $18* slot_copy = new $18($19); ',dnl + auto slot_copy = new $18($19); ',dnl dnl ` // Use the original slot (not a copy). - $18* slot_copy = const_cast<$18*>(&$19);') + auto slot_copy = const_cast<$18*>(&$19);') ')`'dnl dnl Insert the declarations for C output parameters @@ -68,10 +68,10 @@ ifelse(`$18',,,dnl dnl See if the slot should or should not be copied `ifelse(`$20',,dnl ` // Create a copy of the slot. - $18* slot_copy = new $18($19); ',dnl + auto slot_copy = new $18($19); ',dnl dnl ` // Use the original slot (not a copy). - $18* slot_copy = const_cast<$18*>(&$19);') + auto slot_copy = const_cast<$18*>(&$19);') ')`'dnl dnl Insert the declarations for C output parameters @@ -130,10 +130,10 @@ ifelse(`$15',,,dnl dnl See if the slot should or should not be copied `ifelse(`$17',,dnl ` // Create a copy of the slot. - $15* slot_copy = new $15($16); ',dnl + auto slot_copy = new $15($16); ',dnl dnl ` // Use the original slot (not a copy). - $15* slot_copy = const_cast<$15*>(&$16);') + auto slot_copy = const_cast<$15*>(&$16);') ')`'dnl dnl Insert declarations for C the output parameters @@ -161,10 +161,10 @@ ifelse(`$15',,,dnl dnl See if the slot should or should not be copied `ifelse(`$17',,dnl ` // Create a copy of the slot. - $15* slot_copy = new $15($16); ',dnl + auto slot_copy = new $15($16); ',dnl dnl ` // Use the original slot (not a copy). - $15* slot_copy = const_cast<$15*>(&$16);') + auto slot_copy = const_cast<$15*>(&$16);') ')`'dnl dnl Insert the declarations for the C output parameters diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index cb8cdf0b..cc0473c8 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -67,13 +67,13 @@ static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3 using namespace __NAMESPACE__; typedef sigc::slot< $5`'_COMMA_PREFIX($6) > SlotType; - __CPPNAME__* obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); + auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); // Do not try to call a signal on a disassociated wrapper. if(obj) { try { - if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data)) + if(const auto slot = Glib::SignalProxyNormal::data_to_slot`'(data)) ifelse(`$2',void,`dnl (*static_cast(slot))($7); ',`dnl else @@ -109,13 +109,13 @@ static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SU using namespace __NAMESPACE__; typedef sigc::slot< void`'_COMMA_PREFIX($6) > SlotType; - __CPPNAME__* obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); + auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); // Do not try to call a signal on a disassociated wrapper. if(obj) { try { - if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data)) + if(const auto slot = Glib::SignalProxyNormal::data_to_slot`'(data)) (*static_cast(slot))($7); } catch(...) @@ -235,7 +235,7 @@ $4 __CPPNAME__`'_Class::$2_callback`'($5) dnl First, do a simple cast to ObjectBase. We will have to do a dynamic_cast dnl eventually, but it is not necessary to check whether we need to call dnl the vfunc. - Glib::ObjectBase *const obj_base = static_cast( + const auto obj_base = static_cast( Glib::ObjectBase::_get_current_wrapper`'((GObject*)$8)); _IMPORT(SECTION_CHECK) @@ -248,7 +248,7 @@ _IMPORT(SECTION_CHECK) { dnl We need to do a dynamic cast to get the real object type, to call the dnl C++ vfunc on it. - CppObjectType *const obj = dynamic_cast(obj_base); + const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -279,7 +279,7 @@ ifelse($11, `', `dnl } } - BaseClassType *const base = static_cast( + const auto base = static_cast( ifdef(`__BOOL_IS_INTERFACE__',`dnl _IFACE_PARENT_FROM_OBJECT($8)dnl ',`dnl @@ -325,7 +325,7 @@ ifelse(`$9',,,`#ifdef $9' )dnl $3 __NAMESPACE__::__CPPNAME__::on_$1`'($5) { - BaseClassType *const base = static_cast( + const auto base = static_cast( ifdef(`__BOOL_IS_INTERFACE__',`dnl _IFACE_PARENT_FROM_OBJECT(gobject_)dnl ',`dnl diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4 index 8cbf9080..6ed4989e 100644 --- a/tools/m4/vfunc.m4 +++ b/tools/m4/vfunc.m4 @@ -37,13 +37,13 @@ ifelse(`$11',,,`#ifdef $11' $4 __CPPNAME__`'_Class::$2_vfunc_callback`'($5) { ifelse(`$14',,,dnl -` const $13* slot = static_cast<$13*>($14); +` const auto slot = static_cast<$13*>($14); ')dnl dnl First, do a simple cast to ObjectBase. We will have to do a dynamic_cast dnl eventually, but it is not necessary to check whether we need to call dnl the vfunc. - Glib::ObjectBase *const obj_base = static_cast( + const auto obj_base = static_cast( Glib::ObjectBase::_get_current_wrapper`'((GObject*)$8)); _IMPORT(SECTION_CHECK) @@ -56,7 +56,7 @@ _IMPORT(SECTION_CHECK) { dnl We need to do a dynamic cast to get the real object type, to call the dnl C++ vfunc on it. - CppObjectType *const obj = dynamic_cast(obj_base); + const auto obj = dynamic_cast(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -70,9 +70,9 @@ ifelse($9,refreturn_ctype,`dnl Assume Glib::unwrap_copy() is correct if refretur return Glib::unwrap_copy`'(`obj->$1'($7)); ',`dnl not refreturn_ctype ifelse($10,keep_return,`dnl - static GQuark quark_return_value = g_quark_from_static_string("__NAMESPACE__::__CPPNAME__::$1"); + static auto quark_return_value = g_quark_from_static_string("__NAMESPACE__::__CPPNAME__::$1"); - $3* return_value = static_cast<$3*>(g_object_get_qdata(obj_base->gobj(), quark_return_value)); + auto return_value = static_cast<$3*>(g_object_get_qdata(obj_base->gobj(), quark_return_value)); if (!return_value) { return_value = new $3`'(); @@ -158,13 +158,13 @@ ifelse(`$11',,,dnl dnl See if the slot should or should not be copied `ifelse(`$13',,dnl ` // Create a copy of the slot. - $11* slot_copy = new $11($12); ',dnl + auto slot_copy = new $11($12); ',dnl dnl ` // Use the original slot (not a copy). - $11* slot_copy = const_cast<$11*>(&$12);') + auto slot_copy = const_cast<$11*>(&$12);') ')dnl - BaseClassType *const base = static_cast( + const auto base = static_cast( ifdef(`__BOOL_IS_INTERFACE__',`dnl _IFACE_PARENT_FROM_OBJECT(gobject_)dnl ',`dnl -- cgit v1.2.1 From d5fbe0d1e69d81aae918834c3a0c561b99f2791f Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 13:16:43 +0200 Subject: examples: Avoid more shadowed variables. --- examples/dbus/client_bus_listnames.cc | 4 ++-- examples/network/resolver.cc | 4 ++-- examples/network/socket-server.cc | 4 ++-- examples/thread/dispatcher.cc | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc index 4507aec1..06fc5887 100644 --- a/examples/dbus/client_bus_listnames.cc +++ b/examples/dbus/client_bus_listnames.cc @@ -48,12 +48,12 @@ void on_dbus_proxy_available(Glib::RefPtr& result) { // The proxy's call method returns a tuple of the value(s) that the method // call produces so just get the tuple as a VariantContainerBase. - const auto result = proxy->call_sync("ListNames"); + const auto call_result = proxy->call_sync("ListNames"); // Now extract the single item in the variant container which is the // array of strings (the names). Glib::Variant< std::vector> names_variant; - result.get_child(names_variant); + call_result.get_child(names_variant); // Get the vector of strings. std::vector names = names_variant.get(); diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index 49ad2a58..c9195830 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -435,9 +435,9 @@ interrupted (int /*sig*/) } static bool -async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr cancellable) +async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr the_cancellable) { - cancellable->cancel (); + the_cancellable->cancel (); return false; } #endif diff --git a/examples/network/socket-server.cc b/examples/network/socket-server.cc index 360c90bd..897c5d14 100644 --- a/examples/network/socket-server.cc +++ b/examples/network/socket-server.cc @@ -75,8 +75,8 @@ socket_address_to_string (const Glib::RefPtr& address) auto inet_address = isockaddr->get_address (); auto str = inet_address->to_string (); - auto port = isockaddr->get_port (); - auto res = Glib::ustring::compose ("%1:%2", str, port); + auto the_port = isockaddr->get_port (); + auto res = Glib::ustring::compose ("%1:%2", str, the_port); return res; } diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc index 79ff64bc..e58cb227 100644 --- a/examples/thread/dispatcher.cc +++ b/examples/thread/dispatcher.cc @@ -29,7 +29,7 @@ namespace class ThreadProgress { public: - explicit ThreadProgress(int id); + explicit ThreadProgress(int the_id); virtual ~ThreadProgress(); int id() const; @@ -78,10 +78,10 @@ public: void operator()(T ptr) const { delete ptr; } }; -ThreadProgress::ThreadProgress(int id) +ThreadProgress::ThreadProgress(int the_id) : thread_ (nullptr), - id_ (id), + id_ (the_id), progress_ (0) { // Connect to the cross-thread signal. -- cgit v1.2.1 From e1dba38d6b9a6d08c6ddb868a9dae825f4c10932 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 13:22:10 +0200 Subject: Examples: OptionGroup: Make the args public again to fix the build. --- examples/options/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/options/main.cc b/examples/options/main.cc index d693d09d..fcda4a98 100644 --- a/examples/options/main.cc +++ b/examples/options/main.cc @@ -35,6 +35,7 @@ private: bool on_option_arg_filename(const Glib::ustring& option_name, const std::string& value, bool has_value); +public: //These members should live as long as the OptionGroup to which they are added, //and as long as the OptionContext to which that OptionGroup is added. int m_arg_foo; -- cgit v1.2.1 From fc715b2e6bcbe92ae3125026f5e593a73d7bfa70 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 13:29:24 +0200 Subject: C++11: More uses of range-based for. --- gio/src/application.ccg | 6 ++---- glib/src/optiongroup.ccg | 9 ++++----- glib/src/variant.ccg | 5 ++--- glib/src/variant.hg | 12 +++++------- tests/glibmm_variant/main.cc | 14 ++++++-------- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 59f17dd7..8543d201 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -39,11 +39,9 @@ struct ExtraApplicationData ~ExtraApplicationData() { - for (std::vector::iterator iter = option_entry_strings.begin(); - iter != option_entry_strings.end(); ++iter) + for(auto str : option_entry_strings) { - g_free(*iter); - *iter = 0; + g_free(str); } } }; diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index cffa3435..42313bcf 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -157,10 +157,9 @@ gboolean OptionGroup::post_parse_callback(GOptionContext* context, //The C args have now been given values by g_option_context_parse(). //Convert C values to C++ values: - for(type_map_entries::iterator iter = option_group->map_entries_.begin(); - iter != option_group->map_entries_.end(); ++iter) + for(auto& the_pair : option_group->map_entries_) { - auto& cpp_entry = iter->second; + auto& cpp_entry = the_pair.second; cpp_entry.convert_c_to_cpp(); } @@ -286,9 +285,9 @@ OptionGroup::OptionGroup(GOptionGroup* castitem) OptionGroup::~OptionGroup() { //Free any C types that were allocated during add_entry(): - for(type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter) + for(auto& the_pair : map_entries_) { - auto& cpp_entry = iter->second; + auto& cpp_entry = the_pair.second; cpp_entry.release_c_arg(); } diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index fd47549c..af64f619 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -451,11 +451,10 @@ Variant::create(const type_vec_ustring& data) GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj()); // Add the elements of the vector into the builder. - for(type_vec_ustring::const_iterator iter = data.begin(); - iter < data.end(); iter++) + for(const auto& str : data) { g_variant_builder_add(builder, - element_variant_type.get_string().c_str(), iter->c_str()); + element_variant_type.get_string().c_str(), str.c_str()); } // Create the variant using the builder. diff --git a/glib/src/variant.hg b/glib/src/variant.hg index b92d825a..5f9a440e 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -1090,10 +1090,9 @@ Variant< std::vector >::create(const std::vector& data) GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj()); // Add the elements of the vector into the builder. - for(typename std::vector::const_iterator iter = data.begin(); - iter < data.end(); iter++) + for(const auto& element : data) { - Glib::Variant variant = Glib::Variant::create(*iter); + Glib::Variant variant = Glib::Variant::create(element); g_variant_builder_add_value(builder, variant.gobj()); } @@ -1177,11 +1176,10 @@ Variant< std::map >::create(const std::map& data) GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj()); // Add the elements of the map into the builder. - for(typename std::map::const_iterator iter = data.begin(); - iter != data.end(); iter++) + for(const auto& element : data) { - Variant< std::pair > dict_entry = - Variant< std::pair >::create(*iter); + auto dict_entry = + Variant< std::pair >::create(element); g_variant_builder_add_value(builder, dict_entry.gobj()); } diff --git a/tests/glibmm_variant/main.cc b/tests/glibmm_variant/main.cc index 484cb8f1..943f75a8 100644 --- a/tests/glibmm_variant/main.cc +++ b/tests/glibmm_variant/main.cc @@ -166,10 +166,8 @@ int main(int, char**) ComplexDictType map = copy_complex_vector[i]; - for(ComplexDictType::const_iterator iter = map.begin(); - iter != map.end(); iter++) + for(const auto& entry : map) { - std::pair< Glib::ustring, Glib::Variant > entry = *iter; ostr << entry.first << " -> " << entry.second.get() << "." << std::endl; } ostr << std::endl; @@ -309,12 +307,12 @@ void test_dynamic_cast_composite_types() ostr << "Cast composite type (get_type_string()=" << derived.get_type_string() << ", variant_type().get_string()=" << derived.variant_type().get_string() << "): "; composite_type var = derived.get(); - for (composite_type::const_iterator iter1 = var.begin(); iter1 != var.end(); ++iter1) + for (const auto& the_pair : var) { - ostr << "\n " << iter1->first << ":"; - const std::vector& vec = iter1->second; - for (std::vector::const_iterator iter2 = vec.begin(); iter2 != vec.end(); ++iter2) - ostr << " " << *iter2; + ostr << "\n " << the_pair.first << ":"; + const auto& vec = the_pair.second; + for (const auto& str : vec) + ostr << " " << str; } ostr << std::endl; } -- cgit v1.2.1 From ac8300539d154e6fb4d3663ed331971887df029d Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:00:47 +0200 Subject: C++11: More use of auto. --- gio/src/actionmap.ccg | 4 ++-- gio/src/application.ccg | 4 ++-- gio/src/dbusaddress.ccg | 12 +++++------ gio/src/dbussubtreevtable.ccg | 4 ++-- gio/src/file.ccg | 46 +++++++++++++++++++++---------------------- gio/src/loadableicon.ccg | 4 ++-- gio/src/proxyresolver.ccg | 2 +- glib/src/variant.ccg | 12 +++++------ 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg index a294bddc..20194d43 100644 --- a/gio/src/actionmap.ccg +++ b/gio/src/actionmap.ccg @@ -77,7 +77,7 @@ namespace { static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithStringParameterSlot& slot) { //TODO: This syntax is odd: - const Glib::Variant variantDerived = + const auto variantDerived = parameter.cast_dynamic< Glib::Variant >(parameter); const auto str = variantDerived.get(); slot(str); @@ -99,7 +99,7 @@ namespace { static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithIntParameterSlot& slot) { //TODO: This syntax is odd: - const Glib::Variant variantDerived = + const auto variantDerived = parameter.cast_dynamic< Glib::Variant >(parameter); const auto str = variantDerived.get(); slot(str); diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 8543d201..3eccdda6 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -73,7 +73,7 @@ static void Application_signal_open_callback(GApplication* self, GFile** files, { try { - if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) { + if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) { (*static_cast(slot))(vec_files, hint_str); return; } @@ -106,7 +106,7 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile** { try { - if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) { (*static_cast(slot))(vec_files, hint_str); return; diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index 2bcb7d7c..a8b1fd3b 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -65,7 +65,7 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res, GError* gerror = 0; gchar* g_out_guid = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), &g_out_guid, &gerror)); @@ -80,7 +80,7 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res) { GError* gerror = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), 0, &gerror)); @@ -96,7 +96,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, GError* gerror = 0; gchar* g_out_guid = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), &g_out_guid, Glib::unwrap(cancellable), &gerror)); @@ -113,7 +113,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, GError* gerror = 0; gchar* g_out_guid = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), &g_out_guid, 0, &gerror)); @@ -129,7 +129,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, { GError* gerror = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, Glib::unwrap(cancellable), &gerror)); @@ -143,7 +143,7 @@ Glib::RefPtr get_stream_sync(const std::string& address) { GError* gerror = 0; - Glib::RefPtr result = + auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, 0, &gerror)); if(gerror) diff --git a/gio/src/dbussubtreevtable.ccg b/gio/src/dbussubtreevtable.ccg index 5e726cc5..da8dd753 100644 --- a/gio/src/dbussubtreevtable.ccg +++ b/gio/src/dbussubtreevtable.ccg @@ -44,7 +44,7 @@ static char** DBusSubtreeVTable_Enumerate_giomm_callback( try { - std::vector result = + auto result = (*the_slot)(Glib::wrap(connection, true), sender, object_path); // This will be freed by the caller. @@ -77,7 +77,7 @@ static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback( try { - std::vector< Glib::RefPtr > result = + auto result = (*the_slot)(Glib::wrap(connection, true), sender, object_path, node); // This will be freed by the caller, along with unreferencing its members. diff --git a/gio/src/file.ccg b/gio/src/file.ccg index 56516ea1..f94511e4 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -138,7 +138,7 @@ SignalProxy_load_partial_contents_ready_callback(GObject*, GAsyncResult* res, vo try { - Glib::RefPtr result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } catch(...) @@ -441,7 +441,7 @@ FileType File::query_file_type(FileQueryInfoFlags flags) const Glib::RefPtr File::query_info(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) const { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -451,7 +451,7 @@ Glib::RefPtr File::query_info(const Glib::RefPtr& cancell Glib::RefPtr File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -496,7 +496,7 @@ File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -506,7 +506,7 @@ Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr File::query_filesystem_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -548,7 +548,7 @@ File::query_filesystem_info_async(const SlotAsyncReady& slot, const std::string& Glib::RefPtr File::enumerate_children(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -558,7 +558,7 @@ Glib::RefPtr File::enumerate_children(const Glib::RefPtr File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1505,7 +1505,7 @@ File::replace_contents_bytes_async(const SlotAsyncReady& slot, Glib::RefPtr File::replace(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1515,7 +1515,7 @@ Glib::RefPtr File::replace(const Glib::RefPtr& ca Glib::RefPtr File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1526,7 +1526,7 @@ Glib::RefPtr File::replace(const std::string& etag, bool make_ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1536,7 +1536,7 @@ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1548,7 +1548,7 @@ Glib::RefPtr File::replace_readwrite(const std::string& etag, bool Glib::RefPtr File::monitor_directory(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1558,7 +1558,7 @@ Glib::RefPtr File::monitor_directory(const Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1568,7 +1568,7 @@ Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) Glib::RefPtr File::monitor_file(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1578,7 +1578,7 @@ Glib::RefPtr File::monitor_file(const Glib::RefPtr& ca Glib::RefPtr File::monitor_file(FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1589,7 +1589,7 @@ Glib::RefPtr File::monitor_file(FileMonitorFlags flags) Glib::RefPtr File::monitor(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1599,7 +1599,7 @@ Glib::RefPtr File::monitor(const Glib::RefPtr& cancell Glib::RefPtr File::monitor(FileMonitorFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1811,7 +1811,7 @@ File::copy_attributes(const Glib::RefPtr& destination, FileCopyFlags flags Glib::RefPtr File::create_file(const Glib::RefPtr& cancellable, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1821,7 +1821,7 @@ Glib::RefPtr File::create_file(const Glib::RefPtr Glib::RefPtr File::create_file(FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1831,7 +1831,7 @@ Glib::RefPtr File::create_file(FileCreateFlags flags) Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr& cancellable, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1841,7 +1841,7 @@ Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1851,7 +1851,7 @@ Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) Glib::RefPtr File::append_to(const Glib::RefPtr& cancellable, FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1861,7 +1861,7 @@ Glib::RefPtr File::append_to(const Glib::RefPtr& Glib::RefPtr File::append_to(FileCreateFlags flags) { GError* gerror = 0; - Glib::RefPtr retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); + auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index 20281191..c11a44b7 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -30,7 +30,7 @@ LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr retval = + auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, &c_type, @@ -51,7 +51,7 @@ LoadableIcon::load(int size, Glib::ustring& type) { char* c_type; GError* gerror = 0; - Glib::RefPtr retval = + auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, &c_type, diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 72cad04e..01a93b81 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -30,7 +30,7 @@ namespace Gio std::vector ProxyResolver::lookup(const Glib::ustring& uri) { GError* gerror = 0; - std::vector retvalue = + auto retvalue = Glib::ArrayHandler::array_to_vector(g_proxy_resolver_lookup(gobj(), uri.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index af64f619..7523db5b 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -287,7 +287,7 @@ const VariantType& Variant::variant_type() Variant Variant::create(const VariantBase& data) { - Variant result = Variant(g_variant_new_variant(const_cast(data.gobj()))); + auto result = Variant(g_variant_new_variant(const_cast(data.gobj()))); return result; } @@ -318,7 +318,7 @@ const VariantType& Variant::variant_type() Variant Variant::create(const Glib::ustring& data) { - Variant result = + auto result = Variant(g_variant_new_string(data.c_str())); return result; } @@ -374,7 +374,7 @@ const VariantType& Variant::variant_type() Variant Variant::create(const std::string& data) { - Variant result = + auto result = Variant(g_variant_new_bytestring(data.c_str())); return result; } @@ -458,7 +458,7 @@ Variant::create(const type_vec_ustring& data) } // Create the variant using the builder. - Variant result = + auto result = Variant(g_variant_new( array_variant_type.get_string().c_str(), builder)); @@ -540,7 +540,7 @@ Variant::create(const type_vec_string& data) // Create the variant using g_variant_new_bytestring_array() (passing the // newly constructed array. - Variant result = + auto result = Variant(g_variant_new_bytestring_array(str_array, data.size())); @@ -565,7 +565,7 @@ Variant::create_from_object_paths(const type_vec_string& data) // Create the variant using g_variant_new_objv() (passing the // newly constructed array. - Variant result = + auto result = Variant(g_variant_new_objv(str_array, data.size())); g_strfreev(str_array); -- cgit v1.2.1 From b5e068e288a0e9d031c725d5c9423d63daef6a44 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:22:59 +0200 Subject: C++11: examples/tests: More use of auto. --- examples/child_watch/main.cc | 2 +- examples/dbus/client_bus_listnames.cc | 4 +-- examples/dbus/server_without_bus.cc | 6 ++-- examples/dbus/session_bus_service.cc | 4 +-- examples/keyfile/main.cc | 2 +- examples/network/resolver.cc | 8 ++--- examples/network/socket-client.cc | 4 +-- examples/settings/settings.cc | 2 +- examples/thread/dispatcher2.cc | 4 +-- gio/giomm/contenttype.cc | 4 +-- gio/giomm/slot_async.cc | 2 +- gio/giomm/socketsource.h | 2 +- glib/glibmm/dispatcher.cc | 2 +- glib/glibmm/main.cc | 4 +-- glib/glibmm/main.h | 10 +++---- tests/giomm_asyncresult_sourceobject/main.cc | 4 +-- tests/giomm_ioerror/main.cc | 4 +-- tests/giomm_memoryinputstream/main.cc | 2 +- tests/giomm_simple/main.cc | 4 +-- tests/giomm_tls_client/main.cc | 18 ++++++------ tests/glibmm_btree/main.cc | 4 +-- tests/glibmm_mainloop/main.cc | 6 ++-- tests/glibmm_valuearray/main.cc | 4 +-- tests/glibmm_variant/main.cc | 44 ++++++++++++++-------------- 24 files changed, 75 insertions(+), 75 deletions(-) diff --git a/examples/child_watch/main.cc b/examples/child_watch/main.cc index 883577a2..010992e3 100644 --- a/examples/child_watch/main.cc +++ b/examples/child_watch/main.cc @@ -59,7 +59,7 @@ void ChildWatch::on_child_exited(GPid pid, int status) int main() { - Glib::RefPtr mainLoop = Glib::MainLoop::create(); + auto mainLoop = Glib::MainLoop::create(); ChildWatch cwatch(mainLoop); cwatch.run(); diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc index 06fc5887..7b9adad6 100644 --- a/examples/dbus/client_bus_listnames.cc +++ b/examples/dbus/client_bus_listnames.cc @@ -56,7 +56,7 @@ void on_dbus_proxy_available(Glib::RefPtr& result) call_result.get_child(names_variant); // Get the vector of strings. - std::vector names = names_variant.get(); + auto names = names_variant.get(); std::cout << "The names on the message bus are:" << std::endl; @@ -81,7 +81,7 @@ int main(int, char**) loop = Glib::MainLoop::create(); // Get the user session bus connection. - Glib::RefPtr connection = + auto connection = Gio::DBus::Connection::get_sync(Gio::DBus::BUS_TYPE_SESSION); // Check for an unavailable connection. diff --git a/examples/dbus/server_without_bus.cc b/examples/dbus/server_without_bus.cc index 005dc554..6002c149 100644 --- a/examples/dbus/server_without_bus.cc +++ b/examples/dbus/server_without_bus.cc @@ -68,7 +68,7 @@ static void on_method_call(const Glib::RefPtr& /* connect curr_time.assign_current_time(); const Glib::ustring time_str = curr_time.as_iso8601(); - const Glib::Variant time_var = + const auto time_var = Glib::Variant::create(time_str); // Create the tuple. @@ -114,7 +114,7 @@ const Gio::DBus::InterfaceVTable interface_vtable(sigc::ptr_fun(&on_method_call) bool on_server_new_connection(const Glib::RefPtr& connection) { - Glib::RefPtr credentials = + auto credentials = connection->get_peer_credentials(); std::string credentials_str; @@ -200,7 +200,7 @@ int main(int, char**) server->signal_new_connection().connect(sigc::ptr_fun(&on_server_new_connection)); //Keep the server running until the process is killed: - Glib::RefPtr loop = Glib::MainLoop::create(); + auto loop = Glib::MainLoop::create(); loop->run(); return EXIT_SUCCESS; diff --git a/examples/dbus/session_bus_service.cc b/examples/dbus/session_bus_service.cc index b5ec2a71..ed320b8b 100644 --- a/examples/dbus/session_bus_service.cc +++ b/examples/dbus/session_bus_service.cc @@ -66,7 +66,7 @@ static void on_method_call(const Glib::RefPtr& /* connect curr_time.assign_current_time(); const Glib::ustring time_str = curr_time.as_iso8601(); - const Glib::Variant time_var = + const auto time_var = Glib::Variant::create(time_str); // Create the tuple. @@ -163,7 +163,7 @@ int main(int, char**) sigc::ptr_fun(&on_name_lost)); //Keep the service running until the process is killed: - Glib::RefPtr loop = Glib::MainLoop::create(); + auto loop = Glib::MainLoop::create(); loop->run(); Gio::DBus::unown_name(id); diff --git a/examples/keyfile/main.cc b/examples/keyfile/main.cc index 2f56b21a..33e90677 100644 --- a/examples/keyfile/main.cc +++ b/examples/keyfile/main.cc @@ -66,7 +66,7 @@ int main(int, char**) // An exception will be thrown if the value is not in the file: try { - const std::vector values = keyfile.get_integer_list("Another Group", "Numbers"); + const auto values = keyfile.get_integer_list("Another Group", "Numbers"); for(const auto& p : values) std::cout << "Number list value: item=" << p << std::endl; diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index c9195830..42f36a63 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -170,7 +170,7 @@ lookup_one_sync (const Glib::ustring& arg) } else if (Gio::hostname_is_ip_address (arg)) { - Glib::RefPtr addr = Gio::InetAddress::create (arg); + auto addr = Gio::InetAddress::create (arg); try { Glib::ustring name = resolver->lookup_by_address (addr, cancellable); @@ -266,7 +266,7 @@ start_async_lookups (char **argv, int argc) if (arg.find ('/') != std::string::npos) { /* service/protocol/domain */ - std::vector parts = split_service_parts (arg); + auto parts = split_service_parts (arg); if (parts.size () != 3) { usage (); return; @@ -281,7 +281,7 @@ start_async_lookups (char **argv, int argc) } else if (Gio::hostname_is_ip_address (argv[i])) { - Glib::RefPtr addr = Gio::InetAddress::create (argv[i]); + auto addr = Gio::InetAddress::create (argv[i]); resolver->lookup_by_address_async (addr, sigc::bind (sigc::ptr_fun @@ -307,7 +307,7 @@ static void print_connectable_sockaddr (Glib::RefPtr sockaddr) { Glib::ustring phys; - Glib::RefPtr isa = + auto isa = Glib::RefPtr::cast_dynamic (sockaddr); if (!isa) diff --git a/examples/network/socket-client.cc b/examples/network/socket-client.cc index e6ecaba0..44fd94ce 100644 --- a/examples/network/socket-client.cc +++ b/examples/network/socket-client.cc @@ -61,7 +61,7 @@ socket_address_to_string (const Glib::RefPtr& address) Glib::ustring str, res; int port; - Glib::RefPtr isockaddr = + auto isockaddr = Glib::RefPtr::cast_dynamic (address); if (!isockaddr) return Glib::ustring (); @@ -90,7 +90,7 @@ ensure_condition (const Glib::RefPtr& socket, if (use_source) { - Glib::RefPtr source = socket->create_source(condition, cancellable); + auto source = socket->create_source(condition, cancellable); source->connect(sigc::ptr_fun(&source_ready)); source->attach(); loop->run(); diff --git a/examples/settings/settings.cc b/examples/settings/settings.cc index bbf1c19c..84df7a0e 100644 --- a/examples/settings/settings.cc +++ b/examples/settings/settings.cc @@ -75,7 +75,7 @@ int main(int, char**) Glib::setenv("GSETTINGS_SCHEMA_DIR", ".", true); Glib::setenv("GSETTINGS_BACKEND", "memory", true); - const Glib::RefPtr settings = + const auto settings = Gio::Settings::create("org.gtkmm.demo"); settings->signal_changed().connect(sigc::bind(sigc::ptr_fun(&on_key_changed), settings)); diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc index b9afebc1..cd0faf26 100644 --- a/examples/thread/dispatcher2.cc +++ b/examples/thread/dispatcher2.cc @@ -156,9 +156,9 @@ bool ThreadTimer::timeout_handler() void ThreadTimer::thread_function() { // create a new Main Context - Glib::RefPtr context = Glib::MainContext::create(); + auto context = Glib::MainContext::create(); // create a new Main Loop - Glib::RefPtr mainloop = Glib::MainLoop::create(context, true); + auto mainloop = Glib::MainLoop::create(context, true); // attach a timeout handler, that is called every second, to the // newly created MainContext diff --git a/gio/giomm/contenttype.cc b/gio/giomm/contenttype.cc index a01a487e..74efd24a 100644 --- a/gio/giomm/contenttype.cc +++ b/gio/giomm/contenttype.cc @@ -50,7 +50,7 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type) Glib::RefPtr content_type_get_icon(const Glib::ustring& type) { - Glib::RefPtr retvalue = Glib::wrap(g_content_type_get_icon(type.c_str())); + auto retvalue = Glib::wrap(g_content_type_get_icon(type.c_str())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; @@ -59,7 +59,7 @@ Glib::RefPtr content_type_get_icon(const Glib::ustring& type) #ifdef G_OS_UNIX Glib::RefPtr content_type_get_symbolic_icon(const Glib::ustring& type) { - Glib::RefPtr retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str())); + auto retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; diff --git a/gio/giomm/slot_async.cc b/gio/giomm/slot_async.cc index 8db82bc8..31f90778 100644 --- a/gio/giomm/slot_async.cc +++ b/gio/giomm/slot_async.cc @@ -31,7 +31,7 @@ SignalProxy_async_callback(GObject*, GAsyncResult* res, void* data) try { - Glib::RefPtr result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } catch(...) diff --git a/gio/giomm/socketsource.h b/gio/giomm/socketsource.h index a86ed88f..77bec405 100644 --- a/gio/giomm/socketsource.h +++ b/gio/giomm/socketsource.h @@ -45,7 +45,7 @@ public: * is equivalent to: * @code * bool io_handler(Glib::IOCondition io_condition) { ... } - * const Glib::RefPtr socket_source = Gio::SocketSource::create(socket, Glib::IO_IN | Glib::IO_OUT); + * const auto socket_source = Gio::SocketSource::create(socket, Glib::IO_IN | Glib::IO_OUT); * socket_source->connect(sigc::ptr_fun(&io_handler)); * socket_source->attach(Glib::MainContext::get_default()); * @endcode diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc index f6257f36..4fa95dae 100644 --- a/glib/glibmm/dispatcher.cc +++ b/glib/glibmm/dispatcher.cc @@ -197,7 +197,7 @@ DispatchNotifier::DispatchNotifier(const Glib::RefPtr& context) // sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IO_IN); // except for source->set_can_recurse(true). - const Glib::RefPtr source = IOSource::create(fd, Glib::IO_IN); + const auto source = IOSource::create(fd, Glib::IO_IN); // If the signal emission in pipe_io_handler() starts a new main loop, // the event source shall not be blocked while that loop runs. (E.g. while diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc index 1d9d9152..81ffa403 100644 --- a/glib/glibmm/main.cc +++ b/glib/glibmm/main.cc @@ -497,7 +497,7 @@ SignalIO::SignalIO(GMainContext* context) sigc::connection SignalIO::connect(const sigc::slot& slot, int fd, IOCondition condition, int priority) { - const Glib::RefPtr source = IOSource::create(fd, condition); + const auto source = IOSource::create(fd, condition); if(priority != G_PRIORITY_DEFAULT) source->set_priority(priority); @@ -513,7 +513,7 @@ sigc::connection SignalIO::connect(const sigc::slot& slot, const Glib::RefPtr& channel, IOCondition condition, int priority) { - const Glib::RefPtr source = IOSource::create(channel, condition); + const auto source = IOSource::create(channel, condition); if(priority != G_PRIORITY_DEFAULT) source->set_priority(priority); diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h index 94d495c1..30b40a6e 100644 --- a/glib/glibmm/main.h +++ b/glib/glibmm/main.h @@ -107,7 +107,7 @@ public: * is equivalent to: * @code * bool timeout_handler() { ... } - * const Glib::RefPtr timeout_source = Glib::TimeoutSource::create(1000); + * const auto timeout_source = Glib::TimeoutSource::create(1000); * timeout_source->connect(sigc::ptr_fun(&timeout_handler)); * timeout_source->attach(Glib::MainContext::get_default()); * @endcode @@ -165,7 +165,7 @@ public: * is equivalent to: * @code * bool timeout_handler() { ... } - * const Glib::RefPtr timeout_source = Glib::TimeoutSource::create(5000); + * const auto timeout_source = Glib::TimeoutSource::create(5000); * timeout_source->connect(sigc::ptr_fun(&timeout_handler)); * timeout_source->attach(Glib::MainContext::get_default()); * @endcode @@ -232,7 +232,7 @@ public: * is equivalent to: * @code * bool idle_handler() { ... } - * const Glib::RefPtr idle_source = Glib::IdleSource::create(); + * const auto idle_source = Glib::IdleSource::create(); * idle_source->connect(sigc::ptr_fun(&idle_handler)); * idle_source->attach(Glib::MainContext::get_default()); * @endcode @@ -291,7 +291,7 @@ public: * is equivalent to: * @code * bool io_handler(Glib::IOCondition io_condition) { ... } - * const Glib::RefPtr io_source = Glib::IOSource::create(fd, Glib::IO_IN | Glib::IO_HUP); + * const auto io_source = Glib::IOSource::create(fd, Glib::IO_IN | Glib::IO_HUP); * io_source->connect(sigc::ptr_fun(&io_handler)); * io_source->attach(Glib::MainContext::get_default()); * @endcode @@ -319,7 +319,7 @@ public: * is equivalent to: * @code * bool io_handler(Glib::IOCondition io_condition) { ... } - * const Glib::RefPtr io_source = Glib::IOSource::create(channel, Glib::IO_IN | Glib::IO_HUP); + * const auto io_source = Glib::IOSource::create(channel, Glib::IO_IN | Glib::IO_HUP); * io_source->connect(sigc::ptr_fun(&io_handler)); * io_source->attach(Glib::MainContext::get_default()); * @endcode diff --git a/tests/giomm_asyncresult_sourceobject/main.cc b/tests/giomm_asyncresult_sourceobject/main.cc index c9f79e58..12136fa8 100644 --- a/tests/giomm_asyncresult_sourceobject/main.cc +++ b/tests/giomm_asyncresult_sourceobject/main.cc @@ -29,9 +29,9 @@ int main(int, char**) Glib::init(); Gio::init(); - Glib::RefPtr mainloop = Glib::MainLoop::create(); + auto mainloop = Glib::MainLoop::create(); - Glib::RefPtr file = Gio::File::create_for_path("/etc/passwd"); + auto file = Gio::File::create_for_path("/etc/passwd"); file->read_async(&on_read_async); mainloop->run(); diff --git a/tests/giomm_ioerror/main.cc b/tests/giomm_ioerror/main.cc index ae51ec21..797ed22e 100644 --- a/tests/giomm_ioerror/main.cc +++ b/tests/giomm_ioerror/main.cc @@ -34,14 +34,14 @@ int main(int, char**) try { - Glib::RefPtr file = Gio::File::create_for_path(TEST_FILE); + auto file = Gio::File::create_for_path(TEST_FILE); if(!file) { std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl; return EXIT_FAILURE; } - Glib::RefPtr stream = file->read(); + auto stream = file->read(); if(!stream) { std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl; diff --git a/tests/giomm_memoryinputstream/main.cc b/tests/giomm_memoryinputstream/main.cc index 813fa4e3..8228bd21 100644 --- a/tests/giomm_memoryinputstream/main.cc +++ b/tests/giomm_memoryinputstream/main.cc @@ -43,7 +43,7 @@ int main(int, char**) std::memset(buffer, 0, sizeof buffer); try { - Glib::RefPtr stream = Gio::MemoryInputStream::create(); + auto stream = Gio::MemoryInputStream::create(); if (!stream) { std::cerr << "Could not create a MemoryInputStream." << std::endl; diff --git a/tests/giomm_simple/main.cc b/tests/giomm_simple/main.cc index e88c4604..175cadf3 100644 --- a/tests/giomm_simple/main.cc +++ b/tests/giomm_simple/main.cc @@ -22,14 +22,14 @@ int main(int, char**) try { - Glib::RefPtr file = Gio::File::create_for_path(TEST_FILE); + auto file = Gio::File::create_for_path(TEST_FILE); if(!file) { std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl; return EXIT_FAILURE; } - Glib::RefPtr stream = file->read(); + auto stream = file->read(); if(!stream) { std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl; diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc index a8099b72..7a4d4bf2 100644 --- a/tests/giomm_tls_client/main.cc +++ b/tests/giomm_tls_client/main.cc @@ -29,7 +29,7 @@ bool on_accept_certificate(const Glib::RefPtr& cert, std::cout << "Outputing certificate data:" << std::endl << cert->property_certificate_pem().get_value(); - Glib::RefPtr issuer = cert->get_issuer(); + auto issuer = cert->get_issuer(); std::cout << "Outputing the issuer's certificate data:" << std::endl << issuer->property_certificate_pem().get_value(); @@ -74,16 +74,16 @@ int main(int, char**) std::cout << "Successfully resolved address of test host '" << test_host << "'." << std::endl; - Glib::RefPtr first_inet_address = inet_addresses[0]; + auto first_inet_address = inet_addresses[0]; std::cout << "First address of test host is " << first_inet_address->to_string() << "." << std::endl; - Glib::RefPtr socket = + auto socket = Gio::Socket::create(first_inet_address->get_family(), Gio::SOCKET_TYPE_STREAM, Gio::SOCKET_PROTOCOL_TCP); - Glib::RefPtr address = + auto address = Gio::InetSocketAddress::create(first_inet_address, 443); try @@ -105,7 +105,7 @@ int main(int, char**) "." << std::endl; } - Glib::RefPtr conn = Glib::RefPtr::cast_dynamic(Gio::SocketConnection::create(socket)); + auto conn = Glib::RefPtr::cast_dynamic(Gio::SocketConnection::create(socket)); if(!conn || !conn->is_connected()) { @@ -122,7 +122,7 @@ int main(int, char**) try { - Glib::RefPtr tls_connection = + auto tls_connection = Gio::TlsClientConnection::create(conn, address); tls_connection->signal_accept_certificate().connect( @@ -133,7 +133,7 @@ int main(int, char**) std::cout << "Attempting to get the issuer's certificate from the " "connection." << std::endl; - Glib::RefPtr issuer_certificate = + auto issuer_certificate = tls_connection->get_peer_certificate()->get_issuer(); if(!issuer_certificate) @@ -146,12 +146,12 @@ int main(int, char**) std::endl; std::cout << "Attempting to use the connection's database." << std::endl; - Glib::RefPtr database = tls_connection->get_database(); + auto database = tls_connection->get_database(); std::cout << "Looking up the certificate's issuer in the database." << std::endl; - Glib::RefPtr db_certificate = + auto db_certificate = database->lookup_certificate_issuer(issuer_certificate); if(!db_certificate) diff --git a/tests/glibmm_btree/main.cc b/tests/glibmm_btree/main.cc index 8ee1114b..837b7ae7 100644 --- a/tests/glibmm_btree/main.cc +++ b/tests/glibmm_btree/main.cc @@ -74,7 +74,7 @@ my_p_key_compare(const type_p_key_value& key_a, const type_p_key_value& key_b) int main() { - Glib::RefPtr< Glib::BalancedTree > tree = Glib::BalancedTree::create(); + auto tree = Glib::BalancedTree::create(); for (type_key_value::size_type i = 0; i < str.size(); ++i) tree->insert(str.substr(i, 1), str.substr(i, 1)); @@ -137,7 +137,7 @@ main() value = tree->search(sigc::ptr_fun(my_search), "|"); g_assert(value == NULL); - Glib::RefPtr< Glib::BalancedTree > ptree = Glib::BalancedTree::create(sigc::ptr_fun(my_p_key_compare)); + auto ptree = Glib::BalancedTree::create(sigc::ptr_fun(my_p_key_compare)); for (type_key_value::size_type i = 0; i < str.size(); ++i) pstr.push_back(new type_key_value(str.substr(i, 1))); diff --git a/tests/glibmm_mainloop/main.cc b/tests/glibmm_mainloop/main.cc index fbf70027..56bd02d9 100644 --- a/tests/glibmm_mainloop/main.cc +++ b/tests/glibmm_mainloop/main.cc @@ -50,8 +50,8 @@ bool mark_and_quit(const Glib::Threads::Thread* expected_thread, void thread_function(const Glib::Threads::Thread* first_thread, const Glib::RefPtr& first_mainloop) { - Glib::RefPtr second_context = Glib::MainContext::create(); - Glib::RefPtr second_mainloop = Glib::MainLoop::create(second_context); + auto second_context = Glib::MainContext::create(); + auto second_mainloop = Glib::MainLoop::create(second_context); // Show how Glib::MainContext::invoke() can be used for calling a function, // possibly executed in another thread. @@ -75,7 +75,7 @@ int main(int, char**) { Glib::init(); - Glib::RefPtr first_mainloop = Glib::MainLoop::create(); + auto first_mainloop = Glib::MainLoop::create(); // This thread shall be the owner of the default main context, when // thread_function() calls mark_and_quit() via Glib::MainContext::invoke(), diff --git a/tests/glibmm_valuearray/main.cc b/tests/glibmm_valuearray/main.cc index 62b19ede..ca111432 100644 --- a/tests/glibmm_valuearray/main.cc +++ b/tests/glibmm_valuearray/main.cc @@ -69,7 +69,7 @@ int main(int, char**) break; } - Glib::Value int_val = static_cast< Glib::Value& >(value); + auto int_val = static_cast< Glib::Value& >(value); ostr << int_val.get() << " "; } ostr << std::endl; // End of line for list of array elements. @@ -92,7 +92,7 @@ int main(int, char**) break; } - Glib::Value int_val = static_cast< Glib::Value& >(value); + auto int_val = static_cast< Glib::Value& >(value); ostr << int_val.get() << " "; } ostr << std::endl; // End of line for list of array elements. diff --git a/tests/glibmm_variant/main.cc b/tests/glibmm_variant/main.cc index 943f75a8..47943de3 100644 --- a/tests/glibmm_variant/main.cc +++ b/tests/glibmm_variant/main.cc @@ -26,10 +26,10 @@ int main(int, char**) for(guint i = 0; i < int_vector.size(); i++) ostr << int_vector[i] << std::endl; - Glib::Variant< std::vector > integers_variant = + auto integers_variant = Glib::Variant< std::vector >::create(int_vector); - std::vector int_vector2 = integers_variant.get(); + auto int_vector2 = integers_variant.get(); ostr << "The size of the copied vector is " << int_vector2.size() << '.' << std::endl; @@ -53,7 +53,7 @@ int main(int, char**) //vector: std::vector vec_strings; vec_strings.push_back("a"); - Glib::Variant > variant_vec_strings = + auto variant_vec_strings = Glib::Variant >::create(vec_strings); //Dict: @@ -65,7 +65,7 @@ int main(int, char**) ostr << "The original dictionary entry is (" << dict_entry.first << ", " << dict_entry.second << ")." << std::endl; - Glib::Variant dict_entry_variant = + auto dict_entry_variant = Glib::Variant::create(dict_entry); TypeDictEntry copy_entry = dict_entry_variant.get(); @@ -92,7 +92,7 @@ int main(int, char**) ostr << "(" << i << ", " << orig_dict[i] << ")." << std::endl; } - Glib::Variant orig_dict_variant = + auto orig_dict_variant = Glib::Variant::create(orig_dict); TypeDict dict_copy = orig_dict_variant.get(); @@ -106,7 +106,7 @@ int main(int, char**) index = 3; - std::pair a_pair = orig_dict_variant.get_child(index); + auto a_pair = orig_dict_variant.get_child(index); ostr << "Element number " << index + 1 << " in the variant is: (" << a_pair.first << ", " << a_pair.second << ")." << std::endl; @@ -134,7 +134,7 @@ int main(int, char**) Glib::ustring s = "String " + ss.str(); - Glib::Variant v = Glib::Variant::create(i); + auto v = Glib::Variant::create(i); complex_dict1.insert( std::pair< Glib::ustring, Glib::Variant >("Map 1 " + s, v)); @@ -150,7 +150,7 @@ int main(int, char**) complex_vector.push_back(complex_dict1); complex_vector.push_back(complex_dict2); - Glib::Variant complex_variant = + auto complex_variant = Glib::Variant::create(complex_vector); // This will output the type string aa{sv}. @@ -187,7 +187,7 @@ static void test_dynamic_cast_ustring_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_string); ostr << "Casted string Glib::Variant: " << derived.get() << std::endl; } @@ -202,7 +202,7 @@ static void test_dynamic_cast_ustring_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_objectpath); ostr << "Casted object path Glib::Variant: " << derived.get() << std::endl; } @@ -216,7 +216,7 @@ static void test_dynamic_cast_ustring_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_signature); ostr << "Casted signature Glib::Variant: " << derived.get() << std::endl; } @@ -235,7 +235,7 @@ static void test_dynamic_cast_string_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_string); ostr << "Casted string Glib::Variant: " << derived.get() << std::endl; } @@ -250,7 +250,7 @@ static void test_dynamic_cast_string_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_objectpath); ostr << "Casted object path Glib::Variant: " << derived.get() << std::endl; } @@ -264,7 +264,7 @@ static void test_dynamic_cast_string_types() try { - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic< Glib::Variant >(vbase_signature); ostr << "Casted signature Glib::Variant: " << derived.get() << std::endl; } @@ -301,7 +301,7 @@ void test_dynamic_cast_composite_types() try { typedef std::map > composite_type; - Glib::Variant derived = + auto derived = Glib::VariantBase::cast_dynamic >(cppdict); ostr << "Cast composite type (get_type_string()=" << derived.get_type_string() @@ -323,7 +323,7 @@ void test_dynamic_cast_composite_types() try { - Glib::Variant > derived = + auto derived = Glib::VariantBase::cast_dynamic > >(cppdict); g_assert_not_reached(); } @@ -334,9 +334,9 @@ void test_dynamic_cast_composite_types() static void test_dynamic_cast() { - Glib::Variant v1 = Glib::Variant::create(10); + auto v1 = Glib::Variant::create(10); Glib::VariantBase& v2 = v1; - Glib::Variant v3 = Glib::VariantBase::cast_dynamic >(v2); + auto v3 = Glib::VariantBase::cast_dynamic >(v2); g_assert(v3.get() == 10); Glib::VariantBase v5 = v1; @@ -383,7 +383,7 @@ static void test_dynamic_cast() type_dict_sv var_map; type_map_sv map; - Glib::Variant var_string = + auto var_string = Glib::Variant::create("test variant"); map["test key"] = var_string; var_map = type_dict_sv::create(map); @@ -394,7 +394,7 @@ static void test_dynamic_cast() try { - Glib::Variant > var_wrong_map = + auto var_wrong_map = Glib::VariantBase::cast_dynamic > >(ref_var_base); g_assert_not_reached(); } @@ -407,9 +407,9 @@ static void test_dynamic_cast() g_assert(var_string.get() == "test variant"); // A variant of type v - Glib::Variant var_v = Glib::Variant::create(var_string); + auto var_v = Glib::Variant::create(var_string); g_assert(var_v.get_type_string() == "v"); - Glib::Variant var_s2 = + auto var_s2 = Glib::VariantBase::cast_dynamic >(var_v.get()); g_assert(var_s2.get() == "test variant"); -- cgit v1.2.1 From dc8ed8bb42694705b98c89747f3df405c57c107c Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:32:41 +0200 Subject: Regenerate gio _docs.xml --- gio/src/gio_docs.xml | 1085 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1067 insertions(+), 18 deletions(-) diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index d7c3a4ec..9f9a22c8 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -798,6 +798,11 @@ an owner for the destination name in response to this method invocation. + + the caller is prepared to +wait for interactive authorization. Since 2.46. + + @@ -1388,6 +1393,12 @@ Since: 2.26 owner for the destination name in response to this message. + + If set on a method +call, this flag means that the caller is prepared to wait for interactive +authorization. Since 2.46. + + @@ -4035,6 +4046,16 @@ Since: 2.38 + + +If %TRUE, the state of the action will be the negation of the +property value, provided the property is boolean. + +Since: 2.46 + + + + The name of the action. This is mostly meaningful for identifying @@ -6347,6 +6368,24 @@ Since: 2.26 + + +A path to the key in the registry, in UTF-8. + +Since: 2.46 + + + + + + +A path to the key in the registry, in UTF-16. + +Since: 2.46 + + + + If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is @@ -6920,8 +6959,7 @@ Since: 2.28 - the state type, if the action -is stateful + the state type, if the action is stateful @@ -27317,7 +27355,9 @@ If @etag is specified (not %NULL), any existing file must have that etag, or the error %G_IO_ERROR_WRONG_ETAG will be returned. If @make_backup is %TRUE, this function will attempt to make a backup -of @file. +of @file. Internally, it uses g_file_replace(), so will try to replace the +file contents in the safest way possible. For example, atomic renames are +used when replacing local files’ contents. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation @@ -34774,6 +34814,28 @@ Since: 2.20 + + +Creates a new #GNativeSocketAddress for @address and @port. + +Since: 2.46 + + + + + a #GNativeAddress + + + + a port number + + + + a new #GNativeSocketAddress + + + + Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded, @@ -38750,7 +38812,7 @@ Free the returned object with g_object_unref() -Atomically increments the reference count of @array by one. This +Atomically increments the reference count of @resource by one. This function is MT-safe and may be called from any thread. Since: 2.32 @@ -38770,7 +38832,7 @@ Since: 2.32 Atomically decrements the reference count of @resource by one. If the -reference count drops to 0, all memory allocated by the array is +reference count drops to 0, all memory allocated by the resource is released. This function is MT-safe and may be called from any thread. @@ -40774,6 +40836,29 @@ Since: 2.44 + + +Introspects the list of keys on @schema. + +You should probably not be calling this function from "normal" code +(since you should already know what keys are in your schema). This +function is intended for introspection reasons. + +Since: 2.46 + + + + + a #GSettingsSchema + + + + a list of the keys on +@schema + + + + Increase the reference count of @schema, returning a new reference. @@ -45447,6 +45532,9 @@ mode of the #GSocket. On success, the returned #GSocket takes ownership of @fd. On failure, the caller must close @fd themselves. +Since GLib 2.46, it is no longer a fatal error to call this on a non-socket +descriptor. Instead, a GError will be set with code %G_IO_ERROR_FAILED + Since: 2.22 @@ -47144,9 +47232,8 @@ Since: 2.40 Returns the value of the environment variable @variable in the environment of processes launched from this launcher. -The returned string is in the GLib file name encoding. On UNIX, this -means that it can be an arbitrary byte string. On Windows, it will -be UTF-8. +On UNIX, the returned string can be an arbitrary byte string. +On Windows, it will be UTF-8. Since: 2.40 @@ -47262,9 +47349,8 @@ g_environ_unsetenv(), etc. As an alternative, you can use g_subprocess_launcher_setenv(), g_subprocess_launcher_unsetenv(), etc. -All strings in this array are expected to be in the GLib file name -encoding. On UNIX, this means that they can be arbitrary byte -strings. On Windows, they should be in UTF-8. +On UNIX, all strings in this array can be arbitrary byte strings. +On Windows, they should be in UTF-8. Since: 2.40 @@ -47410,10 +47496,9 @@ Since: 2.40 Sets the environment variable @variable in the environment of processes launched from this launcher. -Both the variable's name and value should be in the GLib file name -encoding. On UNIX, this means that they can be arbitrary byte -strings. On Windows, they should be in UTF-8. - +On UNIX, both the variable's name and value can be arbitrary byte +strings, except that the variable's name cannot contain '='. +On Windows, they should be in UTF-8. Since: 2.40 @@ -47639,9 +47724,8 @@ Since: 2.40 Removes the environment variable @variable from the environment of processes launched from this launcher. -The variable name should be in the GLib file name encoding. On UNIX, -this means that they can be arbitrary byte strings. On Windows, they -should be in UTF-8. +On UNIX, the variable's name can be an arbitrary byte string not +containing '='. On Windows, it should be in UTF-8. Since: 2.40 @@ -53974,6 +54058,971 @@ Since: 2.26 + + +Erases change indicator of the @key. + +Subsequent calls to g_win32_registry_key_has_changed() will return %FALSE +until the key is put on watch again by calling +g_win32_registry_key_watch() again. + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + + + + + +Opens a @subkey of the @key. + + + + + + a parent #GWin32RegistryKey + + + + name of a child key to open (in UTF-8), relative to @key + + + + a pointer to a %NULL #GError, or %NULL + + + + a #GWin32RegistryKey or %NULL if can't be opened. Free +with g_object_unref(). + + + + + +Opens a @subkey of the @key. + + + + + + a parent #GWin32RegistryKey + + + + name of a child key to open (in UTF-8), relative to @key + + + + a pointer to a %NULL #GError, or %NULL + + + + a #GWin32RegistryKey or %NULL if can't be opened. Free +with g_object_unref(). + + + + + +Get full path to the key + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + a full path to the key (in UTF-8), +or %NULL if it can't be converted to UTF-8. + + + + + + +Get full path to the key + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + a full path to the key (in UTF-16) + + + + + + +Get data from a value of a key. String data is guaranteed to be +appropriately terminated and will be in UTF-8. + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + (in) %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR +to G_WIN32_REGISTRY_VALUE_STR. + + + + name of the value to get (in UTF-8). +Empty string means the '(Default)' value. + + + + type of the value retrieved. + + + + contents of the value. + + + + size of the buffer pointed +by @value_data. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE on success, %FALSE on failure. + + + + + + +Get data from a value of a key. + +Get data from a value of a key. String data is guaranteed to be +appropriately terminated and will be in UTF-16. + +When calling with value_data == NULL (to get data size without getting +the data itself) remember that returned size corresponds to possibly +unterminated string data (if value is some kind of string), because +termination cannot be checked and fixed unless the data is retreived +too. + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + (in) %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR +to G_WIN32_REGISTRY_VALUE_STR. + + + + name of the value to get (in UTF-16). +Empty string means the '(Default)' value. + + + + type of the value retrieved. + + + + contents of the value. + + + + size of the buffer pointed +by @value_data. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE on success, %FALSE on failure. + + + + + + +Check the @key's status indicator. + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + %TRUE if the @key was put under watch at some point and has changed +since then, %FALSE if it either wasn't changed or wasn't watched at all. + + + + + + +Creates an object that represents a registry key specified by @path. +@path must start with one of the following pre-defined names: +- HKEY_CLASSES_ROOT +- HKEY_CURRENT_CONFIG +- HKEY_CURRENT_USER +- HKEY_CURRENT_USER_LOCAL_SETTINGS +- HKEY_LOCAL_MACHINE +- HKEY_PERFORMANCE_DATA +- HKEY_PERFORMANCE_NLSTEXT +- HKEY_PERFORMANCE_TEXT +- HKEY_USERS +@path must not end with '\\'. + + + + + + absolute full name of a key to open (in UTF-8) + + + + a pointer to a %NULL #GError, or %NULL + + + + a #GWin32RegistryKey or %NULL if can't +be opened. Free with g_object_unref(). + + + + + +Creates an object that represents a registry key specified by @path. +@path must start with one of the following pre-defined names: +- HKEY_CLASSES_ROOT +- HKEY_CURRENT_CONFIG +- HKEY_CURRENT_USER +- HKEY_CURRENT_USER_LOCAL_SETTINGS +- HKEY_LOCAL_MACHINE +- HKEY_PERFORMANCE_DATA +- HKEY_PERFORMANCE_NLSTEXT +- HKEY_PERFORMANCE_TEXT +- HKEY_USERS +@path must not end with L'\\'. + + + + + + absolute full name of a key to open (in UTF-16) + + + + a pointer to a %NULL #GError, or %NULL + + + + a #GWin32RegistryKey or %NULL if can't +be opened. Free with g_object_unref(). + + + + + +Puts @key under a watch. + +When the key changes, an APC will be queued in the current thread. The APC +will run when the current thread enters alertable state (GLib main loop +should do that; if you are not using it, see MSDN documentation for W32API +calls that put thread into alertable state). When it runs, it will +atomically switch an indicator in the @key. If a callback was specified, +it is invoked at that point. Subsequent calls to +g_win32_registry_key_has_changed() will return %TRUE, and the callback (if +it was specified) will not be invoked anymore. +Calling g_win32_registry_key_erase_change_indicator() will reset the indicator, +and g_win32_registry_key_has_changed() will start returning %FALSE. +To resume the watch, call g_win32_registry_key_watch_for_changes() again. + +Calling g_win32_registry_key_watch_for_changes() for a key that is already +being watched is allowed and affects nothing. + +The fact that the key is being watched will be used internally to update +key path (if it changes). + +Since: 2.46 + + + + + a #GWin32RegistryKey + + + + (in) %TRUE also watch the children of the @key, %FALSE +to watch the key only. + + + + specifies the types of changes to watch for. + + + + a function to invoke when a change occurs. + + + + a pointer to pass to @callback on invocation. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE on success, %FALSE on failure. + + + + + + +Assigns the value of @other to @iter. This function +is not useful in applications, because iterators can be assigned +with `GWin32RegistrySubkeyIter i = j;`. The +function is used by language bindings. + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + another #GWin32RegistrySubkeyIter + + + + + + + + +Frees internal buffers of a #GWin32RegistrySubkeyIter. + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + + + + + +Creates a dynamically-allocated copy of an iterator. Dynamically-allocated +state of the iterator is duplicated too. + +Since: 2.46 + + + + + an iterator + + + + a copy of the @iter, +free with g_win32_registry_subkey_iter_free () + + + + + + +Free an iterator allocated on the heap. For iterators that are allocated +on the stack use g_win32_registry_subkey_iter_clear () instead. + +Since: 2.46 + + + + + a dynamically-allocated iterator + + + + + + + + +Gets the name of the subkey at the @iter potision. + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + Pointer to a location +to store the name of a subkey (in UTF-8). Free with g_free(). + + + + Pointer to a location to store the +length of @subkey_name, in gchars, excluding NUL-terminator. +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if the name was retrieved, %FALSE otherwise. + + + + + + +Same as g_win32_registry_subkey_iter_get_next(), but outputs UTF-16-encoded +data, without converting it to UTF-8 first. + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + Pointer to a location +to store the name of a subkey (in UTF-16). + + + + Pointer to a location +to store the length of @subkey_name, in gunichar2s, excluding +NUL-terminator. +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if the name was retrieved, %FALSE otherwise. + + + + + + +Initialises (without allocating) a #GWin32RegistrySubkeyIter. @iter may be +completely uninitialised prior to this call; its old value is +ignored. + +The iterator remains valid for as long as @key exists. +Clean up its internal buffers with a call to +g_win32_registry_subkey_iter_clear() when done. + +Since: 2.46 + + + + + a pointer to a #GWin32RegistrySubkeyIter + + + + a #GWin32RegistryKey to iterate over + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if iterator was initialized successfully, %FALSE on error. + + + + + + +Queries the number of subkeys items in the key that we are +iterating over. This is the total number of subkeys -- not the number +of items remaining. + +This information is accurate at the point of iterator initialization, +and may go out of sync with reality even while subkeys are enumerated. + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + the number of subkeys in the key + + + + + + +Moves iterator to the next subkey. +Enumeration errors can be ignored if @skip_errors is %TRUE + +Here is an example for iterating with g_win32_registry_subkey_iter_next(): +|[<!-- language="C" --> +// recursively iterate a key +void +iterate_key_recursive (GWin32RegistryKey *key) +{ +GWin32RegistrySubkeyIter iter; +gchar *name; +GWin32RegistryKey *child; + +if (!g_win32_registry_subkey_iter_init (&iter, key, NULL)) +return; + +while (g_win32_registry_subkey_iter_next (&iter, TRUE, NULL)) +{ +if (!g_win32_registry_subkey_iter_get_name (&iter, &name, NULL, NULL)) +continue; + +g_print ("subkey '%s'\n", name); +child = g_win32_registry_key_get_child (key, name, NULL); + +if (child) +iterate_key_recursive (child); +} + +g_win32_registry_subkey_iter_clear (&iter); +} +]| + +Since: 2.46 + + + + + a #GWin32RegistrySubkeyIter + + + + %TRUE if iterator should silently ignore errors (such as +the actual number of subkeys being less than expected) and +proceed forward + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if next subkey info was retrieved, %FALSE otherwise. + + + + + + +Assigns the value of @other to @iter. This function +is not useful in applications, because iterators can be assigned +with `GWin32RegistryValueIter i = j;`. The +function is used by language bindings. + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + another #GWin32RegistryValueIter + + + + + + + + +Frees internal buffers of a #GWin32RegistryValueIter. + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + + + + + +Creates a dynamically-allocated copy of an iterator. Dynamically-allocated +state of the iterator is duplicated too. + +Since: 2.46 + + + + + an iterator + + + + a copy of the @iter, +free with g_win32_registry_value_iter_free (). + + + + + + +Free an iterator allocated on the heap. For iterators that are allocated +on the stack use g_win32_registry_value_iter_clear () instead. + +Since: 2.46 + + + + + a dynamically-allocated iterator + + + + + + + + +Stores the data of the value currently being iterated over in @value_data, +and its length - in @value_data_len (if not %NULL). + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + Pointer to a +location to store the data of the value (in UTF-8, if it's a string). + + + + Pointer to a location to store the length +of @value_data, in bytes (including any NUL-terminators, if it's a +string). +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if value data was retrieved, %FALSE otherwise. + + + + + + +Stores the data of the value currently being iterated over in @value_data, +and its length - in @value_data_len (if not %NULL). + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR to +G_WIN32_REGISTRY_VALUE_STR. + + + + Pointer to a +location to store the data of the value (in UTF-16, if it's a string). + + + + Pointer to a location to store the size +of @value_data, in bytes (including any NUL-terminators, if it's a +string). +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if value data was retrieved, %FALSE otherwise. + + + + + + +Stores the name of the value currently being iterated over in @value_name, +and its length - in @value_name_len (if not %NULL). + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + Pointer to a location +to store the name of a value (in UTF-8). + + + + Pointer to a location to store the length +of @value_name, in gchars, excluding NUL-terminator. +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if value name was retrieved, %FALSE otherwise. + + + + + + +Stores the name of the value currently being iterated over in @value_name, +and its length - in @value_name (if not %NULL). + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + Pointer to a location +to store the name of a value (in UTF-16). + + + + Pointer to a location to store the length +of @value_name, in gunichar2s, excluding NUL-terminator. +%NULL if length is not needed. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if value name was retrieved, %FALSE otherwise. + + + + + + +Stores the type of the value currently being iterated over in @value_type. + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + Pointer to a location to store the type of +the value. + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if value type was retrieved, %FALSE otherwise. + + + + + + +Initialises (without allocating) a #GWin32RegistryValueIter. @iter may be +completely uninitialised prior to this call; its old value is +ignored. + +The iterator remains valid for as long as @key exists. +Clean up its internal buffers with a call to +g_win32_registry_value_iter_clear() when done. + +Since: 2.46 + + + + + a pointer to a #GWin32RegistryValueIter + + + + a #GWin32RegistryKey to iterate over + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if iterator was initialized successfully, %FALSE on error. + + + + + + +Queries the number of values items in the key that we are +iterating over. This is the total number of values -- not the number +of items remaining. + +This information is accurate at the point of iterator initialization, +and may go out of sync with reality even while values are enumerated. + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + the number of values in the key + + + + + + +Advances iterator to the next value in the key. If no more values remain then +FALSE is returned. +Enumeration errors can be ignored if @skip_errors is %TRUE + +Here is an example for iterating with g_win32_registry_value_iter_next(): +|[<!-- language="C" --> +// iterate values of a key +void +iterate_values_recursive (GWin32RegistryKey *key) +{ +GWin32RegistryValueIter iter; +gchar *name; +GWin32RegistryValueType val_type; +gchar *val_data; + +if (!g_win32_registry_value_iter_init (&iter, key, NULL)) +return; + +while (g_win32_registry_value_iter_next (&iter, TRUE, NULL)) +{ +if ((!g_win32_registry_value_iter_get_value_type (&iter, &value)) || +((val_type != G_WIN32_REGISTRY_VALUE_STR) && +(val_type != G_WIN32_REGISTRY_VALUE_EXPAND_STR))) +continue; + +if (g_win32_registry_value_iter_get_value (&iter, TRUE, &name, NULL, +&val_data, NULL, NULL)) +g_print ("value '%s' = '%s'\n", name, val_data); +} + +g_win32_registry_value_iter_clear (&iter); +} +]| + +Since: 2.46 + + + + + a #GWin32RegistryValueIter + + + + %TRUE if iterator should silently ignore errors (such as +the actual number of values being less than expected) and +proceed forward + + + + a pointer to %NULL #GError, or %NULL + + + + %TRUE if next value info was retrieved, %FALSE otherwise. + + + + Returns the #GZlibCompressor:file-info property. -- cgit v1.2.1 From ea01e8078711538ce01ae6f290ad01757eddff90 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:33:39 +0200 Subject: Regenerate glib_functions.defs. --- glib/src/glib_functions.defs | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index b93b6ce5..8617a07a 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -1649,6 +1649,42 @@ ) ) +(define-method remove + (of-object "GAsyncQueue") + (c-name "g_async_queue_remove") + (return-type "gboolean") + (parameters + '("gpointer" "item") + ) +) + +(define-method remove_unlocked + (of-object "GAsyncQueue") + (c-name "g_async_queue_remove_unlocked") + (return-type "gboolean") + (parameters + '("gpointer" "item") + ) +) + +(define-method push_front + (of-object "GAsyncQueue") + (c-name "g_async_queue_push_front") + (return-type "none") + (parameters + '("gpointer" "item") + ) +) + +(define-method push_front_unlocked + (of-object "GAsyncQueue") + (c-name "g_async_queue_push_front_unlocked") + (return-type "none") + (parameters + '("gpointer" "item") + ) +) + (define-method timed_pop (of-object "GAsyncQueue") (c-name "g_async_queue_timed_pop") @@ -12202,6 +12238,15 @@ ) ) +(define-method move_to_front + (of-object "GThreadPool") + (c-name "g_thread_pool_move_to_front") + (return-type "gboolean") + (parameters + '("gpointer" "data") + ) +) + (define-method set_max_threads (of-object "GThreadPool") (c-name "g_thread_pool_set_max_threads") -- cgit v1.2.1 From 15a317c73e59f26966a098b829d048dd7656b04d Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:34:34 +0200 Subject: Regenerated glib _docs.xml --- glib/src/glib_docs.xml | 117 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index 99b82185..1708607a 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -5468,6 +5468,54 @@ Pushes the @data into the @queue. @data must not be %NULL. + + +Pushes the @data into the @queue. @data must not be %NULL. +In contrast to g_async_queue_push(), this function +pushes the new item ahead of the items already in the queue, +so that it will be the next one to be popped off the queue. + +Since: 2.46 + + + + + a #GAsyncQueue + + + + @data to push into the @queue + + + + + + + + +Pushes the @data into the @queue. @data must not be %NULL. +In contrast to g_async_queue_push_unlocked(), this function +pushes the new item ahead of the items already in the queue, +so that it will be the next one to be popped off the queue. + +This function must be called while holding the @queue's lock. + +Since: 2.46 + + + + + a #GAsyncQueue + + + + @data to push into the @queue + + + + + + Inserts @data into @queue using @func to determine the new @@ -5602,6 +5650,52 @@ lock. + + +Remove an item from the queue. This function does not block. + +Since: 2.46 + + + + + a #GAsyncQueue + + + + the @data to remove from the @queue + + + + %TRUE if the item was removed + + + + + + +Remove an item from the queue. This function does not block. + +This function must be called while holding the @queue's lock. + +Since: 2.46 + + + + + a #GAsyncQueue + + + + the @data to remove from the @queue + + + + %TRUE if the item was removed + + + + Sorts @queue using @func. @@ -47391,6 +47485,29 @@ Returns the number of currently unused threads. + + +Moves the item to the front of the queue of unprocessed +items, so that it will be processed next. + +Since: 2.46 + + + + + a #GThreadPool + + + + an unprocessed item in the pool + + + + %TRUE if the item was found and moved + + + + This function creates a new thread pool. -- cgit v1.2.1 From 346b3eac79025b2290105f32cd81cdbc865ad286 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:35:28 +0200 Subject: 2.45.31 --- NEWS | 21 +++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a98524d3..d2304b94 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,24 @@ +2.45.4 (unstable): + +Glib: +* HelperList: fix iterator check in operator[] + (Maks Naumov) Bug #751530. + +Build: +* Use (and require) C++11. + (Murray Cumming, Kjell Ahlstedt) +* Use some simple C++11 syntax. + (Murray Cumming) +* Fix the build with -Wshadow. + (Murray Cumming) + +gmmproc: +* Generate code that uses some simple C++11 syntax. + (Murray Cumming) +* _WRAP_SIGNAL: Accept apostrophes in a preceding comment. + (Kjell Ahlstedt) + + 2.45.3 (unstable): * Add SettingsSchema, SettingsSchemaKey and SettingsSchemaSource. diff --git a/configure.ac b/configure.ac index a2b99cfb..cb86406c 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.3], +AC_INIT([glibmm], [2.45.4], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From e0a6b4e54e5dbe09e3ffafa798d32c88b01e182b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 15 Jul 2015 14:54:51 +0200 Subject: 2.45.31 --- NEWS | 2 +- configure.ac | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d2304b94..808c91b3 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -2.45.4 (unstable): +2.45.31 (unstable): Glib: * HelperList: fix iterator check in operator[] diff --git a/configure.ac b/configure.ac index cb86406c..d1758b38 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.4], +AC_INIT([glibmm], [2.45.31], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -30,7 +30,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AM_MAINTAINER_MODE AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I ]) -MM_PREREQ([0.9.7]) +MM_PREREQ([0.9.8]) MM_INIT_MODULE([glibmm-2.4]) MM_INIT_MODULE([giomm-2.4]) -- cgit v1.2.1 From 5fd21ce0f57f29cefbb832e7997ec812631576a5 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 16 Jul 2015 22:19:21 +0200 Subject: C++11: Use nullptr. --- gio/src/appinfo.ccg | 12 +-- gio/src/application.ccg | 6 +- gio/src/asyncinitable.ccg | 2 +- gio/src/datainputstream.ccg | 24 +++--- gio/src/dbusaddress.ccg | 24 +++--- gio/src/dbusconnection.ccg | 18 ++-- gio/src/dbusproxy.ccg | 4 +- gio/src/file.ccg | 114 +++++++++++++------------- gio/src/fileattributeinfolist.ccg | 2 +- gio/src/fileinputstream.ccg | 4 +- gio/src/fileiostream.ccg | 4 +- gio/src/fileoutputstream.ccg | 4 +- gio/src/icon.ccg | 2 +- gio/src/loadableicon.ccg | 4 +- gio/src/memoryinputstream.ccg | 2 +- gio/src/menuattributeiter.ccg | 4 +- gio/src/menuitem.ccg | 2 +- gio/src/menulinkiter.ccg | 4 +- gio/src/mount.ccg | 4 +- gio/src/networkaddress.ccg | 2 +- gio/src/outputstream.ccg | 12 +-- gio/src/proxyresolver.ccg | 2 +- gio/src/resource.ccg | 6 +- gio/src/socket.ccg | 12 +-- gio/src/socketlistener.ccg | 50 +++++------ glib/glibmm/error.cc | 20 ++--- glib/glibmm/exceptionhandler.cc | 2 +- glib/glibmm/helperlist.h | 2 +- glib/glibmm/interface.cc | 2 +- glib/glibmm/listhandle.h | 8 +- glib/glibmm/main.cc | 20 ++--- glib/glibmm/object.cc | 4 +- glib/glibmm/objectbase.cc | 6 +- glib/glibmm/objectbase.h | 4 +- glib/glibmm/property.cc | 8 +- glib/glibmm/propertyproxy_base.cc | 2 +- glib/glibmm/refptr.h | 2 +- glib/glibmm/signalproxy_connectionnode.cc | 4 +- glib/glibmm/slisthandle.h | 8 +- glib/glibmm/streamiochannel.cc | 8 +- glib/glibmm/stringutils.cc | 2 +- glib/glibmm/threadpool.cc | 14 ++-- glib/glibmm/ustring.cc | 10 +-- glib/glibmm/wrap.cc | 8 +- glib/glibmm/wrap.h | 2 +- glib/src/binding.ccg | 2 +- glib/src/checksum.ccg | 2 +- glib/src/convert.ccg | 30 +++---- glib/src/fileutils.ccg | 12 +-- glib/src/iochannel.ccg | 20 ++--- glib/src/keyfile.ccg | 44 +++++----- glib/src/markup.ccg | 12 +-- glib/src/miscutils.ccg | 6 +- glib/src/module.ccg | 2 +- glib/src/module.hg | 2 +- glib/src/nodetree.hg | 10 +-- glib/src/optioncontext.ccg | 2 +- glib/src/optionentry.ccg | 6 +- glib/src/optiongroup.ccg | 16 ++-- glib/src/regex.ccg | 36 ++++---- glib/src/shell.ccg | 6 +- glib/src/spawn.ccg | 16 ++-- glib/src/spawn.hg | 38 ++++----- glib/src/thread.ccg | 4 +- glib/src/thread.hg | 6 +- glib/src/threads.ccg | 2 +- glib/src/threads.hg | 6 +- glib/src/variant.ccg | 8 +- glib/src/varianttype.ccg | 4 +- tests/glibmm_interface_implementation/main.cc | 4 +- tests/glibmm_vector/main.cc | 4 +- tools/extra_defs_gen/generate_extra_defs.cc | 8 +- tools/m4/class_boxedtype.m4 | 2 +- tools/m4/class_interface.m4 | 2 +- tools/m4/class_opaque_copyable.m4 | 2 +- tools/m4/method.m4 | 4 +- tools/m4/signal.m4 | 4 +- tools/m4/vfunc.m4 | 6 +- 78 files changed, 394 insertions(+), 394 deletions(-) diff --git a/gio/src/appinfo.ccg b/gio/src/appinfo.ccg index 8fab8a37..64f04d03 100644 --- a/gio/src/appinfo.ccg +++ b/gio/src/appinfo.ccg @@ -30,8 +30,8 @@ AppInfo::create_from_commandline(const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags) { - GAppInfo* capp_info = 0; - GError* gerror = 0; + GAppInfo* capp_info = nullptr; + GError* gerror = nullptr; capp_info = g_app_info_create_from_commandline(commandline.c_str(), application_name.c_str(), @@ -54,7 +54,7 @@ bool AppInfo::launch(const Glib::RefPtr& file, const Glib::RefPtr > vec; vec.push_back(file); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch(gobj(), Glib::ListHandler >::vector_to_list(vec).data (), Glib::unwrap(launch_context), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -67,7 +67,7 @@ bool AppInfo::launch(const Glib::RefPtr& file) std::vector< Glib::RefPtr > vec; vec.push_back(file); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch(gobj(), Glib::ListHandler >::vector_to_list(vec).data (), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -80,7 +80,7 @@ bool AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr vec; vec.push_back(uri); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch_uris(gobj(), Glib::ListHandler::vector_to_list(vec).data (), Glib::unwrap(launch_context), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -93,7 +93,7 @@ bool AppInfo::launch_uri(const std::string& uri) std::vector vec; vec.push_back(uri); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch_uris(gobj(), Glib::ListHandler::vector_to_list(vec).data (), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 3eccdda6..7b157b01 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -154,7 +154,7 @@ public: const Gio::Application* get_application() const { return application_; } gchar get_short_name() const { return short_name_; } - bool is_filename_option() const { return slot_filename_ != 0; } + bool is_filename_option() const { return slot_filename_ != nullptr; } const Glib::OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; } @@ -222,7 +222,7 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* return false; } - const bool has_value = (value != 0); + const bool has_value = (value != nullptr); const OptionArgCallbackData* const option_arg = iterFind->second; try { @@ -475,7 +475,7 @@ void Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustr else // We ensure that this is null to ensure that it is not used, // telling GApplication to put the parsed value in the options VariantDict instead. - array[0].arg_data = 0; + array[0].arg_data = nullptr; g_application_add_main_option_entries(gobj(), array); } diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 3867ef0e..df26f6f5 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -157,7 +157,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) / if(base && base->init_finish) { - GError* gerror = 0; + GError* gerror = nullptr; bool const result = (*base->init_finish)(gobj(), Glib::unwrap(res), &gerror); diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg index 0b4b4691..8dd8b317 100644 --- a/gio/src/datainputstream.ccg +++ b/gio/src/datainputstream.ccg @@ -26,7 +26,7 @@ namespace Gio bool DataInputStream::read_line(std::string& line, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_line = g_data_input_stream_read_line(gobj(), 0, // pass NULL since we can easily determine the length from the returned std::string Glib::unwrap(cancellable), @@ -44,7 +44,7 @@ bool DataInputStream::read_line(std::string& line, const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -85,7 +85,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } @@ -95,7 +95,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr& result, bool DataInputStream::read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), 0, // pass NULL since we can easily determine the length from the returned std::string @@ -116,7 +116,7 @@ bool DataInputStream::read_until(std::string& data, const std::string& stop_char */ bool DataInputStream::read_until(std::string& data, const std::string& stop_chars) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), 0, // pass NULL since we can easily determine the length from the returned std::string @@ -149,7 +149,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot bool DataInputStream::read_until_finish(const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -158,7 +158,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } @@ -169,7 +169,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr& result, bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ 0, // pass NULL since we can easily determine the length from the returned std::string @@ -190,7 +190,7 @@ bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars */ bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ 0, // pass NULL since we can easily determine the length from the returned std::string @@ -226,7 +226,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA bool DataInputStream::read_upto_finish(const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_upto_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -235,7 +235,7 @@ bool DataInputStream::read_upto_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index a8b1fd3b..2b395095 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -37,7 +37,7 @@ bool is_address(const std::string& string) bool is_supported(const std::string& address) { - GError* gerror = 0; + GError* gerror = nullptr; bool const result = g_dbus_is_supported_address(address.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -62,8 +62,8 @@ void get_stream(const std::string& address, const SlotAsyncReady slot) Glib::RefPtr get_stream_finish(const Glib::RefPtr& res, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), @@ -78,7 +78,7 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res, Glib::RefPtr get_stream_finish(const Glib::RefPtr& res) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), 0, @@ -93,8 +93,8 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res) Glib::RefPtr get_stream_sync(const std::string& address, const Glib::RefPtr& cancellable, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), @@ -110,8 +110,8 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), @@ -127,7 +127,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, @@ -141,7 +141,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, 0, &gerror)); @@ -155,7 +155,7 @@ Glib::RefPtr get_stream_sync(const std::string& address) std::string get_for_bus_sync(BusType bus_type, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; std::string result(g_dbus_address_get_for_bus_sync( static_cast(bus_type), Glib::unwrap(cancellable), &gerror)); @@ -168,7 +168,7 @@ std::string get_for_bus_sync(BusType bus_type, std::string get_for_bus_sync(BusType bus_type) { - GError* gerror = 0; + GError* gerror = nullptr; std::string result(g_dbus_address_get_for_bus_sync( static_cast(bus_type), 0, &gerror)); diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index 31020505..0e9faf67 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -545,7 +545,7 @@ void Connection::flush(const SlotAsyncReady& slot) bool Connection::send_message(const Glib::RefPtr& message, SendMessageFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const bool result = g_dbus_connection_send_message(gobj(), Glib::unwrap(message), static_cast(flags), 0, @@ -587,7 +587,7 @@ Glib::RefPtr Connection::send_message_with_reply_sync( gint timeout_msec) { volatile guint32 out_serial = 0; - GError* gerror = 0; + GError* gerror = nullptr; GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), @@ -606,7 +606,7 @@ Glib::RefPtr Connection::send_message_with_reply_sync( gint timeout_msec) { volatile guint32 out_serial = 0; - GError* gerror = 0; + GError* gerror = nullptr; GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), @@ -679,7 +679,7 @@ Glib::VariantContainerBase Connection::call_sync( CallFlags flags, const Glib::VariantType& reply_type) { - GError* gerror = 0; + GError* gerror = nullptr; GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), bus_name.c_str(), object_path.c_str(), @@ -705,7 +705,7 @@ Glib::VariantContainerBase Connection::call_sync( CallFlags flags, const Glib::VariantType& reply_type) { - GError* gerror = 0; + GError* gerror = nullptr; GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), bus_name.c_str(), object_path.c_str(), @@ -779,7 +779,7 @@ void Connection::emit_signal( const Glib::ustring& destination_bus_name, const Glib::VariantContainerBase& parameters) { - GError* gerror = 0; + GError* gerror = nullptr; // Strings are checked to see if they are empty so that NULL can be passed // for those strings to the C API. This is done because some strings such as @@ -827,7 +827,7 @@ guint Connection::register_object(const Glib::ustring& object_path, const Glib::RefPtr& interface_info, const InterfaceVTable& vtable) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_object(gobj(), object_path.c_str(), Glib::unwrap(interface_info), @@ -842,7 +842,7 @@ guint Connection::register_object(const Glib::ustring& object_path, guint Connection::register_object(const Glib::ustring& object_path, const Glib::RefPtr& interface_info) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_object(gobj(), object_path.c_str(), Glib::unwrap(interface_info), @@ -857,7 +857,7 @@ guint Connection::register_object(const Glib::ustring& object_path, guint Connection::register_subtree(const Glib::ustring& object_path, const SubtreeVTable& vtable, SubtreeFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_subtree(gobj(), object_path.c_str(), diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index 25014f6d..d9850d70 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -330,7 +330,7 @@ Glib::VariantContainerBase Proxy::call_sync( CallFlags flags ) { - GError* g_error = 0; + GError* g_error = nullptr; GVariant* const gvariant = g_dbus_proxy_call_sync(gobj(), method_name.c_str(), @@ -351,7 +351,7 @@ Glib::VariantContainerBase Proxy::call_sync( CallFlags flags ) { - GError* g_error = 0; + GError* g_error = nullptr; GVariant* const gvariant = g_dbus_proxy_call_sync(gobj(), method_name.c_str(), diff --git a/gio/src/file.ccg b/gio/src/file.ccg index f94511e4..7bace932 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -440,7 +440,7 @@ FileType File::query_file_type(FileQueryInfoFlags flags) const Glib::RefPtr File::query_info(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -450,7 +450,7 @@ Glib::RefPtr File::query_info(const Glib::RefPtr& cancell Glib::RefPtr File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -495,7 +495,7 @@ File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -505,7 +505,7 @@ Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr File::query_filesystem_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -547,7 +547,7 @@ File::query_filesystem_info_async(const SlotAsyncReady& slot, const std::string& Glib::RefPtr File::enumerate_children(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -557,7 +557,7 @@ Glib::RefPtr File::enumerate_children(const Glib::RefPtr File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -634,7 +634,7 @@ File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncR bool File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a copy of the slot. @@ -661,7 +661,7 @@ File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a copy of the slot. @@ -688,7 +688,7 @@ File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::copy(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast(flags), @@ -806,7 +806,7 @@ File::copy_async(const Glib::RefPtr& destination, bool File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a move of the slot. @@ -833,7 +833,7 @@ File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a move of the slot. @@ -860,7 +860,7 @@ File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::move(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_move(gobj(), @@ -915,7 +915,7 @@ bool File::set_attributes_finish(const Glib::RefPtr& result, const Glib::RefPtr& info) { - GError* gerror = 0; + GError* gerror = nullptr; GFileInfo* cinfo = Glib::unwrap(info); bool res; @@ -1282,8 +1282,8 @@ File::load_partial_contents_async(const SlotReadMore& slot_read_more, void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, const Glib::RefPtr& cancellable, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents, length, etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1296,8 +1296,8 @@ void File::replace_contents(const char* contents, gsize length, const std::strin void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents, length, etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1310,8 +1310,8 @@ void File::replace_contents(const char* contents, gsize length, const std::strin void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, const Glib::RefPtr& cancellable, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents.c_str(), contents.size(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1324,8 +1324,8 @@ void File::replace_contents(const std::string& contents, const std::string& etag void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents.c_str(), contents.size(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1434,8 +1434,8 @@ File::replace_contents_async(const SlotAsyncReady& slot, void File::replace_contents_finish(const Glib::RefPtr& result, std::string& new_etag) { - GError* gerror = 0; - gchar* c_new_etag = 0; + GError* gerror = nullptr; + gchar* c_new_etag = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), &c_new_etag, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1449,7 +1449,7 @@ void File::replace_contents_finish(const Glib::RefPtr& result, std: void File::replace_contents_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1504,7 +1504,7 @@ File::replace_contents_bytes_async(const SlotAsyncReady& slot, Glib::RefPtr File::replace(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1514,7 +1514,7 @@ Glib::RefPtr File::replace(const Glib::RefPtr& ca Glib::RefPtr File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1525,7 +1525,7 @@ Glib::RefPtr File::replace(const std::string& etag, bool make_ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1535,7 +1535,7 @@ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1547,7 +1547,7 @@ Glib::RefPtr File::replace_readwrite(const std::string& etag, bool Glib::RefPtr File::monitor_directory(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1557,7 +1557,7 @@ Glib::RefPtr File::monitor_directory(const Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1567,7 +1567,7 @@ Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) Glib::RefPtr File::monitor_file(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1577,7 +1577,7 @@ Glib::RefPtr File::monitor_file(const Glib::RefPtr& ca Glib::RefPtr File::monitor_file(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1588,7 +1588,7 @@ Glib::RefPtr File::monitor_file(FileMonitorFlags flags) Glib::RefPtr File::monitor(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1598,7 +1598,7 @@ Glib::RefPtr File::monitor(const Glib::RefPtr& cancell Glib::RefPtr File::monitor(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1609,7 +1609,7 @@ Glib::RefPtr File::monitor(FileMonitorFlags flags) void File::measure_disk_usage(const Glib::RefPtr& cancellable, const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, guint64& num_files, FileMeasureFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; g_file_measure_disk_usage(gobj(), ((GFileMeasureFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &SignalProxy_file_measure_progress_callback, const_cast(&slot_progress), @@ -1754,7 +1754,7 @@ void File::find_enclosing_mount_async(const SlotAsyncReady& slot, int io_priorit bool File::set_attributes_from_info(const Glib::RefPtr& info, const Glib::RefPtr& cancellable, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1764,7 +1764,7 @@ bool File::set_attributes_from_info(const Glib::RefPtr& info, const Gl bool File::set_attributes_from_info(const Glib::RefPtr& info, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1775,7 +1775,7 @@ bool File::set_attributes_from_info(const Glib::RefPtr& info, FileQuer bool File::copy_attributes(const Glib::RefPtr& destination, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_copy_attributes(gobj(), @@ -1793,7 +1793,7 @@ File::copy_attributes(const Glib::RefPtr& destination, const Glib::RefPtr< bool File::copy_attributes(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_copy_attributes(gobj(), @@ -1810,7 +1810,7 @@ File::copy_attributes(const Glib::RefPtr& destination, FileCopyFlags flags Glib::RefPtr File::create_file(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1820,7 +1820,7 @@ Glib::RefPtr File::create_file(const Glib::RefPtr Glib::RefPtr File::create_file(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1830,7 +1830,7 @@ Glib::RefPtr File::create_file(FileCreateFlags flags) Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1840,7 +1840,7 @@ Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1850,7 +1850,7 @@ Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) Glib::RefPtr File::append_to(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1860,7 +1860,7 @@ Glib::RefPtr File::append_to(const Glib::RefPtr& Glib::RefPtr File::append_to(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1870,8 +1870,8 @@ Glib::RefPtr File::append_to(FileCreateFlags flags) bool File::load_contents(const Glib::RefPtr& cancellable, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1883,7 +1883,7 @@ bool File::load_contents(const Glib::RefPtr& cancellable, char*& co bool File::load_contents(const Glib::RefPtr& cancellable, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1893,8 +1893,8 @@ bool File::load_contents(const Glib::RefPtr& cancellable, char*& co bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents(gobj(), 0, &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1906,7 +1906,7 @@ bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) bool File::load_contents(char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents(gobj(), 0, &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1916,8 +1916,8 @@ bool File::load_contents(char*& contents, gsize& length) bool File::load_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1929,7 +1929,7 @@ bool File::load_contents_finish(const Glib::RefPtr& result, char*& bool File::load_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1939,8 +1939,8 @@ bool File::load_contents_finish(const Glib::RefPtr& result, char*& bool File::load_partial_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1952,7 +1952,7 @@ bool File::load_partial_contents_finish(const Glib::RefPtr& result, bool File::load_partial_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileattributeinfolist.ccg b/gio/src/fileattributeinfolist.ccg index 7332e3d2..717b731e 100644 --- a/gio/src/fileattributeinfolist.ccg +++ b/gio/src/fileattributeinfolist.ccg @@ -29,7 +29,7 @@ FileAttributeInfoList::operator bool() const bool FileAttributeInfoList::empty() const { - return gobj() == 0; + return gobj() == nullptr; } FileAttributeInfo diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg index 087f9701..74242ddb 100644 --- a/gio/src/fileinputstream.ccg +++ b/gio/src/fileinputstream.ccg @@ -26,7 +26,7 @@ namespace Gio Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -36,7 +36,7 @@ Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr FileInputStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg index ed8757b9..e1a7c2d9 100644 --- a/gio/src/fileiostream.ccg +++ b/gio/src/fileiostream.ccg @@ -26,7 +26,7 @@ namespace Gio Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -36,7 +36,7 @@ Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& Glib::RefPtr FileIOStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg index 7b940feb..a0c31df6 100644 --- a/gio/src/fileoutputstream.ccg +++ b/gio/src/fileoutputstream.ccg @@ -28,7 +28,7 @@ namespace Gio Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -40,7 +40,7 @@ Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr FileOutputStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/icon.ccg b/gio/src/icon.ccg index 76295bf6..583897a2 100644 --- a/gio/src/icon.ccg +++ b/gio/src/icon.ccg @@ -32,7 +32,7 @@ Icon::equal(const Glib::RefPtr& other) const Glib::RefPtr Icon::create(const std::string& str) { - GError* gerror = 0; + GError* gerror = nullptr; auto icon = g_icon_new_for_string(str.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index c11a44b7..9ae383d9 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -29,7 +29,7 @@ Glib::RefPtr LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr& cancellable) { char* c_type; - GError* gerror = 0; + GError* gerror = nullptr; auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, @@ -50,7 +50,7 @@ Glib::RefPtr LoadableIcon::load(int size, Glib::ustring& type) { char* c_type; - GError* gerror = 0; + GError* gerror = nullptr; auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg index 344506d6..cf30294c 100644 --- a/gio/src/memoryinputstream.ccg +++ b/gio/src/memoryinputstream.ccg @@ -70,7 +70,7 @@ void MemoryInputStream::add_data(const std::string& data) void MemoryInputStream::add_data(const void* data, gssize len) { - char *data_copy = 0; + char *data_copy = nullptr; // copy the data so that the caller doesn't need to keep the data alive if (len < 0) diff --git a/gio/src/menuattributeiter.ccg b/gio/src/menuattributeiter.ccg index a6f9f68b..08e8d4e8 100644 --- a/gio/src/menuattributeiter.ccg +++ b/gio/src/menuattributeiter.ccg @@ -23,8 +23,8 @@ namespace Gio bool MenuAttributeIter::get_next(Glib::ustring& out_name, Glib::VariantBase& value) { - const char* g_out_name = 0; - GVariant* g_value = 0; + const char* g_out_name = nullptr; + GVariant* g_value = nullptr; bool const result = g_menu_attribute_iter_get_next(gobj(), &g_out_name, &g_value); diff --git a/gio/src/menuitem.ccg b/gio/src/menuitem.ccg index de96ad38..4c011abe 100644 --- a/gio/src/menuitem.ccg +++ b/gio/src/menuitem.ccg @@ -57,7 +57,7 @@ void MenuItem::set_action(const Glib::ustring& action) void MenuItem::unset_target() { - const gchar *action_name = 0; + const gchar *action_name = nullptr; g_menu_item_get_attribute (gobj(), G_MENU_ATTRIBUTE_ACTION, "&s", &action_name); g_menu_item_set_action_and_target_value(gobj(), action_name, 0); diff --git a/gio/src/menulinkiter.ccg b/gio/src/menulinkiter.ccg index 9fb93b55..b41fbb11 100644 --- a/gio/src/menulinkiter.ccg +++ b/gio/src/menulinkiter.ccg @@ -24,8 +24,8 @@ namespace Gio bool MenuLinkIter::get_next(Glib::ustring& out_link, Glib::RefPtr& value) { - const char* g_out_link = 0; - GMenuModel* g_value = 0; + const char* g_out_link = nullptr; + GMenuModel* g_value = nullptr; bool const result = g_menu_link_iter_get_next(gobj(), &g_out_link, &g_value); out_link = g_out_link; diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg index 522a700f..d5c36446 100644 --- a/gio/src/mount.ccg +++ b/gio/src/mount.ccg @@ -281,7 +281,7 @@ void Mount::guess_content_type(bool force_rescan) void Mount::guess_content_type_sync(const Glib::RefPtr& cancellable, bool force_rescan) { - GError* gerror = 0; + GError* gerror = nullptr; g_mount_guess_content_type_sync(gobj(), force_rescan, Glib::unwrap(cancellable), &gerror); if(gerror) @@ -290,7 +290,7 @@ void Mount::guess_content_type_sync(const Glib::RefPtr& cancellable void Mount::guess_content_type_sync(bool force_rescan) { - GError* gerror = 0; + GError* gerror = nullptr; g_mount_guess_content_type_sync(gobj(), force_rescan, 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/networkaddress.ccg b/gio/src/networkaddress.ccg index 20cae4a2..dad0dcf1 100644 --- a/gio/src/networkaddress.ccg +++ b/gio/src/networkaddress.ccg @@ -28,7 +28,7 @@ namespace Gio Glib::RefPtr NetworkAddress::parse(const std::string& host_and_port, guint16 default_port) { - GError *error = 0; + GError *error = nullptr; auto *address = G_NETWORK_ADDRESS (g_network_address_parse (host_and_port.c_str (), default_port, &error)); diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index 5ac47fbd..df1c53ba 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -191,7 +191,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, int io_priority) gssize OutputStream::write(const std::string& buffer, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_write(gobj(), buffer.data(), buffer.size(), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -201,7 +201,7 @@ gssize OutputStream::write(const std::string& buffer, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -221,7 +221,7 @@ bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written, co bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -264,7 +264,7 @@ OutputStream::write_bytes_async(const Glib::RefPtr& bytes, co gssize OutputStream::splice(const Glib::RefPtr& source, const Glib::RefPtr& cancellable, OutputStreamSpliceFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -274,7 +274,7 @@ gssize OutputStream::splice(const Glib::RefPtr& source, const Glib: gssize OutputStream::splice(const Glib::RefPtr& source, OutputStreamSpliceFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 01a93b81..b5a05845 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -29,7 +29,7 @@ namespace Gio std::vector ProxyResolver::lookup(const Glib::ustring& uri) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::ArrayHandler::array_to_vector(g_proxy_resolver_lookup(gobj(), uri.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) diff --git a/gio/src/resource.ccg b/gio/src/resource.ccg index 4a4b7162..89d776a7 100644 --- a/gio/src/resource.ccg +++ b/gio/src/resource.ccg @@ -24,7 +24,7 @@ void Resource::get_info(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) const { guint32 file_flags = 0; - GError* gerror = 0; + GError* gerror = nullptr; // Ignore the gboolean return value from g_resource_get_info(). // gerror is set if and only if the return value is FALSE. g_resource_get_info(const_cast(gobj()), path.c_str(), @@ -36,7 +36,7 @@ void Resource::get_info(const std::string& path, gsize& size, void Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const { - GError* gerror = 0; + GError* gerror = nullptr; g_resource_get_info(const_cast(gobj()), path.c_str(), (GResourceLookupFlags)lookup_flags, 0, 0, &gerror); if (gerror) @@ -55,7 +55,7 @@ void Resource::get_info_global(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) { guint32 file_flags = 0; - GError* gerror = 0; + GError* gerror = nullptr; // Ignore the gboolean return value from g_resources_get_info(). // gerror is set if and only if the return value is FALSE. g_resources_get_info(path.c_str(), diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg index 107493f5..571bc00c 100644 --- a/gio/src/socket.ccg +++ b/gio/src/socket.ccg @@ -56,8 +56,8 @@ Glib::RefPtr Socket::create_from_fd(int fd, const Glib::RefPtr& address, char* buffer, gsize size, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GSocketAddress* caddr = 0; + GError* gerror = nullptr; + GSocketAddress* caddr = nullptr; auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -70,8 +70,8 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gsize size) { - GError* gerror = 0; - GSocketAddress* caddr = 0; + GError* gerror = nullptr; + GSocketAddress* caddr = nullptr; auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -85,7 +85,7 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) @@ -97,7 +97,7 @@ gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg index 75552e47..1697ced1 100644 --- a/gio/src/socketlistener.ccg +++ b/gio/src/socketlistener.ccg @@ -25,7 +25,7 @@ namespace Gio bool SocketListener::add_socket(const Glib::RefPtr& socket) { - GError* gerror = 0; + GError* gerror = nullptr; const bool retval = g_socket_listener_add_socket(gobj(), Glib::unwrap(socket), 0, @@ -40,8 +40,8 @@ bool SocketListener::add_socket(const Glib::RefPtr& socket) bool SocketListener::add_address(const Glib::RefPtr& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr& source_object, Glib::RefPtr& effective_address) { - GError* gerror = 0; - GSocketAddress *retaddr = 0; + GError* gerror = nullptr; + GSocketAddress *retaddr = nullptr; const bool retval = g_socket_listener_add_address (gobj(), Glib::unwrap(address), static_cast(type), @@ -60,8 +60,8 @@ bool SocketListener::add_address(const Glib::RefPtr& address, Soc bool SocketListener::add_address(const Glib::RefPtr& address, SocketType type, SocketProtocol protocol, Glib::RefPtr& effective_address) { - GError* gerror = 0; - GSocketAddress *retaddr = 0; + GError* gerror = nullptr; + GSocketAddress *retaddr = nullptr; const bool retval = g_socket_listener_add_address (gobj(), Glib::unwrap(address), static_cast(type), @@ -81,7 +81,7 @@ bool SocketListener::add_address(const Glib::RefPtr& address, Soc bool SocketListener::add_inet_port(guint16 port) { - GError* gerror = 0; + GError* gerror = nullptr; const bool retvalue = g_socket_listener_add_inet_port(gobj(), port, 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -92,7 +92,7 @@ bool SocketListener::add_inet_port(guint16 port) guint16 SocketListener::add_any_inet_port() { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -103,8 +103,8 @@ guint16 SocketListener::add_any_inet_port() Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& source_object, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, Glib::unwrap(cancellable), @@ -120,8 +120,8 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, 0, @@ -137,7 +137,7 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), 0, Glib::unwrap(cancellable), @@ -150,7 +150,7 @@ Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr SocketListener::accept_socket() { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), 0, 0, @@ -190,8 +190,8 @@ void SocketListener::accept_socket_async(const SlotAsyncReady& slot) Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr& result, Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), &retobj, @@ -206,7 +206,7 @@ Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), 0, @@ -220,8 +220,8 @@ Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept(Glib::RefPtr& source_object, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept(gobj(), &retobj, Glib::unwrap(cancellable), @@ -237,8 +237,8 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour Glib::RefPtr SocketListener::accept(Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept(gobj(), &retobj, 0, @@ -254,7 +254,7 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour Glib::RefPtr SocketListener::accept(const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept(gobj(), 0, Glib::unwrap(cancellable), @@ -267,7 +267,7 @@ Glib::RefPtr SocketListener::accept(const Glib::RefPtr SocketListener::accept() { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept(gobj(), 0, 0, @@ -307,8 +307,8 @@ void SocketListener::accept_async(const Glib::RefPtr& cancellable, Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr& result, Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), &retobj, @@ -323,7 +323,7 @@ Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr< Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), 0, diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index d55cb434..8e2bf776 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -29,7 +29,7 @@ namespace typedef std::map ThrowFuncTable; -static ThrowFuncTable* throw_func_table = 0; +static ThrowFuncTable* throw_func_table = nullptr; } // anonymous namespace @@ -65,7 +65,7 @@ Error& Error::operator=(const Error& other) if(gobject_) { g_error_free(gobject_); - gobject_ = 0; + gobject_ = nullptr; } if(other.gobject_) { @@ -83,22 +83,22 @@ Error::~Error() throw() GQuark Error::domain() const { - g_return_val_if_fail(gobject_ != 0, 0); + g_return_val_if_fail(gobject_ != nullptr, 0); return gobject_->domain; } int Error::code() const { - g_return_val_if_fail(gobject_ != 0, -1); + g_return_val_if_fail(gobject_ != nullptr, -1); return gobject_->code; } Glib::ustring Error::what() const { - g_return_val_if_fail(gobject_ != 0, ""); - g_return_val_if_fail(gobject_->message != 0, ""); + g_return_val_if_fail(gobject_ != nullptr, ""); + g_return_val_if_fail(gobject_->message != nullptr, ""); return gobject_->message; } @@ -121,7 +121,7 @@ const GError* Error::gobj() const void Error::propagate(GError** dest) { g_propagate_error(dest, gobject_); - gobject_ = 0; + gobject_ = nullptr; } // static @@ -141,14 +141,14 @@ void Error::register_cleanup() if(throw_func_table) { delete throw_func_table; - throw_func_table = 0; + throw_func_table = nullptr; } } // static void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func) { - g_assert(throw_func_table != 0); + g_assert(throw_func_table != nullptr); (*throw_func_table)[error_domain] = throw_func; } @@ -156,7 +156,7 @@ void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func) // static, noreturn void Error::throw_exception(GError* gobject) { - g_assert(gobject != 0); + g_assert(gobject != nullptr); // Just in case Gtk::Main hasn't been instantiated yet. if(!throw_func_table) diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc index 734da3ef..aedb5432 100644 --- a/glib/glibmm/exceptionhandler.cc +++ b/glib/glibmm/exceptionhandler.cc @@ -40,7 +40,7 @@ static Glib::Threads::Private thread_specific_handler_list; static void glibmm_exception_warning(const GError* error) { - g_assert(error != 0); + g_assert(error != nullptr); g_critical("\n" "unhandled exception (type Glib::Error) in signal handler:\n" diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index d9a1c952..2028a1df 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -81,7 +81,7 @@ public: } inline size_type max_size() { return size_type(-1); } - inline bool empty() { return glist() == 0; } + inline bool empty() { return glist() == nullptr; } inline iterator begin() {return begin_();} diff --git a/glib/glibmm/interface.cc b/glib/glibmm/interface.cc index c8495653..8ed14d39 100644 --- a/glib/glibmm/interface.cc +++ b/glib/glibmm/interface.cc @@ -98,7 +98,7 @@ Interface::Interface(const Interface_Class& interface_class) g_free(iface_props); } } - else // gobject_ == 0 + else // gobject_ == nullptr { // The GObject is not instantiated yet. Add to the custom_interface_classes // and add the interface in the Glib::Object constructor. diff --git a/glib/glibmm/listhandle.h b/glib/glibmm/listhandle.h index e63bb0b0..76bb7a8f 100644 --- a/glib/glibmm/listhandle.h +++ b/glib/glibmm/listhandle.h @@ -37,7 +37,7 @@ namespace Container_Helpers template GList* create_list(Bi pbegin, Bi pend, Tr) { - GList* head = 0; + GList* head = nullptr; while(pend != pbegin) { @@ -56,7 +56,7 @@ GList* create_list(Bi pbegin, Bi pend, Tr) template GList* create_list(For pbegin, Tr) { - GList* head = 0; + GList* head = nullptr; while(*pbegin) { @@ -297,7 +297,7 @@ ListHandle::~ListHandle() if(ownership_ != Glib::OWNERSHIP_SHALLOW) { // Deep ownership: release each container element. - for(GList* node = plist_; node != 0; node = node->next) + for(GList* node = plist_; node != nullptr; node = node->next) Tr::release_c_type(static_cast(node->data)); } g_list_free(plist_); @@ -396,7 +396,7 @@ std::size_t ListHandle::size() const template inline bool ListHandle::empty() const { - return (plist_ == 0); + return (plist_ == nullptr); } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc index 81ffa403..9dfe09f7 100644 --- a/glib/glibmm/main.cc +++ b/glib/glibmm/main.cc @@ -102,7 +102,7 @@ void* SourceConnectionNode::notify(void* data) if (self->source_) { GSource* s = self->source_; - self->source_ = 0; + self->source_ = nullptr; g_source_destroy(s); // Destroying the object triggers execution of destroy_notify_handler(), @@ -120,7 +120,7 @@ void SourceConnectionNode::destroy_notify_callback(void* data) if (self) { // The GLib side is disconnected now, thus the GSource* is no longer valid. - self->source_ = 0; + self->source_ = nullptr; delete self; } @@ -200,10 +200,10 @@ void SourceCallbackData::destroy_notify_callback(void* data) */ static SourceCallbackData* glibmm_source_get_callback_data(GSource* source) { - g_return_val_if_fail(source->callback_funcs != 0, 0); + g_return_val_if_fail(source->callback_funcs != nullptr, 0); GSourceFunc func; - void* user_data = 0; + void* user_data = nullptr; // Retrieve the callback function and data. (*source->callback_funcs->get)(source->callback_data, source, &func, &user_data); @@ -268,7 +268,7 @@ static gboolean glibmm_source_callback_once(void* data) static gboolean glibmm_iosource_callback(GIOChannel*, GIOCondition condition, void* data) { SourceCallbackData *const callback_data = static_cast(data); - g_return_val_if_fail(callback_data->node != 0, 0); + g_return_val_if_fail(callback_data->node != nullptr, 0); try { @@ -943,10 +943,10 @@ Source::~Source() if(gobject_) { SourceCallbackData *const data = glibmm_source_get_callback_data(gobject_); - data->wrapper = 0; + data->wrapper = nullptr; GSource *const tmp_gobject = gobject_; - gobject_ = 0; + gobject_ = nullptr; g_source_unref(tmp_gobject); @@ -1035,7 +1035,7 @@ gboolean Source::dispatch_vfunc(GSource*, GSourceFunc callback, void* user_data) SourceCallbackData *const callback_data = static_cast(user_data); g_return_val_if_fail(callback == &glibmm_dummy_source_callback, 0); - g_return_val_if_fail(callback_data != 0 && callback_data->node != 0, 0); + g_return_val_if_fail(callback_data != nullptr && callback_data->node != nullptr, 0); try { @@ -1057,7 +1057,7 @@ void Source::destroy_notify_callback(void* data) Source *const self = static_cast(data); // gobject_ is already invalid at this point. - self->gobject_ = 0; + self->gobject_ = nullptr; // No exception checking: if the dtor throws, you're out of luck anyway. delete self; @@ -1094,7 +1094,7 @@ sigc::slot_base* Source::get_slot_from_connection_node(void* data) sigc::slot_base* Source::get_slot_from_callback_data(void* data) { SourceCallbackData* const callback_data = static_cast(data); - g_return_val_if_fail(callback_data->node != 0, 0); + g_return_val_if_fail(callback_data->node != nullptr, 0); return callback_data->node->get_slot(); } diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc index 1658d81c..ddaa47b1 100644 --- a/glib/glibmm/object.cc +++ b/glib/glibmm/object.cc @@ -84,10 +84,10 @@ ConstructParams::ConstructParams(const Glib::Class& glibmm_class_, static_cast(g_type_class_ref(glibmm_class.get_type())); unsigned int n_alloced_params = 0; - char* collect_error = 0; // output argument of G_VALUE_COLLECT() + char* collect_error = nullptr; // output argument of G_VALUE_COLLECT() for(const char* name = first_property_name; - name != 0; + name != nullptr; name = va_arg(var_args, char*)) { GParamSpec *const pspec = g_object_class_find_property(g_class, name); diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc index c7add7fe..c1efb135 100644 --- a/glib/glibmm/objectbase.cc +++ b/glib/glibmm/objectbase.cc @@ -119,7 +119,7 @@ ObjectBase::~ObjectBase() g_warning("(Glib::ObjectBase::~ObjectBase): gobject_ = %p", (void*) gobject_); #endif - gobject_ = 0; + gobject_ = nullptr; #ifdef GLIBMM_DEBUG_REFCOUNTING g_warning("(Glib::ObjectBase::~ObjectBase): before g_object_steal_qdata()"); @@ -222,7 +222,7 @@ void ObjectBase::destroy_notify_() g_warning("Glib::ObjectBase::destroy_notify_: gobject_ = %p", (void*) gobject_); #endif - gobject_ = 0; // Make sure we don't unref it again in the dtor. + gobject_ = nullptr; // Make sure we don't unref it again in the dtor. delete this; } @@ -236,7 +236,7 @@ bool ObjectBase::is_anonymous_custom_() const bool ObjectBase::is_derived_() const { // gtkmmproc-generated classes initialize this to 0 by default. - return (custom_type_name_ != 0); + return (custom_type_name_ != nullptr); } void ObjectBase::set_manage() diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index fe501dfc..78f1b13c 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -70,7 +70,7 @@ protected: * The C++ language itself ensures that the constructor * is only invoked once. * - * All classes generated by gtkmmproc use this constructor, with custom_type_name = 0, + * All classes generated by gtkmmproc use this constructor, with custom_type_name = nullptr, * which essentially means it's not a custom type. This is used to optimize * vfunc and signal handler callbacks -- since the C++ virtual methods are * not overridden, invocation can be skipped. @@ -224,7 +224,7 @@ public: // is_derived_() must be public, so that overridden vfuncs and signal h /// This is for use by gtkmm wrappers only, and not by applications. //inline bool is_derived_inline_() const //{ - // return (custom_type_name_ != 0); + // return (custom_type_name_ != nullptr); //} protected: diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc index 4cf054f9..346c3e1f 100644 --- a/glib/glibmm/property.cc +++ b/glib/glibmm/property.cc @@ -239,7 +239,7 @@ PropertyBase::~PropertyBase() bool PropertyBase::lookup_property(const Glib::ustring& name) { - g_assert(param_spec_ == 0); + g_assert(param_spec_ == nullptr); param_spec_ = g_object_class_find_property(G_OBJECT_GET_CLASS(object_->gobj()), name.c_str()); @@ -249,12 +249,12 @@ bool PropertyBase::lookup_property(const Glib::ustring& name) g_param_spec_ref(param_spec_); } - return (param_spec_ != 0); + return (param_spec_ != nullptr); } void PropertyBase::install_property(GParamSpec* param_spec) { - g_return_if_fail(param_spec != 0); + g_return_if_fail(param_spec != nullptr); // Ensure that there would not be id clashes with possible existing // properties overridden from implemented interfaces if dealing with a custom @@ -280,7 +280,7 @@ void PropertyBase::install_property(GParamSpec* param_spec) const char* PropertyBase::get_name_internal() const { const char *const name = g_param_spec_get_name(param_spec_); - g_return_val_if_fail(name != 0, ""); + g_return_val_if_fail(name != nullptr, ""); return name; } diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc index 0f1fac8e..4d449390 100644 --- a/glib/glibmm/propertyproxy_base.cc +++ b/glib/glibmm/propertyproxy_base.cc @@ -112,7 +112,7 @@ void PropertyProxy_Base::reset_property_() const GParamSpec *const pParamSpec = g_object_class_find_property(G_OBJECT_GET_CLASS(obj_->gobj()), property_name_); - g_return_if_fail(pParamSpec != 0); + g_return_if_fail(pParamSpec != nullptr); Glib::ValueBase value; value.init(G_PARAM_SPEC_VALUE_TYPE(pParamSpec)); diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 7b11a756..ccfb26c7 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -305,7 +305,7 @@ bool RefPtr::operator!=(const RefPtr& src) const template inline RefPtr::operator bool() const { - return (pCppObject_ != 0); + return (pCppObject_ != nullptr); } #ifndef GLIBMM_DISABLE_DEPRECATED diff --git a/glib/glibmm/signalproxy_connectionnode.cc b/glib/glibmm/signalproxy_connectionnode.cc index cc6f7079..6784d6eb 100644 --- a/glib/glibmm/signalproxy_connectionnode.cc +++ b/glib/glibmm/signalproxy_connectionnode.cc @@ -51,7 +51,7 @@ void* SignalProxyConnectionNode::notify(void* data) if(conn && conn->object_) { GObject* o = conn->object_; - conn->object_ = 0; + conn->object_ = nullptr; if(g_signal_handler_is_connected(o, conn->connection_id_)) //We check first, because during destruction, GTK+ sometimes seems to disconnect them for us, before we expect it to. See bug #87912 { @@ -84,7 +84,7 @@ void SignalProxyConnectionNode::destroy_notify_handler(gpointer data, GClosure*) if(conn) { // the object has already lost track of this object. - conn->object_ = 0; + conn->object_ = nullptr; delete conn; // if there are connection objects referring to slot_ they are notified during destruction of slot_ } diff --git a/glib/glibmm/slisthandle.h b/glib/glibmm/slisthandle.h index a83cc85e..231d675c 100644 --- a/glib/glibmm/slisthandle.h +++ b/glib/glibmm/slisthandle.h @@ -37,7 +37,7 @@ namespace Container_Helpers template GSList* create_slist(Bi pbegin, Bi pend, Tr) { - GSList* head = 0; + GSList* head = nullptr; while(pend != pbegin) { @@ -56,7 +56,7 @@ GSList* create_slist(Bi pbegin, Bi pend, Tr) template GSList* create_slist(For pbegin, Tr) { - GSList* head = 0; + GSList* head = nullptr; while(*pbegin) { @@ -296,7 +296,7 @@ SListHandle::~SListHandle() if(ownership_ != Glib::OWNERSHIP_SHALLOW) { // Deep ownership: release each container element. - for(GSList* node = pslist_; node != 0; node = node->next) + for(GSList* node = pslist_; node != nullptr; node = node->next) Tr::release_c_type(static_cast(node->data)); } g_slist_free(pslist_); @@ -395,7 +395,7 @@ std::size_t SListHandle::size() const template inline bool SListHandle::empty() const { - return (pslist_ == 0); + return (pslist_ == nullptr); } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/glibmm/streamiochannel.cc b/glib/glibmm/streamiochannel.cc index 8a1b10a7..674960dc 100644 --- a/glib/glibmm/streamiochannel.cc +++ b/glib/glibmm/streamiochannel.cc @@ -59,7 +59,7 @@ StreamIOChannel::~StreamIOChannel() IOStatus StreamIOChannel::read_vfunc(char* buf, gsize count, gsize& bytes_read) { - g_return_val_if_fail(stream_in_ != 0, IO_STATUS_ERROR); + g_return_val_if_fail(stream_in_ != nullptr, IO_STATUS_ERROR); stream_in_->clear(); stream_in_->read(buf, count); @@ -78,7 +78,7 @@ IOStatus StreamIOChannel::read_vfunc(char* buf, gsize count, gsize& bytes_read) IOStatus StreamIOChannel::write_vfunc(const char* buf, gsize count, gsize& bytes_written) { - g_return_val_if_fail(stream_out_ != 0, IO_STATUS_ERROR); + g_return_val_if_fail(stream_out_ != nullptr, IO_STATUS_ERROR); bytes_written = 0; @@ -173,8 +173,8 @@ IOStatus StreamIOChannel::set_flags_vfunc(IOFlags) IOFlags StreamIOChannel::get_flags_vfunc() { gobj()->is_seekable = 1; - gobj()->is_readable = (stream_in_ != 0); - gobj()->is_writeable = (stream_out_ != 0); + gobj()->is_readable = (stream_in_ != nullptr); + gobj()->is_writeable = (stream_out_ != nullptr); IOFlags flags = IO_FLAG_IS_SEEKABLE; diff --git a/glib/glibmm/stringutils.cc b/glib/glibmm/stringutils.cc index 5b61dd1c..e72f029d 100644 --- a/glib/glibmm/stringutils.cc +++ b/glib/glibmm/stringutils.cc @@ -51,7 +51,7 @@ double Glib::Ascii::strtod(const std::string& str, } const char *const bufptr = str.c_str(); - char* endptr = 0; + char* endptr = nullptr; const double result = g_ascii_strtod(bufptr + start_index, &endptr); const int err_no = errno; diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc index 9a9af184..e8e35fde 100644 --- a/glib/glibmm/threadpool.cc +++ b/glib/glibmm/threadpool.cc @@ -128,7 +128,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) gobject_ (0), slot_list_ (new SlotList()) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_thread_pool_new( &call_thread_entry_slot, slot_list_, max_threads, exclusive, &error); @@ -136,7 +136,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) if(error) { delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; Glib::Error::throw_exception(error); } } @@ -157,7 +157,7 @@ void ThreadPool::push(const sigc::slot& slot) { sigc::slot *const slot_ptr = slot_list_->push(slot); - GError* error = 0; + GError* error = nullptr; g_thread_pool_push(gobject_, slot_ptr, &error); if(error) @@ -169,7 +169,7 @@ void ThreadPool::push(const sigc::slot& slot) void ThreadPool::set_max_threads(int max_threads) { - GError* error = 0; + GError* error = nullptr; g_thread_pool_set_max_threads(gobject_, max_threads, &error); if(error) @@ -193,7 +193,7 @@ unsigned int ThreadPool::unprocessed() const bool ThreadPool::get_exclusive() const { - g_return_val_if_fail(gobject_ != 0, false); + g_return_val_if_fail(gobject_ != nullptr, false); return gobject_->exclusive; } @@ -203,14 +203,14 @@ void ThreadPool::shutdown(bool immediately) if(gobject_) { g_thread_pool_free(gobject_, immediately, 1); - gobject_ = 0; + gobject_ = nullptr; } if(slot_list_) { slot_list_->lock_and_unlock(); delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; } } diff --git a/glib/glibmm/ustring.cc b/glib/glibmm/ustring.cc index 6cb4b1f3..1d5e841d 100644 --- a/glib/glibmm/ustring.cc +++ b/glib/glibmm/ustring.cc @@ -1260,7 +1260,7 @@ ustring::FormatStream::~FormatStream() ustring ustring::FormatStream::to_string() const { - GError* error = 0; + GError* error = nullptr; #ifdef GLIBMM_HAVE_WIDE_STREAM const std::wstring str = stream_.str(); @@ -1304,7 +1304,7 @@ std::istream& operator>>(std::istream& is, Glib::ustring& utf8_string) std::string str; is >> str; - GError* error = 0; + GError* error = nullptr; gsize n_bytes = 0; const ScopedPtr buf (g_locale_to_utf8(str.data(), str.size(), 0, &n_bytes, &error)); @@ -1320,7 +1320,7 @@ std::istream& operator>>(std::istream& is, Glib::ustring& utf8_string) std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; const ScopedPtr buf (g_locale_from_utf8(utf8_string.raw().data(), utf8_string.raw().size(), 0, 0, &error)); if (error) @@ -1344,7 +1344,7 @@ std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string) std::wistream& operator>>(std::wistream& is, ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; std::wstring wstr; is >> wstr; @@ -1378,7 +1378,7 @@ std::wistream& operator>>(std::wistream& is, ustring& utf8_string) std::wostream& operator<<(std::wostream& os, const ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; #if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4 // Avoid going through iconv if wchar_t always contains UCS-4. diff --git a/glib/glibmm/wrap.cc b/glib/glibmm/wrap.cc index 4d9c71cf..4b801a46 100644 --- a/glib/glibmm/wrap.cc +++ b/glib/glibmm/wrap.cc @@ -38,7 +38,7 @@ namespace typedef std::vector WrapFuncTable; -static WrapFuncTable* wrap_func_table = 0; +static WrapFuncTable* wrap_func_table = nullptr; } // anonymous namespace @@ -70,7 +70,7 @@ void wrap_register_cleanup() if(wrap_func_table) { delete wrap_func_table; - wrap_func_table = 0; + wrap_func_table = nullptr; } } @@ -95,7 +95,7 @@ void wrap_register(GType type, WrapNewFunction func) static Glib::ObjectBase* wrap_create_new_wrapper(GObject* object) { - g_return_val_if_fail(wrap_func_table != 0, 0); + g_return_val_if_fail(wrap_func_table != nullptr, 0); const bool gtkmm_wrapper_already_deleted = (bool)g_object_get_qdata((GObject*)object, Glib::quark_cpp_wrapper_deleted_); if(gtkmm_wrapper_already_deleted) @@ -140,7 +140,7 @@ static gboolean gtype_wraps_interface(GType implementer_type, GType interface_ty Glib::ObjectBase* wrap_create_new_wrapper_for_interface(GObject* object, GType interface_gtype) { - g_return_val_if_fail(wrap_func_table != 0, 0); + g_return_val_if_fail(wrap_func_table != nullptr, 0); const bool gtkmm_wrapper_already_deleted = (bool)g_object_get_qdata((GObject*)object, Glib::quark_cpp_wrapper_deleted_); if(gtkmm_wrapper_already_deleted) diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h index c4ca34e0..f898785a 100644 --- a/glib/glibmm/wrap.h +++ b/glib/glibmm/wrap.h @@ -73,7 +73,7 @@ TInterface* wrap_auto_interface(GObject* object, bool take_copy = false) //If no exact wrapper was created, //create an instance of the interface, //so we at least get the expected type: - TInterface* result = 0; + TInterface* result = nullptr; if(pCppObject) { result = dynamic_cast(pCppObject); diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg index 8362cb68..29d69ec7 100644 --- a/glib/src/binding.ccg +++ b/glib/src/binding.ccg @@ -83,7 +83,7 @@ Glib::RefPtr Binding::bind_property_value( const SlotTransform& transform_to, const SlotTransform& transform_from) { - GBinding* binding = 0; + GBinding* binding = nullptr; if (transform_to.empty() && transform_from.empty()) { // No user-supplied transformations. diff --git a/glib/src/checksum.ccg b/glib/src/checksum.ccg index efa0d724..9a700501 100644 --- a/glib/src/checksum.ccg +++ b/glib/src/checksum.ccg @@ -28,7 +28,7 @@ Checksum::Checksum(ChecksumType type) Checksum::operator bool() const { - return gobject_ != 0; + return gobject_ != nullptr; } gssize Checksum::get_length(ChecksumType checksum_type) diff --git a/glib/src/convert.ccg b/glib/src/convert.ccg index 295088b1..e7523139 100644 --- a/glib/src/convert.ccg +++ b/glib/src/convert.ccg @@ -35,7 +35,7 @@ IConv::IConv(const std::string& to_codeset, const std::string& from_codeset) { if(gobject_ == reinterpret_cast(-1)) { - GError* gerror = 0; + GError* gerror = nullptr; // Abuse g_convert() to create a GError object. This may seem a weird // thing to do, but it gives us consistently translated error messages @@ -43,7 +43,7 @@ IConv::IConv(const std::string& to_codeset, const std::string& from_codeset) g_convert("", 0, to_codeset.c_str(), from_codeset.c_str(), 0, 0, &gerror); // If this should ever fail we're fucked. - g_assert(gerror != 0); + g_assert(gerror != nullptr); if(gerror) ::Glib::Error::throw_exception(gerror); } @@ -70,7 +70,7 @@ void IConv::reset() // NULL for anything but inbuf; work around that. (NULL outbuf // or NULL *outbuf is allowed by Unix98.) - char* outbuf = 0; + char* outbuf = nullptr; gsize inbytes_left = 0; gsize outbytes_left = 0; @@ -80,7 +80,7 @@ void IConv::reset() std::string IConv::convert(const std::string& str) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_convert_with_iconv( str.data(), str.size(), gobject_, 0, &bytes_written, &gerror); @@ -100,7 +100,7 @@ bool get_charset() bool get_charset(std::string& charset) { - const char* charset_cstr = 0; + const char* charset_cstr = nullptr; const bool is_utf8 = g_get_charset(&charset_cstr); charset = charset_cstr; @@ -113,7 +113,7 @@ std::string convert(const std::string& str, const std::string& from_codeset) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_convert( str.data(), str.size(), to_codeset.c_str(), from_codeset.c_str(), @@ -163,7 +163,7 @@ std::string convert_with_fallback(const std::string& str, Glib::ustring locale_to_utf8(const std::string& opsys_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_locale_to_utf8( opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror); @@ -178,7 +178,7 @@ Glib::ustring locale_to_utf8(const std::string& opsys_string) std::string locale_from_utf8(const Glib::ustring& utf8_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_locale_from_utf8( utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror); @@ -192,7 +192,7 @@ std::string locale_from_utf8(const Glib::ustring& utf8_string) Glib::ustring filename_to_utf8(const std::string& opsys_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_utf8( opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror); @@ -207,7 +207,7 @@ Glib::ustring filename_to_utf8(const std::string& opsys_string) std::string filename_from_utf8(const Glib::ustring& utf8_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_from_utf8( utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror); @@ -220,8 +220,8 @@ std::string filename_from_utf8(const Glib::ustring& utf8_string) std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname) { - char* hostname_buf = 0; - GError* gerror = 0; + char* hostname_buf = nullptr; + GError* gerror = nullptr; char *const buf = g_filename_from_uri(uri.c_str(), &hostname_buf, &gerror); @@ -241,7 +241,7 @@ std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname) std::string filename_from_uri(const Glib::ustring& uri) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_from_uri(uri.c_str(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -252,7 +252,7 @@ std::string filename_from_uri(const Glib::ustring& uri) Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_uri(filename.c_str(), hostname.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -263,7 +263,7 @@ Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& Glib::ustring filename_to_uri(const std::string& filename) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_uri(filename.c_str(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg index 42be941b..43dc1857 100644 --- a/glib/src/fileutils.ccg +++ b/glib/src/fileutils.ccg @@ -26,7 +26,7 @@ namespace Glib Dir::Dir(const std::string& path) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_dir_open(path.c_str(), 0, &error); if(error) @@ -60,7 +60,7 @@ void Dir::close() if(gobject_) { g_dir_close(gobject_); - gobject_ = 0; + gobject_ = nullptr; } } @@ -136,7 +136,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) std::string basename_template (prefix); basename_template += "XXXXXX"; // this sillyness shouldn't be in the interface - GError* error = 0; + GError* error = nullptr; ScopedPtr buf_name_used; const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); @@ -150,7 +150,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) int file_open_tmp(std::string& name_used) { - GError* error = 0; + GError* error = nullptr; ScopedPtr buf_name_used; const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); @@ -166,7 +166,7 @@ std::string file_get_contents(const std::string& filename) { ScopedPtr contents; gsize length = 0; - GError* error = 0; + GError* error = nullptr; g_file_get_contents(filename.c_str(), contents.addr(), &length, &error); @@ -181,7 +181,7 @@ file_set_contents(const std::string& filename, const gchar *contents, gssize length) { - GError* error = 0; + GError* error = nullptr; g_file_set_contents(filename.c_str(), contents, length, &error); diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg index e093a50b..b92a83b8 100644 --- a/glib/src/iochannel.ccg +++ b/glib/src/iochannel.ccg @@ -136,7 +136,7 @@ IOChannel::IOChannel(GIOChannel* gobject, bool take_copy) gobject_ (gobject) { // This ctor should never be called for GlibmmIOChannel instances. - g_assert(gobject != 0); + g_assert(gobject != nullptr); g_assert(gobject->funcs != &GlibmmIOChannel::vfunc_table); if(take_copy) @@ -157,11 +157,11 @@ IOChannel::~IOChannel() if(gobject_->funcs == &GlibmmIOChannel::vfunc_table) { // Disconnect the wrapper object so that it won't be deleted twice. - reinterpret_cast(gobject_)->wrapper = 0; + reinterpret_cast(gobject_)->wrapper = nullptr; } const auto tmp_gobject = gobject_; - gobject_ = 0; + gobject_ = nullptr; g_io_channel_unref(tmp_gobject); } @@ -169,7 +169,7 @@ IOChannel::~IOChannel() Glib::RefPtr IOChannel::create_from_file(const std::string& filename, const std::string& mode) { - GError* gerror = 0; + GError* gerror = nullptr; const auto channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); if(gerror) @@ -208,7 +208,7 @@ IOStatus IOChannel::write(const Glib::ustring& str) IOStatus IOChannel::read_line(Glib::ustring& line) { Glib::ScopedPtr buf; - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); @@ -229,7 +229,7 @@ IOStatus IOChannel::read_line(Glib::ustring& line) IOStatus IOChannel::read_to_end(Glib::ustring& str) { Glib::ScopedPtr buf; - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); @@ -250,7 +250,7 @@ IOStatus IOChannel::read_to_end(Glib::ustring& str) IOStatus IOChannel::read(Glib::ustring& str, gsize count) { Glib::ScopedPtr buf (g_new(char, count)); - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); @@ -270,7 +270,7 @@ IOStatus IOChannel::read(Glib::ustring& str, gsize count) IOStatus IOChannel::set_encoding(const std::string& encoding) { - GError* gerror = 0; + GError* gerror = nullptr; const auto status = g_io_channel_set_encoding( gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror); @@ -367,7 +367,7 @@ void IOChannel::unreference() const Glib::RefPtr wrap(GIOChannel* gobject, bool take_copy) { - IOChannel* cpp_object = 0; + IOChannel* cpp_object = nullptr; if(gobject) { @@ -497,7 +497,7 @@ void GlibmmIOChannel::io_free(GIOChannel* channel) { if(IOChannel *const wrapper = reinterpret_cast(channel)->wrapper) { - wrapper->gobject_ = 0; + wrapper->gobject_ = nullptr; delete wrapper; } diff --git a/glib/src/keyfile.ccg b/glib/src/keyfile.ccg index 366b4980..4488e317 100644 --- a/glib/src/keyfile.ccg +++ b/glib/src/keyfile.ccg @@ -40,7 +40,7 @@ KeyFile::~KeyFile() bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const gboolean result = g_key_file_load_from_data( gobj(), data.c_str(), data.bytes(), @@ -55,8 +55,8 @@ bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags) bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags) { - GError* gerror = 0; - char* full_path_c = 0; + GError* gerror = nullptr; + char* full_path_c = nullptr; const gboolean result = g_key_file_load_from_data_dirs( gobj(), file.c_str(), &full_path_c, @@ -76,8 +76,8 @@ bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_pat bool KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle& search_dirs, std::string& full_path, KeyFileFlags flags) { - GError* gerror = 0; - char* full_path_c = 0; + GError* gerror = nullptr; + char* full_path_c = nullptr; const gboolean result = g_key_file_load_from_dirs( gobj(), file.c_str(), const_cast(search_dirs.data()), @@ -103,7 +103,7 @@ bool KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle KeyFile::get_groups() const Glib::ArrayHandle KeyFile::get_keys(const Glib::ustring& group_name) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_keys( const_cast(gobj()), @@ -139,7 +139,7 @@ Glib::ArrayHandle KeyFile::get_keys(const Glib::ustring& group_na Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_locale_string( const_cast(gobj()), (group_name.empty()) ? 0 : group_name.c_str(), @@ -153,7 +153,7 @@ Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, bool KeyFile::get_boolean(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const bool value = static_cast(g_key_file_get_boolean(const_cast(gobj()), 0, key.c_str(), &gerror)); @@ -165,7 +165,7 @@ bool KeyFile::get_boolean(const Glib::ustring& key) const int KeyFile::get_integer(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const int value = g_key_file_get_integer(const_cast(gobj()), 0, key.c_str(), &gerror); if(gerror) @@ -176,7 +176,7 @@ int KeyFile::get_integer(const Glib::ustring& key) const gint64 KeyFile::get_int64(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const gint64 value = g_key_file_get_int64(const_cast(gobj()), 0, key.c_str(), &gerror); @@ -189,7 +189,7 @@ gint64 KeyFile::get_int64(const Glib::ustring& key) const guint64 KeyFile::get_uint64(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const guint64 value = g_key_file_get_uint64(const_cast(gobj()), 0, key.c_str(), &gerror); @@ -202,7 +202,7 @@ guint64 KeyFile::get_uint64(const Glib::ustring& key) const double KeyFile::get_double(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; double retvalue = g_key_file_get_double(const_cast(gobj()), 0, key.c_str(), &(gerror)); if(gerror) @@ -224,7 +224,7 @@ Glib::ArrayHandle KeyFile::get_string_list(const Glib::ustring& g GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_string_list( const_cast(gobj()), @@ -242,7 +242,7 @@ Glib::ArrayHandle KeyFile::get_locale_string_list(const Glib::ust GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_locale_string_list( const_cast(gobj()), @@ -259,7 +259,7 @@ Glib::ArrayHandle KeyFile::get_boolean_list(const Glib::ustring& group_nam GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; gboolean *const array = g_key_file_get_boolean_list( const_cast(gobj()), @@ -276,7 +276,7 @@ Glib::ArrayHandle KeyFile::get_integer_list(const Glib::ustring& group_name GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; int *const array = g_key_file_get_integer_list( const_cast(gobj()), @@ -293,7 +293,7 @@ Glib::ArrayHandle KeyFile::get_double_list(const Glib::ustring& group_na GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; double *const array = g_key_file_get_double_list(const_cast(gobj()), group_name.c_str(), key.c_str(), @@ -341,7 +341,7 @@ void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustr Glib::ustring KeyFile::get_comment() const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_comment(const_cast(gobj()), 0, 0, &gerror); GLIBMM_THROW(gerror); @@ -351,7 +351,7 @@ Glib::ustring KeyFile::get_comment() const Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name GLIBMM_ERROR_ARG) const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_comment(const_cast(gobj()), (group_name.empty()) ? 0 : group_name.c_str(), 0, &gerror); @@ -362,7 +362,7 @@ Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name GLIBMM_ERROR_ void KeyFile::set_comment(const Glib::ustring& comment GLIBMM_ERROR_ARG) { - GError* gerror = 0; + GError* gerror = nullptr; g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &gerror); GLIBMM_THROW(gerror); @@ -371,7 +371,7 @@ void KeyFile::set_comment(const Glib::ustring& comment GLIBMM_ERROR_ARG) void KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& comment GLIBMM_ERROR_ARG) { - GError* gerror = 0; + GError* gerror = nullptr; g_key_file_set_comment(gobj(), (group_name.empty()) ? 0 : group_name.c_str(), 0, comment.c_str(), &gerror); GLIBMM_THROW(gerror); diff --git a/glib/src/markup.ccg b/glib/src/markup.ccg index ae3d4d2f..738ce781 100644 --- a/glib/src/markup.ccg +++ b/glib/src/markup.ccg @@ -110,7 +110,7 @@ void ParserCallbacks::start_element(GMarkupParseContext* context, for(; *pname && *pvalue; ++pname, ++pvalue) attributes.insert(Parser::AttributeMap::value_type(*pname, *pvalue)); - g_return_if_fail(*pname == 0 && *pvalue == 0); + g_return_if_fail(*pname == nullptr && *pvalue == nullptr); } cpp_context.get_parser()->on_start_element(cpp_context, element_name, attributes); @@ -249,13 +249,13 @@ ParseContext::ParseContext(Parser& parser, ParseFlags flags) ParseContext::~ParseContext() { - parser_ = 0; + parser_ = nullptr; g_markup_parse_context_free(gobject_); } void ParseContext::parse(const Glib::ustring& text) { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_parse(gobject_, text.data(), text.bytes(), &error); if(error) @@ -264,7 +264,7 @@ void ParseContext::parse(const Glib::ustring& text) void ParseContext::parse(const char* text_begin, const char* text_end) { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_parse(gobject_, text_begin, text_end - text_begin, &error); if(error) @@ -273,7 +273,7 @@ void ParseContext::parse(const char* text_begin, const char* text_end) void ParseContext::end_parse() { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_end_parse(gobject_, &error); if(error) @@ -306,7 +306,7 @@ void ParseContext::destroy_notify_callback(void* data) ParseContext *const self = static_cast(data); // Detect premature destruction. - g_return_if_fail(self->parser_ == 0); + g_return_if_fail(self->parser_ == nullptr); } } // namespace Markup diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg index 3beabc9e..9d7de8e1 100644 --- a/glib/src/miscutils.ccg +++ b/glib/src/miscutils.ccg @@ -49,7 +49,7 @@ void set_prgname(const std::string& prgname) std::string getenv(const std::string& variable, bool& found) { const char *const value = g_getenv(variable.c_str()); - found = (value != 0); + found = (value != nullptr); return convert_const_gchar_ptr_to_stdstring(value); } @@ -133,7 +133,7 @@ std::vector get_system_data_dirs() if(!cresult) return result; - for(const gchar* const * iter = cresult; *iter != 0; ++iter) + for(const gchar* const * iter = cresult; *iter != nullptr; ++iter) { result.push_back( convert_const_gchar_ptr_to_stdstring(*iter)); @@ -150,7 +150,7 @@ std::vector get_system_config_dirs() if(!cresult) return result; - for(const gchar* const * iter = cresult; *iter != 0; ++iter) + for(const gchar* const * iter = cresult; *iter != nullptr; ++iter) { result.push_back( convert_const_gchar_ptr_to_stdstring(*iter)); diff --git a/glib/src/module.ccg b/glib/src/module.ccg index 8afd6d35..4e4666cd 100644 --- a/glib/src/module.ccg +++ b/glib/src/module.ccg @@ -34,7 +34,7 @@ Module::~Module() Module::operator bool() const { - return (gobject_ != 0); + return (gobject_ != nullptr); } } // namespace Glib diff --git a/glib/src/module.hg b/glib/src/module.hg index 65f7f87a..f1caf774 100644 --- a/glib/src/module.hg +++ b/glib/src/module.hg @@ -61,7 +61,7 @@ public: * Glib::Module module("plugins/helloworld"); * if(module) * { - * void* func = 0; + * void* func = nullptr; * bool found = get_symbol("some_function", func); * } * @endcode diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg index 2866057e..fb0ff7b5 100644 --- a/glib/src/nodetree.hg +++ b/glib/src/nodetree.hg @@ -337,7 +337,7 @@ public: { sigc::slot real_slot = sigc::ptr_fun(on_compare_child); - GNode* child = 0; + GNode* child = nullptr; typedef sigc::slot type_foreach_gnode_slot; type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); @@ -370,7 +370,7 @@ public: { //We use a sigc::slot for the C callback, so we can bind some extra data. sigc::slot real_slot = sigc::ptr_fun(on_compare_node); - GNode* child = 0; + GNode* child = nullptr; typedef sigc::slot type_traverse_gnode_slot; type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); @@ -690,11 +690,11 @@ private: //Free the wrapped object (g_node_free not available) g_slice_free(GNode, gobject_); - gobject_ = 0; + gobject_ = nullptr; } ///Create a new GNode, taking the contents of an existing node if one is specified. - void clone(const NodeTree* node = 0) + void clone(const NodeTree* node = nullptr) { //Store the this pointer in the GNode so we can discover this wrapper later: gobject_ = g_node_new(reinterpret_cast(this)); @@ -702,7 +702,7 @@ private: if(node) { //Prepend the copied children of @node to the constructing node. - for(const NodeTree* i = node->last_child(); i != 0; i = i->prev_sibling()) + for(const NodeTree* i = node->last_child(); i != nullptr; i = i->prev_sibling()) prepend(*(new NodeTree(*i))); } } diff --git a/glib/src/optioncontext.ccg b/glib/src/optioncontext.ccg index ecc1ac85..56980b49 100644 --- a/glib/src/optioncontext.ccg +++ b/glib/src/optioncontext.ccg @@ -65,7 +65,7 @@ OptionContext::~OptionContext() if(has_ownership_) g_option_context_free(gobj()); - gobject_ = 0; + gobject_ = nullptr; } void OptionContext::add_group(OptionGroup& group) diff --git a/glib/src/optionentry.ccg b/glib/src/optionentry.ccg index 9a64f102..37641692 100644 --- a/glib/src/optionentry.ccg +++ b/glib/src/optionentry.ccg @@ -75,7 +75,7 @@ void OptionEntry::set_long_name(const Glib::ustring& value) if(gobject_->long_name) { g_free((gchar*)(gobject_->long_name)); - gobject_->long_name = 0; + gobject_->long_name = nullptr; } //Note that we do not use NULL for an empty string, @@ -89,7 +89,7 @@ void OptionEntry::set_description(const Glib::ustring& value) if(gobject_->description) { g_free((gchar*)(gobject_->description)); - gobject_->description = 0; + gobject_->description = nullptr; } gobj()->description = (value).empty() ? 0 : g_strdup((value).c_str()); @@ -100,7 +100,7 @@ void OptionEntry::set_arg_description(const Glib::ustring& value) if(gobject_->arg_description) { g_free((gchar*)(gobject_->arg_description)); - gobject_->arg_description = 0; + gobject_->arg_description = nullptr; } gobj()->arg_description = (value).empty() ? 0 : g_strdup((value).c_str()); diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index 42313bcf..4d26a8f7 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -43,7 +43,7 @@ public: { } bool is_filename_option() const - { return slot_filename_ != 0; } + { return slot_filename_ != nullptr; } const OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; } @@ -229,7 +229,7 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* return false; } - const bool has_value = (value != 0); + const bool has_value = (value != nullptr); const OptionArgCallback* const option_arg = static_cast(cppOptionEntry.cpparg_); try @@ -294,7 +294,7 @@ OptionGroup::~OptionGroup() if(has_ownership_) { g_option_group_unref(gobj()); - gobject_ = 0; + gobject_ = nullptr; } } @@ -388,7 +388,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar // Only one C variable shall be allocated for them. // See https://bugzilla.gnome.org/show_bug.cgi?id=744854. bool is_duplicate = false; - void* carg = 0; + void* carg = nullptr; if (arg_type != G_OPTION_ARG_CALLBACK) { for (type_map_entries::iterator iter = map_entries_.begin(); @@ -478,7 +478,7 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() { char** typed_arg = new char*; //The C code will allocate a char* and put it here, for us to g_free() later. - *typed_arg = 0; + *typed_arg = nullptr; carg_ = typed_arg; break; @@ -512,7 +512,7 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() case G_OPTION_ARG_NONE: // Actually a boolean. { gboolean* typed_arg = new gboolean; - *typed_arg = 0; + *typed_arg = false; carg_ = typed_arg; break; @@ -659,7 +659,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() //or add_entry_filename(). auto option_arg = static_cast(cpparg_); delete option_arg; - cpparg_ = 0; + cpparg_ = nullptr; break; } @@ -669,7 +669,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() } } - carg_ = 0; + carg_ = nullptr; } if(entry_) diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index 4f565810..61408cc6 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -24,7 +24,7 @@ Glib::RefPtr Regex::create(const Glib::ustring& pattern, RegexCompileFlags compile_options, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, (GRegexMatchFlags)match_options, &gerror); @@ -47,7 +47,7 @@ bool Regex::match( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match(gobj(), string.c_str(), static_cast(match_options), &ginfo)); match_info.set_gobject(ginfo); @@ -66,8 +66,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_full(gobj(), string.c_str(), -1, start_position, @@ -88,8 +88,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_full(gobj(), string.c_str(), string_len, start_position, @@ -104,7 +104,7 @@ bool Regex::match( bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -114,7 +114,7 @@ bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFla bool Regex::match(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -128,7 +128,7 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_all(gobj(), string.c_str(), static_cast(match_options), &ginfo)); @@ -148,8 +148,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast(g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, @@ -170,8 +170,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast(g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, @@ -186,7 +186,7 @@ bool Regex::match_all( bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -196,7 +196,7 @@ bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatc bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -206,7 +206,7 @@ bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -217,7 +217,7 @@ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, co Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -227,7 +227,7 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi Glib::StringArrayHandle Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/shell.ccg b/glib/src/shell.ccg index 4950c086..db01f78e 100644 --- a/glib/src/shell.ccg +++ b/glib/src/shell.ccg @@ -25,9 +25,9 @@ namespace Glib Glib::ArrayHandle shell_parse_argv(const std::string& command_line) { - char** argv = 0; + char** argv = nullptr; int argc = 0; - GError* error = 0; + GError* error = nullptr; g_shell_parse_argv(command_line.c_str(), &argc, &argv, &error); @@ -45,7 +45,7 @@ std::string shell_quote(const std::string& unquoted_string) std::string shell_unquote(const std::string& quoted_string) { - GError* error = 0; + GError* error = nullptr; char *const buf = g_shell_unquote(quoted_string.c_str(), &error); if(error) diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg index ef9eed2d..5cfbdb7a 100644 --- a/glib/src/spawn.ccg +++ b/glib/src/spawn.ccg @@ -75,7 +75,7 @@ void spawn_async_with_pipes(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async_with_pipes( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -103,7 +103,7 @@ void spawn_async_with_pipes(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async_with_pipes( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -128,7 +128,7 @@ void spawn_async(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -152,7 +152,7 @@ void spawn_async(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -181,7 +181,7 @@ void spawn_sync(const std::string& working_directory, Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_sync( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -215,7 +215,7 @@ void spawn_sync(const std::string& working_directory, Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_sync( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -237,7 +237,7 @@ void spawn_sync(const std::string& working_directory, void spawn_command_line_async(const std::string& command_line) { - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_command_line_async(command_line.c_str(), &gerror); if(gerror) @@ -251,7 +251,7 @@ void spawn_command_line_sync(const std::string& command_line, { Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_command_line_sync( command_line.c_str(), diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg index f82115e8..c10e44bf 100644 --- a/glib/src/spawn.hg +++ b/glib/src/spawn.hg @@ -197,10 +197,10 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0, - int* standard_input = 0, - int* standard_output = 0, - int* standard_error = 0); + Pid* child_pid = nullptr, + int* standard_input = nullptr, + int* standard_output = nullptr, + int* standard_error = nullptr); /** Like the main spawn_async_with_pipes() method, but inheriting the parent's environment. * @@ -223,10 +223,10 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0, - int* standard_input = 0, - int* standard_output = 0, - int* standard_error = 0); + Pid* child_pid = nullptr, + int* standard_input = nullptr, + int* standard_output = nullptr, + int* standard_error = nullptr); /** See spawn_async_with_pipes() for a full description. This function * simply calls the spawn_async_with_pipes() without any pipes. @@ -254,7 +254,7 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0); + Pid* child_pid = nullptr); /** Like the main spawn_async() method, but inheriting the parent's environment. * @@ -273,7 +273,7 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0); + Pid* child_pid = nullptr); /** Executes a child synchronously (waits for the child to exit before returning). * All output from the child is stored in @a standard_output and @a standard_error, @@ -312,9 +312,9 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** Like the main spawn_sync() method, but inheriting the parent's environment. * @@ -336,9 +336,9 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** A simple version of spawn_async() that parses a command line with * shell_parse_argv() and passes it to spawn_async(). It runs a @@ -393,9 +393,9 @@ void spawn_command_line_async(const std::string& command_line); * @throws ShellError If the command line could not be parsed. */ void spawn_command_line_sync(const std::string& command_line, - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** On some platforms, notably WIN32, the Pid type represents a resource * which must be closed to prevent resource leaking. close_pid() diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg index 2116b528..cfca2186 100644 --- a/glib/src/thread.ccg +++ b/glib/src/thread.ccg @@ -73,7 +73,7 @@ Thread* Thread::create(const sigc::slot& slot, bool /* joinable */) // Make a copy of slot on the heap const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; const auto thread = g_thread_try_new(NULL, &call_thread_entry_slot, slot_copy, &error); @@ -99,7 +99,7 @@ Thread* Thread::create(const sigc::slot& slot, unsigned long stack_size, // Make a copy of slot on the heap const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; const auto thread = g_thread_create_full( &call_thread_entry_slot, slot_copy, stack_size, joinable, diff --git a/glib/src/thread.hg b/glib/src/thread.hg index dd116c35..b5efa43b 100644 --- a/glib/src/thread.hg +++ b/glib/src/thread.hg @@ -106,7 +106,7 @@ _WRAP_ENUM(ThreadPriority, GThreadPriority, NO_GTYPE) /** Initializes the GLib thread system. * @deprecated Calling thread_init() is no longer necessary and no longer has any effect. */ -void thread_init(GThreadFunctions* vtable = 0); +void thread_init(GThreadFunctions* vtable = nullptr); /** Returns whether the thread system is initialized. * @return @c true, if the thread system is initialized. @@ -630,7 +630,7 @@ private: * @code * Glib::Cond data_cond; * Glib::Mutex data_mutex; - * void* current_data = 0; + * void* current_data = nullptr; * * void push_data(void* data) * { @@ -648,7 +648,7 @@ private: * data_cond.wait(data_mutex); * * void *const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg index 49ad1079..e507b6d3 100644 --- a/glib/src/threads.ccg +++ b/glib/src/threads.ccg @@ -80,7 +80,7 @@ Thread* Thread::create(const sigc::slot& slot, const std::string& name) // Make a copy of slot on the heap. const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), &call_thread_entry_slot, slot_copy, &error); diff --git a/glib/src/threads.hg b/glib/src/threads.hg index 5fa559c6..412d5fb5 100644 --- a/glib/src/threads.hg +++ b/glib/src/threads.hg @@ -434,7 +434,7 @@ private: * @code * Glib::Threads::Cond data_cond; * Glib::Threads::Mutex data_mutex; - * void* current_data = 0; + * void* current_data = nullptr; * * void push_data(void* data) * { @@ -452,7 +452,7 @@ private: * data_cond.wait(data_mutex); * * void* const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } @@ -508,7 +508,7 @@ public: * return 0; // timeout * * void* const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index 7523db5b..7ab9cb13 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -125,7 +125,7 @@ VariantStringBase::VariantStringBase(GVariant* castitem, bool take_a_reference) void VariantStringBase::create_object_path(VariantStringBase& output, const std::string& object_path) { - GVariant* result = 0; + GVariant* result = nullptr; result = g_variant_new_object_path(object_path.c_str()); g_variant_ref_sink(result); output.init(result); @@ -135,7 +135,7 @@ void VariantStringBase::create_object_path(VariantStringBase& output, void VariantStringBase::create_signature(VariantStringBase& output, const std::string& signature) { - GVariant* result = 0; + GVariant* result = nullptr; result = g_variant_new_signature(signature.c_str()); g_variant_ref_sink(result); output.init(result); @@ -241,7 +241,7 @@ VariantIter VariantContainerBase::get_iter(const VariantType& container_variant_ // use the actual type (which may differ from container_variant_type, if // the GVariant contains strings, object paths or DBus type signatures), // otherwise let g_variant_get() report what's wrong with the type. - GVariantIter* g_iter = 0; + GVariantIter* g_iter = nullptr; g_variant_get(const_cast(gobj()), is_castable_to(container_variant_type) ? get_type_string().c_str() : container_variant_type.get_string().c_str(), @@ -409,7 +409,7 @@ std::string Variant::get() const { const VariantType vtype = get_type(); - const char* pch = 0; + const char* pch = nullptr; if(vtype.equal(VARIANT_TYPE_BYTESTRING)) pch = g_variant_get_bytestring(gobject_); else //g_variant_get_string() can handle strings, object paths, and signatures. diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 46153d6d..5a3702f8 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -27,7 +27,7 @@ VariantType::VariantType(const GVariantType* castitem) if(castitem) gobject_ = g_variant_type_copy(castitem); else - gobject_ = 0; + gobject_ = nullptr; } VariantType::VariantType(const std::string& type_string) @@ -45,7 +45,7 @@ VariantType& VariantType::operator=(const GVariantType* castitem) if(castitem) gobject_ = g_variant_type_copy(castitem); else - gobject_ = 0; + gobject_ = nullptr; return *this; } diff --git a/tests/glibmm_interface_implementation/main.cc b/tests/glibmm_interface_implementation/main.cc index c748215f..40da2787 100644 --- a/tests/glibmm_interface_implementation/main.cc +++ b/tests/glibmm_interface_implementation/main.cc @@ -74,14 +74,14 @@ int main(int, char**) << action.property.get_value() << "'." << std::endl; success &= action.property.get_value() == "A new value."; - gchar* prop_value = 0; + gchar* prop_value = nullptr; g_object_set(action.gobj(), "custom_property", "Another value", NULL); g_object_get(action.gobj(), "custom_property", &prop_value, NULL); std::cout << "The custom property after g_object_set/get() is '" << prop_value << "'." << std::endl; success &= std::strcmp(prop_value, "Another value") == 0; g_free(prop_value); - prop_value = 0; + prop_value = nullptr; std::cout << "The custom property through the Glib::Property<> is '" << action.property.get_value() << "'." << std::endl; diff --git a/tests/glibmm_vector/main.cc b/tests/glibmm_vector/main.cc index b1ae14bb..d184ecc0 100644 --- a/tests/glibmm_vector/main.cc +++ b/tests/glibmm_vector/main.cc @@ -40,7 +40,7 @@ const unsigned int magic_limit(5); GList* create_list() { - GList* head = 0; + GList* head = nullptr; for(unsigned int iter(0); iter < magic_limit; ++iter) { @@ -142,7 +142,7 @@ copy_array(GCredentials** array) { dup[iter] = array[iter]; } - dup[magic_limit] = 0; + dup[magic_limit] = nullptr; return dup; } diff --git a/tools/extra_defs_gen/generate_extra_defs.cc b/tools/extra_defs_gen/generate_extra_defs.cc index 8477f056..bc8a78cf 100644 --- a/tools/extra_defs_gen/generate_extra_defs.cc +++ b/tools/extra_defs_gen/generate_extra_defs.cc @@ -69,7 +69,7 @@ std::string get_properties(GType gtype) std::string strObjectName = g_type_name(gtype); //Get the list of properties: - GParamSpec** ppParamSpec = 0; + GParamSpec** ppParamSpec = nullptr; guint iCount = 0; if(G_TYPE_IS_OBJECT(gtype)) { @@ -160,8 +160,8 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) std::string strResult; std::string strObjectName = g_type_name(gtype); - gpointer gclass_ref = 0; - gpointer ginterface_ref = 0; + gpointer gclass_ref = nullptr; + gpointer ginterface_ref = nullptr; if(G_TYPE_IS_OBJECT(gtype)) gclass_ref = g_type_class_ref(gtype); //Ensures that class_init() is called. @@ -229,7 +229,7 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) gchar* pchNum = g_strdup_printf("%d", j); std::string strParamName = "p" + std::string(pchNum); g_free(pchNum); - pchNum = 0; + pchNum = nullptr; //Just like above, for the return type: std::string strTypeName = get_type_name_signal( typeParamMangled & ~G_SIGNAL_TYPE_STATIC_SCOPE, is_a_pointer_func ); //The type is mangled with a flag. Hacky. diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4 index fc46097d..1afa53a5 100644 --- a/tools/m4/class_boxedtype.m4 +++ b/tools/m4/class_boxedtype.m4 @@ -139,7 +139,7 @@ __CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other) : gobject_(other.gobject_) { - other.gobject_ = 0; + other.gobject_ = nullptr; } __CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other) diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4 index 8d25e6ae..f7e04010 100644 --- a/tools/m4/class_interface.m4 +++ b/tools/m4/class_interface.m4 @@ -96,7 +96,7 @@ void __CPPNAME__`'_Class::iface_init_function(void* g_iface, void*) //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc - g_assert(klass != 0); + g_assert(klass != nullptr); _IMPORT(SECTION_PCC_CLASS_INIT_VFUNCS) diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4 index b98502f3..f3fe4bd6 100644 --- a/tools/m4/class_opaque_copyable.m4 +++ b/tools/m4/class_opaque_copyable.m4 @@ -113,7 +113,7 @@ __CPPNAME__::__CPPNAME__`'(__CNAME__* castitem, bool make_a_copy /* = false */) if(castitem) gobject_ = __OPAQUE_FUNC_COPY`'(castitem); else - gobject_ = 0; + gobject_ = nullptr; } } ') diff --git a/tools/m4/method.m4 b/tools/m4/method.m4 index fe4075d3..3ca4de6e 100644 --- a/tools/m4/method.m4 +++ b/tools/m4/method.m4 @@ -61,7 +61,7 @@ ifelse(`$8',,,`$8 ')dnl ')',dnl End if a C++ output parameter is specified. dnl If is errthrow or refreturn -`ifelse(`$11',,,` GError* gerror = 0; +`ifelse(`$11',,,` GError* gerror = nullptr; ')dnl dnl If a slot type has been specified insert a slot copy declaration. ifelse(`$18',,,dnl @@ -155,7 +155,7 @@ dnl Return the value if it was stored and if the method returns something ifelse(`$3',void,,`ifelse(`$6',,,` return retval; ')')dnl ',dnl End if a C++ output parameter is specified. -`ifelse(`$10',,,` GError* gerror = 0;') +`ifelse(`$10',,,` GError* gerror = nullptr;') dnl If a slot type has been specified insert a slot copy declaration. ifelse(`$15',,,dnl dnl See if the slot should or should not be copied diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index cc0473c8..d85f93c7 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -285,7 +285,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT($8)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); // Call the original underlying C function: if(base && base->$2) @@ -331,7 +331,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT(gobject_)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); if(base && base->$2) ifelse($3,void,`dnl diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4 index 6ed4989e..fd2aeb82 100644 --- a/tools/m4/vfunc.m4 +++ b/tools/m4/vfunc.m4 @@ -117,7 +117,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT($8)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); // Call the original underlying C function: if(base && base->$2) @@ -170,12 +170,12 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT(gobject_)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); if(base && base->$2) { ifelse($10,errthrow,`dnl - GError* gerror = 0; + GError* gerror = nullptr; ')dnl ifelse($3,void,`dnl (*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6)); -- cgit v1.2.1 From ceefa5086bd31397317438cb7b778abfd3931425 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 17 Jul 2015 10:00:51 +0200 Subject: C++11: Use of the override keyword. --- examples/iochannel_stream/fdstream.h | 10 +++++----- glib/src/binding.hg | 2 +- glib/src/iochannel.ccg | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/iochannel_stream/fdstream.h b/examples/iochannel_stream/fdstream.h index 8c7f45dc..80f46757 100644 --- a/examples/iochannel_stream/fdstream.h +++ b/examples/iochannel_stream/fdstream.h @@ -77,11 +77,11 @@ public: fdstream_error get_error() const; protected: - virtual int_type underflow(); - virtual std::streamsize xsgetn(char* dest, std::streamsize num); - virtual int sync(); - virtual int_type overflow(int_type c); - virtual std::streamsize xsputn(const char* source, std::streamsize num); + int_type underflow() override; + std::streamsize xsgetn(char* dest, std::streamsize num) override; + int sync() override; + int_type overflow(int_type c) override; + std::streamsize xsputn(const char* source, std::streamsize num) override; private: Glib::RefPtr iochannel_; diff --git a/glib/src/binding.hg b/glib/src/binding.hg index 7464f5d2..5b5dd4bc 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -384,7 +384,7 @@ public: /** Decrement the reference count for this object. * You should never need to do this manually - use the object via a RefPtr instead. */ - virtual void unreference() const; + void unreference() const override; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ private: diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg index b92a83b8..93faefa7 100644 --- a/glib/src/iochannel.ccg +++ b/glib/src/iochannel.ccg @@ -50,8 +50,8 @@ public: ForeignIOChannel(GIOChannel* gobject, bool take_copy) : Glib::IOChannel(gobject, take_copy), ref_count_(0) {} - virtual void reference() const; - virtual void unreference() const; + void reference() const override; + void unreference() const override; private: mutable int ref_count_; -- cgit v1.2.1 From e67a885cd7df6c165d38e4c6e6d19f5383fc5782 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 17 Jul 2015 10:05:17 +0200 Subject: IOChannel: Documentation: Mark vfuncs as deprecated. Though we cannot hide them via GIOMM_DISABLE_DEPRECATED. --- glib/src/iochannel.hg | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg index 93bf749a..9c97ce78 100644 --- a/glib/src/iochannel.hg +++ b/glib/src/iochannel.hg @@ -78,15 +78,7 @@ class GlibmmIOChannel; * set_encoding("ISO-8859-15"). To set the channel to no encoding, use * set_encoding() without any arguments. * - * You can create an IOChannel with one of the static create methods, or - * implement one yourself, in which case you have to 1) override all - * _vfunc() members. 2) set the GIOChannel flags in your constructor. - * - * @note This feature of being able to implement a custom Glib::IOChannel is - * deprecated in glibmm 2.2. The vfunc interface has not yet stabilized - * enough to allow that -- the C++ wrapper went in by pure accident. Besides, - * it isn't terribly useful either. Thus please refrain from overriding any - * IOChannel vfuncs. + * You can create an IOChannel with one of the static create methods. */ class IOChannel : public sigc::trackable { @@ -437,12 +429,42 @@ protected: IOChannel(GIOChannel* gobject, bool take_copy); #endif + //We don't put GLIBMM_DISABLE_DEPRECATED around these deprecated methods + //because they are virtual and that would make the ABI dependent on the ifdef. + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus read_vfunc(char* buf, gsize count, gsize& bytes_read); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus write_vfunc(const char* buf, gsize count, gsize& bytes_written); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus seek_vfunc(gint64 offset, SeekType type); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus close_vfunc(); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus set_flags_vfunc(IOFlags flags); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOFlags get_flags_vfunc(); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual Glib::RefPtr create_watch_vfunc(IOCondition cond); #ifndef DOXYGEN_SHOULD_SKIP_THIS -- cgit v1.2.1 From 05610cec2ccbc54f20fcc3e995e41649f21c5714 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 17 Jul 2015 10:28:19 +0200 Subject: Glib::List_Iterator (and similar): Deprecate via ifdef. I don't think these have been used since before gtkmm 3.0. They were already hidden from the documentation. --- glib/glibmm/containers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glib/glibmm/containers.h b/glib/glibmm/containers.h index 7d78854b..d863e5e5 100644 --- a/glib/glibmm/containers.h +++ b/glib/glibmm/containers.h @@ -21,6 +21,8 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef GLIBMM_DISABLE_DEPRECATED + #include #include /* for backward compatibility */ #include @@ -358,4 +360,6 @@ public: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ +#endif //GLIBMM_DISABLE_DEPRECATED + #endif /* _GLIBMM_CONTAINERS_H */ -- cgit v1.2.1 From 49bf9a24c90b4da31db81c0efef65a13272db3c8 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sat, 18 Jul 2015 21:56:47 +0200 Subject: C++11: Use = delete instead of private to make classes noncopyable. --- glib/glibmm/dispatcher.cc | 8 +++--- glib/glibmm/dispatcher.h | 8 +++--- glib/glibmm/interface.h | 9 +++---- glib/glibmm/main.h | 19 ++++++------- glib/glibmm/object.h | 8 +++--- glib/glibmm/objectbase.h | 9 ++++--- glib/glibmm/pattern.h | 8 +++--- glib/glibmm/property.h | 7 ++--- glib/glibmm/random.h | 8 +++--- glib/glibmm/threadpool.cc | 8 +++--- glib/glibmm/timer.h | 8 +++--- glib/glibmm/ustring.h | 54 ++++++++++++++++++++----------------- tools/m4/class_gobject.m4 | 5 ++-- tools/m4/class_interface.m4 | 8 +++--- tools/m4/class_opaque_refcounted.m4 | 6 ++--- 15 files changed, 89 insertions(+), 84 deletions(-) diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc index 4fa95dae..d6117312 100644 --- a/glib/glibmm/dispatcher.cc +++ b/glib/glibmm/dispatcher.cc @@ -127,6 +127,10 @@ class DispatchNotifier : public sigc::trackable public: ~DispatchNotifier(); + // noncopyable + DispatchNotifier(const DispatchNotifier&) = delete; + DispatchNotifier& operator=(const DispatchNotifier&) = delete; + static DispatchNotifier* reference_instance( const Glib::RefPtr& context, const Dispatcher* dispatcher); static void unreference_instance( @@ -158,10 +162,6 @@ private: void create_pipe(); bool pipe_io_handler(Glib::IOCondition condition); bool pipe_is_empty(); - - // noncopyable - DispatchNotifier(const DispatchNotifier&); - DispatchNotifier& operator=(const DispatchNotifier&); }; /**** Glib::DispatchNotifier ***********************************************/ diff --git a/glib/glibmm/dispatcher.h b/glib/glibmm/dispatcher.h index 96721651..5de499d1 100644 --- a/glib/glibmm/dispatcher.h +++ b/glib/glibmm/dispatcher.h @@ -78,6 +78,10 @@ public: */ Dispatcher(); + // noncopyable + Dispatcher(const Dispatcher&) = delete; + Dispatcher& operator=(const Dispatcher&) = delete; + /** Create new Dispatcher instance using an arbitrary main context. * @throw Glib::FileError */ @@ -93,10 +97,6 @@ private: sigc::signal signal_; DispatchNotifier* notifier_; - // noncopyable - Dispatcher(const Dispatcher&); - Dispatcher& operator=(const Dispatcher&); - #ifndef DOXYGEN_SHOULD_SKIP_THIS friend class Glib::DispatchNotifier; #endif diff --git a/glib/glibmm/interface.h b/glib/glibmm/interface.h index 7b453a00..0fc9ba62 100644 --- a/glib/glibmm/interface.h +++ b/glib/glibmm/interface.h @@ -62,6 +62,10 @@ public: explicit Interface(GObject* castitem); virtual ~Interface(); + // noncopyable + Interface(const Interface&) = delete; + Interface& operator=(const Interface&) = delete; + //void add_interface(GType gtype_implementer); // Hook for translating API @@ -74,11 +78,6 @@ public: inline GObject* gobj() { return gobject_; } inline const GObject* gobj() const { return gobject_; } - -private: - // noncopyable - Interface(const Interface&); - Interface& operator=(const Interface&); }; RefPtr wrap_interface(GObject* object, bool take_copy = false); diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h index 30b40a6e..53a23705 100644 --- a/glib/glibmm/main.h +++ b/glib/glibmm/main.h @@ -405,6 +405,10 @@ public: typedef Glib::MainContext CppObjectType; typedef GMainContext BaseObjectType; + // noncopyable + MainContext(const MainContext& other) = delete; + MainContext& operator=(const MainContext& other) = delete; + /** Creates a new MainContext. * @return The new MainContext. */ @@ -587,11 +591,6 @@ private: // Glib::MainContext can neither be constructed nor deleted. MainContext(); void operator delete(void*, std::size_t); - - // noncopyable - MainContext(const MainContext& other); - MainContext& operator=(const MainContext& other); - }; /** @relates Glib::MainContext */ @@ -662,6 +661,10 @@ public: typedef Glib::Source CppObjectType; typedef GSource BaseObjectType; + // noncopyable + Source(const Source&) = delete; + Source& operator=(const Source&) = delete; + static Glib::RefPtr create() /* = 0 */; /** Adds a Source to a context so that it will be executed within that context. @@ -802,13 +805,7 @@ public: static sigc::slot_base* get_slot_from_connection_node(void* data); // Used by derived Source classes in other files. static sigc::slot_base* get_slot_from_callback_data(void* data); - -private: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - // noncopyable - Source(const Source&); - Source& operator=(const Source&); }; diff --git a/glib/glibmm/object.h b/glib/glibmm/object.h index 4ac56a11..202b28e5 100644 --- a/glib/glibmm/object.h +++ b/glib/glibmm/object.h @@ -103,6 +103,10 @@ public: typedef GObjectClass BaseClassType; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ + // noncopyable + Object(const Object&) = delete; + Object& operator=(const Object&) = delete; + protected: Object(); //For use by C++-only sub-types. explicit Object(const Glib::ConstructParams& construct_params); @@ -145,10 +149,6 @@ private: friend class Glib::Object_Class; static CppClassType object_class_; - // noncopyable - Object(const Object&); - Object& operator=(const Object&); - #endif /* DOXYGEN_SHOULD_SKIP_THIS */ // Glib::Object can not be dynamic because it lacks a float state. diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index 78f1b13c..44fb7adb 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -57,6 +57,12 @@ class Mutex; */ class GLIBMM_API ObjectBase : virtual public sigc::trackable { +public: + + // noncopyable + ObjectBase(const ObjectBase&) = delete; + ObjectBase& operator=(const ObjectBase&) = delete; + protected: /** This default constructor is called implicitly from the constructor of user-derived * classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. @@ -235,9 +241,6 @@ protected: #endif //DOXYGEN_SHOULD_SKIP_THIS private: - // noncopyable - ObjectBase(const ObjectBase&); - ObjectBase& operator=(const ObjectBase&); #ifndef DOXYGEN_SHOULD_SKIP_THIS virtual void set_manage(); // calls g_error() diff --git a/glib/glibmm/pattern.h b/glib/glibmm/pattern.h index 6f527ccc..dff0a97c 100644 --- a/glib/glibmm/pattern.h +++ b/glib/glibmm/pattern.h @@ -43,6 +43,10 @@ public: explicit PatternSpec(GPatternSpec* gobject); ~PatternSpec(); + // noncopyable + PatternSpec(const PatternSpec&) = delete; + PatternSpec& operator=(const PatternSpec&) = delete; + bool match(const Glib::ustring& str) const; bool match(const Glib::ustring& str, const Glib::ustring& str_reversed) const; @@ -54,10 +58,6 @@ public: private: GPatternSpec* gobject_; - - // noncopyable - PatternSpec(const PatternSpec&); - PatternSpec& operator=(const PatternSpec&); }; /** @} group PatternMatching */ diff --git a/glib/glibmm/property.h b/glib/glibmm/property.h index 716d8599..dadc0f29 100644 --- a/glib/glibmm/property.h +++ b/glib/glibmm/property.h @@ -57,6 +57,10 @@ class PropertyBase { public: + // noncopyable + PropertyBase(const PropertyBase&) = delete; + PropertyBase& operator=(const PropertyBase&) = delete; + /** Returns the name of the property. */ Glib::ustring get_name() const; @@ -98,9 +102,6 @@ protected: const char* get_name_internal() const; private: - // noncopyable - PropertyBase(const PropertyBase&); - PropertyBase& operator=(const PropertyBase&); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/glib/glibmm/random.h b/glib/glibmm/random.h index 864a4a32..aeda3a6a 100644 --- a/glib/glibmm/random.h +++ b/glib/glibmm/random.h @@ -43,6 +43,10 @@ public: explicit Rand(guint32 seed); ~Rand(); + // noncopyable + Rand(const Rand&) = delete; + Rand& operator=(const Rand&) = delete; + void set_seed(guint32 seed); bool get_bool(); @@ -58,10 +62,6 @@ public: private: GRand* gobject_; - - // noncopyable - Rand(const Rand&); - Rand& operator=(const Rand&); }; /** @} group Random */ diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc index e8e35fde..a007a435 100644 --- a/glib/glibmm/threadpool.cc +++ b/glib/glibmm/threadpool.cc @@ -34,6 +34,10 @@ public: SlotList(); ~SlotList(); + // noncopyable + SlotList(const ThreadPool::SlotList&) = delete; + ThreadPool::SlotList& operator=(const ThreadPool::SlotList&) = delete; + sigc::slot* push(const sigc::slot& slot); sigc::slot pop(sigc::slot* slot_ptr); @@ -42,10 +46,6 @@ public: private: Glib::Threads::Mutex mutex_; std::list< sigc::slot > list_; - - // noncopyable - SlotList(const ThreadPool::SlotList&); - ThreadPool::SlotList& operator=(const ThreadPool::SlotList&); }; ThreadPool::SlotList::SlotList() diff --git a/glib/glibmm/timer.h b/glib/glibmm/timer.h index 4864e68b..2c68d3a7 100644 --- a/glib/glibmm/timer.h +++ b/glib/glibmm/timer.h @@ -41,6 +41,10 @@ public: Timer(); ~Timer(); + // not copyable + Timer(const Timer&) = delete; + Timer& operator=(const Timer&) = delete; + void start(); void stop(); void reset(); @@ -63,10 +67,6 @@ public: private: GTimer* gobject_; - - // not copyable - Timer(const Timer&); - Timer& operator=(const Timer&); }; diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index c93a7d7e..3f74be7d 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -875,6 +875,12 @@ struct ustring::SequenceToString : publ class ustring::FormatStream { +public: + + // noncopyable + FormatStream(const ustring::FormatStream&) = delete; + FormatStream& operator=(const ustring::FormatStream&) = delete; + private: #ifdef GLIBMM_HAVE_WIDE_STREAM typedef std::wostringstream StreamType; @@ -883,10 +889,6 @@ private: #endif StreamType stream_; - // noncopyable - FormatStream(const ustring::FormatStream&); - FormatStream& operator=(const ustring::FormatStream&); - public: FormatStream(); ~FormatStream(); @@ -1261,16 +1263,16 @@ class ustring::Stringify private: ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const T& arg) : string_ (ustring::format(arg)) {} //TODO: Why is this here? See the template specialization: explicit inline Stringify(const char* arg) : string_(arg) {} + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1281,12 +1283,13 @@ class ustring::Stringify private: const ustring& string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const ustring& arg) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1299,12 +1302,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char* arg) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1317,12 +1321,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char arg[N]) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1336,12 +1341,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char arg[N]) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; diff --git a/tools/m4/class_gobject.m4 b/tools/m4/class_gobject.m4 index 14cbb22e..edd0c5b5 100644 --- a/tools/m4/class_gobject.m4 +++ b/tools/m4/class_gobject.m4 @@ -248,10 +248,9 @@ private:')dnl endif friend class __CPPNAME__`'_Class; static CppClassType `'__BASE__`'_class_; -private: // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; protected: explicit __CPPNAME__`'(const Glib::ConstructParams& construct_params); diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4 index f7e04010..7226a32b 100644 --- a/tools/m4/class_interface.m4 +++ b/tools/m4/class_interface.m4 @@ -234,14 +234,14 @@ public: typedef __CNAME__ BaseObjectType; typedef __CCLASS__ BaseClassType; + // noncopyable + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; + private: friend class __CPPNAME__`'_Class; static CppClassType `'__BASE__`'_class_; - // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); - #endif /* DOXYGEN_SHOULD_SKIP_THIS */ protected: /** diff --git a/tools/m4/class_opaque_refcounted.m4 b/tools/m4/class_opaque_refcounted.m4 index cec87fa0..847ac3be 100644 --- a/tools/m4/class_opaque_refcounted.m4 +++ b/tools/m4/class_opaque_refcounted.m4 @@ -171,11 +171,11 @@ protected: __CPPNAME__`'(); void operator delete(void*, std::size_t); -private: // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; +private: _IMPORT(SECTION_CLASS2) ') -- cgit v1.2.1 From 9097cd499b3518219ac3a04edf7349012b70a618 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sat, 18 Jul 2015 22:15:57 +0200 Subject: RefPtr<>: Don't mention RefPtr when just RefPtr is allowed. This seems to be correct and allowed. It makes the code clearer. --- glib/glibmm/refptr.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index ccfb26c7..79d05ce4 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -66,7 +66,7 @@ public: * * This increments the shared reference count. */ - inline RefPtr(const RefPtr& src); + inline RefPtr(const RefPtr& src); /** Copy constructor (from different, but castable type). * @@ -80,23 +80,23 @@ public: * done safely without involving a reference/unreference cycle and is * therefore highly efficient. */ - inline void swap(RefPtr& other); + inline void swap(RefPtr& other); /// Copy from another RefPtr: - inline RefPtr& operator=(const RefPtr& src); + inline RefPtr& operator=(const RefPtr& src); /** Copy from different, but castable type). * * Increments the reference count. */ template - inline RefPtr& operator=(const RefPtr& src); + inline RefPtr& operator=(const RefPtr& src); /// Tests whether the RefPtr<> point to the same underlying instance. - inline bool operator==(const RefPtr& src) const; + inline bool operator==(const RefPtr& src) const; /// See operator==(). - inline bool operator!=(const RefPtr& src) const; + inline bool operator!=(const RefPtr& src) const; /** Dereferencing. * @@ -133,7 +133,7 @@ public: * @endcode */ template - static inline RefPtr cast_dynamic(const RefPtr& src); + static inline RefPtr cast_dynamic(const RefPtr& src); /** Static cast to derived class. * @@ -143,7 +143,7 @@ public: * @endcode */ template - static inline RefPtr cast_static(const RefPtr& src); + static inline RefPtr cast_static(const RefPtr& src); /** Cast to non-const. * @@ -153,7 +153,7 @@ public: * @endcode */ template - static inline RefPtr cast_const(const RefPtr& src); + static inline RefPtr cast_const(const RefPtr& src); //TODO: Maybe remove these if we replace operator bool() with operator const void* after //an API/ABI break, as suggested by Daniel Elstner? murrayc. @@ -168,16 +168,16 @@ public: * is still syntactically possible, but the result is semantically * wrong, as p1 REL_OP p2 is interpreted as (bool)p1 REL_OP (bool)p2. */ - inline bool operator<(const RefPtr& src) const; + inline bool operator<(const RefPtr& src) const; /// See operator<(). - inline bool operator<=(const RefPtr& src) const; + inline bool operator<=(const RefPtr& src) const; /// See operator<(). - inline bool operator>(const RefPtr& src) const; + inline bool operator>(const RefPtr& src) const; /// See operator<(). - inline bool operator>=(const RefPtr& src) const; + inline bool operator>=(const RefPtr& src) const; private: T_CppObject* pCppObject_; @@ -215,7 +215,7 @@ RefPtr::RefPtr(T_CppObject* pCppObject) {} template inline -RefPtr::RefPtr(const RefPtr& src) +RefPtr::RefPtr(const RefPtr& src) : pCppObject_ (src.pCppObject_) { @@ -241,7 +241,7 @@ RefPtr::RefPtr(const RefPtr& src) } template inline -void RefPtr::swap(RefPtr& other) +void RefPtr::swap(RefPtr& other) { T_CppObject *const temp = pCppObject_; pCppObject_ = other.pCppObject_; @@ -249,7 +249,7 @@ void RefPtr::swap(RefPtr& other) } template inline -RefPtr& RefPtr::operator=(const RefPtr& src) +RefPtr& RefPtr::operator=(const RefPtr& src) { // In case you haven't seen the swap() technique to implement copy // assignment before, here's what it does: @@ -291,13 +291,13 @@ RefPtr& RefPtr::operator=(const RefPtr& sr } template inline -bool RefPtr::operator==(const RefPtr& src) const +bool RefPtr::operator==(const RefPtr& src) const { return (pCppObject_ == src.pCppObject_); } template inline -bool RefPtr::operator!=(const RefPtr& src) const +bool RefPtr::operator!=(const RefPtr& src) const { return (pCppObject_ != src.pCppObject_); } @@ -363,25 +363,25 @@ RefPtr RefPtr::cast_const(const RefPtr& sr } template inline -bool RefPtr::operator<(const RefPtr& src) const +bool RefPtr::operator<(const RefPtr& src) const { return (pCppObject_ < src.pCppObject_); } template inline -bool RefPtr::operator<=(const RefPtr& src) const +bool RefPtr::operator<=(const RefPtr& src) const { return (pCppObject_ <= src.pCppObject_); } template inline -bool RefPtr::operator>(const RefPtr& src) const +bool RefPtr::operator>(const RefPtr& src) const { return (pCppObject_ > src.pCppObject_); } template inline -bool RefPtr::operator>=(const RefPtr& src) const +bool RefPtr::operator>=(const RefPtr& src) const { return (pCppObject_ >= src.pCppObject_); } -- cgit v1.2.1 From 10898bc89ef57b2447b559af7e4e925739839f7d Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sat, 18 Jul 2015 22:47:56 +0200 Subject: RefPtr: Add move constructor and move assignment operator. --- glib/glibmm/refptr.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 79d05ce4..fd57b361 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -68,6 +68,10 @@ public: */ inline RefPtr(const RefPtr& src); + /** Move constructor + */ + inline RefPtr(RefPtr&& src); + /** Copy constructor (from different, but castable type). * * Increments the reference count. @@ -85,6 +89,9 @@ public: /// Copy from another RefPtr: inline RefPtr& operator=(const RefPtr& src); + /// Move assignment operator: + inline RefPtr& operator=(RefPtr&& src); + /** Copy from different, but castable type). * * Increments the reference count. @@ -223,6 +230,14 @@ RefPtr::RefPtr(const RefPtr& src) pCppObject_->reference(); } +template inline +RefPtr::RefPtr(RefPtr&& src) +: + pCppObject_ (src.pCppObject_) +{ + src.pCppObject_ = nullptr; +} + // The templated ctor allows copy construction from any object that's // castable. Thus, it does downcasts: // base_ref = derived_ref @@ -280,6 +295,14 @@ RefPtr& RefPtr::operator=(const RefPtr& src) return *this; } +template inline +RefPtr& RefPtr::operator=(RefPtr&& src) +{ + pCppObject_ = src.pCppObject_; + src.pCppObject_ = nullptr; + return *this; +} + template template inline -- cgit v1.2.1 From eedf161ea4a7e34476c105dc806e78a8ec4ccc09 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 19 Jul 2015 19:36:46 +0200 Subject: Glib::RefPtr: Move assignment operator: Unref the previous object. --- glib/glibmm/refptr.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index fd57b361..1aca555f 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -298,8 +298,17 @@ RefPtr& RefPtr::operator=(const RefPtr& src) template inline RefPtr& RefPtr::operator=(RefPtr&& src) { + if (pCppObject_) + pCppObject_->unreference(); + pCppObject_ = src.pCppObject_; src.pCppObject_ = nullptr; + + //This should work instead, but seems less efficient: + //RefPtr temp (src); + //this->swap(temp); + //src.pCppObject_ = nullptr; + return *this; } -- cgit v1.2.1 From 74d6630438dc1844176f058cbfeb16c8434e9bed Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 19 Jul 2015 21:33:02 +0200 Subject: C++11: Replace throw() with noexcept. --- glib/glibmm/error.cc | 2 +- glib/glibmm/error.h | 2 +- glib/glibmm/exception.cc | 2 +- glib/glibmm/exception.h | 2 +- glib/glibmm/exceptionhandler.cc | 2 +- glib/glibmm/exceptionhandler.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index 8e2bf776..315ea71d 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -75,7 +75,7 @@ Error& Error::operator=(const Error& other) return *this; } -Error::~Error() throw() +Error::~Error() noexcept { if(gobject_) g_error_free(gobject_); diff --git a/glib/glibmm/error.h b/glib/glibmm/error.h index d2701da4..1886d9a7 100644 --- a/glib/glibmm/error.h +++ b/glib/glibmm/error.h @@ -38,7 +38,7 @@ public: Error(const Error& other); Error& operator=(const Error& other); - virtual ~Error() throw(); + virtual ~Error() noexcept; GQuark domain() const; int code() const; diff --git a/glib/glibmm/exception.cc b/glib/glibmm/exception.cc index cc3d8efd..bf81ee00 100644 --- a/glib/glibmm/exception.cc +++ b/glib/glibmm/exception.cc @@ -30,7 +30,7 @@ namespace Glib { -Exception::~Exception() throw() +Exception::~Exception() noexcept {} Glib::ustring Exception::what() const diff --git a/glib/glibmm/exception.h b/glib/glibmm/exception.h index 56d58b6b..c0e12700 100644 --- a/glib/glibmm/exception.h +++ b/glib/glibmm/exception.h @@ -31,7 +31,7 @@ namespace Glib class Exception { public: - virtual ~Exception() throw() = 0; + virtual ~Exception() noexcept = 0; virtual Glib::ustring what() const = 0; }; diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc index aedb5432..df0b53e1 100644 --- a/glib/glibmm/exceptionhandler.cc +++ b/glib/glibmm/exceptionhandler.cc @@ -99,7 +99,7 @@ sigc::connection add_exception_handler(const sigc::slot& slot) } // internal -void exception_handlers_invoke() throw() +void exception_handlers_invoke() noexcept { // This function will be called from our GLib signal handler proxies // if an exception has been caught. It's not possible to throw C++ diff --git a/glib/glibmm/exceptionhandler.h b/glib/glibmm/exceptionhandler.h index 534ca064..350cd023 100644 --- a/glib/glibmm/exceptionhandler.h +++ b/glib/glibmm/exceptionhandler.h @@ -34,7 +34,7 @@ sigc::connection add_exception_handler(const sigc::slot& slot); #ifndef DOXYGEN_SHOULD_SKIP_THIS // internal -void exception_handlers_invoke() throw(); +void exception_handlers_invoke() noexcept; #endif //DOXYGEN_SHOULD_SKIP_THIS } // namespace Glib -- cgit v1.2.1 From 54850c3a75457d949c0aeebf918edcde0ab2e0f6 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 19 Jul 2015 23:06:31 +0200 Subject: Gio::Application: Add the shutdown signal. For some reason, gmmproc didn't warn about this unwrapped signal. Bug #752600 (Ben) --- gio/src/application.hg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gio/src/application.hg b/gio/src/application.hg index 98c5e570..b80ddac3 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -363,6 +363,10 @@ public: //#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)') _WRAP_SIGNAL(void startup(), "startup") + + //TODO: Remove no_default_handler when we can break ABI + _WRAP_SIGNAL(void shutdown(), "shutdown", no_default_handler, newin "2,46") + _WRAP_SIGNAL(void activate(), "activate") //We wrap the open signal without _WRAP_SIGNAL(), because we need to change its parameters. -- cgit v1.2.1 From 6af1d1e84c6d0f29b82a4f38b975c4675a99fd95 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 22 Jul 2015 12:11:40 +0200 Subject: 2.45.4 --- NEWS | 20 ++++++++++++++++++++ configure.ac | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 808c91b3..271aaf20 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,23 @@ +2.45.4 (unstable): + +Glib: +* RefPtr: Add move constructor and move assignment operator. + (Murray Cumming) + +Gio: +* Application: Add the shutdown signal. + (Murray Cumming) Bug #752600 (Ben) + +Build: +* C++11: Use noexcept instead of throw(). + (Murray Cumming) +* C++11: Use "= delete" instead of private copy constructors/operator=. + (Murray Cumming) +* C++11: Use nullptr instead of 0. + (Murray Cumming) +* C++11: Use the override keyword. + + 2.45.31 (unstable): Glib: diff --git a/configure.ac b/configure.ac index d1758b38..90c08a8d 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.31], +AC_INIT([glibmm], [2.45.4], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -62,7 +62,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.45.3' +glibreq='2.0 >= 2.45.4' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" -- cgit v1.2.1 From f8ee0fb14473b269c773677b060f8a369d3e704e Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 22 Jul 2015 12:43:05 +0200 Subject: 2.45.40 I named the previous version 2.45.31 instead of 2.45.3.1, so we have to use a number bigger than 31. Let's say that 40 is like 4 and we'll use 50 for the next one instead of 5. Sorry. --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 271aaf20..8b702751 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -2.45.4 (unstable): +2.45.40 (unstable): Glib: * RefPtr: Add move constructor and move assignment operator. diff --git a/configure.ac b/configure.ac index 90c08a8d..d032957e 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.4], +AC_INIT([glibmm], [2.45.40], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From 1bed47055676dbc0bdfc5f2542781770bbe4797c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 23 Jul 2015 16:58:55 +0200 Subject: gmmproc: Improve processing of documentation * tools/pm/Output.pm: * tools/pm/DocsParser.pm: When a C++ parameter name differs from the corresponding C parameter name, change the name in the documentation. The translation of argument names works for _WRAP_METHOD() and _WRAP_SIGNAL(). Bug #752469 --- tools/pm/DocsParser.pm | 153 ++++++++++++++++++++++++++++++++++++++++--------- tools/pm/Output.pm | 2 +- 2 files changed, 127 insertions(+), 28 deletions(-) diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 726ada2f..8dae9c14 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -325,7 +325,8 @@ sub lookup_enum_documentation($$$$) # $strCommentBlock lookup_documentation($strFunctionName, $deprecation_docs, $newin, $objCppfunc) # The final objCppfunc parameter is optional. If passed, it is used to # decide if the final C parameter should be omitted if the C++ method -# has a slot parameter. +# has a slot parameter. It is also used for converting C parameter names to +# C++ parameter names in the documentation, if they differ. sub lookup_documentation($$$;$) { my ($functionName, $deprecation_docs, $newin, $objCppfunc) = @_; @@ -357,9 +358,15 @@ sub lookup_documentation($$$;$) $text .= "\n\@deprecated $deprecation_docs\n"; } - DocsParser::append_parameter_docs($objFunction, \$text, $objCppfunc); + my %param_name_mappings = DocsParser::append_parameter_docs($objFunction, \$text, $objCppfunc); DocsParser::append_return_docs($objFunction, \$text); + # Convert C parameter names to C++ parameter names where they differ. + foreach my $key (keys %param_name_mappings) + { + $text =~ s/\@(param|a) $key\b/\@$1 $param_name_mappings{$key}/g; + } + # Remove leading and trailing white space. $text = string_trim($text); @@ -413,51 +420,143 @@ sub add_m4_quotes($) # The final objCppfunc is optional. If passed, it is used to determine # if the final C parameter should be omitted if the C++ method has a -# slot parameter. +# slot parameter. It is also used for converting C parameter names to +# C++ parameter names in the documentation, if they differ. sub append_parameter_docs($$;$) { my ($obj_function, $text, $objCppfunc) = @_; - my @param_names = @{$$obj_function{param_names}}; + my @docs_param_names = @{$$obj_function{param_names}}; my $param_descriptions = \$$obj_function{param_descriptions}; - - # Strip first parameter if this is a method. my $defs_method = GtkDefs::lookup_method_dont_mark($$obj_function{name}); - # the second alternative is for use with method-mappings meaning: - # this function is mapped into this Gtk::class - shift(@param_names) if(($defs_method && $$defs_method{class} ne "") || - ($$obj_function{mapped_class} ne "")); + my @c_param_names = $defs_method ? @{$$defs_method{param_names}} : @docs_param_names; + + # The information in + # $obj_function comes from the docs.xml file, + # $objCppfunc comes from _WRAP_METHOD() or _WRAP_SIGNAL() in the .hg file, + # $defs_method comes from the methods.defs file. + + # Ideally @docs_param_names and @c_param_names are identical. + # In the real world the parameters in the C documentation are sometimes not + # listed in the same order as the arguments in the C function declaration. + # We try to handle that case to some extent. If no argument name is misspelt + # in either the docs or the C function declaration, it usually succeeds for + # methods, but not for signals. For signals there is no C function declaration + # to compare with. If the docs of some method or signal get badly distorted + # due to imperfections in the C docs, and it's difficult to get the C docs + # corrected, correct docs can be added to the docs_override.xml file. + + # Skip first param if this is a signal. + if ($$obj_function{name} =~ /\w+::/) + { + shift(@docs_param_names); + shift(@c_param_names); + } + # Skip first parameter if this is a non-static method. + elsif (defined($objCppfunc)) + { + if (!$$objCppfunc{static}) + { + shift(@docs_param_names); + shift(@c_param_names); + } + } + # The second alternative is for use with method-mappings meaning: + # this function is mapped into this Gtk::class. + elsif (($defs_method && $$defs_method{class} ne "") || + $$obj_function{mapped_class} ne "") + { + shift(@docs_param_names); + shift(@c_param_names); + } - # Also skip first param if this is a signal. - shift(@param_names) if ($$obj_function{name} =~ /\w+::/); # Skip the last param if there is a slot because it would be a # gpointer user_data parameter. - pop(@param_names) if (defined($objCppfunc) && $$objCppfunc{slot_name}); + if (defined($objCppfunc) && $$objCppfunc{slot_name}) + { + pop(@docs_param_names); + pop(@c_param_names); + } - foreach my $param (@param_names) + # Skip the last param if it's an error output param. + if (scalar @docs_param_names && $docs_param_names[-1] eq "error") { - if ($param ne "error" ) #We wrap GErrors as exceptions, so ignore these. + pop(@docs_param_names); + pop(@c_param_names); + } + + my $cpp_param_names; + my $param_mappings; + my $out_param_index = 1000; # No method has that many arguments, hopefully. + if (defined($objCppfunc)) + { + $cpp_param_names = $$objCppfunc{param_names}; + $param_mappings = $$objCppfunc{param_mappings}; # C name -> C++ index + if (exists $$param_mappings{OUT}) { - my $desc = $$param_descriptions->{$param}; + $out_param_index = $$param_mappings{OUT}; + } + } + my %param_name_mappings; # C name -> C++ name - # Deal with callback parameters converting the docs to a slot - # compatible format. - if ($param eq "callback") + for (my $i = 0; $i < @docs_param_names; ++$i) + { + my $param = $docs_param_names[$i]; + my $desc = $$param_descriptions->{$param}; + + if (defined($objCppfunc)) + { + # If the C++ name is not equal to the C name, mark that the name + # shall be changed in the documentation. + my $cpp_name = $param; + if (exists $$param_mappings{$param}) { - $param = "slot"; - $$text =~ s/\@a callback/\@a slot/g; + # Rename and/or reorder declaration ({c_name} or {.}) in _WRAP_*(). + $cpp_name = $$cpp_param_names[$$param_mappings{$param}]; } - - $param =~ s/([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?/$1/g; - DocsParser::convert_docs_to_cpp($obj_function, \$desc); - if(length($desc) > 0) + elsif ($c_param_names[$i] eq $param) + { + # Location in docs coincides with location in C declaration. + my $cpp_index = $i; + $cpp_index++ if ($i >= $out_param_index); + $cpp_name = $$cpp_param_names[$cpp_index]; + } + else + { + # Search for the param in the C declaration. + for (my $j = 0; $j < @c_param_names; ++$j) + { + if ($c_param_names[$j] eq $param) + { + my $cpp_index = $j; + $cpp_index++ if ($j >= $out_param_index); + $cpp_name = $$cpp_param_names[$cpp_index]; + last; + } + } + } + if ($cpp_name ne $param) { - $desc .= '.' unless($desc =~ /(?:^|\.)$/); - $$text .= "\n\@param ${param} \u${desc}"; + $param_name_mappings{$param} = $cpp_name; } } + elsif ($param eq "callback") + { + # Deal with callback parameters converting the docs to a slot + # compatible format. + $param_name_mappings{$param} = "slot"; + } + + $param =~ s/([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?/$1/g; + DocsParser::convert_docs_to_cpp($obj_function, \$desc); + if(length($desc) > 0) + { + $desc .= '.' unless($desc =~ /(?:^|\.)$/); + $$text .= "\n\@param ${param} \u${desc}"; + } } + return %param_name_mappings; } diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index e0f0c294..587d06ba 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -603,7 +603,7 @@ sub output_wrap_sig_decl($$$$$$$$$$$$$$) # Get the existing signal documentation from the parsed docs. my $documentation = DocsParser::lookup_documentation( - "$$objCSignal{class}::$underscored_signal_name", $deprecation_docs, $newin); + "$$objCSignal{class}::$underscored_signal_name", $deprecation_docs, $newin, $objCppfunc); # Create a merged Doxygen comment block for the signal from the looked up # docs (the block will also contain a prototype of the slot as an example). -- cgit v1.2.1 From dd5e56fa26d5fce8aa6fd7d14d3a1c41db0f8d5a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 23 Jul 2015 16:59:18 +0200 Subject: test_scripts/testheaders.sh: Add -std=c++11 in the g++ commands --- tools/test_scripts/testheaders.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test_scripts/testheaders.sh b/tools/test_scripts/testheaders.sh index b6de3976..150ada4e 100755 --- a/tools/test_scripts/testheaders.sh +++ b/tools/test_scripts/testheaders.sh @@ -75,11 +75,11 @@ do for headerfile in $i/${i}mm/*.h do echo "=== $headerfile" - g++ -c -x c++ -o /dev/null $headerfile $CFLAGS + g++ -c -x c++ -std=c++11 -o /dev/null $headerfile $CFLAGS done else echo "=== $i" - g++ -c -x c++ -o /dev/null $i $CFLAGS + g++ -c -x c++ -std=c++11 -o /dev/null $i $CFLAGS fi done -- cgit v1.2.1 From 7d2e6b84c6e4e5a371887f98f42b56aaf94834ab Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 24 Jul 2015 09:47:04 +0200 Subject: HelperList: Don't use ifndef GLIBMM_DISABLE_DEPRECATED around this. To avoid breaking the gtkmm-2.24 build with --enable-warnings=fatal, and the build of apps that do this too. However, those apps (Inkscape) need to stop using that ancient deprecated version of gtkmm. Bug #752797 --- glib/glibmm/helperlist.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index 2028a1df..1c9b9ba5 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -22,7 +22,11 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef GLIBMM_DISABLE_DEPRECATED +//This is not hidden by GLIBMM_DISABLE_DEPRECATED +//because gtkmm-2.24 still uses this type in its public API. +//Note that gtkmm-2.24 itself is completely deprecated, so we really +//can remove this whole class some time soon. +//#ifndef GLIBMM_DISABLE_DEPRECATED #include @@ -169,7 +173,7 @@ protected: } /* namespace Glib */ -#endif //GLIBMM_DISABLE_DEPRECATED +//#endif //GLIBMM_DISABLE_DEPRECATED #endif /* _GLIBMM_HELPERLIST_H */ -- cgit v1.2.1 From 02206202d0754a51ee6914c46549f2dfd274b4ac Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 24 Jul 2015 09:49:20 +0200 Subject: Revert "Glib::List_Iterator (and similar): Deprecate via ifdef." This reverts commit 05610cec2ccbc54f20fcc3e995e41649f21c5714. See the commit in the previous commit about gtkmm-2.24. This is a temporary act of kindness to Inkscape. --- glib/glibmm/containers.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/glib/glibmm/containers.h b/glib/glibmm/containers.h index d863e5e5..7d78854b 100644 --- a/glib/glibmm/containers.h +++ b/glib/glibmm/containers.h @@ -21,8 +21,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef GLIBMM_DISABLE_DEPRECATED - #include #include /* for backward compatibility */ #include @@ -360,6 +358,4 @@ public: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ -#endif //GLIBMM_DISABLE_DEPRECATED - #endif /* _GLIBMM_CONTAINERS_H */ -- cgit v1.2.1 From 8670d2ac55a44c5c928e8bbdfe13911b7a1327ea Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 24 Jul 2015 10:18:55 +0200 Subject: 2.45.41 --- NEWS | 9 +++++++++ configure.ac | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8b702751..8c30d5be 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +2.45.41 (unstable): + +Glib: +* Undeprecate HelperList and List_Iterator because gtkmm-2.4 uses these + in its undeprecated API. However, all of gtkmm-2.4 is deprecated, so + you (Inkscape) shouldn't be using it anyway. + Bug #752797 (Adam Williamson) + (Murray Cumming) + 2.45.40 (unstable): Glib: diff --git a/configure.ac b/configure.ac index d032957e..ffa74891 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.40], +AC_INIT([glibmm], [2.45.41], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) -- cgit v1.2.1 From 6425a5ca3508fa4c75b474db56cc4df9ba0206b3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 24 Jul 2015 19:16:01 +0200 Subject: Update scripts that generate .defs files * tools/gen_scripts/gio_generate_enums.sh: * tools/gen_scripts/gio_generate_extra_defs.sh: * tools/gen_scripts/glib_generate_enums.sh: * tools/gen_scripts/glib_generate_methods.sh: These scripts patch the generated .defs files. Update them like gtkmm's gtk_generate_extra_defs.sh, i.e. more comments and an option to regenerate the patch file. --- tools/gen_scripts/gio_generate_enums.sh | 35 +++++++++++++++++++++++--- tools/gen_scripts/gio_generate_extra_defs.sh | 31 +++++++++++++++++++++-- tools/gen_scripts/glib_generate_enums.sh | 37 +++++++++++++++++++++++----- tools/gen_scripts/glib_generate_methods.sh | 37 +++++++++++++++++++++++----- 4 files changed, 122 insertions(+), 18 deletions(-) diff --git a/tools/gen_scripts/gio_generate_enums.sh b/tools/gen_scripts/gio_generate_enums.sh index e755bc6f..f9de8008 100755 --- a/tools/gen_scripts/gio_generate_enums.sh +++ b/tools/gen_scripts/gio_generate_enums.sh @@ -2,7 +2,20 @@ # Note that JHBUILD_SOURCES should be defined to contain the path to the root # of the jhbuild sources. The script assumes that it resides in the -# tools/gen_scripts directory and the defs file will be placed in glib/src. +# tools/gen_scripts directory and the defs file will be placed in gio/src. + +# To update the gio_enums.defs file: +# 1. ./gio_generate_enums.sh +# Generates gio/src/gio_enums.defs.orig and gio/src/gio_enums.defs. +# If any hunks from the patch file fail to apply, apply them manually to the +# gio_enums.defs file, if required. +# 2. Optional: Remove gio/src/gio_enums.defs.orig. + +# To update the gio_enums.defs file and the patch file: +# 1. Like step 1 when updating only the gio_enums.defs file. +# 2. Apply new patches manually to the gio_enums.defs file. +# 3. ./gio_generate_enums.sh --make-patch +# 4. Like step 2 when updating only the gio_enums.defs file. if [ -z "$JHBUILD_SOURCES" ]; then echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources." @@ -12,7 +25,21 @@ fi PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/gio/src" +OUT_FILE=gio_enums.defs +OUT_DIR_FILE="$OUT_DIR"/$OUT_FILE -ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" -$ENUM_PL "$PREFIX"/gio/*.h > "$OUT_DIR"/gio_enums.defs -patch "$OUT_DIR"/gio_enums.defs "$OUT_DIR"/gio_enums.defs.patch +if [ $# -eq 0 ] +then + ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" + $ENUM_PL "$PREFIX"/gio/*.h > "$OUT_DIR_FILE" + # patch version 2.7.5 does not like directory names. + cd "$OUT_DIR" + PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" + patch $PATCH_OPTIONS $OUT_FILE $OUT_FILE.patch +elif [ "$1" = "--make-patch" ] +then + diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch +else + echo "Usage: $0 [--make-patch]" + exit 1 +fi diff --git a/tools/gen_scripts/gio_generate_extra_defs.sh b/tools/gen_scripts/gio_generate_extra_defs.sh index 4e428bdb..b4330d71 100755 --- a/tools/gen_scripts/gio_generate_extra_defs.sh +++ b/tools/gen_scripts/gio_generate_extra_defs.sh @@ -3,9 +3,36 @@ # This script assumes that it resides in the tools/gen_scripts directory and # the defs file will be placed in gio/src. +# To update the gio_signals.defs file: +# 1. ./gio_generate_extra_defs.sh +# Generates gio/src/gio_signals.defs.orig and gio/src/gio_signals.defs. +# If any hunks from the patch file fail to apply, apply them manually to the +# gio_signals.defs file, if required. +# 2. Optional: Remove gio/src/gio_signals.defs.orig. + +# To update the gio_signals.defs file and the patch file: +# 1. Like step 1 when updating only the gio_signals.defs file. +# 2. Apply new patches manually to the gio_signals.defs file. +# 3. ./gio_generate_extra_defs.sh --make-patch +# 4. Like step 2 when updating only the gio_signals.defs file. + ROOT_DIR="$(dirname "$0")/../.." GEN_DIR="$ROOT_DIR/tools/extra_defs_gen" OUT_DIR="$ROOT_DIR/gio/src" +OUT_FILE=gio_signals.defs +OUT_DIR_FILE="$OUT_DIR"/$OUT_FILE -"$GEN_DIR"/generate_defs_gio > "$OUT_DIR"/gio_signals.defs -patch "$OUT_DIR"/gio_signals.defs "$OUT_DIR"/gio_signals.defs.patch +if [ $# -eq 0 ] +then + "$GEN_DIR"/generate_defs_gio > "$OUT_DIR_FILE" + # patch version 2.7.5 does not like directory names. + cd "$OUT_DIR" + PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" + patch $PATCH_OPTIONS $OUT_FILE $OUT_FILE.patch +elif [ "$1" = "--make-patch" ] +then + diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch +else + echo "Usage: $0 [--make-patch]" + exit 1 +fi diff --git a/tools/gen_scripts/glib_generate_enums.sh b/tools/gen_scripts/glib_generate_enums.sh index c6ff6fe5..220064e5 100755 --- a/tools/gen_scripts/glib_generate_enums.sh +++ b/tools/gen_scripts/glib_generate_enums.sh @@ -4,6 +4,19 @@ # of the jhbuild sources. The script assumes that it resides in the # tools/gen_scripts directory and the defs files will be placed in glib/src. +# To update the g[lib|module|object]_enums.defs files: +# 1. ./glib_generate_enums.sh +# Generates glib/src/glib_enums.defs.orig and glib/src/g[lib|module|object]_enums.defs. +# If any hunks from the patch file fail to apply, apply them manually to the +# glib_enums.defs file, if required. +# 2. Optional: Remove glib/src/glib_enums.defs.orig. + +# To update the g[lib|module|object]_enums.defs files and the patch file: +# 1. Like step 1 when updating only the g[lib|module|object]_enums.defs files. +# 2. Apply new patches manually to the glib_enums.defs file. +# 3. ./glib_generate_enums.sh --make-patch +# 4. Like step 2 when updating only the g[lib|module|object]_enums.defs files. + if [ -z "$JHBUILD_SOURCES" ]; then echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources." exit 1; @@ -13,9 +26,21 @@ PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" -ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" -$ENUM_PL "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_enums.defs -patch "$OUT_DIR"/glib_enums.defs "$OUT_DIR"/glib_enums.defs.patch - -$ENUM_PL "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_enums.defs -$ENUM_PL "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_enums.defs +if [ $# -eq 0 ] +then + ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" + $ENUM_PL "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_enums.defs + $ENUM_PL "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_enums.defs + $ENUM_PL "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_enums.defs + # patch version 2.7.5 does not like directory names. + cd "$OUT_DIR" + PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" + patch $PATCH_OPTIONS glib_enums.defs glib_enums.defs.patch +elif [ "$1" = "--make-patch" ] +then + OUT_DIR_FILE="$OUT_DIR"/glib_enums.defs + diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch +else + echo "Usage: $0 [--make-patch]" + exit 1 +fi diff --git a/tools/gen_scripts/glib_generate_methods.sh b/tools/gen_scripts/glib_generate_methods.sh index 9813db0a..ef41146e 100755 --- a/tools/gen_scripts/glib_generate_methods.sh +++ b/tools/gen_scripts/glib_generate_methods.sh @@ -4,6 +4,19 @@ # of the jhbuild sources. The script assumes it resides in the # tools/gen_scripts directory and the defs files will be placed in glib/src. +# To update the g[lib|module|object]_functions.defs files: +# 1. ./glib_generate_methods.sh +# Generates glib/src/glib_functions.defs.orig and glib/src/g[lib|module|object]_functions.defs. +# If any hunks from the patch file fail to apply, apply them manually to the +# glib_functions.defs file, if required. +# 2. Optional: Remove glib/src/glib_functions.defs.orig. + +# To update the g[lib|module|object]_functions.defs files and the patch file: +# 1. Like step 1 when updating only the g[lib|module|object]_functions.defs files. +# 2. Apply new patches manually to the glib_functions.defs file. +# 3. ./glib_generate_methods.sh --make-patch +# 4. Like step 2 when updating only the g[lib|module|object]_functions.defs files. + if [ -z "$JHBUILD_SOURCES" ]; then echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources." exit 1; @@ -13,9 +26,21 @@ PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" -H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py" -$H2DEF_PY "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_functions.defs -patch "$OUT_DIR"/glib_functions.defs "$OUT_DIR"/glib_functions.defs.patch - -$H2DEF_PY "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_functions.defs -$H2DEF_PY "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_functions.defs +if [ $# -eq 0 ] +then + H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py" + $H2DEF_PY "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_functions.defs + $H2DEF_PY "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_functions.defs + $H2DEF_PY "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_functions.defs + # patch version 2.7.5 does not like directory names. + cd "$OUT_DIR" + PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" + patch $PATCH_OPTIONS glib_functions.defs glib_functions.defs.patch +elif [ "$1" = "--make-patch" ] +then + OUT_DIR_FILE="$OUT_DIR"/glib_functions.defs + diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch +else + echo "Usage: $0 [--make-patch]" + exit 1 +fi -- cgit v1.2.1 From 4ea0e5fa8ce414421e46ecc4ef80031caf076029 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 24 Jul 2015 19:17:18 +0200 Subject: Update glib_enums.defs.patch, add gio_enums.defs.patch * glib/src/glib_enums.defs.patch: G_IO_FLAG_IS_WRITEABLE is an enum constant since 2013-02-04. No patch needed for that any more. * gio/src/gio_enums.defs.patch: New file. Such a file has been useful for a long time. It should have been stored in git long ago. --- gio/src/gio_enums.defs.patch | 14 ++++++++++++++ glib/src/glib_enums.defs.patch | 27 ++++++--------------------- 2 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 gio/src/gio_enums.defs.patch diff --git a/gio/src/gio_enums.defs.patch b/gio/src/gio_enums.defs.patch new file mode 100644 index 00000000..4d64a586 --- /dev/null +++ b/gio/src/gio_enums.defs.patch @@ -0,0 +1,14 @@ +--- ./../../gio/src/gio_enums.defs.orig 2015-07-24 16:57:40.866238234 +0200 ++++ ./../../gio/src/gio_enums.defs 2015-07-24 16:57:40.870238424 +0200 +@@ -495,10 +495,11 @@ + '("timed-out" "G_IO_ERROR_TIMED_OUT" "24") + '("would-recurse" "G_IO_ERROR_WOULD_RECURSE" "25") + '("busy" "G_IO_ERROR_BUSY" "26") + '("would-block" "G_IO_ERROR_WOULD_BLOCK" "27") + '("host-not-found" "G_IO_ERROR_HOST_NOT_FOUND" "28") ++ '("host-not-found" "G_IO_ERROR_HOST_WAS_NOT_FOUND" "28") + '("would-merge" "G_IO_ERROR_WOULD_MERGE" "29") + '("failed-handled" "G_IO_ERROR_FAILED_HANDLED" "30") + '("too-many-open-files" "G_IO_ERROR_TOO_MANY_OPEN_FILES" "31") + '("not-initialized" "G_IO_ERROR_NOT_INITIALIZED" "32") + '("address-in-use" "G_IO_ERROR_ADDRESS_IN_USE" "33") diff --git a/glib/src/glib_enums.defs.patch b/glib/src/glib_enums.defs.patch index feac2c2a..022f3b18 100644 --- a/glib/src/glib_enums.defs.patch +++ b/glib/src/glib_enums.defs.patch @@ -1,6 +1,8 @@ ---- glib_enums.defs 2012-02-28 12:17:21.000000000 -0500 -+++ glib_enums.defs.new 2012-02-28 12:00:52.000000000 -0500 -@@ -386,16 +386,24 @@ +--- ./../../glib/src/glib_enums.defs.orig 2015-07-24 16:56:29.570857821 +0200 ++++ ./../../glib/src/glib_enums.defs 2015-07-24 16:56:29.706864274 +0200 +@@ -464,20 +464,28 @@ + ;; G_IO_ERR GLIB_SYSDEF_POLLERR, + ;; G_IO_HUP GLIB_SYSDEF_POLLHUP, ;; G_IO_NVAL GLIB_SYSDEF_POLLNVAL ;; } GIOCondition; @@ -31,22 +33,5 @@ ) ) -@@ -411,6 +419,10 @@ - ;; G_IO_FLAG_GET_MASK = G_IO_FLAG_MASK, - ;; G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK - ;; } GIOFlags; -+;; Note that we add is-writeable in glibmm to preserve API. -+;; They do that with a #define in glib, though an enum would have been OK: -+;; See http://git.gnome.org/browse/glib/commit/glib/giochannel.h?id=0d1a2eb4bfcd733e0c015c76fb0ca0308b8a61f0 -+;; and https://bugzilla.gnome.org/show_bug.cgi?id=657045#c6 + ;; From gmarkup.h - (define-flags-extended IOFlags - (in-module "G") -@@ -419,6 +431,7 @@ - '("append" "G_IO_FLAG_APPEND" "1 << 0") - '("nonblock" "G_IO_FLAG_NONBLOCK" "1 << 1") - '("is-readable" "G_IO_FLAG_IS_READABLE" "1 << 2") -+ '("is-writeable" "G_IO_FLAG_IS_WRITEABLE" "1 << 3") - '("is-writable" "G_IO_FLAG_IS_WRITABLE" "1 << 3") - '("is-seekable" "G_IO_FLAG_IS_SEEKABLE" "1 << 4") - '("mask" "G_IO_FLAG_MASK" "(1 << 5) - 1") -- cgit v1.2.1 From 4866bc0ee99bfed1e48ccd50484fbdab67782993 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 27 Jul 2015 08:22:53 +0200 Subject: Correct a comment. --- tests/glibmm_refptr_sigc_bind/main.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/glibmm_refptr_sigc_bind/main.cc b/tests/glibmm_refptr_sigc_bind/main.cc index 27b54e9e..38fe93b1 100644 --- a/tests/glibmm_refptr_sigc_bind/main.cc +++ b/tests/glibmm_refptr_sigc_bind/main.cc @@ -1,7 +1,6 @@ // Bug 564005 - Valgrind errors and crash on exit with Gtk::UIManager // Bug 154498 - Unnecessary warning on console: signalproxy_connectionnode.cc -// libsigc++-only test case. (Or almost so. glib_refptr.h is stolen from glibmm.) #include #include -- cgit v1.2.1 From fb6ce37bb06a21503eebd695bac3012447da2247 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 27 Jul 2015 08:44:08 +0200 Subject: tls_client test: Use gnome.org instead of google.org Because I recently find that the connection often, but not always, times out. Maybe Google has changed something about its servers. I was seeing this output when running the test: $ ./giomm_tls_client/test Successfully resolved address of test host 'www.google.com'. First address of test host is 2a00:1450:4016:802::1011. Could not connect socket to 2a00:1450:4016:802::1011:443. Exception: Connection timed out --- tests/giomm_tls_client/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc index 7a4d4bf2..2eb0eaf0 100644 --- a/tests/giomm_tls_client/main.cc +++ b/tests/giomm_tls_client/main.cc @@ -44,7 +44,7 @@ int main(int, char**) { Gio::init(); - const Glib::ustring test_host = "www.google.com"; + const Glib::ustring test_host = "www.gnome.org"; std::vector< Glib::RefPtr > inet_addresses; -- cgit v1.2.1 From a2195549d6477bccfd6365388997d2d5e1752032 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 27 Jul 2015 09:23:31 +0200 Subject: Add tests/glibmm_refptr. To test refcounting, though I'm not sure that the test for the move constructor is quite right. --- tests/Makefile.am | 2 + tests/glibmm_refptr/main.cc | 215 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 tests/glibmm_refptr/main.cc diff --git a/tests/Makefile.am b/tests/Makefile.am index c2b0458b..8f35cbb7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -41,6 +41,7 @@ check_PROGRAMS = \ glibmm_bool_arrayhandle/test \ glibmm_null_vectorutils/test \ glibmm_null_containerhandle/test \ + glibmm_refptr/test \ glibmm_refptr_sigc_bind/test \ glibmm_bytearray/test @@ -101,5 +102,6 @@ glibmm_null_vectorutils_test_SOURCES = glibmm_null_vectorutils/main.cc glibmm_null_vectorutils_test_LDADD = $(giomm_ldadd) glibmm_null_containerhandle_test_SOURCES = glibmm_null_containerhandle/main.cc glibmm_null_containerhandle_test_LDADD = $(giomm_ldadd) +glibmm_refptr_test_SOURCES = glibmm_refptr/main.cc glibmm_refptr_sigc_bind_test_SOURCES = glibmm_refptr_sigc_bind/main.cc glibmm_bytearray_test_SOURCES = glibmm_bytearray/main.cc diff --git a/tests/glibmm_refptr/main.cc b/tests/glibmm_refptr/main.cc new file mode 100644 index 00000000..269c7b0b --- /dev/null +++ b/tests/glibmm_refptr/main.cc @@ -0,0 +1,215 @@ +// Bug 564005 - Valgrind errors and crash on exit with Gtk::UIManager +// Bug 154498 - Unnecessary warning on console: signalproxy_connectionnode.cc + + +#include +#include +#include +#include + +#define ACTIVATE_BUG 1 + +// A class with its own reference-count, for use with RefPtr. +class Something +{ +public: + Something() + : ref_count_(1), + max_ref_count_(ref_count_) + {} + + void reference() + { + ++ref_count_; + + //Track the highest-ever max count. + if(max_ref_count_ < ref_count_) + max_ref_count_ = ref_count_; + } + + void unreference() + { + if (--ref_count_ <= 0) + delete this; + } + + //Just so we can check it in our test. + int ref_count() + { + return ref_count_; + } + + //Just so we can check it in our test. + int max_ref_count() + { + return max_ref_count_; + } + + +private: + int ref_count_; + int max_ref_count_; +}; + +class Parent +{ +public: + explicit Parent(const Glib::RefPtr& something) + : something_(something), + was_constructed_via_copy_constructor_(true), + was_constructed_via_move_constructor_(false) + { + } + + explicit Parent(const Glib::RefPtr&& something) + : something_(std::move(something)), + was_constructed_via_copy_constructor_(false), + was_constructed_via_move_constructor_(true) + { + } + + //Non copyable + Parent(const Parent& src) = delete; + Parent& operator=(const Parent& src) = delete; + + bool was_constructed_via_copy_constructor() const + { + return was_constructed_via_copy_constructor_; + } + + bool was_constructed_via_move_constructor() const + { + return was_constructed_via_move_constructor_; + } + + int something_ref_count() const + { + return something_->ref_count(); + } + + int something_max_ref_count() const + { + return something_->max_ref_count(); + } + +private: + Glib::RefPtr something_; + bool was_constructed_via_copy_constructor_; + bool was_constructed_via_move_constructor_; + +}; + +static +void test_initial_refcount() +{ + Glib::RefPtr refSomething (new Something()); + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert_cmpint(refSomething->max_ref_count(), ==, 1); +} + +static +void test_refptr_copy_constructor() +{ + Glib::RefPtr refSomething (new Something()); + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert_cmpint(refSomething->max_ref_count(), ==, 1); + + { + Glib::RefPtr refSomething2(refSomething); + g_assert_cmpint(refSomething->ref_count(), ==, 2); + g_assert_cmpint(refSomething2->ref_count(), ==, 2); + g_assert_cmpint(refSomething->max_ref_count(), ==, 2); + } + + //Test the refcount after other references should have been released + //when other RefPtrs went out of scope: + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert_cmpint(refSomething->max_ref_count(), ==, 2); +} + +static +void test_refptr_assignment_operator() +{ + Glib::RefPtr refSomething (new Something()); + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert_cmpint(refSomething->max_ref_count(), ==, 1); + + { + Glib::RefPtr refSomething2 = refSomething; + g_assert_cmpint(refSomething->ref_count(), ==, 2); + g_assert_cmpint(refSomething2->ref_count(), ==, 2); + g_assert_cmpint(refSomething->max_ref_count(), ==, 2); + } + + //Test the refcount after other references should have been released + //when other RefPtrs went out of scope: + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert_cmpint(refSomething->max_ref_count(), ==, 2); +} + + + +static +Glib::RefPtr get_something() +{ + static Glib::RefPtr something_to_get; + + //Reinitialize it each time: + something_to_get = Glib::RefPtr(new Something()); + + return something_to_get; +} + +static +void test_refptr_with_parent_copy_constructor() +{ + //We use get_something() because test_refptr_with_parent_move_constructor() does. + Glib::RefPtr refSomething = get_something(); + g_assert_cmpint(refSomething->ref_count(), ==, 2); //1 here and 1 inside get_something() + g_assert_cmpint(refSomething->max_ref_count(), ==, 2); + + { + Parent parent(refSomething); + g_assert(!parent.was_constructed_via_move_constructor()); + g_assert(parent.was_constructed_via_copy_constructor()); + g_assert_cmpint(parent.something_ref_count(), ==, 3); //1 here, 1 in parent, and 1 inside get_something() + g_assert_cmpint(parent.something_max_ref_count(), ==, 3); + } + + //Test the refcount after other references should have been released + //when other RefPtrs went out of scope: + g_assert_cmpint(refSomething->ref_count(), ==, 2); //1 here and 1 inside get_something() + g_assert_cmpint(refSomething->max_ref_count(), ==, 3); +} + +static +void test_refptr_with_parent_move_constructor() +{ + Parent parent(get_something()); + g_assert(parent.was_constructed_via_move_constructor()); + g_assert(!parent.was_constructed_via_copy_constructor()); + g_assert_cmpint(parent.something_ref_count(), ==, 2); //1 in parent and 1 inside get_something() + g_assert_cmpint(parent.something_max_ref_count(), ==, 3); //TODO: Avoid the extra ref in RefPtr::swap()? +} + +int main(int, char**) +{ + //Test initial refcount: + test_initial_refcount(); + + //Test refcount when using the RefPtr copy constructor: + test_refptr_copy_constructor(); + + //Test refcount when using the RefPtr assignment operator (operator=): + test_refptr_assignment_operator(); + + //Test the refcount when another class makes a copy via its constructor: + test_refptr_with_parent_copy_constructor(); + + //Test the refcount when another class makes a copy via its + //(perfect-forwarding)move constructor, which should not involve a temporary + //instance: + test_refptr_with_parent_move_constructor(); + + return EXIT_SUCCESS; +} -- cgit v1.2.1 From bc6d286094449eb484b241bceb10f1bcea9afe20 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 27 Jul 2015 20:56:31 +0200 Subject: tests/glibmm_refptr: Correct the move constructor test. The && was const, which was a silly typo. Thanks to Marcin Kolny for noticing. --- tests/glibmm_refptr/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/glibmm_refptr/main.cc b/tests/glibmm_refptr/main.cc index 269c7b0b..75a6db18 100644 --- a/tests/glibmm_refptr/main.cc +++ b/tests/glibmm_refptr/main.cc @@ -61,7 +61,7 @@ public: { } - explicit Parent(const Glib::RefPtr&& something) + explicit Parent(Glib::RefPtr&& something) : something_(std::move(something)), was_constructed_via_copy_constructor_(false), was_constructed_via_move_constructor_(true) @@ -189,7 +189,7 @@ void test_refptr_with_parent_move_constructor() g_assert(parent.was_constructed_via_move_constructor()); g_assert(!parent.was_constructed_via_copy_constructor()); g_assert_cmpint(parent.something_ref_count(), ==, 2); //1 in parent and 1 inside get_something() - g_assert_cmpint(parent.something_max_ref_count(), ==, 3); //TODO: Avoid the extra ref in RefPtr::swap()? + g_assert_cmpint(parent.something_max_ref_count(), ==, 2); } int main(int, char**) -- cgit v1.2.1 From 07ba42710cc2f7d15c070c44a4d1c1c64d66de61 Mon Sep 17 00:00:00 2001 From: Marcin Kolny Date: Fri, 24 Jul 2015 09:26:47 +0200 Subject: Glib::RefPtr: add "release()" method https://bugzilla.gnome.org/show_bug.cgi?id=752812 * glib/glibmm/refptr.h: "release" method gives an access to managed underlying object, releasing RefPtr's ownership. Method is useful e.g. in wrappers of functions containing transfer-full arguments. --- glib/glibmm/refptr.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 1aca555f..4a23d964 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -132,6 +132,13 @@ public: */ inline void reset(); + /** Release the ownership of underlying instance. + * + * RefPtr's underlying instance is set to nullptr, therefore underlying object can't be accessed through this RefPtr anymore. + * @return an underlying instance. + */ + inline T_CppObject* release() __attribute__((warn_unused_result)); + /** Dynamic cast to derived class. * * The RefPtr can't be cast with the usual notation so instead you can use @@ -355,6 +362,14 @@ void RefPtr::reset() this->swap(temp); } +template inline +T_CppObject* RefPtr::release() +{ + T_CppObject *tmp = pCppObject_; + pCppObject_ = nullptr; + return tmp; +} + template template inline -- cgit v1.2.1 From 1a21147cf2264c17eedd6027948285d2f6583f27 Mon Sep 17 00:00:00 2001 From: Marcin Kolny Date: Sun, 26 Jul 2015 00:44:30 +0000 Subject: Glib::RefPtr: add missing constructor and assignment operator * glib/glibmm/refptr.h: add move constructor and move assignment operator which allow to set underlying object to castable type. * tests/glibmm_refptr/main.cc: add tests for move constructor and move assignment operator containing universal reference as an argument. --- glib/glibmm/refptr.h | 30 ++++++++++++++++++++++++++++++ tests/glibmm_refptr/main.cc | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 4a23d964..4c1913e3 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -72,6 +72,11 @@ public: */ inline RefPtr(RefPtr&& src); + /** Move constructor (from different, but castable type). + */ + template + inline RefPtr(RefPtr&& src); + /** Copy constructor (from different, but castable type). * * Increments the reference count. @@ -92,6 +97,10 @@ public: /// Move assignment operator: inline RefPtr& operator=(RefPtr&& src); + /// Move assignment operator (from different, but castable type): + template + inline RefPtr& operator=(RefPtr&& src); + /** Copy from different, but castable type). * * Increments the reference count. @@ -245,6 +254,15 @@ RefPtr::RefPtr(RefPtr&& src) src.pCppObject_ = nullptr; } +template + template +inline +RefPtr::RefPtr(RefPtr&& src) +: + pCppObject_ (src.release()) +{ +} + // The templated ctor allows copy construction from any object that's // castable. Thus, it does downcasts: // base_ref = derived_ref @@ -319,6 +337,18 @@ RefPtr& RefPtr::operator=(RefPtr&& src) return *this; } +template + template +inline +RefPtr& RefPtr::operator=(RefPtr&& src) +{ + if (pCppObject_) + pCppObject_->unreference(); + pCppObject_ = src.release(); + + return *this; +} + template template inline diff --git a/tests/glibmm_refptr/main.cc b/tests/glibmm_refptr/main.cc index 75a6db18..79ce4c93 100644 --- a/tests/glibmm_refptr/main.cc +++ b/tests/glibmm_refptr/main.cc @@ -51,6 +51,10 @@ private: int max_ref_count_; }; +class SomethingDerived : public Something +{ +}; + class Parent { public: @@ -192,6 +196,27 @@ void test_refptr_with_parent_move_constructor() g_assert_cmpint(parent.something_max_ref_count(), ==, 2); } +static +void test_refptr_universal_reference_move_constructor() +{ + Glib::RefPtr refSomethingDerived(new SomethingDerived()); + Glib::RefPtr refSomething = std::move(refSomethingDerived); + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert(!refSomethingDerived); + g_assert_cmpint(refSomething->max_ref_count(), ==, 1); +} + +static +void test_refptr_universal_reference_asignment_operator() +{ + Glib::RefPtr refSomethingDerived(new SomethingDerived()); + Glib::RefPtr refSomething; + refSomething = std::move(refSomethingDerived); + g_assert_cmpint(refSomething->ref_count(), ==, 1); + g_assert(!refSomethingDerived); + g_assert_cmpint(refSomething->max_ref_count(), ==, 1); +} + int main(int, char**) { //Test initial refcount: @@ -211,5 +236,13 @@ int main(int, char**) //instance: test_refptr_with_parent_move_constructor(); + //Test the refcount when using the RefPtr move constructor with derived class + //as an argument. + test_refptr_universal_reference_move_constructor(); + + //Test the refcount when using the RefPtr assignment operator (operator=) + //with derived class as an argument. + test_refptr_universal_reference_asignment_operator(); + return EXIT_SUCCESS; } -- cgit v1.2.1 From c4b89c7df059d7b29291dc3631be9c0494c8fca8 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 28 Jul 2015 09:39:58 +0200 Subject: tests/glibmm_refptr: Slight improvement. test_refptr_universal_reference_move_constructor(): Make even more sure that its the copy constructor that the compiler uses. --- tests/glibmm_refptr/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/glibmm_refptr/main.cc b/tests/glibmm_refptr/main.cc index 79ce4c93..d55cb57e 100644 --- a/tests/glibmm_refptr/main.cc +++ b/tests/glibmm_refptr/main.cc @@ -200,7 +200,7 @@ static void test_refptr_universal_reference_move_constructor() { Glib::RefPtr refSomethingDerived(new SomethingDerived()); - Glib::RefPtr refSomething = std::move(refSomethingDerived); + Glib::RefPtr refSomething(std::move(refSomethingDerived)); g_assert_cmpint(refSomething->ref_count(), ==, 1); g_assert(!refSomethingDerived); g_assert_cmpint(refSomething->max_ref_count(), ==, 1); -- cgit v1.2.1 From 2c76615b0dcf5f56ec4d231a13c7fd4836bf792f Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 28 Jul 2015 09:41:17 +0200 Subject: tests/glibmm_refptr: Add simpler tests for move constructor/operator=. The *with_parent* tests test much the same thing, but these ones are simpler, based on Marcin Kolny's simpler tests for the universal reference versions. --- tests/glibmm_refptr/main.cc | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/glibmm_refptr/main.cc b/tests/glibmm_refptr/main.cc index d55cb57e..d03b2249 100644 --- a/tests/glibmm_refptr/main.cc +++ b/tests/glibmm_refptr/main.cc @@ -196,6 +196,27 @@ void test_refptr_with_parent_move_constructor() g_assert_cmpint(parent.something_max_ref_count(), ==, 2); } +static +void test_refptr_move_constructor() +{ + Glib::RefPtr refSomething(new Something()); + Glib::RefPtr refSomething2(std::move(refSomething)); + g_assert_cmpint(refSomething2->ref_count(), ==, 1); + g_assert(!refSomething); + g_assert_cmpint(refSomething2->max_ref_count(), ==, 1); +} + +static +void test_refptr_move_assignment_operator() +{ + Glib::RefPtr refSomething(new Something()); + Glib::RefPtr refSomething2; + refSomething2 = std::move(refSomething); + g_assert_cmpint(refSomething2->ref_count(), ==, 1); + g_assert(!refSomething); + g_assert_cmpint(refSomething2->max_ref_count(), ==, 1); +} + static void test_refptr_universal_reference_move_constructor() { @@ -228,11 +249,17 @@ int main(int, char**) //Test refcount when using the RefPtr assignment operator (operator=): test_refptr_assignment_operator(); + //Test the refcount when using the RefPtr move constuctor: + test_refptr_move_constructor(); + + //Test the refcount when using the RefPtr move asignment operator (operator=): + test_refptr_move_assignment_operator(); + //Test the refcount when another class makes a copy via its constructor: test_refptr_with_parent_copy_constructor(); //Test the refcount when another class makes a copy via its - //(perfect-forwarding)move constructor, which should not involve a temporary + //(perfect-forwarding) move constructor, which should not involve a temporary //instance: test_refptr_with_parent_move_constructor(); -- cgit v1.2.1 From 0162a65ffc82c377ec5a4c78a3fe8092d62154f8 Mon Sep 17 00:00:00 2001 From: Marcin Kolny Date: Wed, 29 Jul 2015 13:06:43 +0200 Subject: generate_wrap_init.pl: Allow to use nested namespaces for whole module. https://bugzilla.gnome.org/show_bug.cgi?id=753013 * tools/generate_wrap_init.pl.in: add support for nested namespaces in --namespace parameter, i.e. --namespace=Gst::Bad. It requires to store all classes from module at least in Gst::Bad namespace, but allows to use this namespace in wrap_init.h class. --- tools/generate_wrap_init.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_wrap_init.pl.in b/tools/generate_wrap_init.pl.in index 1381dfe3..f49fe2f2 100644 --- a/tools/generate_wrap_init.pl.in +++ b/tools/generate_wrap_init.pl.in @@ -66,7 +66,7 @@ while ($ARGV[0] =~ /^-/) { if ($ARGV[0] =~ /--namespace=(\S+)/) { - push(@namespace_whole, $1); + push(@namespace_whole, split('::', $1)); if($parent_dir eq "") { $parent_dir = lc($1) . "mm"; } -- cgit v1.2.1 From 9f30d4a6a1d7a5c9392f0447d9bf248a1f2e9229 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 30 Jul 2015 15:43:56 +0200 Subject: Remove gio/src/gio_unix_functions.defs * gio/src/gio.defs: * gio/src/filelist.am: Remove gio_unix_functions.defs. * gio/src/gio_unix_functions.defs: Remove the whole file. All data in this file is also included in gio_methods.defs. --- gio/src/filelist.am | 1 - gio/src/gio.defs | 1 - gio/src/gio_unix_functions.defs | 725 ---------------------------------------- 3 files changed, 727 deletions(-) delete mode 100644 gio/src/gio_unix_functions.defs diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 8f65f782..0f494e48 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -5,7 +5,6 @@ giomm_files_defs = \ gio_enums.defs \ gio_methods.defs \ gio_extra_objects.defs \ - gio_unix_functions.defs \ gio_signals.defs \ gio_vfuncs.defs \ gio_docs.xml \ diff --git a/gio/src/gio.defs b/gio/src/gio.defs index 4db096ff..b86c2792 100644 --- a/gio/src/gio.defs +++ b/gio/src/gio.defs @@ -1,5 +1,4 @@ (include gio_methods.defs) -(include gio_unix_functions.defs) (include gio_extra_objects.defs) (include gio_enums.defs) (include gio_signals.defs) diff --git a/gio/src/gio_unix_functions.defs b/gio/src/gio_unix_functions.defs deleted file mode 100644 index 73bed339..00000000 --- a/gio/src/gio_unix_functions.defs +++ /dev/null @@ -1,725 +0,0 @@ -;; -*- scheme -*- -; object definitions ... -(define-object AppInfoLookup - (in-module "GDesktop") - (c-name "GDesktopAppInfoLookup") - (gtype-id "G_TYPE_DESKTOP_APP_INFO_LOOKUP") -) - -(define-object DescriptorBased - (in-module "GFile") - (c-name "GFileDescriptorBased") - (gtype-id "G_TYPE_FILE_DESCRIPTOR_BASED") -) - -(define-object Connection - (in-module "GUnix") - (parent "GSocketConnection") - (c-name "GUnixConnection") - (gtype-id "G_TYPE_UNIX_CONNECTION") -) - -(define-object CredentialsMessage - (in-module "GUnix") - (parent "GSocketControlMessage") - (c-name "GUnixCredentialsMessage") - (gtype-id "G_TYPE_UNIX_CREDENTIALS_MESSAGE") -) - -(define-object FDList - (in-module "GUnix") - (parent "GObject") - (c-name "GUnixFDList") - (gtype-id "G_TYPE_UNIX_FD_LIST") -) - -(define-object FDMessage - (in-module "GUnix") - (parent "GSocketControlMessage") - (c-name "GUnixFDMessage") - (gtype-id "G_TYPE_UNIX_FD_MESSAGE") -) - -(define-object InputStream - (in-module "GUnix") - (parent "GInputStream") - (c-name "GUnixInputStream") - (gtype-id "G_TYPE_UNIX_INPUT_STREAM") -) - -(define-object OutputStream - (in-module "GUnix") - (parent "GOutputStream") - (c-name "GUnixOutputStream") - (gtype-id "G_TYPE_UNIX_OUTPUT_STREAM") -) - -(define-object SocketAddress - (in-module "GUnix") - (parent "GSocketAddress") - (c-name "GUnixSocketAddress") - (gtype-id "G_TYPE_UNIX_SOCKET_ADDRESS") -) - -;; Enumerations and flags ... - - -;; From gdesktopappinfo.h - -(define-function g_desktop_app_info_get_type - (c-name "g_desktop_app_info_get_type") - (return-type "GType") -) - -(define-function g_desktop_app_info_new_from_filename - (c-name "g_desktop_app_info_new_from_filename") - (return-type "GDesktopAppInfo*") - (parameters - '("const-char*" "filename") - ) -) - -(define-function g_desktop_app_info_new_from_keyfile - (c-name "g_desktop_app_info_new_from_keyfile") - (return-type "GDesktopAppInfo*") - (parameters - '("GKeyFile*" "key_file") - ) -) - -(define-method get_filename - (of-object "GDesktopAppInfo") - (c-name "g_desktop_app_info_get_filename") - (return-type "const-char*") -) - -(define-function g_desktop_app_info_new - (c-name "g_desktop_app_info_new") - (is-constructor-of "GDesktopAppInfo") - (return-type "GDesktopAppInfo*") - (parameters - '("const-char*" "desktop_id") - ) -) - -(define-method get_is_hidden - (of-object "GDesktopAppInfo") - (c-name "g_desktop_app_info_get_is_hidden") - (return-type "gboolean") -) - -(define-function g_desktop_app_info_set_desktop_env - (c-name "g_desktop_app_info_set_desktop_env") - (return-type "none") - (parameters - '("const-char*" "desktop_env") - ) -) - -(define-function g_desktop_app_info_lookup_get_type - (c-name "g_desktop_app_info_lookup_get_type") - (return-type "GType") -) - -(define-method get_default_for_uri_scheme - (of-object "GDesktopAppInfoLookup") - (c-name "g_desktop_app_info_lookup_get_default_for_uri_scheme") - (return-type "GAppInfo*") - (parameters - '("const-char*" "uri_scheme") - ) -) - - - -;; From gfiledescriptorbased.h - -(define-function g_file_descriptor_based_get_type - (c-name "g_file_descriptor_based_get_type") - (return-type "GType") -) - -(define-method get_fd - (of-object "GFileDescriptorBased") - (c-name "g_file_descriptor_based_get_fd") - (return-type "int") -) - - - -;; From gunixconnection.h - -(define-function g_unix_connection_get_type - (c-name "g_unix_connection_get_type") - (return-type "GType") -) - -(define-method send_fd - (of-object "GUnixConnection") - (c-name "g_unix_connection_send_fd") - (return-type "gboolean") - (parameters - '("gint" "fd") - '("GCancellable*" "cancellable") - '("GError**" "error") - ) -) - -(define-method receive_fd - (of-object "GUnixConnection") - (c-name "g_unix_connection_receive_fd") - (return-type "gint") - (parameters - '("GCancellable*" "cancellable") - '("GError**" "error") - ) -) - -(define-method send_credentials - (of-object "GUnixConnection") - (c-name "g_unix_connection_send_credentials") - (return-type "gboolean") - (parameters - '("GCancellable*" "cancellable") - '("GError**" "error") - ) -) - -(define-method receive_credentials - (of-object "GUnixConnection") - (c-name "g_unix_connection_receive_credentials") - (return-type "GCredentials*") - (parameters - '("GCancellable*" "cancellable") - '("GError**" "error") - ) -) - - - -;; From gunixcredentialsmessage.h - -(define-function g_unix_credentials_message_get_type - (c-name "g_unix_credentials_message_get_type") - (return-type "GType") -) - -(define-function g_unix_credentials_message_new - (c-name "g_unix_credentials_message_new") - (is-constructor-of "GUnixCredentialsMessage") - (return-type "GSocketControlMessage*") -) - -(define-function g_unix_credentials_message_new_with_credentials - (c-name "g_unix_credentials_message_new_with_credentials") - (return-type "GSocketControlMessage*") - (parameters - '("GCredentials*" "credentials") - ) -) - -(define-method get_credentials - (of-object "GUnixCredentialsMessage") - (c-name "g_unix_credentials_message_get_credentials") - (return-type "GCredentials*") -) - -(define-function g_unix_credentials_message_is_supported - (c-name "g_unix_credentials_message_is_supported") - (return-type "gboolean") -) - - - -;; From gunixfdlist.h - -(define-function g_unix_fd_list_get_type - (c-name "g_unix_fd_list_get_type") - (return-type "GType") -) - -(define-function g_unix_fd_list_new - (c-name "g_unix_fd_list_new") - (is-constructor-of "GUnixFdList") - (return-type "GUnixFDList*") -) - -(define-function g_unix_fd_list_new_from_array - (c-name "g_unix_fd_list_new_from_array") - (return-type "GUnixFDList*") - (parameters - '("const-gint*" "fds") - '("gint" "n_fds") - ) -) - -(define-method append - (of-object "GUnixFDList") - (c-name "g_unix_fd_list_append") - (return-type "gint") - (parameters - '("gint" "fd") - '("GError**" "error") - ) -) - -(define-method get_length - (of-object "GUnixFDList") - (c-name "g_unix_fd_list_get_length") - (return-type "gint") -) - -(define-method get - (of-object "GUnixFDList") - (c-name "g_unix_fd_list_get") - (return-type "gint") - (parameters - '("gint" "index_") - '("GError**" "error") - ) -) - -(define-method peek_fds - (of-object "GUnixFDList") - (c-name "g_unix_fd_list_peek_fds") - (return-type "const-gint*") - (parameters - '("gint*" "length") - ) -) - -(define-method steal_fds - (of-object "GUnixFDList") - (c-name "g_unix_fd_list_steal_fds") - (return-type "gint*") - (parameters - '("gint*" "length") - ) -) - - - -;; From gunixfdmessage.h - -(define-function g_unix_fd_message_get_type - (c-name "g_unix_fd_message_get_type") - (return-type "GType") -) - -(define-function g_unix_fd_message_new_with_fd_list - (c-name "g_unix_fd_message_new_with_fd_list") - (return-type "GSocketControlMessage*") - (parameters - '("GUnixFDList*" "fd_list") - ) -) - -(define-function g_unix_fd_message_new - (c-name "g_unix_fd_message_new") - (is-constructor-of "GUnixFdMessage") - (return-type "GSocketControlMessage*") -) - -(define-method get_fd_list - (of-object "GUnixFDMessage") - (c-name "g_unix_fd_message_get_fd_list") - (return-type "GUnixFDList*") -) - -(define-method steal_fds - (of-object "GUnixFDMessage") - (c-name "g_unix_fd_message_steal_fds") - (return-type "gint*") - (parameters - '("gint*" "length") - ) -) - -(define-method append_fd - (of-object "GUnixFDMessage") - (c-name "g_unix_fd_message_append_fd") - (return-type "gboolean") - (parameters - '("gint" "fd") - '("GError**" "error") - ) -) - - - -;; From gunixinputstream.h - -(define-function g_unix_input_stream_get_type - (c-name "g_unix_input_stream_get_type") - (return-type "GType") -) - -(define-function g_unix_input_stream_new - (c-name "g_unix_input_stream_new") - (is-constructor-of "GUnixInputStream") - (return-type "GInputStream*") - (parameters - '("gint" "fd") - '("gboolean" "close_fd") - ) -) - -(define-method set_close_fd - (of-object "GUnixInputStream") - (c-name "g_unix_input_stream_set_close_fd") - (return-type "none") - (parameters - '("gboolean" "close_fd") - ) -) - -(define-method get_close_fd - (of-object "GUnixInputStream") - (c-name "g_unix_input_stream_get_close_fd") - (return-type "gboolean") -) - -(define-method get_fd - (of-object "GUnixInputStream") - (c-name "g_unix_input_stream_get_fd") - (return-type "gint") -) - - - -;; From gunixmounts.h - -(define-function g_unix_mount_free - (c-name "g_unix_mount_free") - (return-type "none") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-method free - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_free") - (return-type "none") -) - -(define-function g_unix_mount_compare - (c-name "g_unix_mount_compare") - (return-type "gint") - (parameters - '("GUnixMountEntry*" "mount1") - '("GUnixMountEntry*" "mount2") - ) -) - -(define-function g_unix_mount_get_mount_path - (c-name "g_unix_mount_get_mount_path") - (return-type "const-char*") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_get_device_path - (c-name "g_unix_mount_get_device_path") - (return-type "const-char*") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_get_fs_type - (c-name "g_unix_mount_get_fs_type") - (return-type "const-char*") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_is_readonly - (c-name "g_unix_mount_is_readonly") - (return-type "gboolean") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_is_system_internal - (c-name "g_unix_mount_is_system_internal") - (return-type "gboolean") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_guess_can_eject - (c-name "g_unix_mount_guess_can_eject") - (return-type "gboolean") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_guess_should_display - (c-name "g_unix_mount_guess_should_display") - (return-type "gboolean") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_guess_name - (c-name "g_unix_mount_guess_name") - (return-type "char*") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-function g_unix_mount_guess_icon - (c-name "g_unix_mount_guess_icon") - (return-type "GIcon*") - (parameters - '("GUnixMountEntry*" "mount_entry") - ) -) - -(define-method compare - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_compare") - (return-type "gint") - (parameters - '("GUnixMountPoint*" "mount2") - ) -) - -(define-method get_mount_path - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_get_mount_path") - (return-type "const-char*") -) - -(define-method get_device_path - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_get_device_path") - (return-type "const-char*") -) - -(define-method get_fs_type - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_get_fs_type") - (return-type "const-char*") -) - -(define-method is_readonly - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_is_readonly") - (return-type "gboolean") -) - -(define-method is_user_mountable - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_is_user_mountable") - (return-type "gboolean") -) - -(define-method is_loopback - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_is_loopback") - (return-type "gboolean") -) - -(define-method guess_can_eject - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_guess_can_eject") - (return-type "gboolean") -) - -(define-method guess_name - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_guess_name") - (return-type "char*") -) - -(define-method guess_icon - (of-object "GUnixMountPoint") - (c-name "g_unix_mount_point_guess_icon") - (return-type "GIcon*") -) - -(define-function g_unix_mount_points_get - (c-name "g_unix_mount_points_get") - (return-type "GList*") - (parameters - '("guint64*" "time_read") - ) -) - -(define-function g_unix_mounts_get - (c-name "g_unix_mounts_get") - (return-type "GList*") - (parameters - '("guint64*" "time_read") - ) -) - -(define-function g_unix_mount_at - (c-name "g_unix_mount_at") - (return-type "GUnixMountEntry*") - (parameters - '("const-char*" "mount_path") - '("guint64*" "time_read") - ) -) - -(define-function g_unix_mounts_changed_since - (c-name "g_unix_mounts_changed_since") - (return-type "gboolean") - (parameters - '("guint64" "time") - ) -) - -(define-function g_unix_mount_points_changed_since - (c-name "g_unix_mount_points_changed_since") - (return-type "gboolean") - (parameters - '("guint64" "time") - ) -) - -(define-function g_unix_mount_monitor_get_type - (c-name "g_unix_mount_monitor_get_type") - (return-type "GType") -) - -(define-function g_unix_mount_monitor_new - (c-name "g_unix_mount_monitor_new") - (is-constructor-of "GUnixMountMonitor") - (return-type "GUnixMountMonitor*") -) - -(define-method set_rate_limit - (of-object "GUnixMountMonitor") - (c-name "g_unix_mount_monitor_set_rate_limit") - (return-type "none") - (parameters - '("int" "limit_msec") - ) -) - -(define-function g_unix_is_mount_path_system_internal - (c-name "g_unix_is_mount_path_system_internal") - (return-type "gboolean") - (parameters - '("const-char*" "mount_path") - ) -) - - - -;; From gunixoutputstream.h - -(define-function g_unix_output_stream_get_type - (c-name "g_unix_output_stream_get_type") - (return-type "GType") -) - -(define-function g_unix_output_stream_new - (c-name "g_unix_output_stream_new") - (is-constructor-of "GUnixOutputStream") - (return-type "GOutputStream*") - (parameters - '("gint" "fd") - '("gboolean" "close_fd") - ) -) - -(define-method set_close_fd - (of-object "GUnixOutputStream") - (c-name "g_unix_output_stream_set_close_fd") - (return-type "none") - (parameters - '("gboolean" "close_fd") - ) -) - -(define-method get_close_fd - (of-object "GUnixOutputStream") - (c-name "g_unix_output_stream_get_close_fd") - (return-type "gboolean") -) - -(define-method get_fd - (of-object "GUnixOutputStream") - (c-name "g_unix_output_stream_get_fd") - (return-type "gint") -) - - - -;; From gunixsocketaddress.h - -(define-function g_unix_socket_address_get_type - (c-name "g_unix_socket_address_get_type") - (return-type "GType") -) - -(define-function g_unix_socket_address_new - (c-name "g_unix_socket_address_new") - (is-constructor-of "GUnixSocketAddress") - (return-type "GSocketAddress*") - (parameters - '("const-gchar*" "path") - ) -) - -(define-function g_unix_socket_address_new_abstract - (c-name "g_unix_socket_address_new_abstract") - (return-type "GSocketAddress*") - (parameters - '("const-gchar*" "path") - '("gint" "path_len") - ) -) - -(define-function g_unix_socket_address_new_with_type - (c-name "g_unix_socket_address_new_with_type") - (return-type "GSocketAddress*") - (parameters - '("const-gchar*" "path") - '("gint" "path_len") - '("GUnixSocketAddressType" "type") - ) -) - -(define-method get_path - (of-object "GUnixSocketAddress") - (c-name "g_unix_socket_address_get_path") - (return-type "const-char*") -) - -(define-method get_path_len - (of-object "GUnixSocketAddress") - (c-name "g_unix_socket_address_get_path_len") - (return-type "gsize") -) - -(define-method get_address_type - (of-object "GUnixSocketAddress") - (c-name "g_unix_socket_address_get_address_type") - (return-type "GUnixSocketAddressType") -) - -(define-method get_is_abstract - (of-object "GUnixSocketAddress") - (c-name "g_unix_socket_address_get_is_abstract") - (return-type "gboolean") -) - -(define-function g_unix_socket_address_abstract_names_supported - (c-name "g_unix_socket_address_abstract_names_supported") - (return-type "gboolean") -) - - -- cgit v1.2.1 From 40b6ca519a10da8279bd59f65f703d034ed90147 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 30 Jul 2015 16:56:38 +0200 Subject: tools/gen_scripts: Don't read private.h files * tools/gen_scripts/gio_generate_enums.sh: * tools/gen_scripts/gio_generate_methods.sh: * tools/gen_scripts/glib_generate_enums.sh: * tools/gen_scripts/glib_generate_methods.sh: Don't collect information from header files with names ending in private.h. --- tools/gen_scripts/gio_generate_enums.sh | 4 +++- tools/gen_scripts/gio_generate_methods.sh | 4 +++- tools/gen_scripts/glib_generate_enums.sh | 8 +++++--- tools/gen_scripts/glib_generate_methods.sh | 8 +++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/gen_scripts/gio_generate_enums.sh b/tools/gen_scripts/gio_generate_enums.sh index f9de8008..f891868b 100755 --- a/tools/gen_scripts/gio_generate_enums.sh +++ b/tools/gen_scripts/gio_generate_enums.sh @@ -28,10 +28,12 @@ OUT_DIR="$ROOT_DIR/gio/src" OUT_FILE=gio_enums.defs OUT_DIR_FILE="$OUT_DIR"/$OUT_FILE +shopt -s extglob # Enable extended pattern matching if [ $# -eq 0 ] then ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" - $ENUM_PL "$PREFIX"/gio/*.h > "$OUT_DIR_FILE" + # Process files whose names end with .h, but not with private.h. + $ENUM_PL "$PREFIX"/gio/!(*private).h > "$OUT_DIR_FILE" # patch version 2.7.5 does not like directory names. cd "$OUT_DIR" PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" diff --git a/tools/gen_scripts/gio_generate_methods.sh b/tools/gen_scripts/gio_generate_methods.sh index 16160370..c7dc79fb 100755 --- a/tools/gen_scripts/gio_generate_methods.sh +++ b/tools/gen_scripts/gio_generate_methods.sh @@ -13,6 +13,8 @@ PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/gio/src" +shopt -s extglob # Enable extended pattern matching H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py" -$H2DEF_PY "$PREFIX"/gio/*.h > "$OUT_DIR"/gio_methods.defs +# Process files whose names end with .h, but not with private.h. +$H2DEF_PY "$PREFIX"/gio/!(*private).h > "$OUT_DIR"/gio_methods.defs #patch "$OUT_DIR"/gio_methods.defs "$OUT_DIR"/gio_methods.defs.patch diff --git a/tools/gen_scripts/glib_generate_enums.sh b/tools/gen_scripts/glib_generate_enums.sh index 220064e5..b366ffd5 100755 --- a/tools/gen_scripts/glib_generate_enums.sh +++ b/tools/gen_scripts/glib_generate_enums.sh @@ -26,12 +26,14 @@ PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" +shopt -s extglob # Enable extended pattern matching if [ $# -eq 0 ] then ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl" - $ENUM_PL "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_enums.defs - $ENUM_PL "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_enums.defs - $ENUM_PL "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_enums.defs + # Process files whose names end with .h, but not with private.h. + $ENUM_PL "$PREFIX"/glib/!(*private).h "$PREFIX"/glib/deprecated/!(*private).h > "$OUT_DIR"/glib_enums.defs + $ENUM_PL "$PREFIX"/gmodule/!(*private).h > "$OUT_DIR"/gmodule_enums.defs + $ENUM_PL "$PREFIX"/gobject/!(*private).h > "$OUT_DIR"/gobject_enums.defs # patch version 2.7.5 does not like directory names. cd "$OUT_DIR" PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" diff --git a/tools/gen_scripts/glib_generate_methods.sh b/tools/gen_scripts/glib_generate_methods.sh index ef41146e..701856a6 100755 --- a/tools/gen_scripts/glib_generate_methods.sh +++ b/tools/gen_scripts/glib_generate_methods.sh @@ -26,12 +26,14 @@ PREFIX="$JHBUILD_SOURCES/glib" ROOT_DIR="$(dirname "$0")/../.." OUT_DIR="$ROOT_DIR/glib/src" +shopt -s extglob # Enable extended pattern matching if [ $# -eq 0 ] then H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py" - $H2DEF_PY "$PREFIX"/glib/*.h "$PREFIX"/glib/deprecated/*.h > "$OUT_DIR"/glib_functions.defs - $H2DEF_PY "$PREFIX"/gmodule/*.h > "$OUT_DIR"/gmodule_functions.defs - $H2DEF_PY "$PREFIX"/gobject/*.h > "$OUT_DIR"/gobject_functions.defs + # Process files whose names end with .h, but not with private.h. + $H2DEF_PY "$PREFIX"/glib/!(*private).h "$PREFIX"/glib/deprecated/!(*private).h > "$OUT_DIR"/glib_functions.defs + $H2DEF_PY "$PREFIX"/gmodule/!(*private).h > "$OUT_DIR"/gmodule_functions.defs + $H2DEF_PY "$PREFIX"/gobject/!(*private).h > "$OUT_DIR"/gobject_functions.defs # patch version 2.7.5 does not like directory names. cd "$OUT_DIR" PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig" -- cgit v1.2.1 From 11fa7d9b5f9f07cc1c598eb861038dbea1261fb0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 30 Jul 2015 16:58:39 +0200 Subject: Regenerate gio_methods.defs, glib_functions.defs, gobject_functions.defs Regenerated without information from private.h files. --- gio/src/gio_methods.defs | 193 ++-------------------------------------- glib/src/glib_functions.defs | 125 -------------------------- glib/src/gobject_functions.defs | 4 - 3 files changed, 6 insertions(+), 316 deletions(-) diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 1d46463e..b2a248de 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -2397,15 +2397,6 @@ -;; From gappinfoprivate.h - -(define-function g_app_info_monitor_fire - (c-name "g_app_info_monitor_fire") - (return-type "none") -) - - - ;; From gapplicationcommandline.h (define-function g_application_command_line_get_type @@ -3446,10 +3437,6 @@ -;; From gcontenttypeprivate.h - - - ;; From gcontextspecificgroup.h (define-method get @@ -3644,10 +3631,6 @@ -;; From gcredentialsprivate.h - - - ;; From gdatainputstream.h (define-function g_data_input_stream_get_type @@ -4036,20 +4019,6 @@ -;; From gdbusactiongroup-private.h - -(define-method sync - (of-object "GDBusActionGroup") - (c-name "g_dbus_action_group_sync") - (return-type "gboolean") - (parameters - '("GCancellable*" "cancellable") - '("GError**" "error") - ) -) - - - ;; From gdbusaddress.h (define-function g_dbus_address_escape_value @@ -6165,10 +6134,6 @@ -;; From gdbusprivate.h - - - ;; From gdbusproxy.h (define-function g_dbus_proxy_get_type @@ -10769,43 +10734,6 @@ -;; From gioprivate.h - -(define-method async_read_is_via_threads - (of-object "GInputStream") - (c-name "g_input_stream_async_read_is_via_threads") - (return-type "gboolean") -) - -(define-method async_close_is_via_threads - (of-object "GInputStream") - (c-name "g_input_stream_async_close_is_via_threads") - (return-type "gboolean") -) - -(define-method async_write_is_via_threads - (of-object "GOutputStream") - (c-name "g_output_stream_async_write_is_via_threads") - (return-type "gboolean") -) - -(define-method async_close_is_via_threads - (of-object "GOutputStream") - (c-name "g_output_stream_async_close_is_via_threads") - (return-type "gboolean") -) - -(define-method set_cached_remote_address - (of-object "GSocketConnection") - (c-name "g_socket_connection_set_cached_remote_address") - (return-type "none") - (parameters - '("GSocketAddress*" "address") - ) -) - - - ;; From gioscheduler.h (define-function g_io_scheduler_push_job @@ -12171,10 +12099,6 @@ -;; From gmountprivate.h - - - ;; From gnativesocketaddress.h (define-function g_native_socket_address_get_type @@ -12277,27 +12201,6 @@ -;; From gnetworkingprivate.h - -(define-method get_serial - (of-object "GResolver") - (c-name "g_resolver_get_serial") - (return-type "guint64") -) - -(define-function g_socket - (c-name "g_socket") - (return-type "gint") - (parameters - '("gint" "domain") - '("gint" "type") - '("gint" "protocol") - '("GError**" "error") - ) -) - - - ;; From gnetworkmonitorbase.h (define-function g_network_monitor_base_get_type @@ -12353,6 +12256,12 @@ (return-type "gboolean") ) +(define-method get_network_metered + (of-object "GNetworkMonitor") + (c-name "g_network_monitor_get_network_metered") + (return-type "gboolean") +) + (define-method get_connectivity (of-object "GNetworkMonitor") (c-name "g_network_monitor_get_connectivity") @@ -12617,83 +12526,6 @@ -;; From gnotification-private.h - -(define-method get_id - (of-object "GNotification") - (c-name "g_notification_get_id") - (return-type "const-gchar*") -) - -(define-method get_title - (of-object "GNotification") - (c-name "g_notification_get_title") - (return-type "const-gchar*") -) - -(define-method get_body - (of-object "GNotification") - (c-name "g_notification_get_body") - (return-type "const-gchar*") -) - -(define-method get_icon - (of-object "GNotification") - (c-name "g_notification_get_icon") - (return-type "GIcon*") -) - -(define-method get_priority - (of-object "GNotification") - (c-name "g_notification_get_priority") - (return-type "GNotificationPriority") -) - -(define-method get_n_buttons - (of-object "GNotification") - (c-name "g_notification_get_n_buttons") - (return-type "guint") -) - -(define-method get_button - (of-object "GNotification") - (c-name "g_notification_get_button") - (return-type "none") - (parameters - '("gint" "index") - '("gchar**" "label") - '("gchar**" "action") - '("GVariant**" "target") - ) -) - -(define-method get_button_with_action - (of-object "GNotification") - (c-name "g_notification_get_button_with_action") - (return-type "gint") - (parameters - '("const-gchar*" "action") - ) -) - -(define-method get_default_action - (of-object "GNotification") - (c-name "g_notification_get_default_action") - (return-type "gboolean") - (parameters - '("gchar**" "action") - '("GVariant**" "target") - ) -) - -(define-method serialize - (of-object "GNotification") - (c-name "g_notification_serialize") - (return-type "GVariant*") -) - - - ;; From goutputstream.h (define-function g_output_stream_get_type @@ -17027,19 +16859,6 @@ -;; From gsubprocesslauncher-private.h - -(define-method set_launcher - (of-object "GSubprocess") - (c-name "g_subprocess_set_launcher") - (return-type "none") - (parameters - '("GSubprocessLauncher*" "launcher") - ) -) - - - ;; From gtask.h (define-function g_task_get_type diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs index 8617a07a..f1c453e3 100644 --- a/glib/src/glib_functions.defs +++ b/glib/src/glib_functions.defs @@ -1705,10 +1705,6 @@ -;; From gasyncqueueprivate.h - - - ;; From gatomic.h (define-function g_atomic_int_get @@ -2659,10 +2655,6 @@ -;; From gcharsetprivate.h - - - ;; From gchecksum.h (define-method get_length @@ -3146,10 +3138,6 @@ -;; From gdatasetprivate.h - - - ;; From gdate.h (define-function g_date_new @@ -6163,50 +6151,6 @@ -;; From glib-private.h - -(define-function g_get_worker_context - (c-name "g_get_worker_context") - (return-type "GMainContext*") -) - -(define-function g_check_setuid - (c-name "g_check_setuid") - (return-type "gboolean") -) - -(define-function g_main_context_new_with_next_id - (c-name "g_main_context_new_with_next_id") - (return-type "GMainContext*") - (parameters - '("guint" "next_id") - ) -) - -(define-function g_dir_open_with_errno - (c-name "g_dir_open_with_errno") - (return-type "GDir*") - (parameters - '("const-gchar*" "path") - '("guint" "flags") - ) -) - -(define-function g_dir_new_from_dirp - (c-name "g_dir_new_from_dirp") - (return-type "GDir*") - (parameters - '("gpointer" "dirp") - ) -) - -(define-function glib__private__ - (c-name "glib__private__") - (return-type "GLibPrivateVTable*") -) - - - ;; From glib_trace.h @@ -12307,71 +12251,6 @@ -;; From gthreadprivate.h - -(define-function g_system_thread_wait - (c-name "g_system_thread_wait") - (return-type "none") - (parameters - '("GRealThread*" "thread") - ) -) - -(define-function g_system_thread_new - (c-name "g_system_thread_new") - (is-constructor-of "GSystemThread") - (return-type "GRealThread*") - (parameters - '("GThreadFunc" "func") - '("gulong" "stack_size") - '("GError**" "error") - ) -) - -(define-function g_system_thread_free - (c-name "g_system_thread_free") - (return-type "none") - (parameters - '("GRealThread*" "thread") - ) -) - -(define-function g_system_thread_exit - (c-name "g_system_thread_exit") - (return-type "none") -) - -(define-function g_system_thread_set_name - (c-name "g_system_thread_set_name") - (return-type "none") - (parameters - '("const-gchar*" "name") - ) -) - -(define-function g_thread_new_internal - (c-name "g_thread_new_internal") - (return-type "GThread*") - (parameters - '("const-gchar*" "name") - '("GThreadFunc" "proxy") - '("GThreadFunc" "func") - '("gpointer" "data") - '("gsize" "stack_size") - '("GError**" "error") - ) -) - -(define-function g_thread_proxy - (c-name "g_thread_proxy") - (return-type "gpointer") - (parameters - '("gpointer" "thread") - ) -) - - - ;; From gtimer.h (define-function g_timer_new @@ -13262,10 +13141,6 @@ -;; From gunicodeprivate.h - - - ;; From gunicomp.h diff --git a/glib/src/gobject_functions.defs b/glib/src/gobject_functions.defs index c945e7a7..6254aecb 100644 --- a/glib/src/gobject_functions.defs +++ b/glib/src/gobject_functions.defs @@ -3618,10 +3618,6 @@ -;; From gtype-private.h - - - ;; From gvaluearray.h (define-function g_value_array_get_type -- cgit v1.2.1 From 88d59eff69d399c6f557f8c2be7599e31740b841 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 30 Jul 2015 16:59:20 +0200 Subject: Remove unnecessary _IGNORE() * gio/src/inputstream.hg: * gio/src/notification.hg: * gio/src/outputstream.hg: * gio/src/resolver.hg: * gio/src/socketconnection.hg: Remove _IGNORE() directives that have become unnecessary when the .defs files don't contain information from private.h files. gmmproc warns about unnecessary _IGNORE(). --- gio/src/inputstream.hg | 3 --- gio/src/notification.hg | 4 ---- gio/src/outputstream.hg | 3 --- gio/src/resolver.hg | 5 ----- gio/src/socketconnection.hg | 3 --- 5 files changed, 18 deletions(-) diff --git a/gio/src/inputstream.hg b/gio/src/inputstream.hg index 446e9017..745c11d8 100644 --- a/gio/src/inputstream.hg +++ b/gio/src/inputstream.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The giomm Development Team * * This library is free software; you can redistribute it and/or @@ -41,7 +39,6 @@ namespace Gio class InputStream : public Glib::Object { _CLASS_GOBJECT(InputStream, GInputStream, G_INPUT_STREAM, Glib::Object, GObject) - _IGNORE(g_input_stream_async_read_is_via_threads) dnl// private method public: _WRAP_METHOD(gssize read(void* buffer, gsize count, const Glib::RefPtr& cancellable{?}), diff --git a/gio/src/notification.hg b/gio/src/notification.hg index 806cd2e8..83c38ba4 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -111,10 +111,6 @@ public: // Ignore functions with variable-length parameter lists. _IGNORE(g_notification_add_button_with_target, g_notification_set_default_action_and_target) - // Ignore private methods - _IGNORE(g_notification_get_priority, g_notification_get_button, g_notification_get_default_action) - _IGNORE(g_notification_get_n_buttons, g_notification_get_button_with_action, g_notification_serialize) - _IGNORE(g_notification_get_icon, g_notification_get_id, g_notification_get_body, g_notification_get_title) // There are no properties, signals, vfuncs. }; diff --git a/gio/src/outputstream.hg b/gio/src/outputstream.hg index b318d3bb..afbf1e8b 100644 --- a/gio/src/outputstream.hg +++ b/gio/src/outputstream.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2007 The gtkmm Development Team * * This library is free software; you can redistribute it and/or @@ -39,7 +37,6 @@ _WRAP_ENUM(OutputStreamSpliceFlags, GOutputStreamSpliceFlags, NO_GTYPE) class OutputStream : public Glib::Object { _CLASS_GOBJECT(OutputStream, GOutputStream, G_OUTPUT_STREAM, Glib::Object, GObject) - _IGNORE(g_output_stream_async_write_is_via_threads) dnl// private method public: diff --git a/gio/src/resolver.hg b/gio/src/resolver.hg index 9fa83abe..a958b07f 100644 --- a/gio/src/resolver.hg +++ b/gio/src/resolver.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2009 jonathon jongsma * * This library is free software; you can redistribute it and/or @@ -69,9 +67,6 @@ public: // g_resolver_free_addresses is just a C convenience function _IGNORE(g_resolver_free_addresses) - // g_resolver_get_serial() is private API. - _IGNORE(g_resolver_get_serial) - #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr >',`$2($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr > lookup_by_name(const Glib::ustring& hostname, const Glib::RefPtr& cancellable{?}), g_resolver_lookup_by_name, errthrow) diff --git a/gio/src/socketconnection.hg b/gio/src/socketconnection.hg index f1543869..5ac0b2d6 100644 --- a/gio/src/socketconnection.hg +++ b/gio/src/socketconnection.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2010 Jonathon Jongsma * * This library is free software; you can redistribute it and/or @@ -52,7 +50,6 @@ namespace Gio class SocketConnection : public Gio::IOStream { _CLASS_GOBJECT(SocketConnection, GSocketConnection, G_SOCKET_CONNECTION, Gio::IOStream, GIOStream) - _IGNORE(g_socket_connection_set_cached_remote_address) dnl// private method public: _WRAP_METHOD(bool connect(const Glib::RefPtr& address, const Glib::RefPtr& cancellable{?}), g_socket_connection_connect, errthrow) -- cgit v1.2.1 From a427c8fb49a38912f8a7b6f1ffbf4aa9e2fb16d3 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 28 Jul 2015 10:31:10 +0200 Subject: RefPtr: move assignment operator: Use swap(). This is not actually less efficient - the code is inline anyway. Bug #752876 --- glib/glibmm/refptr.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 4c1913e3..5e213849 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -20,6 +20,7 @@ */ #include +#include namespace Glib { @@ -323,17 +324,10 @@ RefPtr& RefPtr::operator=(const RefPtr& src) template inline RefPtr& RefPtr::operator=(RefPtr&& src) { - if (pCppObject_) - pCppObject_->unreference(); - - pCppObject_ = src.pCppObject_; + RefPtr temp (std::move(src)); + this->swap(temp); src.pCppObject_ = nullptr; - //This should work instead, but seems less efficient: - //RefPtr temp (src); - //this->swap(temp); - //src.pCppObject_ = nullptr; - return *this; } -- cgit v1.2.1 From b8ec08faa271e90b4cce00e0fe9046ede36bb997 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 5 Aug 2015 15:14:22 +0800 Subject: Visual Studio Projects: Update to 2013 The latest glibmm requires enough C++11 to be supported so that it can be built, which is Visual Studio 2013 for the Visual Studio compilers. This updates the 2010 projects (and their settings) to 2013. The folder in which the projects reside in need to be updated, and we would preferably need to make the projects compatible with Visual Studio 2015, from the 2013 projects, which is not too different from the 2010 ones. --- MSVC_Net2010/compose.vcxproj | 8 ++++---- MSVC_Net2010/dispatcher.vcxproj | 8 ++++---- MSVC_Net2010/dispatcher2.vcxproj | 8 ++++---- MSVC_Net2010/gendef.vcxproj | 8 ++++---- MSVC_Net2010/giomm.vcxproj | 12 ++++++++---- MSVC_Net2010/giomm.vcxproj.filters | 4 ++++ MSVC_Net2010/giomm_simple.vcxproj | 8 ++++---- MSVC_Net2010/glibmm-version-paths.props | 2 +- MSVC_Net2010/glibmm.sln | 4 ++-- MSVC_Net2010/glibmm.vcxproj | 10 ++++++---- MSVC_Net2010/glibmm.vcxproj.filters | 2 ++ MSVC_Net2010/glibmm_value.vcxproj | 8 ++++---- MSVC_Net2010/install.vcxproj | 8 ++++---- MSVC_Net2010/keyfile.vcxproj | 8 ++++---- MSVC_Net2010/markup.vcxproj | 8 ++++---- MSVC_Net2010/options.vcxproj | 8 ++++---- MSVC_Net2010/properties.vcxproj | 8 ++++---- MSVC_Net2010/regex.vcxproj | 8 ++++---- MSVC_Net2010/resolver.vcxproj | 8 ++++---- MSVC_Net2010/socket-client.vcxproj | 8 ++++---- MSVC_Net2010/socket-server.vcxproj | 8 ++++---- MSVC_Net2010/thread.vcxproj | 8 ++++---- MSVC_Net2010/threadpool.vcxproj | 8 ++++---- 23 files changed, 91 insertions(+), 79 deletions(-) diff --git a/MSVC_Net2010/compose.vcxproj b/MSVC_Net2010/compose.vcxproj index 1f5eca9e..b8e5bb9b 100644 --- a/MSVC_Net2010/compose.vcxproj +++ b/MSVC_Net2010/compose.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/dispatcher.vcxproj b/MSVC_Net2010/dispatcher.vcxproj index 60a8d4d0..0a093282 100644 --- a/MSVC_Net2010/dispatcher.vcxproj +++ b/MSVC_Net2010/dispatcher.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/dispatcher2.vcxproj b/MSVC_Net2010/dispatcher2.vcxproj index b280859a..30634c22 100644 --- a/MSVC_Net2010/dispatcher2.vcxproj +++ b/MSVC_Net2010/dispatcher2.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/gendef.vcxproj b/MSVC_Net2010/gendef.vcxproj index de5b741b..f07083fb 100644 --- a/MSVC_Net2010/gendef.vcxproj +++ b/MSVC_Net2010/gendef.vcxproj @@ -26,22 +26,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/giomm.vcxproj b/MSVC_Net2010/giomm.vcxproj index d7d67d3f..7fd60f91 100644 --- a/MSVC_Net2010/giomm.vcxproj +++ b/MSVC_Net2010/giomm.vcxproj @@ -26,22 +26,22 @@ DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 @@ -276,6 +276,7 @@ + @@ -290,6 +291,7 @@ + @@ -398,6 +400,7 @@ + @@ -412,6 +415,7 @@ + diff --git a/MSVC_Net2010/giomm.vcxproj.filters b/MSVC_Net2010/giomm.vcxproj.filters index f4300a4a..5c42dd84 100644 --- a/MSVC_Net2010/giomm.vcxproj.filters +++ b/MSVC_Net2010/giomm.vcxproj.filters @@ -107,6 +107,7 @@ Source Files Source Files Source Files + Source Files Source Files Source Files Source Files @@ -121,6 +122,7 @@ Source Files Source Files Source Files + Source Files Source Files Source Files Source Files @@ -228,6 +230,7 @@ Header Files Header Files Header Files + Source Files Source Files Header Files Header Files @@ -242,6 +245,7 @@ Source Files Header Files Header Files + Header Files Header Files Header Files Header Files diff --git a/MSVC_Net2010/giomm_simple.vcxproj b/MSVC_Net2010/giomm_simple.vcxproj index 692f5044..19da8a4e 100644 --- a/MSVC_Net2010/giomm_simple.vcxproj +++ b/MSVC_Net2010/giomm_simple.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/glibmm-version-paths.props b/MSVC_Net2010/glibmm-version-paths.props index d29aa3c2..56dc3098 100644 --- a/MSVC_Net2010/glibmm-version-paths.props +++ b/MSVC_Net2010/glibmm-version-paths.props @@ -1,7 +1,7 @@  - 10 + 12 $(SolutionDir)\..\..\vs$(VSVer)\$(Platform) $(GlibEtcInstallRoot) $(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)\ diff --git a/MSVC_Net2010/glibmm.sln b/MSVC_Net2010/glibmm.sln index 46ca430e..0861e554 100644 --- a/MSVC_Net2010/glibmm.sln +++ b/MSVC_Net2010/glibmm.sln @@ -1,5 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 13.00 +# Visual Studio 2013 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glibmm", "glibmm.vcxproj", "{58B2B53C-C4FF-47FD-817B-095E45B7F7D4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gendef", "gendef.vcxproj", "{07324745-C9BE-4D65-B08A-9C88188C0C28}" diff --git a/MSVC_Net2010/glibmm.vcxproj b/MSVC_Net2010/glibmm.vcxproj index 426a720a..5c5519ba 100644 --- a/MSVC_Net2010/glibmm.vcxproj +++ b/MSVC_Net2010/glibmm.vcxproj @@ -28,22 +28,22 @@ DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 DynamicLibrary MultiByte - v100 + v120 @@ -201,6 +201,7 @@ + @@ -270,6 +271,7 @@ + diff --git a/MSVC_Net2010/glibmm.vcxproj.filters b/MSVC_Net2010/glibmm.vcxproj.filters index 4f4aad39..adcec275 100644 --- a/MSVC_Net2010/glibmm.vcxproj.filters +++ b/MSVC_Net2010/glibmm.vcxproj.filters @@ -18,6 +18,7 @@ Source Files Source Files Source Files + Source Files Source Files Source Files Source Files @@ -87,6 +88,7 @@ Header Files Header Files Header Files + Header Files Header Files Header Files Header Files diff --git a/MSVC_Net2010/glibmm_value.vcxproj b/MSVC_Net2010/glibmm_value.vcxproj index 40f15637..4ad39a76 100644 --- a/MSVC_Net2010/glibmm_value.vcxproj +++ b/MSVC_Net2010/glibmm_value.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/install.vcxproj b/MSVC_Net2010/install.vcxproj index 94624096..7e94904e 100644 --- a/MSVC_Net2010/install.vcxproj +++ b/MSVC_Net2010/install.vcxproj @@ -28,23 +28,23 @@ Utility MultiByte true - v100 + v120 Utility MultiByte - v100 + v120 Utility MultiByte true - v100 + v120 Utility MultiByte - v100 + v120 diff --git a/MSVC_Net2010/keyfile.vcxproj b/MSVC_Net2010/keyfile.vcxproj index 1255f7c3..3f31c33e 100644 --- a/MSVC_Net2010/keyfile.vcxproj +++ b/MSVC_Net2010/keyfile.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/markup.vcxproj b/MSVC_Net2010/markup.vcxproj index 274ec364..8287e517 100644 --- a/MSVC_Net2010/markup.vcxproj +++ b/MSVC_Net2010/markup.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/options.vcxproj b/MSVC_Net2010/options.vcxproj index 294cfa0a..d57e622d 100644 --- a/MSVC_Net2010/options.vcxproj +++ b/MSVC_Net2010/options.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/properties.vcxproj b/MSVC_Net2010/properties.vcxproj index a1acc53c..4d6d7496 100644 --- a/MSVC_Net2010/properties.vcxproj +++ b/MSVC_Net2010/properties.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/regex.vcxproj b/MSVC_Net2010/regex.vcxproj index 27d0c861..73e12dce 100644 --- a/MSVC_Net2010/regex.vcxproj +++ b/MSVC_Net2010/regex.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/resolver.vcxproj b/MSVC_Net2010/resolver.vcxproj index 64753931..1cf3f912 100644 --- a/MSVC_Net2010/resolver.vcxproj +++ b/MSVC_Net2010/resolver.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/socket-client.vcxproj b/MSVC_Net2010/socket-client.vcxproj index ad37cc4c..cdde60f7 100644 --- a/MSVC_Net2010/socket-client.vcxproj +++ b/MSVC_Net2010/socket-client.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/socket-server.vcxproj b/MSVC_Net2010/socket-server.vcxproj index 7a0b085c..53071d88 100644 --- a/MSVC_Net2010/socket-server.vcxproj +++ b/MSVC_Net2010/socket-server.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/thread.vcxproj b/MSVC_Net2010/thread.vcxproj index 33e20548..19ed189f 100644 --- a/MSVC_Net2010/thread.vcxproj +++ b/MSVC_Net2010/thread.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 diff --git a/MSVC_Net2010/threadpool.vcxproj b/MSVC_Net2010/threadpool.vcxproj index 3e047788..e94b0c43 100644 --- a/MSVC_Net2010/threadpool.vcxproj +++ b/MSVC_Net2010/threadpool.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 Application MultiByte - v100 + v120 -- cgit v1.2.1 From d94115843f38967b5e883f5f7d8057882ae364cb Mon Sep 17 00:00:00 2001 From: Marcin Kolny Date: Fri, 7 Aug 2015 10:25:50 +0000 Subject: Glib::RefPtr: minor release() improvements. https://bugzilla.gnome.org/show_bug.cgi?id=752812 * glib/glibmm/refptr.h: add warning in a comment, replace warn_unused_result attribute with corresponding GLib macro. --- glib/glibmm/refptr.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 5e213849..30dbf185 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -20,6 +20,7 @@ */ #include +#include #include namespace Glib @@ -146,8 +147,12 @@ public: * * RefPtr's underlying instance is set to nullptr, therefore underlying object can't be accessed through this RefPtr anymore. * @return an underlying instance. + * + * Most users should not use release(). It can spoil the automatic destruction + * of the managed object. A legitimate use is if you immediately give RefPtr's + * reference to another object. */ - inline T_CppObject* release() __attribute__((warn_unused_result)); + inline T_CppObject* release() G_GNUC_WARN_UNUSED_RESULT; /** Dynamic cast to derived class. * -- cgit v1.2.1