<File RelativePath="..\..\gio\giomm\mountoperation.cc" />\r
<File RelativePath="..\..\gio\giomm\networkaddress.cc" />\r
<File RelativePath="..\..\gio\giomm\networkservice.cc" />\r
+ <File RelativePath="..\..\gio\giomm\notification.cc" />\r
<File RelativePath="..\..\gio\giomm\outputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\pollableinputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\pollableoutputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\mountoperation.h" />\r
<File RelativePath="..\..\gio\giomm\networkaddress.h" />\r
<File RelativePath="..\..\gio\giomm\networkservice.h" />\r
+ <File RelativePath="..\..\gio\giomm\notification.h" />\r
<File RelativePath="..\..\gio\giomm\outputstream.h" />\r
<File RelativePath="..\..\gio\giomm\pollableinputstream.h" />\r
<File RelativePath="..\..\gio\giomm\pollableoutputstream.h" />\r
<File RelativePath="..\..\gio\giomm\mountoperation.cc" />\r
<File RelativePath="..\..\gio\giomm\networkaddress.cc" />\r
<File RelativePath="..\..\gio\giomm\networkservice.cc" />\r
+ <File RelativePath="..\..\gio\giomm\notification.cc" />\r
<File RelativePath="..\..\gio\giomm\outputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\pollableinputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\pollableoutputstream.cc" />\r
<File RelativePath="..\..\gio\giomm\mountoperation.h" />\r
<File RelativePath="..\..\gio\giomm\networkaddress.h" />\r
<File RelativePath="..\..\gio\giomm\networkservice.h" />\r
+ <File RelativePath="..\..\gio\giomm\notification.h" />\r
<File RelativePath="..\..\gio\giomm\outputstream.h" />\r
<File RelativePath="..\..\gio\giomm\pollableinputstream.h" />\r
<File RelativePath="..\..\gio\giomm\pollableoutputstream.h" />\r
<ClCompile Include="..\..\gio\giomm\mountoperation.cc" />
<ClCompile Include="..\..\gio\giomm\networkaddress.cc" />
<ClCompile Include="..\..\gio\giomm\networkservice.cc" />
+ <ClCompile Include="..\..\gio\giomm\notification.cc" />
<ClCompile Include="..\..\gio\giomm\outputstream.cc" />
<ClCompile Include="..\..\gio\giomm\pollableinputstream.cc" />
<ClCompile Include="..\..\gio\giomm\pollableoutputstream.cc" />
<ClInclude Include="..\..\gio\giomm\mountoperation.h" />
<ClInclude Include="..\..\gio\giomm\networkaddress.h" />
<ClInclude Include="..\..\gio\giomm\networkservice.h" />
+ <ClInclude Include="..\..\gio\giomm\notification.h" />
<ClInclude Include="..\..\gio\giomm\outputstream.h" />
<ClInclude Include="..\..\gio\giomm\pollableinputstream.h" />
<ClInclude Include="..\..\gio\giomm\pollableoutputstream.h" />
<ClCompile Include="..\..\gio\giomm\mountoperation.cc"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\gio\giomm\networkaddress.cc"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\gio\giomm\networkservice.cc"><Filter>Source Files</Filter></ClCompile>
+ <ClCompile Include="..\..\gio\giomm\notification.cc"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\gio\giomm\outputstream.cc"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\gio\giomm\pollableinputstream.cc"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\gio\giomm\pollableoutputstream.cc"><Filter>Source Files</Filter></ClCompile>
<ClInclude Include="..\..\gio\giomm\mountoperation.h"><Filter>Header Files</Filter></ClInclude>
<ClInclude Include="..\..\gio\giomm\networkaddress.h"><Filter>Header Files</Filter></ClInclude>
<ClInclude Include="..\..\gio\giomm\networkservice.h"><Filter>Header Files</Filter></ClInclude>
+ <ClInclude Include="..\..\gio\giomm\notification.h"><Filter>Header Files</Filter></ClInclude>
<ClInclude Include="..\..\gio\giomm\outputstream.h"><Filter>Header Files</Filter></ClInclude>
<ClInclude Include="..\..\gio\giomm\pollableinputstream.h"><Filter>Header Files</Filter></ClInclude>
<ClInclude Include="..\..\gio\giomm\pollableoutputstream.h"><Filter>Header Files</Filter></ClInclude>
+2.39.93 (unstable):
+
+Glib:
+* Keyfile: Add save_to_file().
+ (Murray Cumming)
+* Add VariantDict.
+ (Murray Cumming)
+* Variant: Remove the now-unnecessary local g_variant_parse_error_quark().
+ (Murray Cumming) Bug #727554 (Antoine Jacoutot)
+
+Gio:
+* Application: Add the handle-local-options signal.
+* ApplicationCommandline: Add get_options_dict().
+* Settings: Add get_user_value() and get_default_value().
+ (Murray Cumming)
+* Socket: Add get/set_option().
+ (Murray Cumming)
+* TlsInteraction: Add invoke_request_certificate(),
+ request_certificate(), request_certificate_async() and
+ request_certificate_finish().
+ (Murray Cumming)
+
+Build:
+* h2def.py:
+ - Handle *_DEPRECATED_IN_* and AVAILABLE_IN_* with 0 digits.
+ - Also strip *_DEPRECATE_IN_*_FOR () without a space.
+ (Murray Cumming)
+* Visual Studio Projects: Update giomm Projects.
+ (Chun-wei Fan)
+
+
2.39.92 (unstable):
Gio:
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([glibmm], [2.39.92],
+AC_INIT([glibmm], [2.39.93],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library])
])
-glibreq='2.0 >= 2.39.92'
+glibreq='2.0 >= 2.40.0'
GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj()));
const Glib::VariantBase 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<type_glib_variant>(variantBase);
value = variantDerived.get();
}
open(files, hint);
}
+/*
void Application::add_main_option_entry(Glib::OptionEntry& entry)
{
//Create a temporary array, just so we can give the correct thing to g_application_add_main_option_entries():
g_application_add_main_option_entries(gobj(), array);
}
+*/
} // namespace Gio
#include <glibmm/object.h>
#include <glibmm/optiongroup.h>
#include <glibmm/variant.h>
+#include <glibmm/variantdict.h>
#include <giomm/dbusconnection.h>
#include <giomm/notification.h>
_WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group)
+ //TODO: We need to be able to add a group, not just some entries,
+ //so we can do pre and post parsing. See https://bugzilla.gnome.org/show_bug.cgi?id=727602
+ //
//TODO: Custom write the documentation for this method?
- _WRAP_METHOD_DOCS_ONLY(g_application_add_main_option_entries)
- void add_main_option_entry(Glib::OptionEntry& entry);
- _IGNORE(g_application_add_main_option_entries)
+ //_WRAP_METHOD_DOCS_ONLY(g_application_add_main_option_entries)
+ //void add_main_option_entry(Glib::OptionEntry& entry);
+ //_IGNORE(g_application_add_main_option_entries)
_WRAP_METHOD(void add_option_group(Glib::OptionGroup& group), g_application_add_option_group)
-
-
_WRAP_METHOD(bool is_registered() const, g_application_get_is_registered)
_WRAP_METHOD(bool is_remote() const, g_application_get_is_remote)
#m4 _CONVERSION(`GApplicationCommandLine*', `const Glib::RefPtr<ApplicationCommandLine>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(int command_line(const Glib::RefPtr<ApplicationCommandLine>& command_line), "command-line")
+ //TODO: Remove no_default_handler when we can break ABI
+ //TODO: Avoid the use of the Variants in the VariantDict?
+ //TODO: Should options definitely be non-const? Confirm that the handler is meant to modify it.
+#m4 _CONVERSION(`GVariantDict*',`const Glib::RefPtr<Glib::VariantDict>&',`Glib::wrap($3, true)')
+ _WRAP_SIGNAL(int handle_local_options(const Glib::RefPtr<Glib::VariantDict>& options), "handle-local-options", no_default_handler)
+
protected:
virtual void on_open(const type_vec_files& files, const Glib::ustring& hint);
#include <giomm/inputstream.h>
#include <glibmm/object.h>
#include <glibmm/variant.h>
+#include <glibmm/variantdict.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
_WRAP_METHOD(char** get_arguments(int& argc) const, g_application_command_line_get_arguments)
+ //TODO: Wrap the GVariantDict*. See also Application's handle-local-options signal.
+ _WRAP_METHOD(Glib::RefPtr<Glib::VariantDict> get_options_dict(), g_application_command_line_get_options_dict, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Glib::VariantDict> get_options_dict() const, g_application_command_line_get_options_dict, refreturn, constversion)
+
_WRAP_METHOD(Glib::RefPtr<InputStream> get_stdin(), g_application_command_line_get_stdin, refreturn)
_WRAP_METHOD(Glib::RefPtr<const InputStream> get_stdin() const, g_application_command_line_get_stdin, refreturn, constversion)
<description>
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.
</description>
<parameters>
<parameter name="G_IO_ERROR_FAILED">
-<parameter_description> Generic error condition for when any operation fails.
+<parameter_description> Generic error condition for when an operation fails
+and no more specific #GIOErrorEnum value is defined.
</parameter_description>
</parameter>
<parameter name="G_IO_ERROR_NOT_FOUND">
</parameter_description>
</parameter>
<parameter name="G_IO_ERROR_NOT_SUPPORTED">
-<parameter_description> Operation not supported for the current backend.
+<parameter_description> Operation (or one of its parameters) not supported
</parameter_description>
</parameter>
<parameter name="G_IO_ERROR_NOT_MOUNTED">
(such as `/path/to/my icon.png`) without escaping
if the #GFile for @icon is a native file. If the file is not
native, the returned string is the result of g_file_get_uri()
-(such as `sftp://path/to/my\%20icon.png`).
+(such as `sftp://path/to/my%20icon.png`).
- If @icon is a #GThemedIcon with exactly one name, the encoding is
simply the name (such as `network-server`).
<function name="g_io_error_from_errno">
<description>
-Converts errno.h error codes into GIO error codes.
+Converts errno.h error codes into GIO error codes. The fallback
+value %G_IO_ERROR_FAILED is returned for error codes not currently
+handled (but note that future GLib releases may return a more
+specific value instead).
</description>
<function name="g_io_error_from_win32_error">
<description>
-Converts some common error codes into GIO error codes. The
-fallback value G_IO_ERROR_FAILED is returned for error codes not
-handled.
+Converts some common error codes (as returned from GetLastError()
+or WSAGetLastError()) into GIO error codes. The fallback value
+%G_IO_ERROR_FAILED is returned for error codes not currently
+handled (but note that future GLib releases may return a more
+specific value instead).
+
+You can use g_win32_error_message() to get a localized string
+corresponding to @error_code. (But note that unlike g_strerror(),
+g_win32_error_message() returns a string that must be freed.)
Since: 2.26
@action must be an application-wide action (it must start with "app.").
If @target_format is given, it is used to collect remaining
-positional parameters into a GVariant instance, similar to
-g_variant_new(). @action will be activated with that GVariant as its
+positional parameters into a #GVariant instance, similar to
+g_variant_new(). @action will be activated with that #GVariant as its
parameter.
Since: 2.40
</parameter_description>
</parameter>
<parameter name="target_format">
-<parameter_description> a GVariant format string, or %NULL
+<parameter_description> a #GVariant format string, or %NULL
</parameter_description>
</parameter>
<parameter name="Varargs">
-<parameter_description> positional parameters, as determined by @format_string
+<parameter_description> positional parameters, as determined by @target_format
</parameter_description>
</parameter>
</parameters>
</parameter_description>
</parameter>
<parameter name="target">
-<parameter_description> a GVariant to use as @action's parameter, or %NULL
+<parameter_description> a #GVariant to use as @action's parameter, or %NULL
</parameter_description>
</parameter>
</parameters>
application-wide action (it must start with "app.").
If @target_format is given, it is used to collect remaining
-positional parameters into a GVariant instance, similar to
-g_variant_new(). @action will be activated with that GVariant as its
+positional parameters into a #GVariant instance, similar to
+g_variant_new(). @action will be activated with that #GVariant as its
parameter.
When no default action is set, the application that the notification
</parameter_description>
</parameter>
<parameter name="target_format">
-<parameter_description> a GVariant format string, or %NULL
+<parameter_description> a #GVariant format string, or %NULL
</parameter_description>
</parameter>
<parameter name="Varargs">
-<parameter_description> positional parameters, as determined by @format_string
+<parameter_description> positional parameters, as determined by @target_format
</parameter_description>
</parameter>
</parameters>
activated when the notification is clicked on. It must be an
application-wide action (start with "app.").
-If @target_format is given, it is used to collect remaining
-positional parameters into a GVariant instance, similar to
-g_variant_new().
-
If @target is non-%NULL, @action will be activated with @target as
its parameter.
</parameter_description>
</parameter>
<parameter name="target">
-<parameter_description> a GVariant to use as @action's parameter, or %NULL
+<parameter_description> a #GVariant to use as @action's parameter, or %NULL
</parameter_description>
</parameter>
</parameters>
(construct-only #f)
)
+;; From GAppInfoMonitor
+
+(define-signal changed
+ (of-object "GAppInfoMonitor")
+ (return-type "void")
+ (when "first")
+)
+
;; From GCancellable
(define-signal cancelled
(construct-only #f)
)
+;; From GNotification
+
+;; From GPropertyAction
+
+(define-property name
+ (of-object "GPropertyAction")
+ (prop-type "GParamString")
+ (docs "The name used to invoke the action")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
+(define-property parameter-type
+ (of-object "GPropertyAction")
+ (prop-type "GParamBoxed")
+ (docs "The type of GVariant passed to activate()")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property enabled
+ (of-object "GPropertyAction")
+ (prop-type "GParamBoolean")
+ (docs "If the action can be activated")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property state-type
+ (of-object "GPropertyAction")
+ (prop-type "GParamBoxed")
+ (docs "The type of the state kept by the action")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property state
+ (of-object "GPropertyAction")
+ (prop-type "GParamVariant")
+ (docs "The state the action is in")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property object
+ (of-object "GPropertyAction")
+ (prop-type "GParamObject")
+ (docs "The object with the property to wrap")
+ (readable #f)
+ (writable #t)
+ (construct-only #t)
+)
+
+(define-property property-name
+ (of-object "GPropertyAction")
+ (prop-type "GParamString")
+ (docs "The name of the property to wrap")
+ (readable #f)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From GProxy
;; From GProxyAddress
(construct-only #f)
)
+;; From GSubprocess
+
+(define-property flags
+ (of-object "GSubprocess")
+ (prop-type "GParamFlags")
+ (docs "Subprocess flags")
+ (readable #f)
+ (writable #t)
+ (construct-only #t)
+)
+
+(define-property argv
+ (of-object "GSubprocess")
+ (prop-type "GParamBoxed")
+ (docs "Argument vector")
+ (readable #f)
+ (writable #t)
+ (construct-only #t)
+)
+
+;; From GSubprocessLauncher
+
+(define-property flags
+ (of-object "GSubprocessLauncher")
+ (prop-type "GParamFlags")
+ (docs "GSubprocessFlags for launched processes")
+ (readable #f)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From GThemedIcon
(define-property name
value.init(g_value, false /* don't take a reference */);
}
+bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const
+{
+ GVariant* const g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str());
+ if(!g_value)
+ return false;
+
+ value.init(g_value, false /* don't take a reference */);
+ return true;
+}
+
+void Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const
+{
+ GVariant* const g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str());
+ if(!g_value)
+ return;
+
+ value.init(g_value, false /* don't take a reference */);
+}
void Settings::bind(const Glib::ustring& key,
const Glib::PropertyProxy_Base& property_proxy,
SettingsBindFlags flags)
//TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema, const Glib::RefPtr<SettingsBackend>& backend)
//TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema, const Glib::RefPtr<SettingsBackend>& 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)
+
/** Gets the value that is stored in the settings for a @a key.
*
* It is a programmer error to give a @a key that isn't contained in the
void get_value(const Glib::ustring& key, Glib::VariantBase& value) const;
_IGNORE(g_settings_get_value)
+ //TODO: We've added a bool return to handle the NULL return value case,
+ //but maybe other get_value() methods can return NULLs too.
+
+ /** Checks the "user value" of a @a key, if there is one.
+ *
+ * The user value of a key is the last value that was set by the user.
+ *
+ * After calling reset() this function should always return
+ * false (assuming something is not wrong with the system
+ * configuration).
+ *
+ * It is possible that get_value() will return a different
+ * value than this method. This can happen in the case that the user
+ * set a value for a key that was subsequently locked down by the system
+ * administrator -- this method will return the user's old value.
+ *
+ * This method may be useful for adding a "reset" option to a UI or
+ * for providing indication that a particular value has been changed.
+ *
+ * It is a programmer error to give a @a key that isn't contained in the
+ * schema for the settings.
+ *
+ * @param key The key to get the user value for.
+ * @param value A Variant of the expected type.
+ * @result true if a user value was found.
+ *
+ * @newin{2,40}
+ */
+ bool get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const;
+ _IGNORE(g_settings_get_user_value)
+
+ /** Gets the "default value" of a key.
+ *
+ * This is the value that would be read if reset() were to be
+ * called on the key.
+ *
+ * Note that this may be a different value than returned by
+ * get_default_value() if the system administrator
+ * has provided a default value.
+ *
+ * Comparing the return values of get_default_value() and
+ * value() is not sufficient for determining if a value
+ * has been set because the user may have explicitly set the value to
+ * something that happens to be equal to the default. The difference
+ * here is that if the default changes in the future, the user's key
+ * will still be set.
+ *
+ * This method may be useful for adding an indication to a UI of what
+ * the default value was before the user set it.
+ *
+ * It is a programmer error to give a @a key that isn't contained in the
+ * schema for the settings.
+ *
+ * @param key The key to get the default value for.
+ * @param value A Variant of the expected type.
+ *
+ * @newin{2,40}
+ */
+ void get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const;
+ _IGNORE(g_settings_get_default_value)
+
_WRAP_METHOD(int get_int(const Glib::ustring& key) const, g_settings_get_int)
_WRAP_METHOD(void set_int(const Glib::ustring& key, int value), g_settings_set_int)
_WRAP_METHOD(guint get_uint(const Glib::ustring& key) const, g_settings_get_uint)
_WRAP_METHOD_DOCS_ONLY(g_socket_send_with_blocking)
gssize send_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+ _WRAP_METHOD(bool get_option(int level, int optname, int& value) const, g_socket_get_option, errthrow)
+ _WRAP_METHOD(bool set_option(int level, int optname, int value), g_socket_set_option, errthrow)
+
_WRAP_METHOD(guint get_ttl() const, g_socket_get_ttl)
_WRAP_METHOD(void set_ttl(guint ttl), g_socket_set_ttl)
_CLASS_INTERFACE(TlsFileDatabase, GTlsFileDatabase, G_TLS_FILE_DATABASE, GTlsFileDatabaseInterface)
public:
- //TODO: Should this create() method be in TlsDatabase since the _new()
- //function returns a GTlsDatabase?
- // No, it's normal for a G* C API to return a base type, but we correct that in C++.
- // For instance, many GTK+ _new() functions return GtkWidget*. murrayc.
-
//TODO: It is not possible to use _WRAP_CTOR()/WRAP_CREATE() here because this
//class is an interface.
// So, should we make it possible to use them? murrayc.
#include <glibmm/object.h>
#include <giomm/asyncresult.h>
+#include <giomm/tlsconnection.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
{
_WRAP_ENUM(TlsInteractionResult, GTlsInteractionResult)
+_WRAP_ENUM(TlsCertificateRequestFlags, GTlsCertificateRequestFlags)
class Cancellable;
class TlsPassword;
_WRAP_METHOD(TlsInteractionResult ask_password_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_interaction_ask_password_finish, errthrow)
_WRAP_METHOD(TlsInteractionResult invoke_ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_ask_password, errthrow)
+
+
+ _WRAP_METHOD(TlsInteractionResult invoke_request_certificate(const Glib::RefPtr<TlsConnection>& connection, TlsCertificateRequestFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_request_certificate, errthrow)
+
+ _WRAP_METHOD(TlsInteractionResult request_certificate(const Glib::RefPtr<TlsConnection>& connection, TlsCertificateRequestFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_request_certificate, errthrow)
+
+ _WRAP_METHOD(void request_certificate_async(const Glib::RefPtr<TlsConnection>& connection, TlsCertificateRequestFlags flags, const SlotAsyncReady& slot{callback?}, const Glib::RefPtr<Cancellable>& cancellable{.?}), g_tls_interaction_request_certificate_async, slot_name slot, slot_callback SignalProxy_async_callback)
+
+ _WRAP_METHOD(TlsInteractionResult request_certificate_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_interaction_request_certificate_finish, errthrow)
+
+
#m4 _CONVERSION(`GTlsPassword*',`const Glib::RefPtr<TlsPassword>&',`Glib::wrap($3, true)')
_WRAP_VFUNC(TlsInteractionResult ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable), "ask_password", errthrow)
_WRAP_VFUNC(void ask_password_async(const Glib::RefPtr<TlsPassword>& password, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}), "ask_password_async", slot_name slot, slot_callback SignalProxy_async_callback)
#include <glibmm/value.h>
#include <glibmm/valuearray.h>
#include <glibmm/variant.h>
+#include <glibmm/variantdict.h>
#include <glibmm/variantiter.h>
#include <glibmm/varianttype.h>
#include <glibmm/vectorutils.h>
uriutils.hg \
valuearray.hg \
variant.hg \
+ variantdict.hg \
variantiter.hg \
varianttype.hg
- \%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)
-- \%F: equivalent to `\%Y-\%m-\%d` (the ISO 8601 date format)
+- \%F: equivalent to `%Y-%m-%d` (the ISO 8601 date format)
- \%g: the last two digits of the ISO 8601 week-based year as a
decimal number (00-99). This works well with \%V and \%u.
- \%G: the ISO 8601 week-based year as a decimal number. This works
otherwise. In particular, when @error is %NULL, %FALSE will
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
+extended in the future to provide a more specific error code for
+a certain case, your code will still work.
+
</description>
<parameters>
<function name="g_win32_error_message">
<description>
-Translate a Win32 error code (as returned by GetLastError()) into
-the corresponding message. The message is either language neutral,
-or in the thread's language, or the user's language, the system's
-language, or US English (see docs for FormatMessage()). The
-returned string is in UTF-8. It should be deallocated with
-g_free().
+Translate a Win32 error code (as returned by GetLastError() or
+WSAGetLastError()) into the corresponding message. The message is
+either language neutral, or in the thread's language, or the user's
+language, the system's language, or US English (see docs for
+FormatMessage()). The returned string is in UTF-8. It should be
+deallocated with g_free().
</description>
(gtype-id "G_TYPE_VARIANT")
)
+(define-object VariantDict
+ (in-module "GLib")
+ (c-name "GVariantDict")
+ (gtype-id "G_TYPE_VARIANT_DICT")
+)
+
(define-object VariantType
(in-module "GLib")
(c-name "GVariantType")
Glib::ustring to_data();
_IGNORE(g_key_file_to_data)
+ _WRAP_METHOD(bool save_to_file(const std::string& filename), g_key_file_save_to_file, errthrow)
+
_WRAP_METHOD(Glib::ustring get_start_group() const, g_key_file_get_start_group)
/** Gets a list of all groups in the KeyFile
#m4 _CONVERSION(`char**&',`gchar***',`&($3)')
_WRAP_METHOD(bool parse(int& argc, char**& argv), g_option_context_parse, errthrow)
- //TODO: Document ths as useful (only?) with the result from g_win32_get_command_line?
+ //TODO: Document this as useful (only?) with the result from g_win32_get_command_line?
//goption.c has example code that suggests always using this, and ifdefing for G_OS_WIN32, with a g_strdupv for the non-win32 case.
//Presumably we cannot hide that ifdeffing from application code because the argument-removal would be invisible to the caller.
//So can we hide it for people who don't care about arguments being removed from argv?
#include <glib.h>
#include <iostream>
-extern "C"
-{
-
-//This is hack to workaround this problem in glib:
-// https://bugzilla.gnome.org/show_bug.cgi?id=708212
-//We really should not define a g_* symbol outside of glib:
-GQuark g_variant_parse_error_quark()
-{
- return g_variant_parser_get_error_quark();
-}
-
-} //extern C
-
namespace Glib
{
GVariant* const g_value =
g_variant_get_normal_form(const_cast<GVariant*>(gobj()));
- //The C function never returns NULL, according to its docuemenation,
+ //The C function never returns NULL, according to its documenation,
//so we don't need a bool return value.
result.init(g_value); // g_value is already referenced.
}
template<class V_CastTo>
static V_CastTo cast_dynamic(const VariantBase& v) throw(std::bad_cast);
+ _IGNORE(g_variant_dict_new)
+
private:
/** Relational operators are deleted to prevent invalid conversion
* to const void*.
//TODO: Documentation
void get(VariantBase& variant) const;
+ //TODO: Deprecate this in favour of get(VariantBase&)?
_WRAP_METHOD(VariantBase get() const, g_variant_get_variant)
};
--- /dev/null
+/*
+ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <glib.h>
+
+namespace Glib
+{
+
+bool VariantDict::lookup_value_variant(const Glib::ustring& key, const VariantType& expected_type, VariantBase& value) const
+{
+ GVariant* const g_value =
+ g_variant_dict_lookup_value(const_cast<GVariantDict*>(gobj()),
+ key.c_str(),
+ expected_type.gobj());
+ if(!g_value)
+ return false;
+
+ value.init(g_value); // g_value is already referenced.
+ return true;
+}
+
+} //namespace Glib
+
+
--- /dev/null
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <glibmm/variant.h>
+
+_DEFS(glibmm,glib)
+
+namespace Glib
+{
+
+/** VariantDict is a mutable interface to Variant dictionaries.
+ *
+ * It can be used for doing a sequence of dictionary lookups in an
+ * efficient way on an existing Variant dictionary or it can be used
+ * to construct new dictionaries with a hashtable-like interface. It
+ * can also be used for taking existing dictionaries and modifying them
+ * in order to create new ones.
+ *
+ * newin{2,40}
+ */
+class VariantDict
+{
+ //GVariantDict is registered as a boxed type, but it has ref/unref functions instead of copy/free,
+ //so we use it via RefPtr.
+ _CLASS_OPAQUE_REFCOUNTED(VariantDict, GVariantDict, NONE, g_variant_dict_ref, g_variant_dict_unref)
+ _IGNORE(g_variant_dict_ref, g_variant_dict_unref, g_variant_dict_init)
+
+public:
+ _WRAP_METHOD(static Glib::RefPtr<VariantDict> create(const VariantBase& from_asv{?}), g_variant_dict_new)
+
+
+//TODO: Add a method overload that does not take expected_type (which can be null),
+//just returning a VariantBase that should be cast_dynamic()ed?
+
+ /** Looks up a value in the VariantDict. See also lookup_value().
+ *
+ * If the @a key is not found the false is returned.
+ *
+ * The @a expected_type string specifies what type of value is expected.
+ * If the value associated with @a key has a different type then false is
+ * returned.
+ *
+ * If the key is found and the value has the correct type, it is
+ * returned in the @a value output variable.
+ */
+ bool lookup_value_variant(const Glib::ustring& key, const VariantType& expected_type, VariantBase& value) const;
+ _IGNORE(g_variant_dict_lookup_value)
+
+ /** Looks up a value in the VariantDict.
+ *
+ * If the @a key is not found the false is returned.
+ *
+ * If the value associated with @a key has a different type than expected then false is
+ * returned.
+ *
+ * If the key is found and the value has the correct type, it is
+ * returned in the @a value output variable.
+ */
+ template <typename T_Value>
+ bool lookup_value(const Glib::ustring& key, T_Value& value) const;
+ _IGNORE(g_variant_dict_lookup)
+
+
+ _WRAP_METHOD(bool contains(const Glib::ustring& key) const, g_variant_dict_contains)
+
+ _IGNORE(g_variant_dict_insert)
+
+
+ _WRAP_METHOD(void insert_value_variant(const Glib::ustring& key, const VariantBase& value), g_variant_dict_insert_value)
+
+ /** Inserts (or replaces) a key in a VariantDict.
+ *
+ * @param key The key to insert a value for.
+ * @param value The value to insert.
+ */
+ template <typename T_Value>
+ void insert_value(const Glib::ustring& key, const T_Value& value);
+
+
+ _WRAP_METHOD(bool remove(const Glib::ustring& key), g_variant_dict_remove)
+
+ _WRAP_METHOD(void clear(), g_variant_dict_clear)
+
+ _IGNORE(g_variant_dict_end)
+};
+
+template <typename T_Value>
+void VariantDict::insert_value(const Glib::ustring& key, const T_Value& value)
+{
+ typedef Glib::Variant<T_Value> type_glib_variant;
+
+ //TODO: Can we do any check like this here, before glib does?
+ //g_return_val_if_fail(
+ // g_variant_type_equal(g_action_get_parameter_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj()),
+ // Glib::ustring());
+ return insert_value_variant(key, type_glib_variant::create(value));
+}
+
+template <typename T_Value>
+bool VariantDict::lookup_value(const Glib::ustring& key, T_Value& value) const
+{
+ value = T_Value(); //Make sure that it is initialized.
+
+ typedef Glib::Variant<T_Value> type_glib_variant;
+
+ //TODO: Can we do any check like this here, before glib does?
+ //g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj()));
+
+ Glib::VariantBase variantBase;
+ const bool result = lookup_value_variant(key, type_glib_variant::variant_type(), variantBase);
+ if(!result)
+ return result;
+
+ try
+ {
+ const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
+ value = variantDerived.get();
+ }
+ catch(const std::bad_cast& ex)
+ {
+ return false;
+ }
+
+ return result;
+}
+
+} //namespace Glib
+
+
buf = pat.sub('', buf)
#strip *_DEPRECATED_IN_*_FOR (*):
- pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[1-9]_([1-9]*)_FOR \(\S*\)\S*""", re.MULTILINE)
+ pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(\S*\)\S*""", re.MULTILINE)
buf = pat.sub('', buf)
#strip *_DEPRECATED*
buf = pat.sub('', buf)
#strip *_AVAILABLE_IN_*
- pat = re.compile(r"""[A-Z]+_AVAILABLE_IN_[1-9]_[1-9]\S*""", re.MULTILINE)
+ pat = re.compile(r"""[A-Z]+_AVAILABLE_IN_[0-9]_[0-9]\S*""", re.MULTILINE)
buf = pat.sub('', buf)
#strip *_AVAILABLE_IN_ALL
<< get_defs(G_TYPE_ACTION)
<< get_defs(G_TYPE_ACTION_GROUP)
<< get_defs(G_TYPE_APPLICATION)
+ << get_defs(G_TYPE_APP_INFO_MONITOR)
<< get_defs(G_TYPE_CANCELLABLE)
<< get_defs(G_TYPE_BUFFERED_INPUT_STREAM)
<< get_defs(G_TYPE_BUFFERED_OUTPUT_STREAM)
<< get_defs(G_TYPE_MENU_MODEL)
<< get_defs(G_TYPE_MOUNT)
<< get_defs(G_TYPE_MOUNT_OPERATION)
+ << get_defs(G_TYPE_NOTIFICATION)
+ << get_defs(G_TYPE_PROPERTY_ACTION)
<< get_defs(G_TYPE_PROXY)
<< get_defs(G_TYPE_PROXY_ADDRESS)
<< get_defs(G_TYPE_PROXY_ADDRESS_ENUMERATOR)
<< get_defs(G_TYPE_SETTINGS_BACKEND)
<< get_defs(G_TYPE_SIMPLE_ASYNC_RESULT)
<< get_defs(G_TYPE_SIMPLE_ACTION)
+ << get_defs(G_TYPE_SUBPROCESS)
+ << get_defs(G_TYPE_SUBPROCESS_LAUNCHER)
<< get_defs(G_TYPE_THEMED_ICON)
//TODO: This causes a g_warning:
// g_type_init() is deprecated as of 2.36.
// g_type_init();
- std::cout << get_defs( G_TYPE_DATE )
+ std::cout << get_defs( G_TYPE_BYTES )
+ << get_defs( G_TYPE_CHECKSUM )
+ << get_defs( G_TYPE_DATE )
+ << get_defs( G_TYPE_DATE_TIME )
<< get_defs( G_TYPE_IO_CHANNEL )
+ << get_defs( G_TYPE_KEY_FILE )
+ << get_defs( G_TYPE_MAIN_CONTEXT )
+ << get_defs( G_TYPE_MAIN_LOOP )
+ << get_defs( G_TYPE_MATCH_INFO )
<< get_defs( G_TYPE_REGEX )
+ << get_defs( G_TYPE_SOURCE )
+ << get_defs( G_TYPE_THREAD )
<< get_defs( G_TYPE_VARIANT )
+ << get_defs( G_TYPE_VARIANT_BUILDER )
+ << get_defs( G_TYPE_VARIANT_DICT )
<< std::endl;
return 0;
_CONV_ENUM(G,SocketProtocol)
_CONV_ENUM(G,SocketType)
_CONV_ENUM(G,TlsCertificateFlags)
+_CONV_ENUM(G,TlsCertificateRequestFlags)
_CONV_ENUM(G,TlsDatabaseVerifyFlags)
_CONV_ENUM(G,TlsDatabaseLookupFlags)
_CONV_ENUM(G,TlsInteractionResult)
_CONVERSION(`const Glib::RefPtr<const TlsCertificate>&', `GTlsCertificate*', `const_cast<GTlsCertificate*>(Glib::unwrap($3))')
_CONVERSION(`const Glib::RefPtr<TlsCertificate>&',`GTlsCertificate*',`Glib::unwrap($3)')
+#TlsConnection:
+_CONVERSION(`const Glib::RefPtr<TlsConnection>&',`GTlsConnection*',`Glib::unwrap($3)')
+
#TlsDatabase
_CONVERSION(`GTlsDatabase*',`Glib::RefPtr<TlsDatabase>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<TlsDatabase>&',`GTlsDatabase*',`Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<TlsDatabase>&',`GTlsDatabase*',__CONVERT_REFPTR_TO_P)
#TlsInteraction
_CONVERSION(`const Glib::RefPtr<TlsInteraction>&',`GTlsInteraction*',`Glib::unwrap($3)')
_CONVERSION(`GTlsInteraction*',`Glib::RefPtr<TlsInteraction>',`Glib::wrap($3)')
#TlsPassword
-_CONVERSION(`const Glib::RefPtr<TlsPassword>&',`GTlsPassword*',`Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<TlsPassword>&',`GTlsPassword*',__CONVERT_REFPTR_TO_P)
#UnixFDList
_CONVERSION(`GUnixFDList*',`Glib::RefPtr<UnixFDList>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<UnixFDList>&',`GUnixFDList*',`Glib::unwrap($3)')
-
-#Variant
-_CONVERSION(`GVariant*',`Glib::VariantBase',`Glib::wrap($3, false)')
-_CONVERSION(`GVariant*',`Glib::VariantContainerBase',`Glib::VariantContainerBase($3, false)')
-_CONVERSION(`const Glib::VariantBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
-_CONVERSION(`const Glib::VariantContainerBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
-
-#VariantType
-_CONVERSION(`const GVariantType*',`Glib::VariantType',`Glib::wrap(const_cast<GVariantType*>($3), true)')
-_CONVERSION(`const Glib::VariantType&',`const GVariantType*',`$3.gobj()')
+_CONVERSION(`const Glib::RefPtr<UnixFDList>&',`GUnixFDList*',__CONVERT_REFPTR_TO_P)
#Volume
_CONVERSION(`GVolume*',`Glib::RefPtr<Volume>',`Glib::wrap($3)')
_CONVERSION(`GValue*', `Glib::ValueBase&', `*reinterpret_cast<Glib::ValueBase*>($3)')
_CONVERSION(`const GValue*', `const Glib::ValueBase&', `*reinterpret_cast<const Glib::ValueBase*>($3)')
-dnl VariantContainerBase
+#Variant
+_CONVERSION(`GVariant*',`Glib::VariantBase',`Glib::wrap($3, false)')
+_CONVERSION(`GVariant*',`Glib::VariantContainerBase',`Glib::VariantContainerBase($3, false)')
+_CONVERSION(`const VariantBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
+_CONVERSION(`const Glib::VariantBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
+_CONVERSION(`const Glib::VariantContainerBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
+
+# VariantContainerBase
_CONVERSION(`const VariantContainerBase&',`GVariant*',`const_cast<GVariant*>(($3).gobj())')
-dnl VariantType
+#VariantDict
+_CONVERSION(`GVariantDict*',`Glib::RefPtr<VariantDict>',`Glib::wrap($3)')
+_CONVERSION(`GVariantDict*',`Glib::RefPtr<Glib::VariantDict>',`Glib::wrap($3)')
+_CONVERSION(`GVariantDict*',`Glib::RefPtr<const Glib::VariantDict>',`Glib::wrap($3)')
+
+#VariantType
+_CONVERSION(`const GVariantType*',`Glib::VariantType',`Glib::wrap(const_cast<GVariantType*>($3), true)')
_CONVERSION(`const VariantType&',`const GVariantType*',`($3).gobj()')
_CONVERSION(`const Glib::VariantType&',`const GVariantType*',`($3).gobj()')
_CONVERSION(`GVariantType*',`VariantType',`Glib::wrap($3)')